summaryrefslogtreecommitdiff
path: root/internal/suites/const.go
blob: c422f46aac37ab92f1a328b6395129d3707fc593 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package suites

import (
	"fmt"
	"os"

	"github.com/authelia/authelia/v4/internal/configuration/schema"
)

// BaseDomain the base domain.
var (
	BaseDomain     = "example.com:8080"
	Example2DotCom = "example2.com:8080"
	Example3DotCom = "example3.com:8080"
)

const (
	SHA1   = "SHA1"
	SHA256 = "SHA256"
	SHA512 = "SHA512"
)

// GetPathPrefix returns the prefix/url_base of the login portal.
func GetPathPrefix() string {
	return os.Getenv("PathPrefix")
}

// LoginBaseURLFmt the base URL of the login portal for specified baseDomain.
func LoginBaseURLFmt(baseDomain string) string {
	if baseDomain == "" {
		baseDomain = BaseDomain
	}

	return fmt.Sprintf("https://login.%s", baseDomain)
}

// LoginBaseURL the base URL of the login portal.
var LoginBaseURL = LoginBaseURLFmt(BaseDomain)

// SingleFactorBaseURLFmt the base URL of the singlefactor with custom domain.
func SingleFactorBaseURLFmt(baseDomain string) string {
	if baseDomain == "" {
		baseDomain = BaseDomain
	}

	return fmt.Sprintf("https://singlefactor.%s", baseDomain)
}

// SingleFactorBaseURL the base URL of the singlefactor domain.
var SingleFactorBaseURL = SingleFactorBaseURLFmt(BaseDomain)

// AdminBaseURL the base URL of the admin domain.
var AdminBaseURL = fmt.Sprintf("https://admin.%s", BaseDomain)

// MailBaseURL the base URL of the mail domain.
var MailBaseURL = fmt.Sprintf("https://mail.%s", BaseDomain)

// HomeBaseURL the base URL of the home domain.
var HomeBaseURL = fmt.Sprintf("https://home.%s", BaseDomain)

// PublicBaseURL the base URL of the public domain.
var PublicBaseURL = fmt.Sprintf("https://public.%s", BaseDomain)

// SecureBaseURL the base URL of the secure domain.
var SecureBaseURL = fmt.Sprintf("https://secure.%s", BaseDomain)

// DenyBaseURL the base URL of the dev domain.
var DenyBaseURL = fmt.Sprintf("https://deny.%s", BaseDomain)

// DevBaseURL the base URL of the dev domain.
var DevBaseURL = fmt.Sprintf("https://dev.%s", BaseDomain)

// MX1MailBaseURL the base URL of the mx1.mail domain.
var MX1MailBaseURL = fmt.Sprintf("https://mx1.mail.%s", BaseDomain)

// MX2MailBaseURL the base URL of the mx2.mail domain.
var MX2MailBaseURL = fmt.Sprintf("https://mx2.mail.%s", BaseDomain)

// OIDCBaseURL the base URL of the oidc domain.
var OIDCBaseURL = fmt.Sprintf("https://oidc.%s", BaseDomain)

// DuoBaseURL the base URL of the Duo configuration API.
var DuoBaseURL = "https://duo.example.com"

// AutheliaBaseURL the base URL of Authelia service.
var AutheliaBaseURL = "https://authelia.example.com:9091"

const (
	t            = "true"
	testUsername = "john"
	testPassword = "password"
)

const (
	envFileProd        = "/web/.env.production"
	envFileDev         = "/web/.env.development"
	namespaceAuthelia  = "authelia"
	namespaceDashboard = "kubernetes-dashboard"
	namespaceKube      = "kube-system"
)

var (
	storageLocalTmpConfig = schema.Configuration{
		TOTP: schema.TOTP{
			Issuer:        "Authelia",
			DefaultPeriod: 6,
		},
		Storage: schema.Storage{
			EncryptionKey: "a_not_so_secure_encryption_key",
			Local: &schema.StorageLocal{
				Path: "/tmp/db.sqlite3",
			},
		},
	}
)