diff --git a/.gitignore b/.gitignore index 398b62c..de419ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # 自定义 +/logs # 系统文件 /target diff --git a/bin/application-dev.yml b/bin/application-dev.yml new file mode 100644 index 0000000..c2c75a3 --- /dev/null +++ b/bin/application-dev.yml @@ -0,0 +1,44 @@ +# ========== 自定义 ========== +# 服务端口号 +server: + port: 8080 + +# 代理配置 +proxy: + # 访问目标站点所用代理(除 free-ss) + enable: true + host: 127.0.0.1 + port: 1080 + + # 访问 free-ss 时所用代理 + free-ss: + enable: false + host: 113.12.72.24 + port: 3128 + socks: false + + +# phantomjs 路径 +phantomjs: + path: file:lib\phantomjs.exe + + +# 因 Heroku 应用 30 分钟没有访问会自动休眠,为防止休眠,系统每 20 分钟访问一次该配置地址 +health: + url: + cron: 0 0/20 6-23 * * ? + + +# spring boot 启用调试模式 +debug: true + + +# ========== Spring ========== +spring: + # Spring 数据库 + datasource: + platform: h2 + driver-class-name: org.h2.Driver + url: jdbc:h2:./data/db + username: sa + password: \ No newline at end of file diff --git a/bin/run.bat b/bin/run.bat new file mode 100644 index 0000000..c6fc41d --- /dev/null +++ b/bin/run.bat @@ -0,0 +1,2 @@ +chcp 65001 +java -jar -Dfile.encoding=UTF-8 -Djava.net.preferIPv4Stack=true -Dspring.profiles.active=dev lib/ShadowSocks-Share-0.0.1-SNAPSHOT.jar --spring.config.location=config/application-dev.yml \ No newline at end of file diff --git a/src/main/java/com/example/ShadowSocksShare/service/impl/Free_ssDevCrawlerServiceImpl.java b/src/main/java/com/example/ShadowSocksShare/service/impl/Free_ssDevCrawlerServiceImpl.java index f85b922..a63b935 100644 --- a/src/main/java/com/example/ShadowSocksShare/service/impl/Free_ssDevCrawlerServiceImpl.java +++ b/src/main/java/com/example/ShadowSocksShare/service/impl/Free_ssDevCrawlerServiceImpl.java @@ -104,6 +104,7 @@ public ShadowSocksEntity getShadowSocks() { cliArgsCap.add("--proxy-type=socks5");*/ cliArgsCap.add("--ssl-protocol=any"); cliArgsCap.add("--script-encoding=utf8"); + cliArgsCap.add("--webdriver-logfile=logs/phantomjsdriver.log"); cliArgsCap.add("--webdriver-loglevel=INFO"); cliArgsCap.add("--debug=false"); capability.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, cliArgsCap); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 602c531..c659626 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -1,4 +1,9 @@ # ========== 自定义 ========== +# 服务端口号 +server: + port: 8080 + +# 代理配置 proxy: # 访问目标站点所用代理(除 free-ss) enable: true @@ -15,7 +20,7 @@ proxy: # phantomjs 路径 phantomjs: - path: file:D:\ssr\phantomjs.exe + path: file:D:\phantomjs.exe # 因 Heroku 应用 30 分钟没有访问会自动休眠,为防止休眠,系统每 20 分钟访问一次该配置地址 @@ -32,5 +37,8 @@ debug: true spring: # Spring 数据库 datasource: + platform: h2 + driver-class-name: org.h2.Driver + url: jdbc:h2:~/test username: sa password: \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index e7eb2ca..48b4076 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -1,4 +1,9 @@ # ========== 自定义 ========== +# 服务端口号 +server: + port: 8080 + +# 代理配置 proxy: # 访问目标站点所用代理(除 free-ss) enable: false @@ -32,5 +37,8 @@ debug: false spring: # Spring 数据库 datasource: + platform: h2 + driver-class-name: org.h2.Driver + url: jdbc:h2:~/test username: sa password: unrDG0Nb3r4l \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 53292af..0a1e49d 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -14,14 +14,6 @@ spring: profiles: active: prod - # Spring 数据库 - datasource: - platform: h2 - url: jdbc:h2:~/test - driver-class-name: org.h2.Driver - # username: sa - # password: unrDG0Nb3r4l - # Spring H2 配置 h2: console: diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index b4b07d3..ff5b170 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -8,6 +8,19 @@ + + logs/ShadowSocks-Share.log + + logs/ShadowSocks-Share-%d{yyyy-MM-dd}.log + 7 + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n + + false + false + + @@ -16,6 +29,7 @@ +