diff --git a/README.md b/README.md index b4d44ec..848e6c1 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,33 @@ SlimFact streamlines your invoicing process, ensuring accuracy, security, and co ## Documentation [Invoice status flowchart](./packages/docs/Flowchart.md) +## Self hosted +## Self hosted +```sh +wget https://raw.githubusercontent.com/simsustech/slimfact/main/docker-compose.yaml +wget https://raw.githubusercontent.com/simsustech/slimfact/main/.env.example -O .env +mkdir env +nano -L .env # Change environment +nano -L env/POSTGRES_PASSWORD # Enter postgress password +nano -L env/OTP_SECRET # Enter OTP secret, use openssl rand -base64 32 +nano -L env/OIDC_COOKIES_KEYS # Enter OIDC cookies keys, use openssl rand -base64 32, comma separated +docker compose up +``` + +## Developers +SlimFact is built on top of [Modular API](https://www.simsus.tech/modularapi). You will need an account for private NPM access. + +``` +git clone https://github.com/simsustech/slimfact.git +cd slimfact +pnpm i +docker compose -f docker-compose.dev.yaml up +cd packages/api +POSTGRES_PASSWORD=ufgouifdgjdfg POSTGRES_DB=slimfact pnpm run migrate:latest +POSTGRES_PASSWORD=ufgouifdgjdfg POSTGRES_DB=slimfact pnpm run seed:fake +pnpm run dev +``` + ## License Copyright © simsustech 2024-present diff --git a/docker-compose.yaml b/docker-compose.yaml index 25e96e5..aa7d713 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,26 +1,6 @@ services: api: - image: "ghcr.io/simsustech/slimfact" - build: - context: . - secrets: - - POSTGRES_PASSWORD - - OTP_SECRET - - SIMSUSTECH_NPM_TOKEN - dockerfile: Dockerfile - target: api - # args: - # App env variables - # - VITE_API_HOSTNAME=${HOSTNAME} - # - VITE_API_HOSTNAME=vitrify.local - # - VITE_OIDC_ISSUER=https://${HOSTNAME}/oidc - # - VITE_OIDC_CLIENT_ID=${OIDC_CLIENT_ID} - # - VITE_OIDC_REDIRECT_URI=https://${HOSTNAME}/redirect - # - VITE_OIDC_EMAIL_CHANGE_URI=https://${HOSTNAME}/interaction/email/change - # - VITE_OIDC_EMAIL_VERIFY_URI=https://${HOSTNAME}/interaction/email/verify - # - VITE_OIDC_PASSWORD_CHANGE_URI=https://${HOSTNAME}/interaction/password/change - # - VITE_TITLE=Modularapi - # - VITE_LANG=nl + image: "ghcr.io/simsustech/slimfact:latest" labels: caddy: ${HOSTNAME} caddy.reverse_proxy: "{{upstreams 80}}" @@ -37,7 +17,7 @@ services: MAIL_USER: ${MAIL_USER} MAIL_PASS: ${MAIL_PASS} LICENSE_KEY: ${LICENSE_KEY} - OIDC_COOKIES_KEYS: # openssl rand -base64 32 + OIDC_COOKIES_KEYS: /run/secrets/OIDC_COOKIES_KEYS OTP_SECRET_FILE: /run/secrets/OTP_SECRET OTP_VALIDITY_SECONDS: 3600 EMAIL_FOOTER: "Footer" @@ -48,8 +28,8 @@ services: # entrypoint: ["/bin/sh", "-c", "tail -f /dev/null"] secrets: - POSTGRES_PASSWORD - - SIMSUSTECH_NPM_TOKEN - OTP_SECRET + - OIDC_COOKIES_KEYS networks: web: slimfact: @@ -75,10 +55,10 @@ services: secrets: POSTGRES_PASSWORD: file: ./env/POSTGRES_PASSWORD - SIMSUSTECH_NPM_TOKEN: - file: ./env/SIMSUSTECH_NPM_TOKEN OTP_SECRET: file: ./env/OTP_SECRET + OIDC_COOKIES_KEYS: + file: ./env/OIDC_COOKIES_KEYS networks: slimfact: diff --git a/env example/OIDC_COOKIES_KEYS b/env example/OIDC_COOKIES_KEYS new file mode 100644 index 0000000..b065cc8 --- /dev/null +++ b/env example/OIDC_COOKIES_KEYS @@ -0,0 +1 @@ +# openssl rand -base64 32, comma separated \ No newline at end of file