From 0c4f7a05a18d1a6c0c5c3f3aa376868ebadbef1b Mon Sep 17 00:00:00 2001 From: marlon Date: Sat, 24 Jan 2026 16:03:50 -0500 Subject: [PATCH] initial --- .env.sample | 9 ++++++--- README.md | 2 ++ abra.sh | 6 +++++- compose.yml | 31 ++++++++++++++++--------------- nginx.conf.tmpl | 2 +- umap.conf.tmpl | 3 +-- 6 files changed, 31 insertions(+), 22 deletions(-) diff --git a/.env.sample b/.env.sample index 5b88fc0..c21496c 100644 --- a/.env.sample +++ b/.env.sample @@ -10,6 +10,9 @@ LETS_ENCRYPT_ENV=production SECRET_SECRET_KEY_VERSION=v1 # length=100 charset=hex SITE_URL=https://$DOMAIN +ALLOWED_HOSTS=$DOMAIN +CSRF_TRUSTED_ORIGINS=https://$DOMAIN + SITE_NAME=My UMap Server SITE_DESCRIPTION=Welcome to my map of the world. No borders, no nations. #UMAP_HELP_URL=http://mysite.com/documentation @@ -25,9 +28,9 @@ SITE_DESCRIPTION=Welcome to my map of the world. No borders, no nations. ## Language/Localization #USE_I18N=false #LANGUAGE_CODE="it" -#LEAFLET_LONGITUDE="15" -#LEAFLET_LATITUDE="15" -#LEAFLET_ZOOM="5" +#LEAFLET_LONGITUDE="-93" +#LEAFLET_LATITUDE="45" +#LEAFLET_ZOOM="10" #UMAP_DEMO_SITE=1 #UMAP_READONLY=1 diff --git a/README.md b/README.md index dc8f95f..dd1cf54 100644 --- a/README.md +++ b/README.md @@ -20,5 +20,7 @@ * `abra app new umap --secrets` * `abra app config ` * `abra app deploy ` +* `abra app command app create_admin` +* Access admin interface at `https:///admin` For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech). diff --git a/abra.sh b/abra.sh index beb290c..837c745 100755 --- a/abra.sh +++ b/abra.sh @@ -3,4 +3,8 @@ export CONFIG_VERSION=v1 export NGINX_VERSION=v1 -export NGINX_UMAP_VERSION=v1 \ No newline at end of file +export NGINX_UMAP_VERSION=v1 + +create_admin(){ + umap createsuperuser +} \ No newline at end of file diff --git a/compose.yml b/compose.yml index 263e073..bd0bfda 100644 --- a/compose.yml +++ b/compose.yml @@ -10,15 +10,17 @@ services: - "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})" - "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure" - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}" - ## Edit the following line if you are using one, but not both, "Redirect" sections below - #- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirectscheme,${STACK_NAME}-redirecthostname" - ## Redirect from EXTRA_DOMAINS to DOMAIN - # - "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.regex=^http[s]?://([^/]*)/(.*)" - # - "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.replacement=https://${DOMAIN}/$${2}" - # - "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.permanent=true" - ## Redirect HTTP to HTTPS - # - "traefik.http.middlewares.${STACK_NAME}-redirectscheme.redirectscheme.scheme=https" - # - "traefik.http.middlewares.${STACK_NAME}-redirectscheme.redirectscheme.permanent=true" + # Edit the following line if you are using one, but not both, "Redirect" sections below + - "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirectscheme,${STACK_NAME}-redirecthostname" + # Redirect from EXTRA_DOMAINS to DOMAIN + - "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.regex=^http[s]?://([^/]*)/(.*)" + - "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.replacement=https://${DOMAIN}/$${2}" + - "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.permanent=true" + # Redirect HTTP to HTTPS + - "traefik.http.middlewares.${STACK_NAME}-redirectscheme.redirectscheme.scheme=https" + - "traefik.http.middlewares.${STACK_NAME}-redirectscheme.redirectscheme.permanent=true" + environment: + STACK_NAME: $STACK_NAME volumes: - static:/static:ro - data:/data:ro @@ -32,10 +34,10 @@ services: networks: - proxy - umap - - umap: + app: image: umap/umap:3.5.0 + hostname: ${STACK_NAME}-app networks: - umap deploy: @@ -43,7 +45,7 @@ services: condition: on-failure labels: ## When you're ready for release, run "abra recipe sync " to set this - - "coop-cloud.${STACK_NAME}.version=0.0.1+2.9.3" + - "coop-cloud.${STACK_NAME}.version=0.1.0+3.5.0" ## Enable backups: https://docs.coopcloud.tech/maintainers/handbook/#how-do-i-configure-backuprestore # - "backupbot.backup=true" # - "backupbot.backup.path=/some/path" @@ -51,9 +53,8 @@ services: DATABASE_URL: postgis://postgres@db/postgres STATIC_ROOT: /srv/umap/static MEDIA_ROOT: /srv/umap/uploads - REALTIME_ENABLED: 1 + REALTIME_ENABLED: "True" REDIS_URL: redis://redis:6379 - ALLOWED_HOSTS: $DOMAIN volumes: - data:/srv/umap/uploads - static:/srv/umap/static @@ -64,7 +65,7 @@ services: secrets: - secret_key # healthcheck: -# test: ["CMD", "curl", "-f", "http://localhost:9000"] +# test: ["CMD", "curl", "-f", "http://localhost:8000"] # interval: 30s # timeout: 10s # retries: 10 diff --git a/nginx.conf.tmpl b/nginx.conf.tmpl index ab5149f..68c0919 100644 --- a/nginx.conf.tmpl +++ b/nginx.conf.tmpl @@ -31,7 +31,7 @@ http { # Proxy pass to ASGI server location / { - proxy_pass http://umap:8000; + proxy_pass http://{{ env "STACK_NAME" }}-app:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/umap.conf.tmpl b/umap.conf.tmpl index cbb8185..61ca9ae 100644 --- a/umap.conf.tmpl +++ b/umap.conf.tmpl @@ -1,2 +1 @@ -SECRET_KEY='{{ secret "secret_key" }}' -ALLOWED_HOSTS=[ '{{ env "DOMAIN" }}{{ env "EXTRA_DOMAINS" }}' ] \ No newline at end of file +SECRET_KEY='{{ secret "secret_key" }}' \ No newline at end of file