Skip to content

Commit 0a12488

Browse files
thost96tremor021CrazyWolf13
authored
New Script: Authelia (#2060)
* fixed subscription nag removal * Authelia + Dev env * unbound var fix * fixes * service start and update function * remove dev env * remove dev env * Apply suggestions from code review Co-authored-by: Tobias <[email protected]> * Update authelia.sh * Update authelia-install.sh --------- Co-authored-by: Slaviša Arežina <[email protected]> Co-authored-by: Tobias <[email protected]>
1 parent 10d4ce4 commit 0a12488

File tree

3 files changed

+173
-0
lines changed

3 files changed

+173
-0
lines changed

ct/authelia.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: thost96 (thost96)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://www.authelia.com/
7+
8+
APP="Authelia"
9+
TAGS=""
10+
var_cpu="1"
11+
var_ram="512"
12+
var_disk="2"
13+
var_os="debian"
14+
var_version="12"
15+
var_unprivileged="1"
16+
17+
header_info "$APP"
18+
base_settings
19+
20+
variables
21+
color
22+
catch_errors
23+
24+
function update_script() {
25+
header_info
26+
check_container_storage
27+
check_container_resources
28+
if [[ ! -d "/etc/authelia/" ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
29+
RELEASE=$(curl -s https://api.github.com/repos/authelia/authelia/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
30+
if [[ "${RELEASE}" != "$(/usr/bin/authelia -v | awk '{print substr($3, 2, length($2)) }' )" ]]; then
31+
msg_info "Updating $APP to ${RELEASE}"
32+
apt-get update &>/dev/null
33+
apt-get -y upgrade &>/dev/null
34+
wget -q "https://github.com/authelia/authelia/releases/download/${RELEASE}/authelia_${RELEASE}_amd64.deb"
35+
dpkg -i "authelia_${RELEASE}_amd64.deb" &>/dev/null
36+
msg_info "Cleaning Up"
37+
rm -f "authelia_${RELEASE}_amd64.deb"
38+
apt-get -y autoremove &>/dev/null
39+
apt-get -y autoclean &>/dev/null
40+
msg_ok "Cleanup Completed"
41+
msg_ok "Updated $APP to ${RELEASE}"
42+
else
43+
msg_ok "No update required. ${APP} is already at ${RELEASE}"
44+
fi
45+
exit
46+
}
47+
48+
start
49+
build_container
50+
description
51+
52+
msg_ok "Completed Successfully!\n"
53+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
54+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
55+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9091${CL}"

install/authelia-install.sh

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: thost96 (thost96)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://www.authelia.com/
7+
8+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc
21+
msg_ok "Installed Dependencies"
22+
23+
msg_info "Installing Authelia"
24+
RELEASE=$(curl -s https://api.github.com/repos/authelia/authelia/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
25+
wget -q "https://github.com/authelia/authelia/releases/download/${RELEASE}/authelia_${RELEASE}_amd64.deb"
26+
$STD dpkg -i "authelia_${RELEASE}_amd64.deb"
27+
msg_ok "Install Authelia completed"
28+
29+
msg_info "Setting Authelia up"
30+
touch /etc/authelia/emails.txt
31+
JWT_SECRET=$(openssl rand -hex 64)
32+
SESSION_SECRET=$(openssl rand -hex 64)
33+
STORAGE_KEY=$(openssl rand -hex 64)
34+
DOMAIN=$(hostname -d)
35+
36+
cat <<EOF >/etc/authelia/users.yml
37+
users:
38+
authelia:
39+
disabled: false
40+
displayname: "Authelia Admin"
41+
password: "$argon2id$v=19$m=65536,t=3,p=4$ZBopMzXrzhHXPEZxRDVT2w$SxWm96DwhOsZyn34DLocwQEIb4kCDsk632PuiMdZnig"
42+
groups: []
43+
EOF
44+
45+
cat <<EOF >/etc/authelia/configuration.yml
46+
authentication_backend:
47+
file:
48+
path: /etc/authelia/users.yml
49+
access_control:
50+
default_policy: one_factor
51+
session:
52+
secret: "${SESSION_SECRET}"
53+
name: 'authelia_session'
54+
same_site: 'lax'
55+
inactivity: '5m'
56+
expiration: '1h'
57+
remember_me: '1M'
58+
cookies:
59+
- domain: "${DOMAIN}"
60+
authelia_url: "https://auth.${DOMAIN}"
61+
storage:
62+
encryption_key: "${STORAGE_KEY}"
63+
local:
64+
path: /etc/authelia/db.sqlite
65+
identity_validation:
66+
reset_password:
67+
jwt_secret: "${JWT_SECRET}"
68+
jwt_lifespan: '5 minutes'
69+
jwt_algorithm: 'HS256'
70+
notifier:
71+
filesystem:
72+
filename: /etc/authelia/emails.txt
73+
EOF
74+
systemctl enable -q --now authelia
75+
msg_ok "Authelia Setup completed"
76+
77+
motd_ssh
78+
customize
79+
80+
msg_info "Cleaning up"
81+
rm -f "authelia_${RELEASE}_amd64.deb"
82+
$STD apt-get -y autoremove
83+
$STD apt-get -y autoclean
84+
msg_ok "Cleaned"

json/authelia.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "Authelia",
3+
"slug": "authelia",
4+
"categories": [
5+
6
6+
],
7+
"date_created": "2025-02-05",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 9091,
12+
"documentation": "https://www.authelia.com/integration/deployment/bare-metal/",
13+
"website": "https://www.authelia.com/",
14+
"logo": "https://www.authelia.com/images/branding/logo.png",
15+
"description": "Authelia is an open-source authentication and authorization server and portal fulfilling the identity and access management (IAM) role of information security in providing multi-factor authentication and single sign-on (SSO) for your applications via a web portal. It acts as a companion for common reverse proxies.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/authelia.sh",
20+
"resources": {
21+
"cpu": 1,
22+
"ram": 512,
23+
"hdd": 2,
24+
"os": "Debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": "authelia",
31+
"password": "authelia"
32+
},
33+
"notes": []
34+
}

0 commit comments

Comments
 (0)