Remove APPLICATION_HOST env var.

This commit is contained in:
Eugene Burmakin 2025-01-07 13:28:51 +01:00
parent ae6dc5ac8a
commit 688440710f
6 changed files with 12 additions and 18 deletions

View file

@ -26,7 +26,6 @@ services:
DATABASE_PASSWORD: password DATABASE_PASSWORD: password
DATABASE_NAME: dawarich_development DATABASE_NAME: dawarich_development
MIN_MINUTES_SPENT_IN_CITY: 60 MIN_MINUTES_SPENT_IN_CITY: 60
APPLICATION_HOST: localhost
APPLICATION_HOSTS: localhost APPLICATION_HOSTS: localhost
TIME_ZONE: Europe/London TIME_ZONE: Europe/London
APPLICATION_PROTOCOL: http APPLICATION_PROTOCOL: http

View file

@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
# 0.21.5 - 2025-01-07 # 0.21.5 - 2025-01-07
You may now use Geoapify API for reverse geocoding. To obrain an API key, sign up at https://myprojects.geoapify.com/ and create a new project. Make sure you have read and understood the [pricing policy](https://www.geoapify.com/pricing) and [Terms and Conditions](https://www.geoapify.com/terms-and-conditions/). You may now use Geoapify API for reverse geocoding. To obtain an API key, sign up at https://myprojects.geoapify.com/ and create a new project. Make sure you have read and understood the [pricing policy](https://www.geoapify.com/pricing) and [Terms and Conditions](https://www.geoapify.com/terms-and-conditions/).
### Added ### Added
@ -16,6 +16,7 @@ You may now use Geoapify API for reverse geocoding. To obrain an API key, sign u
### Removed ### Removed
- Photon ENV vars from the `.env.development` and docker-compose.yml files. - Photon ENV vars from the `.env.development` and docker-compose.yml files.
- `APPLICATION_HOST` env var.
# 0.21.4 - 2025-01-05 # 0.21.4 - 2025-01-05

View file

@ -86,11 +86,11 @@ Rails.application.configure do
# Raise error when a before_action's only/except options reference missing actions # Raise error when a before_action's only/except options reference missing actions
config.action_controller.raise_on_missing_callback_actions = true config.action_controller.raise_on_missing_callback_actions = true
config.action_mailer.default_url_options = { host: ENV.fetch('APPLICATION_HOST', 'localhost'), port: 3000 }
config.hosts << ENV.fetch('APPLICATION_HOST', 'localhost')
hosts = ENV.fetch('APPLICATION_HOSTS', 'localhost') hosts = ENV.fetch('APPLICATION_HOSTS', 'localhost').split(',')
config.hosts.concat(hosts.split(',')) if hosts.present?
config.action_mailer.default_url_options = { host: hosts.first, port: 3000 }
config.hosts.concat(hosts) if hosts.present?
config.force_ssl = ENV.fetch('APPLICATION_PROTOCOL', 'http').downcase == 'https' config.force_ssl = ENV.fetch('APPLICATION_PROTOCOL', 'http').downcase == 'https'

View file

@ -62,7 +62,6 @@ services:
DATABASE_PASSWORD: password DATABASE_PASSWORD: password
DATABASE_NAME: dawarich_development DATABASE_NAME: dawarich_development
MIN_MINUTES_SPENT_IN_CITY: 60 MIN_MINUTES_SPENT_IN_CITY: 60
APPLICATION_HOST: localhost
APPLICATION_HOSTS: localhost APPLICATION_HOSTS: localhost
TIME_ZONE: Europe/London TIME_ZONE: Europe/London
APPLICATION_PROTOCOL: http APPLICATION_PROTOCOL: http
@ -115,7 +114,6 @@ services:
DATABASE_USERNAME: postgres DATABASE_USERNAME: postgres
DATABASE_PASSWORD: password DATABASE_PASSWORD: password
DATABASE_NAME: dawarich_development DATABASE_NAME: dawarich_development
APPLICATION_HOST: localhost
APPLICATION_HOSTS: localhost APPLICATION_HOSTS: localhost
BACKGROUND_PROCESSING_CONCURRENCY: 10 BACKGROUND_PROCESSING_CONCURRENCY: 10
APPLICATION_PROTOCOL: http APPLICATION_PROTOCOL: http

View file

@ -41,7 +41,6 @@ services:
DATABASE_PASSWORD: password DATABASE_PASSWORD: password
DATABASE_NAME: dawarich_development DATABASE_NAME: dawarich_development
MIN_MINUTES_SPENT_IN_CITY: 60 MIN_MINUTES_SPENT_IN_CITY: 60
APPLICATION_HOST: localhost
APPLICATION_HOSTS: localhost APPLICATION_HOSTS: localhost
APPLICATION_PROTOCOL: http APPLICATION_PROTOCOL: http
DISTANCE_UNIT: km DISTANCE_UNIT: km
@ -94,7 +93,6 @@ services:
DATABASE_USERNAME: postgres DATABASE_USERNAME: postgres
DATABASE_PASSWORD: password DATABASE_PASSWORD: password
DATABASE_NAME: dawarich_development DATABASE_NAME: dawarich_development
APPLICATION_HOST: localhost
APPLICATION_HOSTS: localhost APPLICATION_HOSTS: localhost
BACKGROUND_PROCESSING_CONCURRENCY: 10 BACKGROUND_PROCESSING_CONCURRENCY: 10
APPLICATION_PROTOCOL: http APPLICATION_PROTOCOL: http

View file

@ -14,7 +14,6 @@ dawarich_app:
... ...
environment: environment:
... ...
APPLICATION_HOST: "yourhost.com" <------------------------------ Edit this
APPLICATION_HOSTS: "yourhost.com,www.yourhost.com,127.0.0.1" <-- Edit this APPLICATION_HOSTS: "yourhost.com,www.yourhost.com,127.0.0.1" <-- Edit this
``` ```
@ -25,7 +24,6 @@ dawarich_sidekiq:
... ...
environment: environment:
... ...
APPLICATION_HOST: "yourhost.com" <------------------------------ Edit this
APPLICATION_HOSTS: "yourhost.com,www.yourhost.com,127.0.0.1" <-- Edit this APPLICATION_HOSTS: "yourhost.com,www.yourhost.com,127.0.0.1" <-- Edit this
... ...
``` ```
@ -48,7 +46,7 @@ server {
brotli on; brotli on;
brotli_comp_level 6; brotli_comp_level 6;
brotli_types brotli_types
text/css text/css
text/plain text/plain
text/xml text/xml
@ -106,24 +104,24 @@ With the above commands entered, the configuration below should work properly.
```apache ```apache
<VirtualHost *:80> <VirtualHost *:80>
ServerName example.com ServerName example.com
ProxyRequests Off ProxyRequests Off
ProxyPreserveHost On ProxyPreserveHost On
<Proxy *> <Proxy *>
Require all granted Require all granted
</Proxy> </Proxy>
Header always set X-Real-IP %{REMOTE_ADDR}s Header always set X-Real-IP %{REMOTE_ADDR}s
Header always set X-Forwarded-For %{REMOTE_ADDR}s Header always set X-Forwarded-For %{REMOTE_ADDR}s
Header always set X-Forwarded-Proto https Header always set X-Forwarded-Proto https
Header always set X-Forwarded-Server %{SERVER_NAME}s Header always set X-Forwarded-Server %{SERVER_NAME}s
Header always set Host %{HTTP_HOST}s Header always set Host %{HTTP_HOST}s
SetOutputFilter BROTLI SetOutputFilter BROTLI
AddOutputFilterByType BROTLI_COMPRESS text/css text/plain text/xml text/javascript application/javascript application/json application/manifest+json application/vnd.api+json application/xml application/xhtml+xml application/rss+xml application/atom+xml application/vnd.ms-fontobject application/x-font-ttf application/x-font-opentype application/x-font-truetype image/svg+xml image/x-icon image/vnd.microsoft.icon font/ttf font/eot font/otf font/opentype AddOutputFilterByType BROTLI_COMPRESS text/css text/plain text/xml text/javascript application/javascript application/json application/manifest+json application/vnd.api+json application/xml application/xhtml+xml application/rss+xml application/atom+xml application/vnd.ms-fontobject application/x-font-ttf application/x-font-opentype application/x-font-truetype image/svg+xml image/x-icon image/vnd.microsoft.icon font/ttf font/eot font/otf font/opentype
BrotliCompressionQuality 6 BrotliCompressionQuality 6
ProxyPass / http://127.0.0.1:3000/ ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/ ProxyPassReverse / http://127.0.0.1:3000/