Skip to content

Commit

Permalink
Fix an issue with SSL and env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvel committed Sep 16, 2024
1 parent 2fe6968 commit d06e124
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@

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
Expand Down

0 comments on commit d06e124

Please sign in to comment.