From 1573afc4cef2ff256c644446c04b83a792bb656a Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Thu, 21 May 2026 22:09:20 +0300 Subject: [PATCH 1/6] #488: updated config --- .vscode/settings.json | 10 ++++----- README.md | 21 +++++++------------ .../authentication/originMiddleware.ts | 7 ++++++- example.env | 4 ++++ 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 043e92f9..20375e92 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,11 +5,11 @@ "json.format.enable": false, "css.format.braceStyle": "expand", "css.format.spaceAroundSelectorSeparator": true, - "typescript.format.placeOpenBraceOnNewLineForControlBlocks": true, - "typescript.format.placeOpenBraceOnNewLineForFunctions": true, - "typescript.preferences.importModuleSpecifierEnding": "minimal", - "typescript.preferences.quoteStyle": "single", - "typescript.format.semicolons": "insert", + "js/ts.format.placeOpenBraceOnNewLineForControlBlocks": true, + "js/ts.format.placeOpenBraceOnNewLineForFunctions": true, + "js/ts.preferences.importModuleSpecifierEnding": "minimal", + "js/ts.preferences.quoteStyle": "single", + "js/ts.format.semicolons": "insert", "editor.codeActionsOnSave": { "source.organizeImports": "explicit" } diff --git a/README.md b/README.md index 418546bd..0284b709 100644 --- a/README.md +++ b/README.md @@ -16,31 +16,26 @@ We're working hard to get the MVP done. To document the project we started writi ## How to run -The project requires [Node.js](https://nodejs.org/) version 20+ to run the application and [Docker](https://www.docker.com/) for the additional services. +The project requires [Node.js](https://nodejs.org/) version 22+ to run the application and [Docker](https://www.docker.com/) for the additional services. You need to set up the configuration first by copying the `example.env` file to a `development.env` file. Copying the file is enough for the first run. Then you can run the following command to start Docker: ```bash -npm run docker-compose up +npm run docker-up ``` -This will start a [Keycloack](https://www.keycloak.org/) instance for account management, a [MongoDB](https://www.mongodb.com/) instance for data storage and a [MinIO](https://min.io/) instance for storing the comic images. +This will start a [Keycloack](https://www.keycloak.org/) instance for account management, a [MongoDB](https://www.mongodb.com/) instance for data storage and a [SeaweadFS](https://seaweedfs.github.io/) instance for storing the comic images. -Next you can start the application with the following commands: +Next you can build and start the application with the following commands: ```bash npm install npm run build -npm run standalone +npm run dist +npm run demo ``` -This will start the Jitar runtime at port 3000. To start the application you need to run the following command in a new terminal: - -```bash -npm run dev -``` - -Now a [Vite](https://vitest.dev/) dev server is running on port 5173. You can then navigate to http://localhost:5173 to see the application. +This will start the social application at port 3000. ## How to use @@ -50,4 +45,4 @@ Once you're in it should be pretty straightforward. You should be able to comic! ## Contributing -This project is not open for code contributions. However, if you have any questions or suggestions, feel free to contact us at [comify\@masking.tech](mailto:comify@masking.tech?subject=Comify%20question), or post a message in the discussion section of this repository. +This project is not open for code contributions. However, if you have any questions or suggestions, we would love to hear from you at [comify\@masking.tech](mailto:comify@masking.tech?subject=Comify%20question), or post a message in the discussion section of this repository. diff --git a/development/common/integrations/authentication/originMiddleware.ts b/development/common/integrations/authentication/originMiddleware.ts index abcafb1f..d1bb6ac2 100644 --- a/development/common/integrations/authentication/originMiddleware.ts +++ b/development/common/integrations/authentication/originMiddleware.ts @@ -1,4 +1,9 @@ import { OriginMiddleware } from '@jitar-plugins/http'; -export default new OriginMiddleware(); +const options = { + sameSite: process.env.ORIGIN_COOKIE_SAME_SITE || 'Strict', + secure: process.env.ORIGIN_COOKIE_SECURE === 'true' +} + +export default new OriginMiddleware(options); diff --git a/example.env b/example.env index baa5d76d..792352e8 100644 --- a/example.env +++ b/example.env @@ -47,6 +47,10 @@ NOTIFICATION_DRIVER="memory" # WEBPUSH_VAPID_PUBLIC_KEY="" # WEBPUSH_VAPID_PRIVATE_KEY="" +# ORIGIN MIDDLEWARE +ORIGIN_COOKIE_SAME_SITE='Strict' +ORIGIN_COOKIE_SECURE=false #localhost is not a secure context in Safari + # ######################################################################## # DOCKER # ######################################################################## From 986ea2d179d1df5a74ab8ed2254ad1b7aa5d2606 Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Thu, 21 May 2026 22:13:09 +0300 Subject: [PATCH 2/6] #488: updated ci config --- .github/workflows/nodejsci.yml | 42 +++++++++---------- .../authentication/originMiddleware.ts | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/nodejsci.yml b/.github/workflows/nodejsci.yml index 2b310e51..768abff8 100644 --- a/.github/workflows/nodejsci.yml +++ b/.github/workflows/nodejsci.yml @@ -13,26 +13,26 @@ jobs: strategy: matrix: - node-version: [lts/*] + node-version: [ lts/* ] steps: - - uses: actions/checkout@v6 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v6 - with: - node-version: ${{ matrix.node-version }} - cache: npm - cache-dependency-path: '**/package-lock.json' - - - name: Install dependencies - run: npm ci - - - name: Compile - run: npm run compile - - - name: Test - run: npm run test - - - name: Lint - run: npm run lint \ No newline at end of file + - uses: actions/checkout@v6 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + cache: npm + cache-dependency-path: '**/package-lock.json' + + - name: Install dependencies + run: npm ci + + - name: Compile + run: npm run build + + - name: Test + run: npm run test + + - name: Lint + run: npm run lint diff --git a/development/common/integrations/authentication/originMiddleware.ts b/development/common/integrations/authentication/originMiddleware.ts index d1bb6ac2..fea64dc6 100644 --- a/development/common/integrations/authentication/originMiddleware.ts +++ b/development/common/integrations/authentication/originMiddleware.ts @@ -4,6 +4,6 @@ import { OriginMiddleware } from '@jitar-plugins/http'; const options = { sameSite: process.env.ORIGIN_COOKIE_SAME_SITE || 'Strict', secure: process.env.ORIGIN_COOKIE_SECURE === 'true' -} +}; export default new OriginMiddleware(options); From 1455d2c8ff1c6badfd37cf114b1ea03864ee269d Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Thu, 21 May 2026 22:20:07 +0300 Subject: [PATCH 3/6] #488: updated workflows --- .github/workflows/codeql.yml | 15 +++++---------- .github/workflows/nodejsci.yml | 2 -- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a5764dc9..f839ff52 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -12,16 +12,12 @@ name: "CodeQL" on: - push: - branches: [ "main" ] - paths: - - 'src/**' pull_request: branches: [ "main" ] paths: - - 'src/**' + - 'development/**' schedule: - - cron: '39 10 * * 1' + - cron: '39 10 * * 1' jobs: analyze: @@ -35,7 +31,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'javascript' ] + language: [ 'typescript' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support @@ -47,16 +43,15 @@ jobs: - name: Initialize CodeQL uses: github/codeql-action/init@v4 with: - source-root: src + source-root: development languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. - + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs queries: security-extended,security-and-quality - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) # - name: Autobuild diff --git a/.github/workflows/nodejsci.yml b/.github/workflows/nodejsci.yml index 768abff8..73bd2d4d 100644 --- a/.github/workflows/nodejsci.yml +++ b/.github/workflows/nodejsci.yml @@ -1,8 +1,6 @@ name: Node.js CI on: - push: - branches: [ main ] pull_request: branches: [ main ] From a03181e02f7da8dd22a24608d2226173dffbc7dd Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Thu, 21 May 2026 22:20:19 +0300 Subject: [PATCH 4/6] #488: processed feedback --- .gitignore | 17 ++--------------- README.md | 2 +- vitest.config.ts | 2 +- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 94b8f06e..ca985000 100644 --- a/.gitignore +++ b/.gitignore @@ -1,25 +1,12 @@ -# Logs logs *.log npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* artifacts coverage node_modules +development.env -# Editor directories and files !.vscode/extensions.json -.idea .DS_Store -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? -*.tgz - -development.env \ No newline at end of file +*.tgz \ No newline at end of file diff --git a/README.md b/README.md index 0284b709..365f5f78 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ You need to set up the configuration first by copying the `example.env` file to npm run docker-up ``` -This will start a [Keycloack](https://www.keycloak.org/) instance for account management, a [MongoDB](https://www.mongodb.com/) instance for data storage and a [SeaweadFS](https://seaweedfs.github.io/) instance for storing the comic images. +This will start a [Keycloak](https://www.keycloak.org/) instance for account management, a [MongoDB](https://www.mongodb.com/) instance for data storage and a [SeaweedFS](https://seaweedfs.github.io/) instance for storing the comic images. Next you can build and start the application with the following commands: diff --git a/vitest.config.ts b/vitest.config.ts index cdac2d20..c14bda03 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -7,4 +7,4 @@ export default defineConfig({ plugins: [ tsconfigPaths() ] -}); \ No newline at end of file +}); From 186873ef15db77838a0a52009c87784f5ae257a8 Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Thu, 21 May 2026 22:29:18 +0300 Subject: [PATCH 5/6] #488: updated build scripts for github runners --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 63a36e86..3f28df34 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,9 @@ "type": "module", "scripts": { - "build": "npm run build --workspaces", + "build": "npm run build-domain && npm run build-app", + "build-domain": "npm run build-domain --workspaces", + "build-app": "npm run build-app --workspaces --if-present", "lint": "npm run lint --workspaces", "review": "npm run review --workspaces", "clean": "npm run clean --workspaces", From e468152525fe6645e1391e705d52ce02f3bc77fe Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Thu, 21 May 2026 22:35:01 +0300 Subject: [PATCH 6/6] #488: processed feedback --- .../integrations/authentication/authenticationMiddleware.ts | 2 +- .../common/integrations/authentication/originMiddleware.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/development/common/integrations/authentication/authenticationMiddleware.ts b/development/common/integrations/authentication/authenticationMiddleware.ts index 492324e1..67bb3b64 100644 --- a/development/common/integrations/authentication/authenticationMiddleware.ts +++ b/development/common/integrations/authentication/authenticationMiddleware.ts @@ -9,7 +9,7 @@ const authProcedures = { logout: 'social/domain/authentication/logout' }; -const redirectPath = process.env.AUTHENTICATION_CLIENT_PATH || ''; +const redirectPath = process.env.AUTHENTICATION_CLIENT_PATH ?? ''; const whiteList: string[] = [ 'common/domain/tenant/getByOriginConverted' diff --git a/development/common/integrations/authentication/originMiddleware.ts b/development/common/integrations/authentication/originMiddleware.ts index fea64dc6..5b4e260a 100644 --- a/development/common/integrations/authentication/originMiddleware.ts +++ b/development/common/integrations/authentication/originMiddleware.ts @@ -2,7 +2,7 @@ import { OriginMiddleware } from '@jitar-plugins/http'; const options = { - sameSite: process.env.ORIGIN_COOKIE_SAME_SITE || 'Strict', + sameSite: process.env.ORIGIN_COOKIE_SAME_SITE ?? 'Strict', secure: process.env.ORIGIN_COOKIE_SECURE === 'true' };