diff --git a/.app_version b/.app_version index 88541566..a67cebaf 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.21.0 +0.21.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index a57d6e34..7d5c2fc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -# 0.21.1 - 2024-12-23 +# 0.21.1 - 2024-12-24 ### Added - Cache cleaning and preheating upon application start. +- `PHOTON_API_KEY` env var to set Photon API key. It's an optional env var, but it's required if you want to use Photon API as a Patreon supporter. +- 'X-Dawarich-Response' header to the `GET /api/v1/health` endpoint. It's set to 'Hey, I\'m alive!' to make it easier to check if the API is working. + +### Changed + +- Custom config for PostgreSQL is now optional in `docker-compose.yml`. # 0.21.0 - 2024-12-20 @@ -29,7 +35,7 @@ To mount a custom `postgresql.conf` file, you need to create a `postgresql.conf` volumes: - dawarich_db_data:/var/lib/postgresql/data - dawarich_shared:/var/shared -+ - ./postgresql.conf:/etc/postgresql/postgresql.conf # Provide path to custom config ++ - ./postgresql.conf:/etc/postgresql/postgres.conf # Provide path to custom config ... healthcheck: test: [ "CMD-SHELL", "pg_isready -U postgres -d dawarich_development" ] @@ -37,7 +43,7 @@ To mount a custom `postgresql.conf` file, you need to create a `postgresql.conf` retries: 5 start_period: 30s timeout: 10s -+ command: postgres -c config_file=/etc/postgresql/postgresql.conf # Use custom config ++ command: postgres -c config_file=/etc/postgresql/postgres.conf # Use custom config ``` To ensure your database is using custom config, you can connect to the container (`docker exec -it dawarich_db psql -U postgres`) and run `SHOW config_file;` command. It should return the following path: `/etc/postgresql/postgresql.conf`. diff --git a/app/controllers/api/v1/health_controller.rb b/app/controllers/api/v1/health_controller.rb index 1e5ab2f1..53563cb0 100644 --- a/app/controllers/api/v1/health_controller.rb +++ b/app/controllers/api/v1/health_controller.rb @@ -4,6 +4,8 @@ class Api::V1::HealthController < ApiController skip_before_action :authenticate_api_key def index + response.set_header('X-Dawarich-Response', 'Hey, I\'m alive!') render json: { status: 'ok' } end end + diff --git a/config/initializers/geocoder.rb b/config/initializers/geocoder.rb index d873c8ea..837fb394 100644 --- a/config/initializers/geocoder.rb +++ b/config/initializers/geocoder.rb @@ -17,4 +17,6 @@ if defined?(PHOTON_API_HOST) settings[:photon] = { use_https: PHOTON_API_USE_HTTPS, host: PHOTON_API_HOST } end +settings[:http_headers] = { 'X-Api-Key' => PHOTON_API_KEY } if defined?(PHOTON_API_KEY) + Geocoder.configure(settings) diff --git a/docker-compose.yml b/docker-compose.yml index 68ad7846..fc46ae30 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,7 @@ services: volumes: - dawarich_db_data:/var/lib/postgresql/data - dawarich_shared:/var/shared - - ./postgresql.conf:/etc/postgresql/postgresql.conf # Provide path to your custom config + # - ./postgresql.conf:/etc/postgresql/postgresql.conf # Optional, uncomment if you want to use a custom config networks: - dawarich environment: @@ -36,7 +36,7 @@ services: retries: 5 start_period: 30s timeout: 10s - command: postgres -c config_file=/etc/postgresql/postgresql.conf # Use custom config + # command: postgres -c config_file=/etc/postgresql/postgresql.conf # Use custom config, uncomment if you want to use a custom config dawarich_app: image: freikin/dawarich:latest container_name: dawarich_app diff --git a/postgres.conf.example b/postgresql.conf.example similarity index 100% rename from postgres.conf.example rename to postgresql.conf.example