sso-core/README.md

22 lines
851 B
Markdown
Raw Normal View History

2024-05-20 17:25:46 +00:00
# sso-core
2024-05-16 14:49:11 +00:00
2024-05-20 17:25:46 +00:00
This is a SvelteKit-powered authentication service.
2024-05-16 14:49:11 +00:00
2024-06-11 16:49:57 +00:00
## Requirements
1. A MySQL or MariaDB database.
2. Node.js 20+ or Docker.
2024-05-20 17:25:46 +00:00
## Set up
2024-05-16 14:49:11 +00:00
2024-06-11 16:49:57 +00:00
1. Clone the repository.
2. Install dependenices - `npm install`.
3. Configure the environment - `cp .env.example .env`.
4. Generate secrets and stuff:
2024-05-20 17:25:46 +00:00
1. Session secret - `node -e 'console.log(require("crypto").randomBytes(16).toString("hex"))'`.
2. Challenge secret - `node -e 'console.log(require("crypto").randomBytes(32).toString("hex"))'`.
3. Generate JWT keys in the `private` directory - `openssl genpkey -out jwt.private.pem -algorithm RSA -pkeyopt rsa_keygen_bits:2048`.
4. Also make the public key - `openssl rsa -in jwt.private.pem -pubout -outform PEM -out jwt.public.pem`.
2024-06-11 16:49:57 +00:00
5. Build the application - `npm run build`.
6. Run the application - `node -r dotenv/config build`.