Skip to content

Commit

Permalink
Merge pull request #271 from BingChunMoLi/develop
Browse files Browse the repository at this point in the history
v3.15.7
  • Loading branch information
BingChunMoLi authored Sep 16, 2024
2 parents d2914e8 + 12ccec9 commit b53286e
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 36 deletions.
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM maven:3.9.9-eclipse-temurin-17-alpine as builder
WORKDIR /workspace/app
COPY mvnw .
COPY .mvn .mvn
COPY pom.xml .
COPY src src
COPY lombok.config .
Expand All @@ -10,11 +8,9 @@ RUN java -Djarmode=tools -jar target/moliapi.jar extract --layers --destination

FROM eclipse-temurin:17-jdk-alpine
MAINTAINER BingChunMoLi <[email protected]>
VOLUME /soft/config
VOLUME /var/log/moliapi
EXPOSE 8090
RUN adduser --disabled-password -h /soft/config/ -D -g api api
USER api:api
VOLUME /soft/.api
WORKDIR /soft
COPY --from=builder /workspace/app/extracted/dependencies/ ./
COPY --from=builder /workspace/app/extracted/spring-boot-loader/ ./
COPY --from=builder /workspace/app/extracted/snapshot-dependencies/ ./
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile_old
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM eclipse-temurin:17-alpine
MAINTAINER BingChunMoLi <[email protected]>
MAINTAINER BingChunMoLi <[email protected]>
RUN mkdir -p /var/log/moliapi
RUN chmod -R a+w /var/log/moliapi
RUN addgroup api && adduser api -D -S -s /bin/bash -G api
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ services:
ports:
- "8090:8090"
volumes:
- ./docker-compose/config:/soft/config/
- /var/log/moliapi:/var/log/moliapi
- ./docker-compose/config:/soft/.api/
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.bingchunmoli</groupId>
<artifactId>moliapi</artifactId>
<version>3.15.6</version>
<version>3.15.7</version>
<name>MoLiApi</name>
<description>MoLiApi</description>

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/bingchunmoli/api/ApiApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class ApiApplication {

public static void main(String[] args) {
System.setProperty("spring.config.additional-location","optional:file:/soft/config/");
System.setProperty("spring.config.additional-location","optional:file:/soft/.api/config/");
SpringApplication.run(ApiApplication.class, args);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ moli:
uploadPath: /soft/bili/fav/
rclonePath: ${moli.utilPath}rclone
youGetPath: ${moli.utilPath}YouGet
utilPath: /soft/config/util/
utilPath: ${moli.path}/util/
downloadAudioPath: ${moli.basePath}/audio
basePath: /soft/config
play-list-id: 8792430274
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
moli:
version: @version@
path: /soft/config/
path: ${user.home}
init:
sql-path: classpath:/init/db/init.sql
yi-yan-json-path: init/data/
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<!-- 用来定义变量值的标签,<property> 有两个属性,name和value;其中name的值是变量的名称,value的值时变量定义的值。通过<property>定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<property name="app_name" value="api"/>
<property name="log_path" value="${user.home}/.api/log/"/>
<property name="log_path" value="${user.home}/log/"/>
<springProperty scope="context" name="loki_url" source="loki.url" defaultValue="localhost"/>

<!-- key: 标识此timestamp的名字; datePattern: 设置将当前时间(解析配置文件的时间)转换为字符串的模式,遵循java.txt.SimpleDateFormat的格式。 -->
Expand Down
18 changes: 7 additions & 11 deletions src/main/resources/db/migration/V0___init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ CREATE TABLE IF NOT EXISTS `yi_yan`
`type` varchar(5) DEFAULT NULL,
`from` varchar(50) DEFAULT NULL,
`from_who` varchar(20) DEFAULT NULL,
`creator` varchar(20) DEFAULT NULL,
`creator` varchar(50) DEFAULT NULL,
`creator_uid` int DEFAULT NULL,
`reviewer` int DEFAULT NULL,
`commit_from` varchar(20) DEFAULT NULL,
Expand All @@ -96,9 +96,10 @@ CREATE TABLE IF NOT EXISTS `yi_yan`

CREATE TABLE IF NOT EXISTS `weather_sub`
(
`id` int NOT NULL AUTO_INCREMENT primary key,
`id` int NOT NULL AUTO_INCREMENT,
location varchar(10) not null comment '订阅的城市',
email varchar(30) not null comment '邮箱'
email varchar(30) not null comment '邮箱',
PRIMARY KEY (`id`)
);

CREATE TABLE IF NOT EXISTS daily_log
Expand Down Expand Up @@ -254,21 +255,16 @@ create table if not exists bili_user
id int not null
primary key,
name varchar(30) null comment '昵称',
face varchar(80) null,
constraint bili_user_id_uindex
unique (id)
face varchar(80) null
);

CREATE TABLE if not exists `config`
(
id INT auto_increment not null,
id INT auto_increment not null primary key,
`key` varchar(100) NOT NULL COMMENT '配置的key',
`value` varchar(500) COMMENT '配置的值',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '更新时间',
primary key (`id`),
constraint config_uindex
unique (`key`)
`update_time` datetime NOT NULL COMMENT '更新时间'
);

INSERT INTO yi_yan (id, uuid, hitokoto, type, `from`, from_who, creator, creator_uid, reviewer, commit_from, created_at,
Expand Down
16 changes: 5 additions & 11 deletions src/main/resources/templates/WeatherNotion.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,11 @@
<th>天气</th>
<th>图标</th>
</tr>
<tr>
<td th:each="i : ${data}" th:text="${i.fxDate}"></td>
</tr>
<tr>
<td th:each="i : ${data}" th:text="${i.getTempMin() + '°c/' + i.getTempMax() + '°c'}"></td>
</tr>
<tr>
<td th:each="i : ${data}" th:text="${i.textDay}"></td>
</tr>
<tr>
<td th:each="i : ${data}">
<tr th:each="i : ${data}">
<td th:text="${i.fxDate}"></td>
<td th:text="${i.getTempMin() + '°c/' + i.getTempMax() + '°c'}"></td>
<td th:text="${i.textDay}"></td>
<td>
<img th:src="${'https://obs.bingchunmoli.com/weather/' + i.iconDay + '-fill.svg'}" />
</td>
</tr>
Expand Down

0 comments on commit b53286e

Please sign in to comment.