From 4de972cb11dd142addaf298813ba926f06987524 Mon Sep 17 00:00:00 2001 From: hexxa Date: Sat, 2 Apr 2022 17:03:59 +0800 Subject: [PATCH] fix(config): clean up configs and workflows --- .../{cd_docker.yml => ci_docker.yml} | 2 +- ...github_binary.yml => ci_github_binary.yml} | 2 +- configs/demo.yml | 17 +--------- configs/dev.yml | 2 +- configs/docker.yml | 33 ------------------- configs/lan.yml | 2 +- src/client/web/src/components/root_frame.tsx | 2 +- src/client/web/webpack.app.prod.js | 11 ++++--- src/server/config.go | 4 +-- src/server/server.go | 2 +- 10 files changed, 15 insertions(+), 62 deletions(-) rename .github/workflows/{cd_docker.yml => ci_docker.yml} (98%) rename .github/workflows/{cd_github_binary.yml => ci_github_binary.yml} (98%) diff --git a/.github/workflows/cd_docker.yml b/.github/workflows/ci_docker.yml similarity index 98% rename from .github/workflows/cd_docker.yml rename to .github/workflows/ci_docker.yml index ec94b70..a94dd62 100644 --- a/.github/workflows/cd_docker.yml +++ b/.github/workflows/ci_docker.yml @@ -1,4 +1,4 @@ -name: cd-docker +name: ci-docker on: release: diff --git a/.github/workflows/cd_github_binary.yml b/.github/workflows/ci_github_binary.yml similarity index 98% rename from .github/workflows/cd_github_binary.yml rename to .github/workflows/ci_github_binary.yml index 993c8d5..d7be90b 100644 --- a/.github/workflows/cd_github_binary.yml +++ b/.github/workflows/ci_github_binary.yml @@ -1,4 +1,4 @@ -name: cd-binary +name: ci-binary # Controls when the action will run. on: diff --git a/configs/demo.yml b/configs/demo.yml index a74069f..e8f2b31 100644 --- a/configs/demo.yml +++ b/configs/demo.yml @@ -2,8 +2,6 @@ fs: root: "/quickshare/root" opensLimit: 1024 openTTL: 60 # 1 min -secrets: - tokenSecret: "" server: debug: false host: "0.0.0.0" @@ -33,18 +31,5 @@ users: - name: "demo" pwd: "Quicksh@re" role: "user" -workers: - queueSize: 1024 - sleepCyc: 1 # in second - workerCount: 2 -site: - clientCfg: - siteName: "Quickshare" - siteDesc: "quick and simple file sharing" - bg: - url: "/static/img/textured_paper.png" - repeat: "repeat" - position: "center" - align: "fixed" db: - dbPath: "/quickshare/root/quickshare.db" \ No newline at end of file + dbPath: "/quickshare/root/quickshare.db" diff --git a/configs/dev.yml b/configs/dev.yml index 8715c36..52e55ec 100644 --- a/configs/dev.yml +++ b/configs/dev.yml @@ -40,7 +40,7 @@ workers: site: clientCfg: siteName: "Quickshare" - siteDesc: "quick and simple file sharing" + siteDesc: "Quick and simple file sharing" bg: url: "/static/img/textured_paper.png" repeat: "repeat" diff --git a/configs/docker.yml b/configs/docker.yml index f155c9d..2f901c4 100644 --- a/configs/docker.yml +++ b/configs/docker.yml @@ -2,8 +2,6 @@ fs: root: "/quickshare/root" opensLimit: 1024 openTTL: 60 # 1 min -secrets: - tokenSecret: "" server: debug: false host: "0.0.0.0" @@ -12,36 +10,5 @@ server: writeTimeout: 86400000 # 1 day maxHeaderBytes: 512 publicPath: "/quickshare/public" -users: - enableAuth: true - defaultAdmin: "" - defaultAdminPwd: "" - cookieTTL: 604800 # 1 week - cookieSecure: false - cookieHttpOnly: true - minUserNameLen: 3 - minPwdLen: 6 - captchaWidth: 256 - captchaHeight: 60 - captchaEnabled: true - uploadSpeedLimit: 1048576 # 1MB/limiterCyc - downloadSpeedLimit: 1048576 # 1MB/limiterCyc - spaceLimit: 104857600 # 100MB - limiterCapacity: 1000 - limiterCyc: 1000 # 1s - predefinedUsers: [] -workers: - queueSize: 1024 - sleepCyc: 1 # in second - workerCount: 2 -site: - clientCfg: - siteName: "Quickshare" - siteDesc: "quick and simple file sharing" - bg: - url: "/static/img/textured_paper.png" - repeat: "repeat" - position: "center" - align: "fixed" db: dbPath: "/quickshare/root/quickshare.db" diff --git a/configs/lan.yml b/configs/lan.yml index e83eb89..5abf904 100644 --- a/configs/lan.yml +++ b/configs/lan.yml @@ -36,7 +36,7 @@ workers: site: clientCfg: siteName: "Quickshare" - siteDesc: "quick and simple file sharing" + siteDesc: "Quick and simple file sharing" bg: url: "/static/img/textured_paper.png" repeat: "repeat" diff --git a/src/client/web/src/components/root_frame.tsx b/src/client/web/src/components/root_frame.tsx index 0ac6937..7ac136f 100644 --- a/src/client/web/src/components/root_frame.tsx +++ b/src/client/web/src/components/root_frame.tsx @@ -156,7 +156,7 @@ export class RootFrame extends React.Component {
Quickshare - - quick and simple file sharing. + Quick and simple file sharing.
diff --git a/src/client/web/webpack.app.prod.js b/src/client/web/webpack.app.prod.js index e1e36c8..e3f558f 100644 --- a/src/client/web/webpack.app.prod.js +++ b/src/client/web/webpack.app.prod.js @@ -4,20 +4,21 @@ const HtmlWebpackPlugin = require("html-webpack-plugin"); const prod = require("./webpack.prod.js"); module.exports = merge(prod, { - entry: "./src/app.tsx", + entry: ["./src/app.tsx", "./src/components/api.ts"], context: `${__dirname}`, output: { globalObject: "this", path: `${__dirname}/../../../public/static`, chunkFilename: "[name].bundle.js", - filename: "[name].bundle.js" + filename: "[name].bundle.js", + library: "Q", }, plugins: [ new HtmlWebpackPlugin({ template: `${__dirname}/build/template/index.template.html`, hash: true, filename: `../index.html`, - minify: false - }) - ] + minify: false, + }), + ], }); diff --git a/src/server/config.go b/src/server/config.go index bc2af93..bbf8275 100644 --- a/src/server/config.go +++ b/src/server/config.go @@ -89,7 +89,7 @@ func DefaultConfigStruct() *Config { CookieTTL: 3600 * 24 * 7, // 1 week CookieSecure: false, CookieHttpOnly: true, - MinUserNameLen: 4, + MinUserNameLen: 3, MinPwdLen: 8, CaptchaWidth: 256, CaptchaHeight: 60, @@ -121,7 +121,7 @@ func DefaultConfigStruct() *Config { Site: &db.SiteConfig{ ClientCfg: &db.ClientConfig{ SiteName: "Quickshare", - SiteDesc: "quick and simple file sharing", + SiteDesc: "Quick and simple file sharing", Bg: &db.BgConfig{ Url: "/static/img/textured_paper.png", Repeat: "repeat", diff --git a/src/server/server.go b/src/server/server.go index 4d57636..0ef7bba 100644 --- a/src/server/server.go +++ b/src/server/server.go @@ -165,7 +165,7 @@ func initDeps(cfg gocfg.ICfg) *depidx.Deps { err = siteStore.Init(&db.SiteConfig{ ClientCfg: &db.ClientConfig{ SiteName: cfg.StringOr("Site.ClientCfg.SiteName", "Quickshare"), - SiteDesc: cfg.StringOr("Site.ClientCfg.SiteDesc", "quick and simple file sharing"), + SiteDesc: cfg.StringOr("Site.ClientCfg.SiteDesc", "Quick and simple file sharing"), Bg: &db.BgConfig{ Url: cfg.StringOr("Site.ClientCfg.Bg.Url", "/static/img/textured_paper.png"), Repeat: cfg.StringOr("Site.ClientCfg.Bg.Repeat", "repeat"),