webcompile/README.md

52 lines
2.6 KiB
Markdown
Raw Normal View History

2022-08-04 20:00:24 +05:30
# Project Segfault website
2022-07-23 16:50:05 +05:30
2022-07-23 15:15:56 +05:30
Live at [projectsegfau.lt](https://projectsegfau.lt).
2022-02-28 23:42:33 +05:30
## Developing
2023-01-25 22:41:11 +05:30
> You need a lot of infrastructure to run a complete version of the website including: Ghost CMS deployment and Authentik authentication.
2023-01-11 00:28:52 +05:30
2022-07-23 15:15:56 +05:30
### Prerequisites
2022-02-28 23:42:33 +05:30
2022-07-23 15:15:56 +05:30
- Install [node.js](https://nodejs.org).
2023-01-11 00:28:52 +05:30
- Install [pnpm](https://pnpm.io/).
2022-07-23 15:15:56 +05:30
- Learn [Svelte](https://svelte.dev).
2023-02-03 23:25:33 +05:30
- Add the environment variables from the [environment variables section](#environment-variables).
2022-07-23 15:15:56 +05:30
2022-08-04 20:00:24 +05:30
### Running a dev server.
2022-07-23 16:50:05 +05:30
2023-01-11 00:28:52 +05:30
1. Clone the repository using `git clone https://github.com/ProjectSegfault/website`.
2022-07-23 15:15:56 +05:30
2. Change directory into the clone using `cd ./website`.
2023-01-11 00:28:52 +05:30
3. Install dependencies using `pnpm i`.
4. Run the dev server using `pnpm dev`.
2022-08-05 19:31:15 +05:30
5. Open a browser on `http://localhost:5173/` and you should see the website running locally!
2023-01-11 00:28:52 +05:30
## Running in production
In production you can run the website through Docker Compose or locally. We strongly recommend using Docker since it makes everything 10 times easier.
### Docker
First install Docker and Docker Compose on your system (use Linux if you are sane). After that add the environment variables from the [environment variables section](#environment-variables) and run `docker compose up -d` in the directory of the source code (or just the compose.yml file if you aren't building from source). If you are using Portainer (if you aren't, start using it) you should add a new stack in the Stacks section and select the compose file option, then copy the compose.yml file.
### Locally
If you want to run the website locally in production follow the steps in [developing](#developing) but use `node build` instead of `pnpm dev` and expect the website to be in `http://localhost:3000`.
## Environment variables
The website has the following **mandatory** environment variables
2023-02-18 15:01:27 +05:30
| Name | Description |
| :----------------- | :--------------------------------------------- |
| AUTH_CLIENT_ID | Authentik client ID |
| AUTH_CLIENT_SECRET | Authentik client secret |
| AUTH_ISSUER | Authentication issuer URL |
| AUTH_TRUST_HOST | Your domain |
| AUTH_SECRET | Random 32 char secret |
| GHOST_URL | Your Ghost CMS URL |
| GHOST_API_KEY | Your Ghost CMS API key |
| KUMA_URL | Your Uptime Kuma announcements URL |
| ORIGIN | Your domain |
| ADDRESS_HEADER | Header used to retrieve client IP (Caddy only) |