chore: add README.md
This commit is contained in:
parent
3adb5f910a
commit
47f5d70eca
|
@ -0,0 +1,62 @@
|
|||
# sessions
|
||||
|
||||
A minimalist backend for [sessions-ext](https://gitea.dwysokinski.me/twhelp/sessions-ext).
|
||||
|
||||
## Getting started
|
||||
|
||||
### Development
|
||||
|
||||
#### Set up the environment
|
||||
|
||||
Prerequisites:
|
||||
|
||||
1. **Go** (>= 1.19)
|
||||
2. **Node.js** (LTS, needed for commitlint)
|
||||
3. **Kubernetes** (>= 1.25.0)
|
||||
1. **minikube**
|
||||
2. **Docker Desktop**
|
||||
4. **Docker CLI**
|
||||
5. **Skaffold**
|
||||
6. **pre-commit**
|
||||
7. **IDE/Code editor** (e.g. Goland, VSCode, vim, neovim)
|
||||
8. **direnv** (optional, but recommended)
|
||||
|
||||
```shell
|
||||
# install git hooks and required tools
|
||||
make install
|
||||
|
||||
# run all required services
|
||||
skaffold run --port-forward=true --tail=true
|
||||
|
||||
# stop all of them
|
||||
skaffold delete
|
||||
```
|
||||
|
||||
## Configuration options
|
||||
|
||||
Configuration options can be specified via environment variables.
|
||||
|
||||
| Env variable | Default | Description |
|
||||
|--------------------------------|-----------------------|--------------------------------------------------------------------------------------------------------------------|
|
||||
| ``APP_MODE`` | ``development`` | Whether to use development or production settings |
|
||||
| ``DB_DSN`` | | Syntax: ``postgres://user:password@host:5432/db?sslmode=disable``. Only Postgres is supported. |
|
||||
| ``DB_MAX_OPEN_CONNECTIONS`` | ``5`` | The maximum number of open connections to the database (https://pkg.go.dev/database/sql#DB.SetMaxOpenConns) |
|
||||
| ``DB_MAX_IDLE_CONNECTIONS`` | ``2`` | The maximum number of connections in the idle connection pool (https://pkg.go.dev/database/sql#DB.SetMaxIdleConns) |
|
||||
| ``DB_CONNECTION_MAX_LIFETIME`` | ``3m`` | The maximum amount of time a connection may be reused (https://pkg.go.dev/database/sql#DB.SetConnMaxLifetime) |
|
||||
| ``API_SWAGGER_ENABLED`` | ``false`` | Enable/disable Swagger |
|
||||
| ``API_SWAGGER_HOST`` | | |
|
||||
| ``API_SWAGGER_SCHEMES`` | ``http,https`` | |
|
||||
| ``API_CORS_ENABLED`` | ``false`` | Enable/disable cors headers |
|
||||
| ``API_CORS_ALLOWED_ORIGINS`` | | List of requesting domains that are allowed |
|
||||
| ``API_CORS_ALLOW_CREDENTIALS`` | ``false`` | Allow/forbid requests with credentials |
|
||||
| ``API_CORS_ALLOWED_METHODS`` | ``HEAD,GET,POST,PUT`` | List of allowed methods |
|
||||
| ``API_CORS_MAX_AGE`` | ``300`` | Max time to cache response (in seconds) |
|
||||
| | | |
|
||||
|
||||
## License
|
||||
|
||||
Distributed under the MIT License. See ``LICENSE`` for more information.
|
||||
|
||||
## Contact
|
||||
|
||||
Dawid Wysokiński - [contact@dwysokinski.me](mailto:contact@dwysokinski.me)
|
|
@ -6,6 +6,10 @@ build:
|
|||
template: latest
|
||||
artifacts:
|
||||
- image: sessions
|
||||
hooks:
|
||||
before:
|
||||
- command: [ "sh", "-c", "make generate" ]
|
||||
os: [ darwin, linux ]
|
||||
context: .
|
||||
docker:
|
||||
dockerfile: ./build/docker/sessions/dev/Dockerfile
|
||||
|
|
Loading…
Reference in New Issue