Fix an issue with SSL and env variable

This commit is contained in:
Chris Veleris 2024-09-16 23:54:02 +03:00
parent 2fe6968e3b
commit d06e124e5b
2 changed files with 4 additions and 3 deletions

View file

@ -91,7 +91,7 @@ puma -C app/config/puma.rb
Pull the latest image:
```bash
docker pull chrisvel/tududi:0.19
docker pull chrisvel/tududi:0.20
```
In order to start the docker container you need 3 enviromental variables:
@ -120,7 +120,7 @@ TUDUDI_INTERNAL_SSL_ENABLED
-e TUDUDI_INTERNAL_SSL_ENABLED=false \
-v ~/tududi_db:/usr/src/app/tududi_db \
-p 9292:9292 \
-d chrisvel/tududi:0.19
-d chrisvel/tududi:0.20
```
3. Navigate to https://localhost:9292 and fill in your email and password.

3
app.rb
View file

@ -29,7 +29,8 @@ set :public_folder, 'public'
configure do
enable :sessions
set :sessions, httponly: true, secure: production?, expire_after: 2_592_000
set :sessions, httponly: true, secure: (production? && ENV['TUDUDI_INTERNAL_SSL_ENABLED'] == 'true'),
expire_after: 2_592_000
set :session_secret, ENV.fetch('TUDUDI_SESSION_SECRET') { SecureRandom.hex(64) }
# Auto-create user if not exists