:rocket:修改存储源

This commit is contained in:
hello-hao
2023-03-15 10:20:55 +08:00
parent e61b7ce10d
commit cc05712906
6 changed files with 30 additions and 120 deletions
+2 -1
View File
@@ -8,11 +8,12 @@ services:
# 配置启动参数
args:
JAR_FILE: tbed.jar
dockerfile: Dockerfile
dockerfile: Dockerfile-tbed
ports:
- "10088:10088"
- "10089:10089"
volumes:
- /HellohaoData/web:/hellohaotbed/webapps
- /HellohaoData/:/HellohaoData/
environment:
# 环境变量, 在application.yml中读取
@@ -219,23 +219,24 @@ public class AdminRootController {
@ResponseBody
public Msg updateStorage(@RequestParam(value = "data", defaultValue = "") String data) {
JSONObject jsonObj = JSONObject.parseObject(data);
Integer id = jsonObj.getInteger("id");
String AccessKey = jsonObj.getString("AccessKey");
String AccessSecret = jsonObj.getString("AccessSecret");
String Endpoint = jsonObj.getString("Endpoint");
String Bucketname = jsonObj.getString("Bucketname");
String RequestAddress = jsonObj.getString("RequestAddress");
Integer storageType = jsonObj.getInteger("storageType");
String keyname = jsonObj.getString("keyname");
Keys keys = new Keys();
keys.setId(id);
keys.setAccessKey(AccessKey);
keys.setAccessSecret(AccessSecret);
keys.setEndpoint(Endpoint);
keys.setBucketname(Bucketname);
keys.setRequestAddress(RequestAddress);
keys.setStorageType(storageType);
keys.setKeyname(keyname);
// Integer id = jsonObj.getInteger("id");
// String AccessKey = jsonObj.getString("AccessKey");
// String AccessSecret = jsonObj.getString("AccessSecret");
// String Endpoint = jsonObj.getString("Endpoint");
// String Bucketname = jsonObj.getString("Bucketname");
// String RequestAddress = jsonObj.getString("RequestAddress");
// Integer storageType = jsonObj.getInteger("storageType");
// String keyname = jsonObj.getString("keyname");
// Keys keys = new Keys();
// keys.setId(id);
// keys.setAccessKey(AccessKey);
// keys.setAccessSecret(AccessSecret);
// keys.setEndpoint(Endpoint);
// keys.setBucketname(Bucketname);
// keys.setRequestAddress(RequestAddress);
// keys.setStorageType(storageType);
// keys.setKeyname(keyname);
Keys keys = JSON.toJavaObject(jsonObj,Keys.class);
Msg msg = keysService.updateKey(keys);
return msg;
}
@@ -68,6 +68,7 @@ public class IndexController {
jsonObject.put("links", cd.getString("links"));
jsonObject.put("aboutinfo", cd.getString("aboutinfo"));
jsonObject.put("logo", cd.getString("logo"));
jsonObject.put("webfavicons", cd.getString("webfavicons"));
jsonObject.put("api", updateConfig.getApi());
jsonObject.put("register", sysConfig.getRegister());
jsonObject.put("isuse", appClient.getIsuse());
+5 -81
View File
@@ -1,94 +1,18 @@
package cn.hellohao.pojo;
import lombok.Data;
@Data
public class Keys {
private Integer id;
private String AccessKey;
private String AccessSecret;
private String Endpoint;
private String Region;
private String Bucketname;
private String RequestAddress;
private Integer storageType;
private String keyname;
private String RootPath;//存入的目录
public Keys() {
super();
}
public Keys(Integer id, String accessKey, String accessSecret, String endpoint, String bucketname,
String requestAddress, Integer storageType,String keyname) {
super();
this.id = id;
this.AccessKey = accessKey;
this.AccessSecret = accessSecret;
this.Endpoint = endpoint;
this.Bucketname = bucketname;
this.RequestAddress = requestAddress;
this.storageType = storageType;
this.keyname = keyname;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getAccessKey() {
return AccessKey;
}
public void setAccessKey(String accessKey) {
AccessKey = accessKey;
}
public String getAccessSecret() {
return AccessSecret;
}
public void setAccessSecret(String accessSecret) {
AccessSecret = accessSecret;
}
public String getEndpoint() {
return Endpoint;
}
public void setEndpoint(String endpoint) {
Endpoint = endpoint;
}
public String getBucketname() {
return Bucketname;
}
public void setBucketname(String bucketname) {
Bucketname = bucketname;
}
public String getRequestAddress() {
return RequestAddress;
}
public void setRequestAddress(String requestAddress) {
RequestAddress = requestAddress;
}
public Integer getStorageType() {
return storageType;
}
public void setStorageType(Integer storageType) {
this.storageType = storageType;
}
public String getKeyname() {
return keyname;
}
public void setKeyname(String keyname) {
this.keyname = keyname;
}
}
+3 -20
View File
@@ -101,7 +101,7 @@ public class FirstRun implements InitializingBean {
}
Integer isconfdata = RunSqlScript.RunSelectCount(isTableName+"'confdata'");
if(isconfdata==0){
Integer integer = RunSqlScript.RunInsert(createConfdata);
RunSqlScript.RunInsert(createConfdata);
RunSqlScript.RunInsert(instartConfdata);
Print.Normal("Add table.confdata");
}
@@ -143,25 +143,8 @@ public class FirstRun implements InitializingBean {
private String instartAppclient = "INSERT INTO `appclient` VALUES ('app', 'on', NULL, NULL, 'Hellohao图像托管', 'https://hellohao.nos-eastchina1.126.net/TbedClient/app.png', '1.0.1');";
//创建confdata表
private String createConfdata = "CREATE TABLE tbed.confdata ( `key` varchar(100) NULL, jsondata LONGTEXT NULL )";
private String instartConfdata = "INSERT INTO `confdata` VALUES ('config', '{" +
" \"sourcekey\":7," +
" \"emails\":1," +
" \"webname\":\"Hellohao图床\"," +
" \"explain\":\"Hellohao图像托管,是一家免费开源的图像托管,即时分享你的美好瞬间。\"," +
" \"links\":\"<p style=\\\"color:#7c7c88;\\\">© 2019 <a href=\\\"http://www.Hellohao.cn/\\\" target=\\\"_blank\\\" title=\\\"Hellohao\\\">Hellohao</a><span> - All Rights Reserved</span> </p>\",\n" +
" \"notice\":\"也许...|这将是最好用的图床|为了更好的用户体验,建议您注册本站继续免费使用Hellohao图床。本站不得上传任何形式的非法图片,一旦发现,永久删除并禁封账户。情节严重者将相关资料交于相关部门处理。\",\n" +
" \"domain\":\"http://127.0.0.1:10088\"," +
" \"background1\":\"\"," +
" \"sett\":\"1\"," +
" \"webms\":\"Hellohao图像托管,是一家免费开源的图像托管,即时分享你的美好瞬间。\"," +
" \"webkeywords\":\"hellohao图床,图床,图片上传,开源图床,hellohao,图像托管,图片分享\"," +
" \"theme\":2," +
" \"websubtitle\":\"这将是你用过最优秀的图像托管程序\"," +
" \"logo\":null," +
" \"aboutinfo\":\"<img width=\\\"300px\\\" src=\\\"http://img.wwery.com/hellohao/rPscRYwz.png\\\">\\n <br />\\n <br />\\n <p>也许,这将是你用到最优秀的图像托管程序</p>\\n <p>本程序为Hellohao图象托管程序</p>\\n <br/>\\n <p style=\\\"color: #656565;\\\">作者:hellohao独立开发</p>\\n <p style=\\\"color: #656565;\\\">www.hellohao.cn</p>\"" +
"}');";
private String instartConfdata =
"INSERT INTO `confdata` VALUES ('config', '{\\\"sourcekey\\\":7,\\\"emails\\\":1,\\\"webname\\\":\\\"Hellohao图床\\\",\\\"explain\\\":\\\"Hellohao图像托管,是一家免费开源的图像托管,即时分享你的美好瞬间。\\\",\\\"links\\\":\\\"<p style=\\\\\\\"color:#7c7c88;\\\\\\\">© 2019 <a href=\\\\\\\"http://www.Hellohao.cn/\\\\\\\" target=\\\\\\\"_blank\\\\\\\" title=\\\\\\\"Hellohao\\\\\\\">Hellohao</a><span> - All Rights Reserved</span> </p>\\\",\\\"notice\\\":\\\"也许...|这将是最好用的图床|为了更好的用户体验,建议您注册本站继续免费使用Hellohao图床。本站不得上传任何形式的非法图片,一旦发现,永久删除并禁封账户。情节严重者将相关资料交于相关部门处理。\\\",\\\"domain\\\":\\\"http://127.0.0.1:10088\\\",\\\"background1\\\":\\\"\\\",\\\"sett\\\":\\\"1\\\",\\\"webms\\\":\\\"Hellohao图像托管,是一家免费开源的图像托管,即时分享你的美好瞬间。\\\",\\\"webkeywords\\\":\\\"hellohao图床,图床,图片上传,开源图床,hellohao,图像托管,图片分享\\\",\\\"theme\\\":2,\\\"websubtitle\\\":\\\"这将是你用过最优秀的图像托管程序\\\",\\\"logo\\\":null,\\\"aboutinfo\\\":\\\"<img width=\\\\\\\"300px\\\\\\\" src=\\\\\\\"http://img.wwery.com/hellohao/rPscRYwz.png\\\\\\\"> <br /> <br /> <p>也许,这将是你用到最优秀的图像托管程序</p> <p>本程序为Hellohao图象托管程序</p> <br/> <p style=\\\\\\\"color: #656565;\\\\\\\">作者:hellohao独立开发</p> <p style=\\\\\\\"color: #656565;\\\\\\\">www.hellohao.cn</p>\\\"}');";
private String inddx_md5key = "ALTER TABLE imgdata ADD INDEX index_md5key_url ( md5key,imgurl)";
// create index yarn_app_result_i4 on yarn_app_result (flow_exec_id(100), another_column(50));
+1 -1
View File
@@ -14,7 +14,7 @@ spring.datasource.url=${MYSQL_URL:jdbc:mysql://127.0.0.1:3306/tbed?useUnicode=tr
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.redis.host= 127.0.0.1
spring.redis.port=10087
spring.redis.port=6379
## 设置最大连接数,0为无限
spring.redis.pool.max-active=8
# 连接超时时间(毫秒)