mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-24 22:06:57 +00:00
fix bug
This commit is contained in:
parent
045c09b518
commit
3b321e60b5
3 changed files with 8 additions and 7 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -7,3 +7,4 @@ build/
|
||||||
vendor/
|
vendor/
|
||||||
pages
|
pages
|
||||||
certs.sqlite
|
certs.sqlite
|
||||||
|
.bash_history
|
||||||
|
|
|
@ -89,17 +89,17 @@ var (
|
||||||
EnvVars: []string{"HOST"},
|
EnvVars: []string{"HOST"},
|
||||||
Value: "[::]",
|
Value: "[::]",
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.UintFlag{
|
||||||
Name: "port",
|
Name: "port",
|
||||||
Usage: "specifies the https port to listen to ssl requests",
|
Usage: "specifies the https port to listen to ssl requests",
|
||||||
EnvVars: []string{"PORT", "HTTPS_PORT"},
|
EnvVars: []string{"PORT", "HTTPS_PORT"},
|
||||||
Value: "443",
|
Value: 443,
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.UintFlag{
|
||||||
Name: "http-port",
|
Name: "http-port",
|
||||||
Usage: "specifies the http port, you also have to enable http server via ENABLE_HTTP_SERVER=true",
|
Usage: "specifies the http port, you also have to enable http server via ENABLE_HTTP_SERVER=true",
|
||||||
EnvVars: []string{"HTTP_PORT"},
|
EnvVars: []string{"HTTP_PORT"},
|
||||||
Value: "80",
|
Value: 80,
|
||||||
},
|
},
|
||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "enable-http-server",
|
Name: "enable-http-server",
|
||||||
|
|
|
@ -47,10 +47,10 @@ func Serve(ctx *cli.Context) error {
|
||||||
rawDomain := ctx.String("raw-domain")
|
rawDomain := ctx.String("raw-domain")
|
||||||
mainDomainSuffix := ctx.String("pages-domain")
|
mainDomainSuffix := ctx.String("pages-domain")
|
||||||
rawInfoPage := ctx.String("raw-info-page")
|
rawInfoPage := ctx.String("raw-info-page")
|
||||||
listeningHost := fmt.Sprintf("%s:%s", ctx.String("host"), ctx.String("port"))
|
listeningHost := ctx.String("host")
|
||||||
listeningSSLAddress := fmt.Sprintf("%s:%s", listeningHost, ctx.String("port"))
|
listeningSSLAddress := fmt.Sprintf("%s:%d", listeningHost, ctx.Uint("port"))
|
||||||
|
listeningHTTPAddress := fmt.Sprintf("%s:%d", listeningHost, ctx.Uint("http-port"))
|
||||||
enableHTTPServer := ctx.Bool("enable-http-server")
|
enableHTTPServer := ctx.Bool("enable-http-server")
|
||||||
listeningHTTPAddress := fmt.Sprintf("%s:%s", listeningHost, ctx.String("http-port"))
|
|
||||||
|
|
||||||
allowedCorsDomains := AllowedCorsDomains
|
allowedCorsDomains := AllowedCorsDomains
|
||||||
if rawDomain != "" {
|
if rawDomain != "" {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue