diff --git a/Dockerfile b/Dockerfile index 4d42d98..9b75dc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 . @@ -10,11 +8,9 @@ RUN java -Djarmode=tools -jar target/moliapi.jar extract --layers --destination FROM eclipse-temurin:17-jdk-alpine MAINTAINER BingChunMoLi -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/ ./ diff --git a/Dockerfile_old b/Dockerfile_old index 0ff4cc5..2c3f1ef 100644 --- a/Dockerfile_old +++ b/Dockerfile_old @@ -1,5 +1,5 @@ FROM eclipse-temurin:17-alpine -MAINTAINER BingChunMoLi +MAINTAINER BingChunMoLi 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 diff --git a/docker-compose.yml b/docker-compose.yml index 8fcb733..5a55c87 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/pom.xml b/pom.xml index a51cde3..9c2392b 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ com.bingchunmoli moliapi - 3.15.6 + 3.15.7 MoLiApi MoLiApi diff --git a/src/main/java/com/bingchunmoli/api/ApiApplication.java b/src/main/java/com/bingchunmoli/api/ApiApplication.java index 777a0a6..007dbd4 100644 --- a/src/main/java/com/bingchunmoli/api/ApiApplication.java +++ b/src/main/java/com/bingchunmoli/api/ApiApplication.java @@ -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); } diff --git a/src/main/resources/application-template.yml b/src/main/resources/application-template.yml index 11bbe2a..1ae5f50 100644 --- a/src/main/resources/application-template.yml +++ b/src/main/resources/application-template.yml @@ -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 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 30a77f5..6b41639 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -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/ diff --git a/src/main/resources/config/logback-spring.xml b/src/main/resources/config/logback-spring.xml index 353e191..8806c67 100644 --- a/src/main/resources/config/logback-spring.xml +++ b/src/main/resources/config/logback-spring.xml @@ -12,7 +12,7 @@ - + diff --git a/src/main/resources/db/migration/V0___init.sql b/src/main/resources/db/migration/V0___init.sql index 3ed856a..6e17d4d 100644 --- a/src/main/resources/db/migration/V0___init.sql +++ b/src/main/resources/db/migration/V0___init.sql @@ -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, @@ -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 @@ -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, diff --git a/src/main/resources/templates/WeatherNotion.html b/src/main/resources/templates/WeatherNotion.html index 08db265..03f0d2d 100644 --- a/src/main/resources/templates/WeatherNotion.html +++ b/src/main/resources/templates/WeatherNotion.html @@ -44,17 +44,11 @@ 天气 图标 - - - - - - - - - - - + + + + +