delete password cfg
This commit is contained in:
@@ -26,8 +26,6 @@ import java.util.concurrent.TimeUnit;
|
||||
public class TsgUtil {
|
||||
|
||||
public static String TSG_URL;
|
||||
private static String TSG_USERNAME;
|
||||
private static String TSG_PASSWORD;
|
||||
private static Integer httpTimeOut;
|
||||
private static String TSG_TOKEN;
|
||||
|
||||
@@ -41,16 +39,6 @@ public class TsgUtil {
|
||||
TSG_URL = url;
|
||||
}
|
||||
|
||||
@Value("${tsg.system.username}")
|
||||
private void setTsgUsername(String username) {
|
||||
TSG_USERNAME = username;
|
||||
}
|
||||
|
||||
@Value("${tsg.system.password}")
|
||||
private void setTsgPassword(String password) {
|
||||
TSG_PASSWORD = password;
|
||||
}
|
||||
|
||||
@Value("${tsg.system.token}")
|
||||
private void setTsgToken(String token) {
|
||||
TSG_TOKEN = token;
|
||||
@@ -60,32 +48,8 @@ public class TsgUtil {
|
||||
if (StrUtil.isNotEmpty(TSG_TOKEN)) {
|
||||
return TSG_TOKEN;
|
||||
}
|
||||
String token = "";
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("username", TSG_USERNAME);
|
||||
map.put("password", TSG_PASSWORD);
|
||||
try {
|
||||
Stopwatch watch = Stopwatch.createStarted();
|
||||
String response = HttpRequest.post(TSG_URL + "/v1/user/login")
|
||||
.body(JSONUtil.toJsonStr(map))
|
||||
.timeout(httpTimeOut)
|
||||
.execute().body();
|
||||
log.info("get tsg-api token, cost {} seconds", watch.elapsed(TimeUnit.SECONDS));
|
||||
if (StrUtil.isBlank(response)) {
|
||||
log.error("failed to get TSG system token. response: {}", response);
|
||||
throw new RuntimeException("ailed to get TSG system token. response: " + response);
|
||||
}
|
||||
JSONObject jsonObject = JSONUtil.parseObj(response);
|
||||
if (!"200".equals(jsonObject.get("code").toString())) {
|
||||
log.error("failed to get TSG system token. response: {}", response);
|
||||
throw new RuntimeException("ailed to get TSG system token. response: " + response);
|
||||
}
|
||||
token = JSONUtil.parseObj(jsonObject.get("data")).get("token").toString();
|
||||
} catch (Exception e) {
|
||||
log.error("failed to get TSG system token. message: {}", e.getMessage());
|
||||
throw e;
|
||||
}
|
||||
return token;
|
||||
log.error("failed to get TSG system token.");
|
||||
throw new IllegalArgumentException("failed to get TSG system token.");
|
||||
}
|
||||
|
||||
public static void updateObjectById(Integer id, Map<String, Object> body) {
|
||||
|
||||
@@ -1,200 +0,0 @@
|
||||
server:
|
||||
port: 9999
|
||||
spring:
|
||||
application:
|
||||
name: cn-object-scheduler
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.44.53:3306/cn_api?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=UTC&failOverReadOnly=false&connectTimeout=10000&socketTimeout=300000
|
||||
username: root
|
||||
password: 111111
|
||||
logging:
|
||||
config: ./config/logback-spring.xml
|
||||
tsg:
|
||||
system:
|
||||
url: http://192.168.44.3:80
|
||||
username:
|
||||
password:
|
||||
token: aa2bdec5518ad131f71944b13ce5c298&1&
|
||||
httpTimeout: 3600000
|
||||
object:
|
||||
ip:
|
||||
#指定排除的IP. 1.如果没有可不写值,2.若有多个用英文逗号,分隔如: 127.0.0.1,127.0.0.2,3.可适用IP段匹配,如:127.*
|
||||
excludeValue: 0.0.0.0,255.255.255.255,127.*,8.8.8.8,1.1.1.1
|
||||
cyberghostvpn_serverip:
|
||||
id: 1
|
||||
name: cyberghostvpn_serverip
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
hotspotvpn_serverip:
|
||||
id: 2
|
||||
name: hotspotvpn_serverip
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
ipvanishvpn_serverip:
|
||||
id: 3
|
||||
name: ipvanishvpn_serverip
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
geckovpn_serverip:
|
||||
id: 4
|
||||
name: geckovpn_serverip
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
ivacyvpn_serverip:
|
||||
id: 5
|
||||
name: ivacyvpn_serverip
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
turbovpn_serverip:
|
||||
id: 6
|
||||
name: turbovpn_serverip
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
vpnunlimited_serverip:
|
||||
id: 7
|
||||
name: vpnunlimited_serverip
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
windscribevpn_serverip:
|
||||
id: 8
|
||||
name: windscribevpn_serverip
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
vpn4fame_serverip:
|
||||
id: 9
|
||||
name: vpn4fame_serverip
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
protonvpn_ip:
|
||||
id: 10
|
||||
name: protonvpn_ip
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
expressvpn_ip:
|
||||
id: 11
|
||||
name: expressvpn_ip
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
fqdn:
|
||||
cyberghostvpn_servername:
|
||||
id: 101
|
||||
name: cyberghostvpn_servername
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
ipvanishvpn_servername:
|
||||
id: 102
|
||||
name: ipvanishvpn_servername
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
ivacyvpn_servername:
|
||||
id: 103
|
||||
name: ivacyvpn_servername
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
vpnunlimited_servername:
|
||||
id: 104
|
||||
name: vpnunlimited_servername
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
vpn4fame_servername:
|
||||
id: 105
|
||||
name: vpn4fame_servername
|
||||
update:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
sql:
|
||||
delete:
|
||||
cron: 0 0 0/1 * * ?
|
||||
enable: false
|
||||
offsetSecond: -600
|
||||
Reference in New Issue
Block a user