Remove extra environment

This commit is contained in:
Manav Rathi 2024-03-18 12:35:18 +05:30
parent 5ee878c30e
commit d8347c3976
No known key found for this signature in database
5 changed files with 15 additions and 15 deletions

View file

@ -712,9 +712,8 @@ func main() {
}
func runServer(environment string, server *gin.Engine) {
if environment == "local" || environment == "proxy" {
server.Run(":8080")
} else {
useTLS := viper.GetBool("http.use_tls")
if useTLS {
certPath, err := config.CredentialFilePath("tls.cert")
if err != nil {
log.Fatal(err)
@ -726,6 +725,8 @@ func runServer(environment string, server *gin.Engine) {
}
log.Fatal(server.RunTLS(":443", certPath, keyPath))
} else {
server.Run(":8080")
}
}

View file

@ -65,6 +65,12 @@
# It must be specified if running in a non-local environment.
log-file: ""
# HTTP connection parameters
http:
# If true, bind to 443 and use TLS.
# By default, this is false, and museum will bind to 8080 without TLS.
# use_tls: true
# Database connection parameters
db:
host: localhost

View file

@ -1,5 +1,8 @@
log-file: /var/logs/museum.log
http:
use_tls: true
stripe:
path:
success: ?status=success&session_id={CHECKOUT_SESSION_ID}

View file

@ -1,11 +0,0 @@
# Production setup when running behind a reverse proxy like Nginx
#
# - TLS terminates on Nginx not on us
# - Otherwise the same as `production.yaml`
log-file: /var/logs/museum.log
stripe:
path:
success: ?status=success&session_id={CHECKOUT_SESSION_ID}
cancel: ?status=fail&reason=canceled

View file

@ -10,7 +10,8 @@ ExecStartPre=docker pull rg.fr-par.scw.cloud/ente/museum-prod
ExecStartPre=-docker stop museum
ExecStartPre=-docker rm museum
ExecStart=docker run --name museum \
-e ENVIRONMENT=proxy \
-e ENVIRONMENT=production \
-e ENTE_HTTP-USE_TLS=0 \
--hostname "%H" \
-p 8080:8080 \
-p 2112:2112 \