From 3c6fd5ae40cdd503e0eed1f04c957cbede09bc38 Mon Sep 17 00:00:00 2001 From: Jan Szumotalski Date: Wed, 12 Mar 2025 20:02:41 +0100 Subject: [PATCH] Added essential files --- .env | 3 +++ README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ cert/conf/.gitkeep | 0 cert/www/.gitkeep | 0 compose.yml | 37 +++++++++++++++++++++++++++++++++++++ config/keys.json | 4 ++++ config/options.json | 8 ++++++++ config/usettings.json | 22 ++++++++++++++++++++++ 8 files changed, 116 insertions(+) create mode 100644 .env create mode 100644 README.md create mode 100644 cert/conf/.gitkeep create mode 100644 cert/www/.gitkeep create mode 100644 compose.yml create mode 100644 config/keys.json create mode 100644 config/options.json create mode 100644 config/usettings.json diff --git a/.env b/.env new file mode 100644 index 0000000..db4a487 --- /dev/null +++ b/.env @@ -0,0 +1,3 @@ +ORIGIN= +VAPID= +SECRET= \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..4c865f5 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +## Certbot +The project is adjusted to use of certbot. +This command might come in handy: +``` +docker run --rm --name certbot -v "./cert/www:/var/www/certbot/:rw" -v "./cert/conf:/etc/letsencrypt/:rw" certbot/certbot certonly --webroot --webroot-path /var/www/certbot/ -d +``` +Replace `` at the end with your domain name. + +## Things to change +Change following files: +- `.env`: + | What to change | Note | + | --- | --- | + | `ORIGIN=` | Insert final domain name | + | `VAPID=` | Used for notifications. Currently broken. | + | `SECRET=` | Used for encrypting sessions. | +- `./config/`: + - `keys.json`: + | What to change | Note | + | --- | --- | + | `publicKey` | Add your own VAPID keys | + | `privateKey` | Add your own VAPID keys | + - `options.json`: + Change your desired modules by swapping between `true` and `false` next to their name. + - `usettings.json`: + Most things can be changed on the fly inside of the app. `menu` is not done yet. +- `./ipwa`: + - `Dockerfile`: + | Line | What to change | Note | + | --- | --- | --- | + | 7 | ``apiEndpoint: `http://localhost/api`,`` | Change url to backend endpoint | + + - `httpd.conf`: + | Line | What to change | Note | + | --- | --- | --- | + | 233 | `ServerAdmin you@example.com` | Change to webmaster's email | + | 242 | `ServerName www.example.com` | Change to final domain name | + | 312 | `ServerName www.example.com` | See above | + | 314 | `SSLCertificateFile /cert/live//cert.pem` | Change `` to the domain name above | + | 315 | `SSLCertificateKeyFile /cert/live//privkey.pem` | Change `` to the domain name above | + | 316 | `SSLCertificateChainFile /cert/live//chain.pem` | Change `` to the domain name above | + - (Optional) `src/assets/icons/*` - You can change the icons to your own diff --git a/cert/conf/.gitkeep b/cert/conf/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/cert/www/.gitkeep b/cert/www/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..3c855bd --- /dev/null +++ b/compose.yml @@ -0,0 +1,37 @@ +services: + front: + build: ./ipwa + restart: unless-stopped + env_file: + - .env + volumes: + - ./cert/www/:/var/www/certbot/:ro + - ./cert/conf/:/cert/:ro + depends_on: + - api + ports: + - 80:80 + - 443:443 + api: + build: ./ipwa-backend + restart: unless-stopped + env_file: + - .env + expose: + - 8080 + depends_on: + - mongodb + volumes: + - ./config/:/app/config/ + - ./cert/conf/:/cert/:ro + mongodb: + image: mongo:latest + restart: unless-stopped + expose: + - 27017 + ports: + - "127.0.0.1:27017:27017" + volumes: + - mongodb:/data/db +volumes: + mongodb: \ No newline at end of file diff --git a/config/keys.json b/config/keys.json new file mode 100644 index 0000000..70d1b61 --- /dev/null +++ b/config/keys.json @@ -0,0 +1,4 @@ +{ + "publicKey": "", + "privateKey": "" +} \ No newline at end of file diff --git a/config/options.json b/config/options.json new file mode 100644 index 0000000..86d7e19 --- /dev/null +++ b/config/options.json @@ -0,0 +1,8 @@ +{ + "news": true, + "menu": true, + "notif": false, + "groups": true, + "clean": true, + "key": true +} diff --git a/config/usettings.json b/config/usettings.json new file mode 100644 index 0000000..f59f062 --- /dev/null +++ b/config/usettings.json @@ -0,0 +1,22 @@ +{ + "keyrooms": [], + "cleanThings": [], + "rooms": [], + "menu": { + "defaultItems": { + "sn": [ + "Pieczywo 2", + "Masło 1", + "Herbata", + "Cytryna" + ], + "kol": [ + "Pieczywo 2", + "Masło 1", + "Dżem", + "Herbata", + "Cytryna" + ] + } + } + } \ No newline at end of file