From 7193ffdc9dab1b70030c491b972d972ee32c0abe Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 23 Nov 2026 14:07:54 +0100 Subject: [PATCH] Missing well-known files --- Dockerfile | 7 ++++--- docker-compose.yml | 4 ++-- scripts/{ => nginx}/nginx.conf | 8 +++++--- .../nginx/well-known/apple-app-site-association | 13 +++++++++++++ scripts/nginx/well-known/assetlinks.json | 14 ++++++++++++++ scripts/{ => postgres}/fold_hunspell.py | 0 scripts/{ => postgres}/postgres-polish.sql | 0 7 files changed, 38 insertions(+), 8 deletions(-) rename scripts/{ => nginx}/nginx.conf (93%) create mode 100644 scripts/nginx/well-known/apple-app-site-association create mode 100644 scripts/nginx/well-known/assetlinks.json rename scripts/{ => postgres}/fold_hunspell.py (100%) rename scripts/{ => postgres}/postgres-polish.sql (100%) diff --git a/Dockerfile b/Dockerfile index d9a71d9b0..1722739a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -111,7 +111,8 @@ FROM nginx:alpine AS nginx ARG UID ARG GID -# COPY nginx.conf conf.d/... +COPY scripts/nginx/nginx.conf /etc/nginx/conf.d/default.conf +COPY scripts/nginx/well-known /app/.well-known RUN addgroup -g $GID app && addgroup nginx app COPY --from=static-builder /app/var/static /app/var/static @@ -129,7 +130,7 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends hunspell-pl \ && rm -rf /var/lib/apt/lists/* -COPY scripts/fold_hunspell.py /usr/local/bin/fold_hunspell.py +COPY scripts/postgres/fold_hunspell.py /usr/local/bin/fold_hunspell.py RUN set -eu; \ mkdir /out; cd /tmp; \ @@ -152,7 +153,7 @@ COPY --from=polish-dict /out/ /tmp/polish-dict/ RUN mv /tmp/polish-dict/* "/usr/share/postgresql/$PG_MAJOR/tsearch_data/" \ && rmdir /tmp/polish-dict -COPY scripts/postgres-polish.sql /docker-entrypoint-initdb.d/10-postgres-polish.sql +COPY scripts/postgres/postgres-polish.sql /docker-entrypoint-initdb.d/10-postgres-polish.sql ########## diff --git a/docker-compose.yml b/docker-compose.yml index afa178665..025589fe5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,7 +30,7 @@ services: command: python -Wall ./manage.py runserver 0.0.0.0:8000 ports: # Dev: use http://localhost:8000/ directly - - "127.0.0.1:8000:8000" + - "8000:8000" celery: <<: *app-base @@ -65,7 +65,7 @@ services: - "127.0.0.1:8101:80" volumes: - ./var/media:/app/var/media:ro - - ./scripts/nginx.conf:/etc/nginx/conf.d/default.conf:ro + - ./scripts/nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro depends_on: - web diff --git a/scripts/nginx.conf b/scripts/nginx/nginx.conf similarity index 93% rename from scripts/nginx.conf rename to scripts/nginx/nginx.conf index 561a5d4e4..a34ef5575 100644 --- a/scripts/nginx.conf +++ b/scripts/nginx/nginx.conf @@ -9,20 +9,22 @@ server { proxy_buffers 16 16k; proxy_buffer_size 32k; + root /app/var; + + location /.well-known/ {} + location /static/ { - root /app/var; expires 30d; } location /media/ { - root /app/var; expires 30d; } location ~ ^/media/.*\.(mp3|ogg|daisy\.zip)$ { add_header Content-Disposition "attachment"; } location ~ ^/media/.*\.txt$ { - add_header Content-Type "text/plain; charset=utf-8"; + charset utf-8; } location ~ ^/media/book/(pdf|epub|mobi|fb2|cover|xml)/ { # kill cache diff --git a/scripts/nginx/well-known/apple-app-site-association b/scripts/nginx/well-known/apple-app-site-association new file mode 100644 index 000000000..afeaa3e14 --- /dev/null +++ b/scripts/nginx/well-known/apple-app-site-association @@ -0,0 +1,13 @@ +{ + "applinks": { + "apps": [], + "details": [ + { + "appID": "WX9PLY5GYU.pl.app.wolnelektury", + "paths": [ + "/*" + ] + } + ] + } +} \ No newline at end of file diff --git a/scripts/nginx/well-known/assetlinks.json b/scripts/nginx/well-known/assetlinks.json new file mode 100644 index 000000000..9154b21b1 --- /dev/null +++ b/scripts/nginx/well-known/assetlinks.json @@ -0,0 +1,14 @@ +[ + { + "relation": [ + "delegate_permission/common.handle_all_urls" + ], + "target": { + "namespace": "android_app", + "package_name": "pl.app.wolnelektury", + "sha256_cert_fingerprints": [ + "4F:5E:3E:70:18:02:00:AF:7F:91:93:65:DC:55:B1:2D:81:C8:DF:62:9C:22:00:C3:D8:52:33:DF:41:E5:2C:BF" + ] + } + } +] diff --git a/scripts/fold_hunspell.py b/scripts/postgres/fold_hunspell.py similarity index 100% rename from scripts/fold_hunspell.py rename to scripts/postgres/fold_hunspell.py diff --git a/scripts/postgres-polish.sql b/scripts/postgres/postgres-polish.sql similarity index 100% rename from scripts/postgres-polish.sql rename to scripts/postgres/postgres-polish.sql -- 2.20.1