Skip to content

Commit

Permalink
fix: no breaking change from old config
Browse files Browse the repository at this point in the history
  • Loading branch information
BoYanZh committed Jun 6, 2023
1 parent 0b1ec95 commit bd9cb8a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ COPY entrypoint.sh /entrypoint.sh
RUN apk add --no-cache bash ca-certificates su-exec tzdata; \
chmod +x /entrypoint.sh
ENV PUID=0 PGID=0 UMASK=022
EXPOSE 5244 5245
EXPOSE 5244
CMD [ "/entrypoint.sh" ]
4 changes: 4 additions & 0 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ the address is defined in config file`,
r := gin.New()
r.Use(gin.LoggerWithWriter(log.StandardLogger().Out), gin.RecoveryWithWriter(log.StandardLogger().Out))
server.Init(r)
if conf.Conf.HttpsPort == 0 && conf.Conf.Scheme.Https {
conf.Conf.Scheme.DisableHttp = true
conf.Conf.HttpsPort = conf.Conf.Port
}
var httpSrv, httpsSrv *http.Server
if !conf.Conf.Scheme.DisableHttp {
httpBase := fmt.Sprintf("%s:%d", conf.Conf.Address, conf.Conf.Port)
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ services:
- '/etc/alist:/opt/alist/data'
ports:
- '5244:5244'
- '5245:5245'
environment:
- PUID=0
- PGID=0
Expand Down
2 changes: 1 addition & 1 deletion internal/conf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func DefaultConfig() *Config {
return &Config{
Address: "0.0.0.0",
Port: 5244,
HttpsPort: 5245,
HttpsPort: 0,
JwtSecret: random.String(16),
TokenExpiresIn: 48,
TempDir: tempDir,
Expand Down

0 comments on commit bd9cb8a

Please sign in to comment.