新增支持s3协议对象存储

This commit is contained in:
eoao
2025-08-31 12:04:19 +08:00
parent 562528e968
commit 86a80900c1
27 changed files with 1981 additions and 277 deletions

View File

@@ -21,10 +21,26 @@ const init = {
await this.v1_5DB(c);
await this.v1_6DB(c);
await this.v1_7DB(c);
await this.v1_7DB(c);
await this.v2DB(c);
await settingService.refresh(c);
return c.text(t('initSuccess'));
},
async v2DB(c) {
try {
await c.env.db.batch([
c.env.db.prepare(`ALTER TABLE setting ADD COLUMN bucket TEXT NOT NULL DEFAULT '';`),
c.env.db.prepare(`ALTER TABLE setting ADD COLUMN region TEXT NOT NULL DEFAULT '';`),
c.env.db.prepare(`ALTER TABLE setting ADD COLUMN endpoint TEXT NOT NULL DEFAULT '';`),
c.env.db.prepare(`ALTER TABLE setting ADD COLUMN s3_access_key TEXT NOT NULL DEFAULT '';`),
c.env.db.prepare(`ALTER TABLE setting ADD COLUMN s3_secret_key TEXT NOT NULL DEFAULT '';`)
]);
} catch (e) {
console.error(e.message)
}
},
async v1_7DB(c) {
try {
await c.env.db.prepare(`ALTER TABLE setting ADD COLUMN login_domain INTEGER NOT NULL DEFAULT 0;`).run();
@@ -308,7 +324,6 @@ const init = {
(17, '系统设置', '', 0, 1, 6),
(18, '设置查看', 'setting:query', 17, 2, 0),
(19, '设置修改', 'setting:set', 17, 2, 1),
(20, '物理清空', 'setting:clean', 17, 2, 2),
(21, '邮箱侧栏', '', 0, 0, 1),
(22, '邮箱查看', 'account:query', 21, 2, 0),
(23, '邮箱添加', 'account:add', 21, 2, 1),