From 8346d31cb8dd8d79bca74b322de3ba3a56950688 Mon Sep 17 00:00:00 2001 From: elweyn Date: Thu, 27 Jul 2023 09:53:34 +0200 Subject: [PATCH 1/7] fix(webapp): add jsconfig.json to navigate in webapp. --- webapp/jsconfig.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 webapp/jsconfig.json diff --git a/webapp/jsconfig.json b/webapp/jsconfig.json new file mode 100644 index 000000000..f0ff997a2 --- /dev/null +++ b/webapp/jsconfig.json @@ -0,0 +1,11 @@ +// tsconfig.json +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "~/*": [ + "./*" + ] + } + } +} \ No newline at end of file From fb0b29e5893606d660ce0131c6ca7be4b2d017d5 Mon Sep 17 00:00:00 2001 From: Hannes Heine Date: Fri, 4 Aug 2023 07:10:15 +0200 Subject: [PATCH 2/7] Update webapp/jsconfig.json Co-authored-by: mahula --- webapp/jsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/webapp/jsconfig.json b/webapp/jsconfig.json index f0ff997a2..8dc14a328 100644 --- a/webapp/jsconfig.json +++ b/webapp/jsconfig.json @@ -1,4 +1,3 @@ -// tsconfig.json { "compilerOptions": { "baseUrl": ".", From 2f587afb5e1b82fd374492ed6d9851b34a10f569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 8 Aug 2023 14:15:40 +0200 Subject: [PATCH 3/7] Fix backup script for neo4j v4 Co-Authored-By: Ulf Gebhardt --- deployment/scripts/cluster.backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/scripts/cluster.backup.sh b/deployment/scripts/cluster.backup.sh index 7d9cbd44d..103309419 100755 --- a/deployment/scripts/cluster.backup.sh +++ b/deployment/scripts/cluster.backup.sh @@ -32,7 +32,7 @@ sleep 60 # database backup kubectl --kubeconfig=${KUBECONFIG} -n default exec -it \ $(kubectl --kubeconfig=${KUBECONFIG} -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') \ - -- neo4j-admin dump --to=/var/lib/neo4j/$BACKUP_DATE-neo4j-dump + -- neo4j-admin dump --database=graph.db --to=/var/lib/neo4j/$BACKUP_DATE-neo4j-dump # copy neo4j backup to local drive kubectl --kubeconfig=${KUBECONFIG} cp \ default/$(kubectl --kubeconfig=${KUBECONFIG} -n default get pods | grep ocelot-neo4j |awk '{ print $1 }'):/var/lib/neo4j/$BACKUP_DATE-neo4j-dump $BACKUP_FOLDER/neo4j-dump From 01108252408944ce1dc4e0eecd9aba2718a66acd Mon Sep 17 00:00:00 2001 From: elweyn Date: Thu, 7 Sep 2023 10:51:39 +0200 Subject: [PATCH 4/7] Add ~* so we can write import ... from ~assets --- webapp/jsconfig.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webapp/jsconfig.json b/webapp/jsconfig.json index 8dc14a328..7e3695e4e 100644 --- a/webapp/jsconfig.json +++ b/webapp/jsconfig.json @@ -4,7 +4,10 @@ "paths": { "~/*": [ "./*" - ] + ], + "~*": [ + "./*" + ], } } } \ No newline at end of file From b5ae10193144df51041bd9826cdea0c58f2cc70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 11 Sep 2023 12:43:02 +0200 Subject: [PATCH 5/7] Fix post language detection - In case no language is detected set default. --- .../middleware/languages/languages.spec.ts | 21 +++++++++++++++++++ backend/src/middleware/languages/languages.ts | 12 +++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/backend/src/middleware/languages/languages.spec.ts b/backend/src/middleware/languages/languages.spec.ts index f4f57adc4..8daa311e1 100644 --- a/backend/src/middleware/languages/languages.spec.ts +++ b/backend/src/middleware/languages/languages.spec.ts @@ -131,4 +131,25 @@ describe('languagesMiddleware', () => { }, }) }) + + describe('detects no language', () => { + it('has default language', async () => { + variables = { + ...variables, + content: '', + } + await expect( + mutate({ + mutation: createPostMutation, + variables, + }), + ).resolves.toMatchObject({ + data: { + CreatePost: { + language: 'en', + }, + }, + }) + }) + }) }) diff --git a/backend/src/middleware/languages/languages.ts b/backend/src/middleware/languages/languages.ts index 83d4e424c..3c043ceec 100644 --- a/backend/src/middleware/languages/languages.ts +++ b/backend/src/middleware/languages/languages.ts @@ -1,20 +1,24 @@ import LanguageDetect from 'languagedetect' import { removeHtmlTags } from '../helpers/cleanHtml' -const setPostLanguage = (text) => { +const setPostLanguage = (text, defaultLanguage) => { const lngDetector = new LanguageDetect() lngDetector.setLanguageType('iso2') - return lngDetector.detect(removeHtmlTags(text), 1)[0][0] + let languages = lngDetector.detect(removeHtmlTags(text), 1) + if (!(Array.isArray(languages) && languages.length > 0)) { + languages = [[defaultLanguage, 1.0]] + } + return languages[0][0] } export default { Mutation: { CreatePost: async (resolve, root, args, context, info) => { - args.language = await setPostLanguage(args.content) + args.language = await setPostLanguage(args.content, context.user.locale) return resolve(root, args, context, info) }, UpdatePost: async (resolve, root, args, context, info) => { - args.language = await setPostLanguage(args.content) + args.language = await setPostLanguage(args.content, context.user.locale) return resolve(root, args, context, info) }, }, From 011a099abddcd62d5eebcc415857ee36860c4285 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 12 Sep 2023 09:05:09 +0200 Subject: [PATCH 6/7] add write-all permission to workflow cache cleanup steps --- .github/workflows/test-backend.yml | 1 + .github/workflows/test-e2e.yml | 1 + .github/workflows/test-webapp.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml index 03e517826..e2e20a747 100644 --- a/.github/workflows/test-backend.yml +++ b/.github/workflows/test-backend.yml @@ -127,6 +127,7 @@ jobs: if: ${{ needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.docker == 'true' }} needs: [files-changed, unit_test_backend] runs-on: ubuntu-latest + permissions: write-all continue-on-error: true steps: - name: Delete cache diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 02d65ba9e..46ed27d33 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -101,6 +101,7 @@ jobs: name: Cleanup needs: [docker_preparation, fullstack_tests] runs-on: ubuntu-latest + permissions: write-all continue-on-error: true steps: - name: Delete cache diff --git a/.github/workflows/test-webapp.yml b/.github/workflows/test-webapp.yml index 2b1e144a5..6a0bbf9e2 100644 --- a/.github/workflows/test-webapp.yml +++ b/.github/workflows/test-webapp.yml @@ -103,6 +103,7 @@ jobs: if: ${{ needs.files-changed.outputs.docker == 'true' || needs.files-changed.outputs.webapp == 'true' }} needs: [files-changed, unit_test_webapp] runs-on: ubuntu-latest + permissions: write-all continue-on-error: true steps: - name: Delete cache From b2829f0c1680de347a4602432ce7a37e33764021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 12 Sep 2023 11:38:48 +0200 Subject: [PATCH 7/7] =?UTF-8?q?Release=20v3.0.4=20=E2=80=93=20Fix=20Group?= =?UTF-8?q?=20Link=20on=20Map,=20Embed=20Backend=20Shot=20Down=20and=20Bug?= =?UTF-8?q?=20on=20Post=20Language=20Detect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 20 +++++++++++++++++++- backend/package.json | 2 +- package.json | 2 +- webapp/maintenance/source/package.json | 2 +- webapp/package.json | 2 +- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51e7c33a9..dcf0595fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,26 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [3.0.4](https://github.com/Ocelot-Social-Community/Ocelot-Social/compare/3.0.3...3.0.4) + +- fix(other): fix backup script for neo4j v4 [`#6662`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6662) +- fix(other): fix workflow cache cleanup fail [`#6722`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6722) +- fix(backend): fix post language detection [`#6720`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6720) +- fix(webapp): add jsconfig.json to navigate in webapp. [`#6645`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6645) +- fix(backend): metascraper crash [`#6704`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6704) +- build(other): bump aws-sdk from 2.652.0 to 2.1425.0 in /backend [`#6651`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6651) +- build(other): bump @babel/preset-env from 7.9.5 to 7.22.9 in /backend [`#6578`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6578) +- build(other): bump @babel/preset-env from 7.22.7 to 7.22.9 [`#6572`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6572) +- build(other): bump dotenv from 8.6.0 to 16.3.1 [`#6483`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6483) +- Bump @babel/preset-env from 7.9.5 to 7.22.9 in /backend [`ae0c6f1`](https://github.com/Ocelot-Social-Community/Ocelot-Social/commit/ae0c6f12bd86c39b33a2b48c2eeb0eccb880821c) +- Revert "Revert "Revert "update metascraper packages""" [`7fdc5e8`](https://github.com/Ocelot-Social-Community/Ocelot-Social/commit/7fdc5e8f5ed8e191763acfcd74c510138145f612) +- Revert "Revert "update metascraper packages"" [`d5c1421`](https://github.com/Ocelot-Social-Community/Ocelot-Social/commit/d5c142129291264d5508b3f32b8500c2451a5f39) + #### [3.0.3](https://github.com/Ocelot-Social-Community/Ocelot-Social/compare/3.0.2...3.0.3) +> 4 September 2023 + +- chore(release): release v3.0.3 – fix chat avatar error, adjust layout of filter and enable e-mail dkim [`#6702`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6702) - build(other): bump @babel/core from 7.22.8 to 7.22.9 [`#6573`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6573) - feat(backend): implement dkim config for nodemailer [`#6692`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6692) - fix(webapp): filtermenu mobile bug [`#6694`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6694) @@ -13,7 +31,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - fix(webapp): fix the group link in the map [`#6698`](https://github.com/Ocelot-Social-Community/Ocelot-Social/pull/6698) - Bump @babel/core from 7.22.8 to 7.22.9 [`209390a`](https://github.com/Ocelot-Social-Community/Ocelot-Social/commit/209390a7e026b03ee92f7b1ecb3b1a7b3b2e0232) - Write documentation for DKIM e-mail setting [`9f5d32e`](https://github.com/Ocelot-Social-Community/Ocelot-Social/commit/9f5d32e527151854f1888614c59e0aa5f2b504d0) -- Refine DKIM config for Nodemailer [`28665bd`](https://github.com/Ocelot-Social-Community/Ocelot-Social/commit/28665bd175236d2e00299fe895cd5901bfe7e499) +- Release v3.0.3 [`7d761c2`](https://github.com/Ocelot-Social-Community/Ocelot-Social/commit/7d761c262a6e7bf6382cc49148c55ac8037db12a) #### [3.0.2](https://github.com/Ocelot-Social-Community/Ocelot-Social/compare/3.0.1...3.0.2) diff --git a/backend/package.json b/backend/package.json index 2ebebf32b..557aa16e1 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "ocelot-social-backend", - "version": "3.0.3", + "version": "3.0.4", "description": "GraphQL Backend for ocelot.social", "repository": "https://github.com/Ocelot-Social-Community/Ocelot-Social", "author": "ocelot.social Community", diff --git a/package.json b/package.json index 4753d7ec4..784b4259d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ocelot-social", - "version": "3.0.3", + "version": "3.0.4", "description": "Free and open source software program code available to run social networks.", "author": "ocelot.social Community", "license": "MIT", diff --git a/webapp/maintenance/source/package.json b/webapp/maintenance/source/package.json index beb1f1a11..1d173ae32 100644 --- a/webapp/maintenance/source/package.json +++ b/webapp/maintenance/source/package.json @@ -1,6 +1,6 @@ { "name": "@ocelot-social/maintenance", - "version": "3.0.3", + "version": "3.0.4", "description": "Maintenance page for ocelot.social", "repository": "https://github.com/Ocelot-Social-Community/Ocelot-Social", "author": "ocelot.social Community", diff --git a/webapp/package.json b/webapp/package.json index 0372ad982..8899fbac3 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -1,6 +1,6 @@ { "name": "ocelot-social-webapp", - "version": "3.0.3", + "version": "3.0.4", "description": "ocelot.social Frontend", "repository": "https://github.com/Ocelot-Social-Community/Ocelot-Social", "author": "ocelot.social Community",