From 0795095d5f79ff2b77f59eb473e23481aaf24ed8 Mon Sep 17 00:00:00 2001 From: redbeardymcgee Date: Thu, 5 Dec 2024 19:24:37 -0600 Subject: [PATCH] move wger to wip branch --- WIP/wger/beat.volume | 2 - WIP/wger/cache.volume | 2 - WIP/wger/database.volume | 2 - WIP/wger/media.volume | 2 - WIP/wger/prod.env | 167 --------------------------------- WIP/wger/static.volume | 2 - WIP/wger/wger-beat.container | 23 ----- WIP/wger/wger-cache.container | 17 ---- WIP/wger/wger-db.container | 27 ------ WIP/wger/wger-nginx.container | 22 ----- WIP/wger/wger-worker.container | 17 ---- WIP/wger/wger.container | 23 ----- 12 files changed, 306 deletions(-) delete mode 100644 WIP/wger/beat.volume delete mode 100644 WIP/wger/cache.volume delete mode 100644 WIP/wger/database.volume delete mode 100644 WIP/wger/media.volume delete mode 100644 WIP/wger/prod.env delete mode 100644 WIP/wger/static.volume delete mode 100644 WIP/wger/wger-beat.container delete mode 100644 WIP/wger/wger-cache.container delete mode 100644 WIP/wger/wger-db.container delete mode 100644 WIP/wger/wger-nginx.container delete mode 100644 WIP/wger/wger-worker.container delete mode 100644 WIP/wger/wger.container diff --git a/WIP/wger/beat.volume b/WIP/wger/beat.volume deleted file mode 100644 index 7202a54..0000000 --- a/WIP/wger/beat.volume +++ /dev/null @@ -1,2 +0,0 @@ -[Volume] -VolumeName=wger-beat diff --git a/WIP/wger/cache.volume b/WIP/wger/cache.volume deleted file mode 100644 index 801c022..0000000 --- a/WIP/wger/cache.volume +++ /dev/null @@ -1,2 +0,0 @@ -[Volume] -VolumeName=wger-cache diff --git a/WIP/wger/database.volume b/WIP/wger/database.volume deleted file mode 100644 index 0f9160e..0000000 --- a/WIP/wger/database.volume +++ /dev/null @@ -1,2 +0,0 @@ -[Volume] -VolumeName=wger-database diff --git a/WIP/wger/media.volume b/WIP/wger/media.volume deleted file mode 100644 index 5c733c6..0000000 --- a/WIP/wger/media.volume +++ /dev/null @@ -1,2 +0,0 @@ -[Volume] -VolumeName=wger-media diff --git a/WIP/wger/prod.env b/WIP/wger/prod.env deleted file mode 100644 index 06871d0..0000000 --- a/WIP/wger/prod.env +++ /dev/null @@ -1,167 +0,0 @@ -# Django's secret key, change to a 50 character random string if you are running -# this instance publicly. For an online generator, see e.g. https://djecrety.ir/ -SECRET_KEY=wger-docker-supersecret-key-1234567890!@#$%^&*(-_) - -# Signing key used for JWT, use something different than the secret key -SIGNING_KEY=wger-docker-secret-jwtkey-1234567890!@#$%^&*(-_=+) - -# 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 - -# -# Consult the deployment section in the readme if you are running this behind a -# reverse proxy with HTTPS enabled - -# CSRF_TRUSTED_ORIGINS=https://my.domain.example.com,https://118.999.881.119 -# X_FORWARDED_PROTO_HEADER_SET=True - -# -# Static 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/ - -# -# These settings usually don't need changing -# - -# -# Application -WGER_INSTANCE=https://wger.de # Wger instance from which to sync exercises, images, etc. -ALLOW_REGISTRATION=True -ALLOW_GUEST_USERS=True -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 -# 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 - -# Synchronzing ingredients -# You can also syncronize the ingredients from a remote wger instance, and have -# basically the same options as for the ingredients: -# - 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_INGREDIENTS_CELERY=True -# - Manually trigger the process as needed: -# docker compose exec web python3 manage.py sync-ingredients - -# When scanning products with the barcode scanner, it is possible to dynamically -# fetch the ingredient if it is not known in the local database. This option controlls -# where to try to download the ingredient and their images. -# Possible values OFF, WGER or None. Note that it is recommended to keep this as WGER -# so that we don't overwhelm the Open Food Facts servers. Needs to have USE_CELERY -# set to true -DOWNLOAD_INGREDIENTS_FROM=WGER - -# 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 - -# -# Database -DJANGO_DB_ENGINE=django.db.backends.postgresql -DJANGO_DB_DATABASE=wger -DJANGO_DB_USER=wger -DJANGO_DB_PASSWORD=wger -DJANGO_DB_HOST=db -DJANGO_DB_PORT=5432 -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 -AXES_IPWARE_PROXY_COUNT=1 -AXES_IPWARE_META_PRECEDENCE_ORDER=HTTP_X_FORWARDED_FOR,REMOTE_ADDR -# -# Others -DJANGO_DEBUG=False -WGER_USE_GUNICORN=True -EXERCISE_CACHE_TTL=18000 # in seconds - 5*60*60, 5 hours -SITE_URL=http://localhost - -# -# JWT auth -ACCESS_TOKEN_LIFETIME=10 # The lifetime duration of the access token, in minutes -REFRESH_TOKEN_LIFETIME=24 # The lifetime duration of the refresh token, in hours - -# -# Other possible settings - -# Recaptcha keys. You will need to create an account and register your domain -# https://www.google.com/recaptcha/ -# RECAPTCHA_PUBLIC_KEY=abcde... -# RECAPTCHA_PRIVATE_KEY=abcde... -USE_RECAPTCHA=False - -# 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 - -# -# 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 - -# Whether to compress css and js files into one (of each) -# COMPRESS_ENABLED=True - -# -# 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 -NUMBER_OF_PROXIES=1 diff --git a/WIP/wger/static.volume b/WIP/wger/static.volume deleted file mode 100644 index ed2b792..0000000 --- a/WIP/wger/static.volume +++ /dev/null @@ -1,2 +0,0 @@ -[Volume] -VolumeName=wger-static diff --git a/WIP/wger/wger-beat.container b/WIP/wger/wger-beat.container deleted file mode 100644 index 900fdae..0000000 --- a/WIP/wger/wger-beat.container +++ /dev/null @@ -1,23 +0,0 @@ -[Unit] -Description=Wger heartbeat - - -[Service] -Restart=on-failure -TimeoutStartSec=900 - -[Install] -WantedBy=default.target - -[Container] -Image=docker.io/wger/server:latest -ContainerName=wger-beat -HostName=wger-beat -Exec=/start-beat - -Network=protonvpn - -Volume=wger-beat:/home/wger/beat - -Environment=./prod.env - diff --git a/WIP/wger/wger-cache.container b/WIP/wger/wger-cache.container deleted file mode 100644 index 4ba7248..0000000 --- a/WIP/wger/wger-cache.container +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=Wger Redis cache - - -[Service] -Restart=on-failure -TimeoutStartSec=900 - -[Install] -WantedBy=default.target - -[Container] -Image=docker.io/redis:latest -ContainerName=wger-cache -HostName=wger-cache - -Volume=wger-cache:/data diff --git a/WIP/wger/wger-db.container b/WIP/wger/wger-db.container deleted file mode 100644 index 34e8149..0000000 --- a/WIP/wger/wger-db.container +++ /dev/null @@ -1,27 +0,0 @@ -[Unit] -Description=Wger database - - -[Service] -Restart=on-failure -TimeoutStartSec=900 - -[Install] -WantedBy=default.target - -[Container] -Image=docker.io/postgres:15-alpine -ContainerName=wger-db -HostName=wger-db - -Network= -#PublishPort=5432 - -Volume=wger-database:/var/lib/postgresql/data - -#Secret=wger-db-pw,type=env,target=POSTGRES_PASSWORD - -Environment=POSTGRES_USER=wger -Environment=POSTGRES_PASSWORD=wger -Environment=POSTGRES_DB=wger - diff --git a/WIP/wger/wger-nginx.container b/WIP/wger/wger-nginx.container deleted file mode 100644 index 2f7f52b..0000000 --- a/WIP/wger/wger-nginx.container +++ /dev/null @@ -1,22 +0,0 @@ -[Unit] -Description=Wger static web server - - -[Service] -Restart=on-failure -TimeoutStartSec=900 - -[Install] -WantedBy=default.target - -[Container] -Image=docker.io/nginx:stable -ContainerName=wger-nginx -HostName=wger-nginx - -PublishPort=80 - -Volume=./nginx.default.conf:/etc/nginx/conf.d/default.conf -Volume=wger-static:/wger/static:ro -Volume=wger-media:/wger/media:ro - diff --git a/WIP/wger/wger-worker.container b/WIP/wger/wger-worker.container deleted file mode 100644 index 4a96b3f..0000000 --- a/WIP/wger/wger-worker.container +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=Wger worker - - -[Service] -Restart=on-failure -TimeoutStartSec=900 - -[Install] -WantedBy=default.target - -[Container] -Image=docker.io/wger/server:latest -ContainerName=wger-worker -HostName=wger-worker - -Environment=prod.env diff --git a/WIP/wger/wger.container b/WIP/wger/wger.container deleted file mode 100644 index b2c4a80..0000000 --- a/WIP/wger/wger.container +++ /dev/null @@ -1,23 +0,0 @@ -[Unit] -Description=Fitness tracker - -Requires=wger-db.service -Requires=wger-nginx.service - -[Service] -Restart=on-failure -TimeoutStartSec=900 - -[Install] -WantedBy=default.target - -[Container] -Image=docker.io/wger/server:latest -ContainerName=wger -HostName=wger - -PublishPort=8000 - -Volume=wger-static:/home/wger/static - -EnvironmentFile=prod.env