feat: add healthcheck and remove unused user variable

This commit is contained in:
devydave
2026-02-17 16:37:47 +01:00
parent f80be04111
commit eadb31ffae
3 changed files with 33 additions and 23 deletions

View File

@ -7,7 +7,6 @@ DOMAIN=tinyauth.example.com
LETS_ENCRYPT_ENV=production
SECRET_USERS_VERSION=v1
SECRET_CLIENT_SECRET_VERSION=v1
AUTH_URL=https://example.com/auth/v1/oidc/authorize

View File

@ -1,24 +1,40 @@
# tinyauth
> One line description of the recipe
> Tinyauth is a simple authentication middleware that adds a simple login screen or OAuth with Google, Github or any other provider to all of your apps.
<!-- metadata -->
* **Category**: Apps
* **Category**: Utilities
* **Status**: 0
* **Image**: [`tinyauth`](https://hub.docker.com/r/tinyauth), 4, upstream
* **Healthcheck**: No
* **Image**: [`tinyauth`](https://ghcr.io/steveiliop56/tinyauth), 4, upstream
* **Healthcheck**: Yes
* **Backups**: No
* **Email**: No
* **Tests**: No
* **SSO**: No
* **SSO**: Yes
<!-- endmetadata -->
## Quick start
* `abra app new tinyauth --secrets`
* `abra app new tinyauth`
* `abra app secret insert <app-name> client_secret v1 yoursecret`
* `abra app config <app-name>`
* `abra app deploy <app-name>`
### Using the app with other services
When using tinyauth you probably need to set `TINY_MIDDLEWARE`. This variable needs to match the `STACK_NAME` of this app.
For example this app is deployed at `auth.example.com` the `TINY_MIDDLEWARE` should be `auth_example_com`.
## Add support to other recipes
1. Add an extension compose file with the following content.
```yaml
services:
app:
deploy:
labels:
- "traefik.http.routers.${STACK_NAME}.middlewares=${TINY_MIDDLEWARE}"
```
2. Add the `TINY_MIDDLEWARE` variable.
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).

View File

@ -31,27 +31,22 @@ services:
environment:
APP_URL: "https://${DOMAIN}"
DISABLE_ANALYTICS: "true"
#USERS_FILE: /run/secrets/users
PROVIDERS_SSO_AUTH_URL: ${AUTH_URL}
PROVIDERS_SSO_AUTH_URL: ${AUTH_URL}
PROVIDERS_SSO_CLIENT_ID: ${CLIENT_ID}
PROVIDERS_SSO_CLIENT_SECRET_FILE: /run/secrets/client_secret
PROVIDERS_SSO_REDIRECT_URL: https://${DOMAIN}/api/oauth/callback/sso
PROVIDERS_SSO_SCOPES: ${SCOPES}
PROVIDERS_SSO_CLIENT_SECRET_FILE: /run/secrets/client_secret
PROVIDERS_SSO_REDIRECT_URL: https://${DOMAIN}/api/oauth/callback/sso
PROVIDERS_SSO_SCOPES: ${SCOPES}
PROVIDERS_SSO_TOKEN_URL: ${TOKEN_URL}
PROVIDERS_SSO_USER_INFO_URL: ${USER_INFO_URL}
secrets:
- users
- client_secret
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:3000/api/healthz"]
# interval: 5s
# timeout: 3s
# retries: 10
# start_period: 1m
- client_secret
healthcheck:
test: ["CMD", "tinyauth", "healthcheck"]
interval: 5s
timeout: 3s
retries: 10
start_period: 5s
secrets:
users:
name: ${STACK_NAME}_users_${SECRET_USERS_VERSION}
external: true
client_secret:
name: ${STACK_NAME}_client_secret_${SECRET_CLIENT_SECRET_VERSION}
external: true