tinyauth icon indicating copy to clipboard operation
tinyauth copied to clipboard

[REFACTOR] Unify container labels

Open steveiliop56 opened this issue 1 year ago • 4 comments

Right now container labels are scattered instead of being grouped in purpose-specific groups:

// OAuthLabels is a list of labels that can be used in a tinyauth protected container
type OAuthLabels struct {
	Whitelist string
	Groups    string
}

// Basic auth labels for a tinyauth protected container
type BasicLabels struct {
	User     string
	Password string
}

// Labels is a struct that contains the labels for a tinyauth protected container
type Labels struct {
	Users   string
	Allowed string
	Headers []string
	Domain  string
	Basic   BasicLabels
	OAuth   OAuthLabels
}

They should be instead refactored to more intuitive labels like:

type PathLabels struct {
	Allowed string
}

type GenericLabels struct {
	Users string
}

type OAuthLabels struct {
	Whitelist string
	Groups    string
}

type ConfigLabels struct {
	Domain string
	Headers []string
	Basic   BasicLabels
	Paths PathLabels
}

type Labels struct {
	Generic GenericLabels
	OAuth   OAuthLabels
	Config  ConfigLabels
}

This would require a breaking change but it would make labels easier to understand and use.

steveiliop56 avatar Jun 19 '25 19:06 steveiliop56

Another idea is to go with an app based approach. For example:

tinyauth.apps.[app-name].domain: app.example.com
tinyauth.apps.[app-name].ip.bypass: 10.10.10.10

This will allow the labels to be placed anywhere (including in the Tinyauth container itself) and Tinyauth will still be able to identify them. This can allow for a centralized Tinyauth instance that can handle auth and access controls for apps from multiple servers.

steveiliop56 avatar Jul 17 '25 10:07 steveiliop56

Another idea is to go with an app based approach. For example:

tinyauth.apps.[app-name].domain: app.example.com tinyauth.apps.[app-name].ip.bypass: 10.10.10.10 This will allow the labels to be placed anywhere (including in the Tinyauth container itself) and Tinyauth will still be able to identify them. This can allow for a centralized Tinyauth instance that can handle auth and access controls for apps from multiple servers.

this is a better approach.

hhftechnology avatar Aug 02 '25 08:08 hhftechnology

Another idea is to go with an app based approach. For example:

tinyauth.apps.[app-name].domain: app.example.com tinyauth.apps.[app-name].ip.bypass: 10.10.10.10 This will allow the labels to be placed anywhere (including in the Tinyauth container itself) and Tinyauth will still be able to identify them. This can allow for a centralized Tinyauth instance that can handle auth and access controls for apps from multiple servers.

This approach will also make it much easier to configure outside of docker directly; e.g. Kubernetes or non-docker apps.

justin8 avatar Aug 12 '25 14:08 justin8

Another idea is to go with an app based approach. For example:

tinyauth.apps.[app-name].domain: app.example.com
tinyauth.apps.[app-name].ip.bypass: 10.10.10.10

This will allow the labels to be placed anywhere (including in the Tinyauth container itself) and Tinyauth will still be able to identify them. This can allow for a centralized Tinyauth instance that can handle auth and access controls for apps from multiple servers.

That's the approach I will be taking yeah.

steveiliop56 avatar Aug 12 '25 14:08 steveiliop56