fix(config): clean up configs and workflows

This commit is contained in:
hexxa 2022-04-02 17:03:59 +08:00 committed by Hexxa
parent 2f6aa33108
commit 4de972cb11
10 changed files with 15 additions and 62 deletions

View file

@ -1,4 +1,4 @@
name: cd-docker name: ci-docker
on: on:
release: release:

View file

@ -1,4 +1,4 @@
name: cd-binary name: ci-binary
# Controls when the action will run. # Controls when the action will run.
on: on:

View file

@ -2,8 +2,6 @@ fs:
root: "/quickshare/root" root: "/quickshare/root"
opensLimit: 1024 opensLimit: 1024
openTTL: 60 # 1 min openTTL: 60 # 1 min
secrets:
tokenSecret: ""
server: server:
debug: false debug: false
host: "0.0.0.0" host: "0.0.0.0"
@ -33,18 +31,5 @@ users:
- name: "demo" - name: "demo"
pwd: "Quicksh@re" pwd: "Quicksh@re"
role: "user" 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: db:
dbPath: "/quickshare/root/quickshare.db" dbPath: "/quickshare/root/quickshare.db"

View file

@ -40,7 +40,7 @@ workers:
site: site:
clientCfg: clientCfg:
siteName: "Quickshare" siteName: "Quickshare"
siteDesc: "quick and simple file sharing" siteDesc: "Quick and simple file sharing"
bg: bg:
url: "/static/img/textured_paper.png" url: "/static/img/textured_paper.png"
repeat: "repeat" repeat: "repeat"

View file

@ -2,8 +2,6 @@ fs:
root: "/quickshare/root" root: "/quickshare/root"
opensLimit: 1024 opensLimit: 1024
openTTL: 60 # 1 min openTTL: 60 # 1 min
secrets:
tokenSecret: ""
server: server:
debug: false debug: false
host: "0.0.0.0" host: "0.0.0.0"
@ -12,36 +10,5 @@ server:
writeTimeout: 86400000 # 1 day writeTimeout: 86400000 # 1 day
maxHeaderBytes: 512 maxHeaderBytes: 512
publicPath: "/quickshare/public" 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: db:
dbPath: "/quickshare/root/quickshare.db" dbPath: "/quickshare/root/quickshare.db"

View file

@ -36,7 +36,7 @@ workers:
site: site:
clientCfg: clientCfg:
siteName: "Quickshare" siteName: "Quickshare"
siteDesc: "quick and simple file sharing" siteDesc: "Quick and simple file sharing"
bg: bg:
url: "/static/img/textured_paper.png" url: "/static/img/textured_paper.png"
repeat: "repeat" repeat: "repeat"

View file

@ -156,7 +156,7 @@ export class RootFrame extends React.Component<Props, State, {}> {
<div id="tail" className="container-center"> <div id="tail" className="container-center">
<a href="https://github.com/ihexxa/quickshare">Quickshare</a> - <a href="https://github.com/ihexxa/quickshare">Quickshare</a> -
quick and simple file sharing. Quick and simple file sharing.
</div> </div>
</div> </div>
</div> </div>

View file

@ -4,20 +4,21 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
const prod = require("./webpack.prod.js"); const prod = require("./webpack.prod.js");
module.exports = merge(prod, { module.exports = merge(prod, {
entry: "./src/app.tsx", entry: ["./src/app.tsx", "./src/components/api.ts"],
context: `${__dirname}`, context: `${__dirname}`,
output: { output: {
globalObject: "this", globalObject: "this",
path: `${__dirname}/../../../public/static`, path: `${__dirname}/../../../public/static`,
chunkFilename: "[name].bundle.js", chunkFilename: "[name].bundle.js",
filename: "[name].bundle.js" filename: "[name].bundle.js",
library: "Q",
}, },
plugins: [ plugins: [
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: `${__dirname}/build/template/index.template.html`, template: `${__dirname}/build/template/index.template.html`,
hash: true, hash: true,
filename: `../index.html`, filename: `../index.html`,
minify: false minify: false,
}) }),
] ],
}); });

View file

@ -89,7 +89,7 @@ func DefaultConfigStruct() *Config {
CookieTTL: 3600 * 24 * 7, // 1 week CookieTTL: 3600 * 24 * 7, // 1 week
CookieSecure: false, CookieSecure: false,
CookieHttpOnly: true, CookieHttpOnly: true,
MinUserNameLen: 4, MinUserNameLen: 3,
MinPwdLen: 8, MinPwdLen: 8,
CaptchaWidth: 256, CaptchaWidth: 256,
CaptchaHeight: 60, CaptchaHeight: 60,
@ -121,7 +121,7 @@ func DefaultConfigStruct() *Config {
Site: &db.SiteConfig{ Site: &db.SiteConfig{
ClientCfg: &db.ClientConfig{ ClientCfg: &db.ClientConfig{
SiteName: "Quickshare", SiteName: "Quickshare",
SiteDesc: "quick and simple file sharing", SiteDesc: "Quick and simple file sharing",
Bg: &db.BgConfig{ Bg: &db.BgConfig{
Url: "/static/img/textured_paper.png", Url: "/static/img/textured_paper.png",
Repeat: "repeat", Repeat: "repeat",

View file

@ -165,7 +165,7 @@ func initDeps(cfg gocfg.ICfg) *depidx.Deps {
err = siteStore.Init(&db.SiteConfig{ err = siteStore.Init(&db.SiteConfig{
ClientCfg: &db.ClientConfig{ ClientCfg: &db.ClientConfig{
SiteName: cfg.StringOr("Site.ClientCfg.SiteName", "Quickshare"), 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{ Bg: &db.BgConfig{
Url: cfg.StringOr("Site.ClientCfg.Bg.Url", "/static/img/textured_paper.png"), Url: cfg.StringOr("Site.ClientCfg.Bg.Url", "/static/img/textured_paper.png"),
Repeat: cfg.StringOr("Site.ClientCfg.Bg.Repeat", "repeat"), Repeat: cfg.StringOr("Site.ClientCfg.Bg.Repeat", "repeat"),