From 2ffd3a64cbac353ce974e43edd5a378304dfa99a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Morawski?= Date: Thu, 26 Mar 2026 20:03:17 +0100 Subject: [PATCH] disable paywall --- Dockerfile | 29 +++++++++++++++++++ packages/snjs/lib/Services/Api/ApiService.ts | 2 +- .../lib/Services/Features/FeaturesService.ts | 2 +- .../javascripts/Application/WebApplication.ts | 2 +- 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..fe722e2cc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# Etap 1: build +FROM node:20-alpine AS builder + +WORKDIR /app +RUN corepack enable + +COPY . . + +RUN yarn install --frozen-lockfile +RUN yarn build:web + +# Etap 2: serwer nginx +FROM nginx:alpine + +COPY --from=builder /app/packages/web/dist /usr/share/nginx/html + +# SPA fallback +RUN printf 'server {\n\ + listen 80;\n\ + server_name _;\n\ + root /usr/share/nginx/html;\n\ + index index.html;\n\ + location / {\n\ + try_files $uri /index.html;\n\ + }\n\ +}\n' > /etc/nginx/conf.d/default.conf + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/packages/snjs/lib/Services/Api/ApiService.ts b/packages/snjs/lib/Services/Api/ApiService.ts index ca259c8a5..a06a84617 100644 --- a/packages/snjs/lib/Services/Api/ApiService.ts +++ b/packages/snjs/lib/Services/Api/ApiService.ts @@ -683,7 +683,7 @@ export class LegacyApiService throw Error('Cannot download offline repo without url and offlineKEy') } - const TRUSTED_FEATURE_HOSTS = ['api.standardnotes.com', 'localhost'] + const TRUSTED_FEATURE_HOSTS = ['api.standardnotes.com', 'localhost', 'apinotes.radmit.pl'] const { hostname } = new URL(featuresUrl) diff --git a/packages/snjs/lib/Services/Features/FeaturesService.ts b/packages/snjs/lib/Services/Features/FeaturesService.ts index 1aed45fe7..8c668d8e4 100644 --- a/packages/snjs/lib/Services/Features/FeaturesService.ts +++ b/packages/snjs/lib/Services/Features/FeaturesService.ts @@ -60,7 +60,7 @@ export class FeaturesService private getFeatureStatusUseCase = new GetFeatureStatusUseCase(this.items) - private readonly PROD_OFFLINE_FEATURES_URL = 'https://api.standardnotes.com/v1/offline/features' + private readonly PROD_OFFLINE_FEATURES_URL = 'https://apinotes.radmit.pl/v1/offline/features' constructor( private storage: StorageServiceInterface, diff --git a/packages/web/src/javascripts/Application/WebApplication.ts b/packages/web/src/javascripts/Application/WebApplication.ts index aa27bd5b8..280083674 100644 --- a/packages/web/src/javascripts/Application/WebApplication.ts +++ b/packages/web/src/javascripts/Application/WebApplication.ts @@ -119,7 +119,7 @@ export class WebApplication extends SNApplication implements WebApplicationInter /** * iOS file:// based origin does not work with production cookies */ - apiVersion: platform === Platform.Ios || platform === Platform.Android ? ApiVersion.v0 : ApiVersion.v1, + apiVersion: platform === Platform.Ios || platform === Platform.Android ? ApiVersion.v0 : ApiVersion.v0, loadBatchSize: deviceInterface.environment === Environment.Mobile ? 250 : ApplicationOptionsDefaults.loadBatchSize, sleepBetweenBatches: