diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml index 03e517826e..e2e20a7471 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 02d65ba9ed..46ed27d33e 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 2b1e144a54..6a0bbf9e26 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 51e7c33a95..dcf0595fa8 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 2ebebf32bf..557aa16e11 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/backend/src/middleware/languages/languages.spec.ts b/backend/src/middleware/languages/languages.spec.ts index f4f57adc4f..8daa311e1a 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 83d4e424c8..3c043ceec7 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) }, }, diff --git a/backend/src/schema/resolvers/embeds/scraper.ts b/backend/src/schema/resolvers/embeds/scraper.ts index bcaa6e4620..79dd5a3681 100644 --- a/backend/src/schema/resolvers/embeds/scraper.ts +++ b/backend/src/schema/resolvers/embeds/scraper.ts @@ -20,7 +20,6 @@ const metascraper = Metascraper([ require('metascraper-publisher')(), require('metascraper-title')(), require('metascraper-url')(), - require('metascraper-audio')(), require('metascraper-soundcloud')(), require('metascraper-video')(), require('metascraper-youtube')(), diff --git a/deployment/scripts/cluster.backup.sh b/deployment/scripts/cluster.backup.sh index 7d9cbd44d5..1033094196 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 diff --git a/package.json b/package.json index 4753d7ec46..784b4259de 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/jsconfig.json b/webapp/jsconfig.json new file mode 100644 index 0000000000..7e3695e4e2 --- /dev/null +++ b/webapp/jsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "~/*": [ + "./*" + ], + "~*": [ + "./*" + ], + } + } +} \ No newline at end of file diff --git a/webapp/maintenance/source/package.json b/webapp/maintenance/source/package.json index beb1f1a112..1d173ae323 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 0372ad982b..8899fbac3c 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",