diff --git a/.gitignore b/.gitignore index e3a53e5..b116fa3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ docker/roodjongeren_prod/.env.prod dump_rood*.sql +roodjongeren-export* node_modules/ diff --git a/README.md b/README.md index 4e7e1e5..9406327 100644 --- a/README.md +++ b/README.md @@ -84,27 +84,13 @@ Pull the latest changes from GitHub via `sudo git pull`. Afterwards `cd ..` back into the folder with your docker compose file and run `sudo docker compose build [service] [--no-cache]` to create new docker images. -Deploy them with `sudo docker compose up`. +Deploy them with `sudo docker compose up -d`. -### Backing Up & Restoring Database +### Backing Up -You can back up a database from the host machine using the following command: - -```bash -docker exec -t rood_postgres pg_dump -c -U rood rood > dump_rood.sql -``` - -To restore the backup of the database into a running Postgres container, use the following: - -```bash -cat dump_rood.sql | docker exec -i rood_postgres psql -U rood -d rood -``` - -To back up images and files uploaded to Strapi, you can run `docker cp` in the instance: - -```bash -sudo docker cp rood_strapi:/usr/src/app/public/uploads/ uploads_backup/ -``` +You can back up the database and Strapi assets using `import.sh` on the production instance. +This will export all data to a compressed file named `roodjongeren-export.tar.gz`. +You can use `yarn strapi import` to import the back up locally. ### Configuring SSL diff --git a/backend/Dockerfile b/backend/Dockerfile index f8822ec..a15b373 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM arm64v8/node:19.8-alpine +FROM arm64v8/node:16.14-alpine WORKDIR /usr/src/app diff --git a/backend/package.json b/backend/package.json index f3546cf..682f03a 100644 --- a/backend/package.json +++ b/backend/package.json @@ -8,7 +8,8 @@ "start": "strapi start", "build": "strapi build", "start-prod": "strapi build && strapi start", - "strapi": "strapi" + "strapi": "strapi", + "import-backup": "strapi import --file ../roodjongeren-export.tar.gz" }, "devDependencies": {}, "dependencies": { diff --git a/backend/public/uploads/.gitkeep b/backend/public/uploads/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/backend/public/uploads/banner_2996c8bb91_68eed244ed.webp b/backend/public/uploads/banner_2996c8bb91_68eed244ed.webp deleted file mode 100644 index 64ed393..0000000 Binary files a/backend/public/uploads/banner_2996c8bb91_68eed244ed.webp and /dev/null differ diff --git a/backend/public/uploads/frog_fashion_b9f51e51f1.jpg b/backend/public/uploads/frog_fashion_b9f51e51f1.jpg deleted file mode 100644 index 9c9b163..0000000 Binary files a/backend/public/uploads/frog_fashion_b9f51e51f1.jpg and /dev/null differ diff --git a/backend/public/uploads/large_banner_2996c8bb91_68eed244ed.webp b/backend/public/uploads/large_banner_2996c8bb91_68eed244ed.webp deleted file mode 100644 index 505633a..0000000 Binary files a/backend/public/uploads/large_banner_2996c8bb91_68eed244ed.webp and /dev/null differ diff --git a/backend/public/uploads/medium_banner_2996c8bb91_68eed244ed.webp b/backend/public/uploads/medium_banner_2996c8bb91_68eed244ed.webp deleted file mode 100644 index 50b3afc..0000000 Binary files a/backend/public/uploads/medium_banner_2996c8bb91_68eed244ed.webp and /dev/null differ diff --git a/backend/public/uploads/small_banner_2996c8bb91_68eed244ed.webp b/backend/public/uploads/small_banner_2996c8bb91_68eed244ed.webp deleted file mode 100644 index f067457..0000000 Binary files a/backend/public/uploads/small_banner_2996c8bb91_68eed244ed.webp and /dev/null differ diff --git a/backend/public/uploads/small_frog_fashion_b9f51e51f1.jpg b/backend/public/uploads/small_frog_fashion_b9f51e51f1.jpg deleted file mode 100644 index 6ec5ba5..0000000 Binary files a/backend/public/uploads/small_frog_fashion_b9f51e51f1.jpg and /dev/null differ diff --git a/backend/public/uploads/thumbnail_banner_2996c8bb91_68eed244ed.webp b/backend/public/uploads/thumbnail_banner_2996c8bb91_68eed244ed.webp deleted file mode 100644 index c81a248..0000000 Binary files a/backend/public/uploads/thumbnail_banner_2996c8bb91_68eed244ed.webp and /dev/null differ diff --git a/backend/public/uploads/thumbnail_frog_fashion_b9f51e51f1.jpg b/backend/public/uploads/thumbnail_frog_fashion_b9f51e51f1.jpg deleted file mode 100644 index caf35fb..0000000 Binary files a/backend/public/uploads/thumbnail_frog_fashion_b9f51e51f1.jpg and /dev/null differ diff --git a/docker/roodjongeren_prod/docker-compose.no-nginx.yml b/docker/roodjongeren_prod/docker-compose.no-nginx.yml index 97f8832..bb4b0e3 100644 --- a/docker/roodjongeren_prod/docker-compose.no-nginx.yml +++ b/docker/roodjongeren_prod/docker-compose.no-nginx.yml @@ -47,7 +47,7 @@ services: build: ./roodjongeren/frontend restart: unless-stopped environment: - - BACKEND_URL=http://strapi:1337 + - BACKEND_URL=$STRAPI_URL - NEXT_PUBLIC_BACKEND_URL=/backend depends_on: - strapi diff --git a/docker/umami b/docker/umami index 0cb14f3..7a3443c 160000 --- a/docker/umami +++ b/docker/umami @@ -1 +1 @@ -Subproject commit 0cb14f3f6c4fd542da0f20ae55849f88ce357d6d +Subproject commit 7a3443cd06772f3cde37bdbb0bf38eabf4515561 diff --git a/frontend/Dockerfile b/frontend/Dockerfile index a7b6589..22a2b7f 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,4 +1,4 @@ -FROM arm64v8/node:19.8-alpine AS dependencies +FROM arm64v8/node:16.14-alpine AS dependencies ENV NODE_ENV=production diff --git a/frontend/package.json b/frontend/package.json index 354d798..952968a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,23 +13,23 @@ "@types/leaflet": "^1.9.3", "@types/node": "17.0.33", "@types/qs": "^6.9.7", - "@types/react": "18.0.28", + "@types/react": "18.0.33", "autoprefixer": "^10.4.14", - "axios": "^1.3.4", - "eslint": "8.36.0", - "eslint-config-next": "13.2.4", + "axios": "^1.3.5", + "eslint": "8.38.0", + "eslint-config-next": "13.3.0", "leaflet": "^1.9.3", "leaflet-defaulticon-compatibility": "^0.1.1", - "next": "13.2.4", + "next": "13.3.0", "next-transpile-modules": "^10.0.0", "qs": "^6.11.1", "react": "18.2.0", "react-dom": "18.2.0", "react-icons": "^4.8.0", "react-leaflet": "^4.2.1", - "react-markdown": "^8.0.5", + "react-markdown": "^8.0.6", "remark-gfm": "^3.0.1", - "tailwindcss": "^3.2.7", + "tailwindcss": "^3.3.1", "typescript": "4.9.4" }, "devDependencies": { diff --git a/frontend/src/components/Banner.tsx b/frontend/src/components/Banner.tsx index 2127c38..1d3bab5 100644 --- a/frontend/src/components/Banner.tsx +++ b/frontend/src/components/Banner.tsx @@ -19,11 +19,12 @@ export default function Banner(props: Props) { Banner -
+
-
+

{props.title}

-

{props.subtitle}

+

+ {props.subtitle} +

@@ -50,9 +53,9 @@ function ContentLink() { return (
-
-
-
+
+ diff --git a/frontend/src/components/ConfidantCard.tsx b/frontend/src/components/ConfidantCard.tsx index d59a19f..cd5aa3e 100644 --- a/frontend/src/components/ConfidantCard.tsx +++ b/frontend/src/components/ConfidantCard.tsx @@ -18,6 +18,7 @@ export default function ConfidantCard(props: Props) { {`Foto ) : ( @@ -42,6 +43,7 @@ export default function PostItem(props: Props) { src="/images/rood-logo.svg" alt="" fill + sizes="10rem" className="object-contain opacity-10" /> )} diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index 46f5d56..eb79b6f 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -74,8 +74,8 @@ export async function getStaticProps(): Promise> { const [homeContent, afdelingen, news, submissions] = await Promise.all([ fetchHome(), fetchAfdelingen(), - fetchPosts(PostType.NEWS, null, null, 1, 8, true), - fetchPosts(PostType.SUBMISSION, null, null, 1, 4, true), + fetchPosts(PostType.NEWS, null, null, 1, 9, true), + fetchPosts(PostType.SUBMISSION, null, null, 1, 3, true), ]); return { diff --git a/frontend/src/pages/posts.tsx b/frontend/src/pages/posts.tsx index 2b1ae2c..3abb158 100644 --- a/frontend/src/pages/posts.tsx +++ b/frontend/src/pages/posts.tsx @@ -52,8 +52,6 @@ export default function PostsPage(props: Props) { } }, [searchString, page, props]); - console.log(posts); - return (
= 3.1.0 < 4" + +"thenify@>= 3.1.0 < 4": + version "3.3.1" + resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" + integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== + dependencies: + any-promise "^1.0.0" + tiny-glob@^0.2.9: version "0.2.9" resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.9.tgz#2212d441ac17928033b110f8b3640683129d31e2" @@ -2934,6 +2968,11 @@ trough@^2.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-2.0.2.tgz#94a3aa9d5ce379fc561f6244905b3f36b7458d96" integrity sha512-FnHq5sTMxC0sk957wHDzRnemFnNBvt/gSY99HzK8F7UP5WAbvP70yX5bd7CjEQkN+TjdxwI7g7lJ6podqrG2/w== +ts-interface-checker@^0.1.9: + version "0.1.13" + resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699" + integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== + tsconfig-paths@^3.14.1: version "3.14.1" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" @@ -3150,11 +3189,6 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -xtend@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"