dawarich Documentation

Your favorite self-hostable alternative to Google Timeline (Google Location History)

RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy dawarich on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name dawarich -p 3000:3000 --restart always freikin/dawarich:latest
Configured Services & Ports
โš™๏ธ dawarich_redis
image: redis:7.4-alpine
โš™๏ธ dawarich_db
image: postgis/postgis:17-3.5-alpine
โš™๏ธ dawarich_app
image: freikin/dawarich:latest
๐Ÿ”Œ Ports: ${DAWARICH_APP_PORT:-3000}:3000
โš™๏ธ dawarich_sidekiq
image: freikin/dawarich:latest
docker-compose.yml
yaml (docker-compose.yml)
# full list of environment variables with descriptions can be found in the documentation:
# https://dawarich.app/docs/self-hosting/environment-variables/

networks:
  dawarich:

services:
  dawarich_redis:
    image: redis:7.4-alpine
    container_name: dawarich_redis
    command: >
      redis-server
      --save 900 1
      --save 300 10
      --appendonly no
    networks:
      - dawarich
    volumes:
      - dawarich_shared:/data
    restart: always
    healthcheck:
      test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
      interval: 10s
      retries: 5
      start_period: 30s
      timeout: 10s

  dawarich_db:
    image: postgis/postgis:17-3.5-alpine
    # image: imresamu/postgis:17-3.5-alpine # If you're on ARM architecture, use this image instead
    shm_size: 1G
    container_name: dawarich_db
    volumes:
      - dawarich_db_data:/var/lib/postgresql/data
      - dawarich_shared:/var/shared
    networks:
      - dawarich
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-postgres}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
      POSTGRES_DB: ${POSTGRES_DB:-dawarich_development}
    restart: always
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-dawarich_development}" ]
      interval: 10s
      retries: 5
      start_period: 30s
      timeout: 10s
    # 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
    volumes:
      - dawarich_public:/var/app/public
      - dawarich_watched:/var/app/tmp/imports/watched
      - dawarich_storage:/var/app/storage
      - dawarich_db_data:/dawarich_db_data
    networks:
      - dawarich
    ports:
      - "${DAWARICH_APP_PORT:-3000}:3000"
    stdin_open: true
    tty: true
    entrypoint: web-entrypoint.sh
    command: ['bin/rails', 'server', '-p', '3000', '-b', '::']
    restart: unless-stopped
    environment:
      RAILS_ENV: ${RAILS_ENV:-production}
      ### To run under a non-root user, set PUID/PGID here (do NOT use `user:`).
      # PUID: ${PUID:-1000}
      # PGID: ${PGID:-1000}
      REDIS_URL: ${REDIS_URL:-redis://dawarich_redis:6379}
      DATABASE_HOST: ${DATABASE_HOST:-dawarich_db}
      DATABASE_PORT: ${DATABASE_PORT:-5432}
      DATABASE_USERNAME: ${DATABASE_USERNAME:-postgres}
      DATABASE_PASSWORD: ${DATABASE_PASSWORD:-password}
      DATABASE_NAME: ${DATABASE_NAME:-dawarich_development}
      APPLICATION_HOSTS: ${APPLICATION_HOSTS:-localhost,::1,127.0.0.1}
      TIME_ZONE: ${TIME_ZONE:-Europe/London}
      APPLICATION_PROTOCOL: ${APPLICATION_PROTOCOL:-http}
      PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:-false}
      SECRET_KEY_BASE: ${SECRET_KEY_BASE:-"CHANGE_ME"}
      RAILS_LOG_TO_STDOUT: ${RAILS_LOG_TO_STDOUT:-true}
      SELF_HOSTED: ${SELF_HOSTED:-true}
      STORE_GEODATA: ${STORE_GEODATA:-true}
      # One preloaded Puma worker is plenty for a household instance and
      # halves idle memory. Raise for busier instances.
      WEB_CONCURRENCY: ${WEB_CONCURRENCY:-1}
      ### OTP encryption keys are required if you want to use 2FA
      # OTP_ENCRYPTION_PRIMARY_KEY: ${OTP_ENCRYPTION_PRIMARY_KEY:-}
      # OTP_ENCRYPTION_DETERMINISTIC_KEY: ${OTP_ENCRYPTION_DETERMINISTIC_KEY:-}
      # OTP_ENCRYPTION_KEY_DERIVATION_SALT: ${OTP_ENCRYPTION_KEY_DERIVATION_SALT:-}
    logging:
      driver: "json-file"
      options:
        max-size: ${LOG_MAX_SIZE:-100m}
        max-file: ${LOG_MAX_FILE:-5}
    healthcheck:
      test: [ "CMD-SHELL", "wget -qO - http://127.0.0.1:3000/api/v1/health | grep -q '\"status\"\\s*:\\s*\"ok\"'" ]
      interval: 10s
      retries: 30
      start_period: 30s
      timeout: 10s
    depends_on:
      dawarich_db:
        condition: service_healthy
        restart: true
      dawarich_redis:
        condition: service_healthy
        restart: true
    deploy:
      resources:
        limits:
          cpus: ${APP_CPU_LIMIT:-0.50}
          memory: ${APP_MEMORY_LIMIT:-4G}

  dawarich_sidekiq:
    image: freikin/dawarich:latest
    container_name: dawarich_sidekiq
    volumes:
      - dawarich_public:/var/app/public
      - dawarich_watched:/var/app/tmp/imports/watched
      - dawarich_storage:/var/app/storage
    networks:
      - dawarich
    stdin_open: true
    tty: true
    entrypoint: sidekiq-entrypoint.sh
    command: ['sidekiq']
    restart: unless-stopped
    environment:
      RAILS_ENV: ${RAILS_ENV:-production}
      ### To run under a non-root user, set PUID/PGID here (do NOT use `user:`).
      # PUID: ${PUID:-1000}
      # PGID: ${PGID:-1000}
      REDIS_URL: ${REDIS_URL:-redis://dawarich_redis:6379}
      DATABASE_HOST: ${DATABASE_HOST:-dawarich_db}
      DATABASE_PORT: ${DATABASE_PORT:-5432}
      DATABASE_USERNAME: ${DATABASE_USERNAME:-postgres}
      DATABASE_PASSWORD: ${DATABASE_PASSWORD:-password}
      DATABASE_NAME: ${DATABASE_NAME:-dawarich_development}
      APPLICATION_HOSTS: ${APPLICATION_HOSTS:-localhost,::1,127.0.0.1}
      # 3 job threads keep idle memory and DB connections low; raise
      # temporarily for large imports.
      BACKGROUND_PROCESSING_CONCURRENCY: ${BACKGROUND_PROCESSING_CONCURRENCY:-3}
      APPLICATION_PROTOCOL: ${APPLICATION_PROTOCOL:-http}
      PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:-false}
      SECRET_KEY_BASE: ${SECRET_KEY_BASE:-"CHANGE_ME"}
      RAILS_LOG_TO_STDOUT: ${RAILS_LOG_TO_STDOUT:-true}
      SELF_HOSTED: ${SELF_HOSTED:-true}
      STORE_GEODATA: ${STORE_GEODATA:-true}
      ### OTP encryption keys are required if you want to use 2FA
      # OTP_ENCRYPTION_PRIMARY_KEY: ${OTP_ENCRYPTION_PRIMARY_KEY:-}
      # OTP_ENCRYPTION_DETERMINISTIC_KEY: ${OTP_ENCRYPTION_DETERMINISTIC_KEY:-}
      # OTP_ENCRYPTION_KEY_DERIVATION_SALT: ${OTP_ENCRYPTION_KEY_DERIVATION_SALT:-}
    logging:
      driver: "json-file"
      options:
        max-size: ${LOG_MAX_SIZE:-100m}
        max-file: ${LOG_MAX_FILE:-5}
    healthcheck:
      test: [ "CMD-SHELL", "pgrep -f sidekiq" ]
      interval: 10s
      retries: 30
      start_period: 30s
      timeout: 10s
    depends_on:
      dawarich_db:
        condition: service_healthy
        restart: true
      dawarich_redis:
        condition: service_healthy
        restart: true
      dawarich_app:
        condition: service_healthy
        restart: true

volumes:
  dawarich_db_data:
  dawarich_shared:
  dawarich_public:
  dawarich_watched:
  dawarich_storage:

File: README.md

๐ŸŒ Dawarich: Your Self-Hostable Location History Tracker

| | |


Screenshots

Map View

Timeline View

Insights Page

Family Page

Statistics Overview

Trips page


About Dawarich

If you're looking for Dawarich Cloud, where everything is managed for you, check out Dawarich Cloud.

Dawarich is a self-hostable web app designed to replace Google Timeline (aka Google Location History).
It enables you to:

  • Track your location history.
  • Visualize your data on an interactive map.
  • Create trips and analyze your travel history.
  • Share your location with family members.
  • Integrate with photo management apps like Immich and Photoprism to visualize geotagged photos.
  • Import your location history from Google Maps Timeline, OwnTracks, GPX, GeoJSON and some other sources
  • Explore statistics like the number of countries and cities visited, total distance traveled, and more!
  • Share your location with family members.

Changelog: Find the latest updates here.

**Contribute**: See [CONTRIBUTING.md](CONTRIBUTING.md) for how to contribute to Dawarich.

โš ๏ธ Disclaimer

Updating strategy

  • DO NOT UPDATE AUTOMATICALLY: Read release notes before updating. Automatic updates may break your setup.
  • Under active development: Expect frequent updates, bugs, and breaking changes.
  • Do not delete your original data after importing into Dawarich.
  • Backup before updates: Always backup your data before upgrading.
  • Stay up-to-date: Make sure you're running the latest version for the best experience.

๐Ÿงญ Supported Location Tracking

You can track your location with the following apps:

Simply install one of the supported apps on your device and configure it to send location updates to your Dawarich instance.


How to Start Dawarich Locally

  1. Clone the repository.
  2. Run the following command to start the app:
    bash
    docker compose -f docker/docker-compose.yml up
  3. Access the app at http://localhost:3000.

To stop the app, press Ctrl+C.

You can use default values or create a .env file based on .env.example to customize your setup.


How to Install Dawarich

Default Credentials

  • Username: [email protected]
  • Password: safepassword
    Feel free to change them in the account settings.

Features

Location Tracking

Location History Visualization

  • View your historical data on a map with customizable layers:
    • Heatmap
    • Points
    • Lines between points
    • Fog of War

Family Sharing

  • Share your location with family members.
  • View locations of family members on the map (with their consent).
  • Each family member can enable or disable location sharing individually.

Areas

  • Draw areas on the map so Dawarich could suggest your visits there.

Visits (Beta)

  • Dawarich can suggest places you've visited and allow you to confirm or reject them.

Statistics

  • Analyze your travel history: number of countries/cities visited, distance traveled, and time spent, broken down by year and month.

Insights

  • Get insights about your location history, like "Your most visited place is home, with 120 visits", or "You spent 30 days in Paris in 2024".

Days in country

  • See how many days you've spent in each country. Useful for tax residency purposes or just to see where you spend most of your time.

Trips

  • Create a trip to visualize your travels between two points in time. You'll be able to see the route, distance, and time spent, and also add notes to your trip. If you have Immich or Photoprism integration, you'll also be able to see photos from your trips!

Integrations

  • Provide credentials for Immich or Photoprism (or both!) and Dawarich will automatically import geodata from your photos.
  • You'll also be able to visualize your photos on the map!

Import Your Data

  • Import from various sources:
    • Google Maps Timeline
    • OwnTracks
    • Strava
    • Immich
    • GPX/GeoJSON files
    • Photosโ€™ EXIF data

Export Your Data

  • Export your data to GeoJSON or GPX formats.

๐Ÿ“š Guides and Tutorials

More guides available in the Docs.


Environment Variables

Check the documentation on the website for detailed information about environment variables and settings.


Star History

As you could probably guess, I like statistics.


File: docs/How_to_extract_geodata_from_photos.md

User Guide: Importing GPS Coordinates from your photos into Dawarich

Introduction:
This user guide provides step-by-step instructions on how to extract GPS coordinates from photos and import it into the Dawarich service.
This process is useful for adding points of interest from memorable locations into Dawarich, especially when Google Location History is unavailable or was not initially enabled.

Requirements:

  • Mac OS operating system
  • exiftool software installed
  • exiftool template created

Steps to Import GPS Coordinates into Dawarich:

  1. Download and install exiftool from the official website.
  2. Create an empty template text file, name it as gpx.fmt and paste the code provided below into it.
text
#------------------------------------------------------------------------------
# File:         gpx.fmt
#
#
# Usage:        exiftool -p gpx.fmt -ee3 FILE [...] > out.gpx
#
# Requires:     ExifTool version 10.49 or later
#
# Revisions:    2010/02/05 - P. Harvey created
#               2018/01/04 - PH Added IF to be sure position exists
#               2018/01/06 - PH Use DateFmt function instead of -d option
#               2019/10/24 - PH Preserve sub-seconds in GPSDateTime value
#
# Notes:     1) Input file(s) must contain GPSLatitude and GPSLongitude.
#            2) The -ee3 option is to extract the full track from video files.
#            3) The -fileOrder option may be used to control the order of the
#               generated track points when processing multiple files.
#------------------------------------------------------------------------------
#[HEAD]<?xml version="1.0" encoding="utf-8"?>
#[HEAD]<gpx version="1.0"
#[HEAD] creator="ExifTool $ExifToolVersion"
#[HEAD] xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
#[HEAD] xmlns="http://www.topografix.com/GPX/1/0"
#[HEAD] xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
#[HEAD]
#[HEAD]<number>1</number>
#[HEAD]
#[IF]  $gpslatitude $gpslongitude
#[BODY]
#[BODY]  <ele>$gpsaltitude#</ele>
#[BODY]  <time>${gpsdatetime#;my ($ss)=/\.\d+/g;DateFmt("%Y-%m-%dT%H:%M:%SZ");s/Z/${ss}Z/ if $ss}</time>
#[BODY]
#[TAIL]
#[TAIL]
#[TAIL]</gpx>
  1. Create a separate directory for the photos from which you want to extract coordinates.
  2. Move the necessary photos and gpx.fmt template to this directory.
  3. Open Terminal and navigate to the directory containing the photos.

Command to Execute:

text
exiftool -if '$gpsdatetime' -fileOrder gpsdatetime -p ./gpx.fmt -d %Y-%m-%dT%H:%M:%SZ *JPG > output.gpx

Note: Ensure that exiftool is properly installed on your system, and the file 'gpx.fmt' is located in the same directory as the photos.

  1. GPX-track based on photo's GPS-coordinates and dates will be placed as output.gpx file into the same directory.
  2. Go to Dawarich webpage, select Imports, click "New Import" button, select source โ€” gpx and choose output.gpx file.
  3. After the import processed all GPX-points will be added to Dawarich map.

File: docs/How_to_install_Dawarich_in_k8s.md

How to install Dawarich on Kubernetes

An unofficial Helm chart is available here. For a manual installation using YAML manifests, see below.

Prerequisites

  • Kubernetes cluster and basic kubectl knowledge.
  • Some persistent storage class prepared, in this example, Longhorn.
  • Working Postgres and Redis instances. In this example Postgres lives in 'db' namespace and Redis in 'redis' namespace.
  • Ngingx ingress controller with Letsencrypt integeation.
  • This example uses 'example.com' as a domain name, you want to change it to your own.
  • This will work on IPv4 and IPv6 Single Stack clusters, as well as Dual Stack deployments.

Installation

Namespace

bash
kubectl create namespace dawarich

Persistent volume claims

yaml
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  namespace: dawarich
  name: public
  labels:
    storage.k8s.io/name: longhorn
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: longhorn
  resources:
    requests:
      storage: 1Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  namespace: dawarich
  name: watched
  labels:
    storage.k8s.io/name: longhorn
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: longhorn
  resources:
    requests:
      storage: 1Gi

Deployment

text
/* Detailed source-code truncated for AI context efficiency. */

Service and Ingress

yaml
---
apiVersion: v1
kind: Service
metadata:
  namespace: dawarich
  labels:
    service: dawarich
  name: dawarich
spec:
  ports:
    - protocol: TCP
      port: 3000
      targetPort: 3000
  selector:
    app: dawarich
---
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: dawarich
  name: dawarich-ingress
  annotations:
    kubernetes.io/ingress.class: "nginx"
    cert-manager.io/cluster-issuer: letsencrypt-prod
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/proxy-body-size: 1000m
spec:
  tls:
    - hosts:
        - dawarich.example.com
      secretName: letsencrypt-prod
  rules:
    - host: dawarich.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: dawarich
                port:
                  number: 3000

File: docs/How_to_install_Dawarich_on_Synology.md

How to install Dawarich on Synology using Docker

Preparation

Container manager

Firstly you need to install Container manager on your DSM.

  • Open Synology DSM web UI.
  • In the main menu open Package Center.
  • Search Container Manager in the "open source" section.
  • Install that.

Web station

Do the same for Web station packet.

Project folder preparation

Docker root share

If you don't yet have separate share for docker projects would be good to create it.

If you don't want to use dedicated share for projects installed by docker skip it and go to the next chapter.

  • Open Control panel -> Shared folder -> Create -> Create shared folder
  • Set name, for example docker, and location.
  • Check Hide this shared folder in "My Network Places". This hides this folder from listening by smb, afp, ftp shares.
  • Click Next several times until you see Configure user permissions window.
  • Check Read/write access for your user and No Access for all another.

Dawarich root folder

  1. Open your Docker root folder in File station.
  2. Create new folder dawarich and open it.
  3. Create folders redis, db_data, db_shared and public in dawarich folder.
  4. Copy docker compose and .env files form synology repo folder into dawarich folder on your synology.

Installation

Project create

  1. Open Container Manager -> Projects -> Create
  2. In create project window.
    1. Set project name as you wish.
    2. Set path to Dawarich root folder.
      1. DSM asks about existed docker-compose file, choose use existing a docker-compose.yml to create the project.
    3. Click Next.
    4. Check Set up web portal via Web Station.
      1. Select container name, port, and http protocol (not https).
    5. Click "Next".
    6. Uncheck Start the project once it is created.
    7. Click "Done".
  3. In the popup "dawarich has been created. Go to Web Station to configure the web portal for the container." click "OK". Web station Portal Creation Wizard will be opened.
  4. Set portal type to Name-based.
  5. Set hostname as your wish. For example, if your DSM has hostname my-syno.com, you can use dawarich.my-syno.com.
  6. Check HTTPS settings - HSTS

    I expected that you have configured the certificate in DSM. See Control panel -> Security -> Certificate. For example, previously you configured QuickConnect or DynDNS (DDNS). See Control panel -> External Access

  7. Click Create.

Configuration

DNS

On your local DNS server, you need to add new record with dawarich.my-syno.com and IP address of Synology (see Control panel -> Network -> Network Interface in your DSM) to provide correct access to Dawarich, or just use wildcard *.my-syno.com record to resolve all subdomains my-syno.com to Synology ip.

Please read the documentation of your DNS server to understand how to do it.

If you don't yet have a DNS server you can install Synology DNS.

Don't forget to reconfigure your DHCP server or all device settings in your local network to use this DNS server.

Dawarich

  1. Open /Docker root folder/Dawarich root folder/.env file in any text editor. For example, you can use Text editor package or download it from File station, edit locally and upload it back, or get access by file share.

  2. Update your APPLICATION_HOSTS value to include your Dawarich hostname that you set in Web station. In example above dawarich.my-syno.com. If you want to set multiple hosts, separate them by a comma: dawarich.my-syno.com,dawarich2.my-syno.com.

  3. Set your current TIME_ZONE. The full list here.

  4. Optionally change DATABASE_USERNAME, DATABASE_USERNAME, DATABASE_NAME.

  5. Click on the name of your project.

  6. Open YAML Configurations tab.

Run

  1. Open Container Manager -> Projects ->dawarich
  2. In the top right corner click Action -> Build
  3. Wait until the popup writes that all is done and wait a few minutes more until all apps in containers start.
  4. Open it by your hostname. In this example https://dawarich.my-syno.com

There are two possible options:

  1. With Web station. But you will have the default web station icon.
  2. With custom application for Package Center.

Web station

  • Open Web station -> Web Portal -> dawarich (project).
  • Check Create shortcut on main menu and set link name.

Custom application

Synology allows you to create custom applications and install them by Package Center
Here you can find a tool that creates dummy applications only with icon on the main menu.
You can use this tool and create your own app, or use the prepared one in this repo. But you need to change url to Dawarich inside it.

  • Edit update.sh from synology folder. And in the first lines set correct values for author and URL.
  • Run update.sh. When the script finishes you will see the spk and Dawarich.spk in the same folder.

If you don't have Linux console you can create a temporal docker project to generate spk package.

  • Create a new folder in Docker root folder.
  • Create subfolder app and copy update.sh and spk.tgz into this subfolder.
  • Open Container Manager -> Projects -> Create.
  • Set any name, set a newly created folder, and set Create docker-compose.yml.
  • Copy the text below to the text field.
yaml
name: spk-template

services:
  spk-template:
    container_name: spk-template
    image: alpine
    restart: unless-stopped
    working_dir: /app
    volumes:
      - ./app:/app
    command:
      - /app/update.sh
  • Click Next, Next, Done
    The container should run and finish automatically.

  • After that you can see spk and Dawarich.spk in the app folder.

  • Check url in spk/package/ui/config file and maintainer and distributor in spk/INFO file.

  • Open Package Center, click on Manual Install, select Dawarich.spk, agree with the security notice, and install it.


File: docs/How_to_install_Dawarich_using_Docker.md

How to install Dawarich using Docker

To do that you need previously install Docker on your system.

To quick Dawarich install copy the contents of the docker-compose.yml file from project root folder to dedicated folder in your server and run docker compose up in this folder.

This command use docker-compose.yml to build your local environment.

When this command done successfully and all services in containers will start you can open Dawarich web UI by this link http://127.0.0.1:3000.

Default credentials for first login in are [email protected] and safepassword.


File: docs/how_to_setup_reverse_proxy.md

Setting up reverse proxy

Environment Variable

To make Dawarich work with a reverse proxy, you need to ensure the APPLICATION_HOSTS environment variable is set to include the domain name that the reverse proxy will use.
For example, if your Dawarich instance is supposed to be on the domain name timeline.mydomain.com, then include "timeline.mydomain.com" in this environment variable.
Make sure to exclude "http://" or "https://" from the environment variable. โš ๏ธ The webpage will not work if you do include http:// or https:// in the variable. โš ๏ธ

At the time of writing this, the way to set the environment variable is to edit the docker-compose.yml file. Find all APPLICATION_HOSTS entries in the docker-compose.yml file and make sure to include your domain name. Example:

yaml
dawarich_app:
    image: freikin/dawarich:latest
    container_name: dawarich_app
    ...
    environment:
      ...
      APPLICATION_HOSTS: "yourhost.com,www.yourhost.com,127.0.0.1" <-- Edit this
yaml
dawarich_sidekiq:
    image: freikin/dawarich:latest
    container_name: dawarich_sidekiq
    ...
    environment:
      ...
      APPLICATION_HOSTS: "yourhost.com,www.yourhost.com,127.0.0.1" <-- Edit this
      ...

For a Synology install, refer to Synology Install Tutorial. In this page, it is explained how to set the APPLICATION_HOSTS environment variable.

Virtual Host

Now that the app works with a domain name, the server needs to be set up to use a reverse proxy. Usually, this is done by setting it up in the virtual host configuration.

Below are examples of reverse proxy configurations.

Nginx

nginx
server {

	listen 80;
	listen [::]:80;
	server_name example.com;

	brotli on;
	brotli_comp_level 6;
	brotli_types
		text/css
		text/plain
		text/xml
		text/x-component
		text/javascript
		application/x-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;

	location / {
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto https;
		proxy_set_header X-Forwarded-Server $host;
		proxy_set_header Host $http_host;
		proxy_redirect off;

		proxy_pass http://127.0.0.1:3000/;
	}

}

Apache2

For Apache2, you might need to enable some modules. Start by entering the following commands so the example configuration below works without any problems.

text
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod headers
sudo a2enmod brotli

With the above commands entered, the configuration below should work properly.

apache
<VirtualHost *:80>
	ServerName example.com

	ProxyRequests Off
	ProxyPreserveHost On

	
		Require all granted
	

	Header always set X-Real-IP %{REMOTE_ADDR}s
	Header always set X-Forwarded-For %{REMOTE_ADDR}s
	Header always set X-Forwarded-Proto https
	Header always set X-Forwarded-Server %{SERVER_NAME}s
	Header always set Host %{HTTP_HOST}s

	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
	BrotliCompressionQuality 6

	ProxyPass / http://127.0.0.1:3000/
	ProxyPassReverse / http://127.0.0.1:3000/

</VirtualHost>

Caddy

Here is the minimum Caddy config you will need to front Dawarich with. Please keep in mind that if you are running Caddy separately from your Dawarich stack, you'll need to have a network that is shared between them.

First, create the Docker network that will be used between the stacks, if needed:

text
docker network create frontend

Second, create a Docker network for Dawarich to use as the backend network:

text
docker network create dawarich

Adjust the following part of your Dawarich docker-compose.yaml, so that the web app is exposed to your new network and the backend Dawarich network:

yaml
networks:
  dawarich:
  frontend:
    external: true
services:
  ...

Lastly, edit your Caddy config as needed:

caddy
{
	http_port 80
	https_port 443
}

timeline.example.com {
	reverse_proxy dawarich_app:3000

	encode brotli {
		match {
			content_type text/css text/plain text/xml text/x-component text/javascript application/x-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
		}
	}
}

timeline.example.com is an example, use your own (sub) domain.


Please note that the above configurations are just examples and that they contain the minimum configuration needed to make the reverse proxy work properly. Feel free to adjust the configuration to your own needs.