Skip to content

Commit b47bf84

Browse files
author
xxx
committed
项目优化
1 parent b570313 commit b47bf84

File tree

8 files changed

+79
-9
lines changed

8 files changed

+79
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 自定义
2+
/logs
23

34
# 系统文件
45
/target

bin/application-dev.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# ========== 自定义 ==========
2+
# 服务端口号
3+
server:
4+
port: 8080
5+
6+
# 代理配置
7+
proxy:
8+
# 访问目标站点所用代理(除 free-ss)
9+
enable: true
10+
host: 127.0.0.1
11+
port: 1080
12+
13+
# 访问 free-ss 时所用代理
14+
free-ss:
15+
enable: false
16+
host: 113.12.72.24
17+
port: 3128
18+
socks: false
19+
20+
21+
# phantomjs 路径
22+
phantomjs:
23+
path: file:lib\phantomjs.exe
24+
25+
26+
# 因 Heroku 应用 30 分钟没有访问会自动休眠,为防止休眠,系统每 20 分钟访问一次该配置地址
27+
health:
28+
url:
29+
cron: 0 0/20 6-23 * * ?
30+
31+
32+
# spring boot 启用调试模式
33+
debug: true
34+
35+
36+
# ========== Spring ==========
37+
spring:
38+
# Spring 数据库
39+
datasource:
40+
platform: h2
41+
driver-class-name: org.h2.Driver
42+
url: jdbc:h2:./data/db
43+
username: sa
44+
password:

bin/run.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
chcp 65001
2+
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

src/main/java/com/example/ShadowSocksShare/service/impl/Free_ssDevCrawlerServiceImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ public ShadowSocksEntity getShadowSocks() {
104104
cliArgsCap.add("--proxy-type=socks5");*/
105105
cliArgsCap.add("--ssl-protocol=any");
106106
cliArgsCap.add("--script-encoding=utf8");
107+
cliArgsCap.add("--webdriver-logfile=logs/phantomjsdriver.log");
107108
cliArgsCap.add("--webdriver-loglevel=INFO");
108109
cliArgsCap.add("--debug=false");
109110
capability.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, cliArgsCap);

src/main/resources/application-dev.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# ========== 自定义 ==========
2+
# 服务端口号
3+
server:
4+
port: 8080
5+
6+
# 代理配置
27
proxy:
38
# 访问目标站点所用代理(除 free-ss)
49
enable: true
@@ -15,7 +20,7 @@ proxy:
1520

1621
# phantomjs 路径
1722
phantomjs:
18-
path: file:D:\ssr\phantomjs.exe
23+
path: file:D:\phantomjs.exe
1924

2025

2126
# 因 Heroku 应用 30 分钟没有访问会自动休眠,为防止休眠,系统每 20 分钟访问一次该配置地址
@@ -32,5 +37,8 @@ debug: true
3237
spring:
3338
# Spring 数据库
3439
datasource:
40+
platform: h2
41+
driver-class-name: org.h2.Driver
42+
url: jdbc:h2:~/test
3543
username: sa
3644
password:

src/main/resources/application-prod.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# ========== 自定义 ==========
2+
# 服务端口号
3+
server:
4+
port: 8080
5+
6+
# 代理配置
27
proxy:
38
# 访问目标站点所用代理(除 free-ss)
49
enable: false
@@ -32,5 +37,8 @@ debug: false
3237
spring:
3338
# Spring 数据库
3439
datasource:
40+
platform: h2
41+
driver-class-name: org.h2.Driver
42+
url: jdbc:h2:~/test
3543
username: sa
3644
password: unrDG0Nb3r4l

src/main/resources/application.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ spring:
1414
profiles:
1515
active: prod
1616

17-
# Spring 数据库
18-
datasource:
19-
platform: h2
20-
url: jdbc:h2:~/test
21-
driver-class-name: org.h2.Driver
22-
# username: sa
23-
# password: unrDG0Nb3r4l
24-
2517
# Spring H2 配置
2618
h2:
2719
console:

src/main/resources/logback-spring.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@
88
</encoder>
99
</appender>
1010

11+
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
12+
<file>logs/ShadowSocks-Share.log</file>
13+
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
14+
<fileNamePattern>logs/ShadowSocks-Share-%d{yyyy-MM-dd}.log</fileNamePattern>
15+
<maxHistory>7</maxHistory>
16+
</rollingPolicy>
17+
<encoder>
18+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n</pattern>
19+
</encoder>
20+
<append>false</append>
21+
<prudent>false</prudent>
22+
</appender>
23+
1124
<logger name="com.example.ShadowSocksShare" level="DEBUG"/>
1225

1326
<logger name="org.springframework.web" level="DEBUG"/>
@@ -16,6 +29,7 @@
1629

1730
<root level="INFO">
1831
<appender-ref ref="STDOUT"/>
32+
<appender-ref ref="FILE"/>
1933
</root>
2034
</springProfile>
2135

0 commit comments

Comments
 (0)