Skip to content

Beszel

Beszel is a lightweight server monitoring platform that includes Docker statistics, historical data, and alert functions. It uses PocketBase under the hood making it easy to add Tinyauth as an OpenID connect provider.

  • A running instance of Beszel
  • A Tinyauth instance

To begin with, we need to generate a client ID and secret in Tinyauth for Beszel. This can be done by running the following command:

Terminal window
docker run -i -t --rm ghcr.io/steveiliop56/tinyauth:v5 oidc create beszel

From the output, make sure to note down the client ID and secret as we will need them later for the Beszel configuration.

Now, we can pass our configuration to Tinyauth using environment variables:

Terminal window
TINYAUTH_OIDC_PRIVATEKEYPATH=/path/to/private/key.pem
TINYAUTH_OIDC_PUBLICKEYPATH=/path/to/public/key.pem
TINYAUTH_OIDC_CLIENTS_BESZEL_CLIENTID=client-id
TINYAUTH_OIDC_CLIENTS_BESZEL_CLIENTSECRET=ta-client-secret
TINYAUTH_OIDC_CLIENTS_BESZEL_TRUSTEDREDIRECTURIS=https://your-beszel-instance.com/api/oauth2-redirect
TINYAUTH_OIDC_CLIENTS_BESZEL_NAME=Beszel

Restart your Tinyauth instance to apply the new configuration.

Next, we need to add the OAuth provider to Beszel. First, toggle the Hide collection create and edit controls setting under https://your-beszel-instance.com/_/#/settings (you can log in to PocketBase with your Beszel credentials).

Beszel Collection Controls

Then, go to the Collections tab and click on the users collection. In the users collection, click the little gear icon, then Options, OAuth2 (make sure it’s enabled) and Add provider. In the provider selection, select OpenID Connect (1, 2, 3 doesn’t matter).

Beszel Providers

In the new window, fill in the following values.

NameValue
Client IDThe client ID you generated from the previous step.
Client SecretThe client secret you generated from the previous step.
Display NameUse whatever you like, for example, Tinyauth.
Auth URLhttps://tinyauth.example.com/authorize
Token URLhttps://tinyauth.example.com/api/oidc/token
Fetch user info fromUser info URL
User info URLhttps://tinyauth.example.com/api/oidc/userinfo
Support PKCEYes, checked.

Beszel Create Provider

Finally, click Set provider config.

After configuring the PocketBase backend of Beszel, you should see a new Tinyauth option in the login screen.

Beszel Login Screen

Login and enjoy!