# # Change these settings # # Django's secret keys, change to a 50 character random string. Generate e.g. with: # * python -c "import secrets; print(secrets.token_urlsafe(50))" or # * https://djecrety.ir/ # Note that if you leave this key unchanged, a new one will be generated on every # startup, which means that for example all sessions will be invalidated every time # you restart the server. SECRET_KEY=wger-docker-supersecret-key-1234567890!@#$%^&*(-_) # The URL where the application will be available. SITE_URL=http://localhost # JWT keys, used by the mobile app. This default NEEDS to be changed. # Generate fresh keys with: docker compose exec web ./manage.py generate-jwt-keys JWT_PUBLIC_KEY=eyJhbGciOiAiUlMyNTYiLCAia3R5IjogIlJTQSIsICJuIjogInFhdVVnb0ZXenRNcjVEYks3bFIxZXUxazJrdllyblJkRGh1NDFyWnFLeWhDWkJya0FTS0d0N25KbVUwVEpKb1d0cFF2eHVvc0ZGeW1BMUhXQnNaY0dtVlcxdlowdDJlazl4THg5bjg2UWRIVWc1MktsRG9ZUzNtRTFaWW5BYzJfRDM3UmxyQkVxRXpuSnBNeDJ3VkpLcVdRZHlWSWh6Q082YzRnOWN3VExGbUhkVXVURXMzdDNBN1MyNENrUkM2TE1KSFFvRTJzay1uWlJyZE9fTHVNNUJJcVp2b1dWUC1Salp4OWk4OGdaaDhvOEcyWW1xZnMwczRzYW1fam85bmFaYlo4aFBFQ0FZdnZUZ29ObzRHMGpXZERZeGdPWHlXTE80bTk1SEdMSFJMZjZ5M29vdkZad2QwN2FFbThEU3dBX3hsY1V4WHNNZ0ZlYVVVZkp2NEV4USIsICJlIjogIkFRQUIiLCAia2lkIjogInBvd2Vyc3luYyJ9 JWT_PRIVATE_KEY=eyJhbGciOiAiUlMyNTYiLCAia3R5IjogIlJTQSIsICJuIjogInFhdVVnb0ZXenRNcjVEYks3bFIxZXUxazJrdllyblJkRGh1NDFyWnFLeWhDWkJya0FTS0d0N25KbVUwVEpKb1d0cFF2eHVvc0ZGeW1BMUhXQnNaY0dtVlcxdlowdDJlazl4THg5bjg2UWRIVWc1MktsRG9ZUzNtRTFaWW5BYzJfRDM3UmxyQkVx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3dGajMxZWZWRTlFRWRSa0F0dGVoOWh2ZzBkM2FXVDZ1bFQ4YlpubWo3WkFjNG55aVdwOTlFd0k5U0hFX01UUE11YVZSeUw5SmFIX2R0Uk5nVGE5UV9hZUs2d1pkY3RwLUZRT1lteVlDWmhzRnVOTG45TFJ3UklJOVJ0YlBXYW55X01jQjgiLCAiZHAiOiAiWjFNNkhmakN3aVJqcnJBaEV6dmQyajlMbkxNd0RzZXdjX2xkdTNhamJVaDFuQjU5S09rczRZV0lFVlJXclpieEczOWJtVkVEWUc2T0p5dFpsY2lDQ3ZBWnluVEREVHlvWjFtVWhXcndaVmQzS1dvOTNXRm94eUVKOE04d0JZTmVDZTBCRzZkeVYwVnZyekxUNWEtTmhMRUk2dFZWMXZBSU8xNWF5N1V3c0U4IiwgImRxIjogIktsclpBUWZEZUEtNmtiVGpHa3NMSDFvQmFycDZjbG93SmpUc2ViVmxnU2pqSGxReHdCVFZzZEI4M1Zsc2ZDVmZTNXlrTDJ1cnQybkVZWVl5OWU1MmhReE1yd0tITFYyQUpQeS1qMXBZM1RjWU10SUUtTkE5cWtNSDVOTjVab3hoT1VrZ0ZIT2RpbUxBSWpnMG9FeThtVzB2SVdOWjZYcS1TaVhrUmo5aUZxMCIsICJxaSI6ICJzSV84RTh0MTBsRDY2NTh3UXRpY19BaUUxOVk1Rms0SDJWbnpGclBhVU04aWFNaVc2eUZxMFZuN3RXa2RTWS1STTB1SFMwdmVmSEcyZTBKSWxEanhBUmZWZUcwNTFyVUNRZjBkSnR4U0ZDQUp2eGxMRTZsYjZOQlUwZVIyMld6bjVob1ZZTVpHZnQ5QnA0SlVOOHJkMF9lMm1kSjhxc09wM1NLQ3NTSTByUkkiLCAia2lkIjogInBvd2Vyc3luYyJ9 # The server's timezone, for a list of possible names: # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones TIME_ZONE=Europe/Berlin TZ=Europe/Berlin # # These settings usually don't need changing # # # Other powersync settings PS_STORAGE_PG_URI=postgres://powersync_storage:powersync_password@db:5432/wger PS_PORT=8080 POWERSYNC_URL_PATH=ps # The full url for the powersync service, overrides POWERSYNC_URL_PATH if set. Only # set if you know what you are doing and have a very different setup #POWERSYNC_URL=https://ps.my-domain.example.com:1234 # Lifetime in seconds of the token the app uses against the powersync service. # Leave as is unless you are debugging. #POWERSYNC_TOKEN_LIFETIME=600 # # If you get CSRF errors set your domain here # Consult the docs for more details: # https://wger.readthedocs.io/en/latest/administration/errors.html#csrf-errors # CSRF_TRUSTED_ORIGINS=https://my.domain.example.com,https://118.999.881.119 # X_FORWARDED_PROTO_HEADER_SET=True # USE_X_FORWARDED_HOST=True # # Static and media files # If you are running the application behind a reverse proxy or changed the port, the # links for some images *might* break (specially in the mobile app). Also note that # the API response is cached and contains the host, if you change this setting, just run # docker compose exec web python3 manage.py warmup-exercise-api-cache --force # MEDIA_URL=https://your-domain.example.com/media/ # STATIC_URL=https://your-domain.example.com/static/ # # Application WGER_INSTANCE=https://wger.de # Wger instance from which to sync exercises, images, etc. ALLOW_REGISTRATION=True # Whether to allow "guest users". When this setting is active and an unlogged user # tries to access a protected resouce (dashboard, etc.) a new guest user is created # automatically. These can be deleted with "./manage py delete-temp-users" ALLOW_GUEST_USERS=False ALLOW_UPLOAD_VIDEOS=True # Users won't be able to contribute to exercises if their account age is # lower than this amount in days. MIN_ACCOUNT_AGE_TO_TRUST=21 # Whether the footer and the landing page link to the mobile app in the app stores # WGER_SHOW_APP_STORE_LINKS=True # Synchronzing exercises # It is recommended to keep the local database synchronized with the wger # instance specified in WGER_INSTANCE since there are new added or translations # improved. For this you have different possibilities: # - Sync exercises on startup: # SYNC_EXERCISES_ON_STARTUP=True # DOWNLOAD_EXERCISE_IMAGES_ON_STARTUP=True # - Sync them in the background with celery. This will setup a job that will run # once a week at a random time (this time is selected once when starting the server) SYNC_EXERCISES_CELERY=True SYNC_EXERCISE_IMAGES_CELERY=True SYNC_EXERCISE_VIDEOS_CELERY=True # - Manually trigger the process as needed: # docker compose exec web python3 manage.py sync-exercises # docker compose exec web python3 manage.py download-exercise-images # docker compose exec web python3 manage.py download-exercise-videos # Synchronizing ingredients # A new installation has no ingredients due to size constraints. Load them once manually, # either a base set (only on an instance without ingredients): # docker compose exec web wger load-online-fixtures # or the full dataset: # docker compose exec web python3 manage.py sync-ingredients-bulk --set-mode insert # See https://wger.readthedocs.io/en/latest/administration/sync-data.html # # Afterwards you can keep them up to date from a remote wger instance: # - Sync them in the background with celery. This will setup a job that will run # once a month at a random time (this time is selected once when starting the server) SYNC_INGREDIENTS_CELERY=True SYNC_INGREDIENTS_DUMP_URL=https://wger.de/media/ingredients/ingredients.jsonl.gz # - Manually trigger the process as needed: # docker compose exec web python3 manage.py sync-ingredients-bulk --set-mode update # This option controls whether to download ingredients and their images from the # configured wger instance. When scanning products with the barcode scanner, it is # possible to dynamically fetch the ingredient if it is not known in the local database. # Possible values: WGER or None (to deactivate). Requires USE_CELERY to be set to true. DOWNLOAD_INGREDIENTS_FROM=WGER # Keep exercise api cache warmed up. This will setup a job that will run once # a week at a random time (this time is selected once when starting the server). # Requires USE_CELERY to be set to true. CACHE_API_EXERCISES_CELERY=True # Whether to force updating the exercise api cache every time the job runs CACHE_API_EXERCISES_CELERY_FORCE_UPDATE=True # Whether celery is configured and should be used. Can be left to true with # this setup but can be deactivated if you are using the app in some other way USE_CELERY=True # # Celery CELERY_BROKER=redis://cache:6379/2 CELERY_BACKEND=redis://cache:6379/2 CELERY_FLOWER_PASSWORD=adminadmin CELERY_WORKER_CONCURRENCY=4 # Set to one if using sqlite # # Database # # The Postgres container reads POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB # directly from this file. If you change the password, also update it inside PS_DATABASE_URI. POSTGRES_USER=wger POSTGRES_PASSWORD=wger POSTGRES_DB=wger PS_DATABASE_URI=postgres://wger:wger@db:5432/wger DJANGO_PERFORM_MIGRATIONS=True # Perform any new database migrations on startup # # Cache DJANGO_CACHE_BACKEND=django_redis.cache.RedisCache DJANGO_CACHE_LOCATION=redis://cache:6379/1 DJANGO_CACHE_TIMEOUT=1296000 # in seconds - 60*60*24*15, 15 Days DJANGO_CACHE_CLIENT_CLASS=django_redis.client.DefaultClient # DJANGO_CACHE_CLIENT_PASSWORD=abcde... # Only if you changed the redis config # DJANGO_CACHE_CLIENT_SSL_KEYFILE=/path/to/ssl_keyfile # Path to an ssl private key. # DJANGO_CACHE_CLIENT_SSL_CERTFILE=/path/to/ssl_certfile # Path to an ssl certificate. # DJANGO_CACHE_CLIENT_SSL_CERT_REQS= # The string value for the verify_mode. # DJANGO_CACHE_CLIENT_SSL_CHECK_HOSTNAME=False # If set, match the hostname during the SSL handshake. # # Brute force login attacks # https://django-axes.readthedocs.io/en/latest/index.html AXES_ENABLED=True AXES_FAILURE_LIMIT=10 AXES_COOLOFF_TIME=30 # in minutes AXES_HANDLER=axes.handlers.cache.AxesCacheHandler AXES_LOCKOUT_PARAMETERS=ip_address # Where to read the client's IP from. The bundled nginx (and Caddyfile.example) # set X-Real-IP to the address the request came from. Don't use X-Forwarded-For # here, its left part is written by the client. # If you run your own reverse proxy in front of the bundled nginx, X-Real-IP is # that proxy's address. Use HTTP_X_FORWARDED_FOR,REMOTE_ADDR with a count of 1 # instead (the entry your proxy appended). AXES_IPWARE_PROXY_COUNT=0 AXES_IPWARE_META_PRECEDENCE_ORDER=HTTP_X_REAL_IP,REMOTE_ADDR # # Others DJANGO_DEBUG=False WGER_USE_GUNICORN=True EXERCISE_CACHE_TTL=2419200 # in seconds - 60*60*24*28, 4 weeks (entries are invalidated on write) WGER_PORT=8000 # Only change if you have a very different setup and know what you are doing # # JWT auth ACCESS_TOKEN_LIFETIME=10 # The lifetime duration of the access token, in minutes REFRESH_TOKEN_LIFETIME=2880 # The lifetime duration of the refresh token, in hours (default 4 months) # # OAuth2 provider # Please consult https://wger.readthedocs.io/en/latest/administration/oauth2_provider.html first # IDP_OIDC_PRIVATE_KEY= # # Auth Proxy Authentication # # Please read the documentation before enabling this feature: # https://wger.readthedocs.io/en/latest/administration/auth_proxy.html AUTH_PROXY_HEADER= AUTH_PROXY_TRUSTED_IPS= AUTH_PROXY_CREATE_UNKNOWN_USER=False AUTH_PROXY_USER_EMAIL_HEADER= AUTH_PROXY_USER_NAME_HEADER= # # Other possible settings # Log level for the web app, possible values: DEBUG, INFO, WARNING, ERROR, CRITICAL LOG_LEVEL_PYTHON=INFO # Captcha on the registration and password reset forms: none, recaptcha or turnstile # https://wger.readthedocs.io/en/latest/administration/settings.html#captcha CAPTCHA_PROVIDER=none # Google reCAPTCHA v3, register your domain at https://www.google.com/recaptcha/ # RECAPTCHA_PUBLIC_KEY=abcde... # RECAPTCHA_PRIVATE_KEY=abcde... # RECAPTCHA_REQUIRED_SCORE=0.75 # Cloudflare Turnstile, create a widget for your domain in the Cloudflare dashboard # TURNSTILE_SITE_KEY=0x... # TURNSTILE_SECRET_KEY=0x... # Clears the static files before copying the new ones (i.e. just calls collectstatic # with the appropriate flag: "manage.py collectstatic --no-input --clear"). Usually # This can be left like this but if you have problems and new static files are not # being copied correctly, clearing everything might help DJANGO_CLEAR_STATIC_FIRST=False # Whether to collect static files on startup. If this flag is set to false, # the startup time will be faster as no files need to be processed, however # in this case you will need to run this step manually with # "docker compose exec web python3 manage.py collectstatic --no-input" # after the server has started. Failing to do so might cause important files like # the react js to get "out of sync" with the backend DJANGO_COLLECTSTATIC_ON_STARTUP=True # # Email # https://docs.djangoproject.com/en/4.1/topics/email/#smtp-backend # ENABLE_EMAIL=False # EMAIL_HOST=email.example.com # EMAIL_PORT=587 # EMAIL_HOST_USER=username # EMAIL_HOST_PASSWORD=password # EMAIL_USE_TLS=True # EMAIL_USE_SSL=False FROM_EMAIL=wger Workout Manager # Set your name and email to be notified if an internal server error occurs. # Needs a working email configuration # DJANGO_ADMINS=your name,email@example.com # # Django Rest Framework # The number of proxies in front of the application. In the default configuration # only nginx is. Change as approtriate if your setup differs. Also note that this # is only used when throttling API requests. NUMBER_OF_PROXIES=1 # # Gunicorn # # Additional gunicorn options, change as needed. # For the number of workers to spawn, a usually recommended value is (2 x $num_cores) + 1 # see: # - https://docs.gunicorn.org/en/stable/settings.html # - https://github.com/wger-project/wger/blob/master/extras/docker/production/entrypoint.sh GUNICORN_CMD_ARGS="--workers 3 --threads 2 --worker-class gthread --timeout 240" # # Prometheus metrics EXPOSE_PROMETHEUS_METRICS=False # # Use an S3 bucket / Object Storage for media or static files. # See https://wger.readthedocs.io/en/latest/administration/storage.html#s3-object-storage #USE_S3_MEDIA_FILES=False #USE_S3_STATIC_FILES=False #AWS_ACCESS_KEY_ID='' #AWS_SECRET_ACCESS_KEY='' #AWS_STORAGE_BUCKET_NAME='' #AWS_S3_REGION_NAME='' #AWS_S3_ENDPOINT_URL='' #AWS_S3_CUSTOM_DOMAIN='' #USE_S3_URL_FOR_MEDIA=True #USE_S3_URL_FOR_STATIC=True #S3_MEDIA_FILES_LOCATION=media #S3_STATIC_FILES_LOCATION=static #AWS_QUERYSTRING_AUTH=False #AWS_DEFAULT_ACL=public-read