Skip to content

Commit cc81fdf

Browse files
Davor Ornikclaude
andcommitted
Add Horilla HR (ct)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
1 parent 43db5d3 commit cc81fdf

3 files changed

Lines changed: 215 additions & 0 deletions

File tree

‎ct/horilla-hr.sh‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env bash
2+
_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main"
3+
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
4+
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
5+
6+
# Copyright (c) 2021-2026 community-scripts ORG
7+
# Author: Community Contributor
8+
# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE
9+
# Source: https://github.com/horilla-opensource/horilla
10+
11+
APP="Horilla-HR"
12+
var_tags="${var_tags:-hr;business;erp;django}"
13+
var_cpu="${var_cpu:-2}"
14+
var_ram="${var_ram:-4096}"
15+
var_disk="${var_disk:-12}"
16+
var_os="${var_os:-debian}"
17+
var_version="${var_version:-13}"
18+
var_arm64="${var_arm64:-yes}"
19+
var_unprivileged="${var_unprivileged:-1}"
20+
21+
header_info "$APP"
22+
variables
23+
color
24+
catch_errors
25+
26+
function update_script() {
27+
header_info
28+
check_container_storage
29+
check_container_resources
30+
31+
if [[ ! -d /opt/horilla ]]; then
32+
msg_error "No ${APP} Installation Found!"
33+
exit
34+
fi
35+
36+
if check_for_gh_release "horilla" "horilla-opensource/horilla"; then
37+
msg_info "Stopping Horilla HR"
38+
systemctl stop horilla-scheduler horilla
39+
msg_ok "Stopped Horilla HR"
40+
41+
create_backup /opt/horilla/.env
42+
43+
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP=".env" fetch_and_deploy_gh_release "horilla" "horilla-opensource/horilla" "tarball"
44+
45+
restore_backup
46+
47+
PYTHON_VERSION="3.13" setup_uv
48+
49+
msg_info "Updating Horilla HR"
50+
$STD uv pip install --python /opt/horilla/.venv/bin/python -r /opt/horilla/requirements.txt
51+
cd /opt/horilla
52+
set -a && source /opt/horilla/.env && set +a
53+
$STD /opt/horilla/.venv/bin/python manage.py compilemessages
54+
$STD /opt/horilla/.venv/bin/python manage.py collectstatic --noinput
55+
$STD /opt/horilla/.venv/bin/python manage.py migrate --noinput
56+
msg_ok "Updated Horilla HR"
57+
58+
msg_info "Starting Horilla HR"
59+
systemctl start horilla horilla-scheduler
60+
msg_ok "Started Horilla HR"
61+
msg_ok "Updated successfully!"
62+
fi
63+
exit
64+
}
65+
66+
start
67+
build_container
68+
description
69+
70+
msg_ok "Completed Successfully!\n"
71+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
72+
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
73+
echo -e "${GATEWAY}${BGN}http://${IP}:8000${CL}"
74+
echo -e "${INFO}${YW}First run: open the URL, choose \"Initialize Database\" and enter DB_INIT_PASSWORD from /opt/horilla/.env (inside the container).${CL}"

‎install/horilla-hr-install.sh‎

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2026 community-scripts ORG
4+
# Author: Community Contributor
5+
# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE
6+
# Source: https://github.com/horilla-opensource/horilla
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 install -y \
18+
gettext \
19+
libcairo2
20+
msg_ok "Installed Dependencies"
21+
22+
PG_VERSION="17" setup_postgresql
23+
PG_DB_NAME="horilla" PG_DB_USER="horilla" PG_DB_CREDS_FILE="/dev/null" setup_postgresql_db
24+
PYTHON_VERSION="3.13" setup_uv
25+
26+
fetch_and_deploy_gh_release "horilla" "horilla-opensource/horilla" "tarball"
27+
28+
msg_info "Installing Horilla HR"
29+
$STD uv venv --python 3.13 /opt/horilla/.venv
30+
$STD uv pip install --python /opt/horilla/.venv/bin/python -r /opt/horilla/requirements.txt
31+
msg_ok "Installed Horilla HR"
32+
33+
msg_info "Configuring Horilla HR"
34+
cat <<EOF >/opt/horilla/.env
35+
DJANGO_SETTINGS_MODULE=horilla.settings
36+
SECRET_KEY=$(random_password 50)
37+
DEBUG=False
38+
ALLOWED_HOSTS=localhost,127.0.0.1,${LOCAL_IP}
39+
CSRF_TRUSTED_ORIGINS=http://${LOCAL_IP}:8000
40+
SECURE_SSL_REDIRECT=False
41+
TIME_ZONE=UTC
42+
DATABASE_URL=postgres://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}
43+
DB_INIT_PASSWORD=$(random_password)
44+
EOF
45+
chmod 600 /opt/horilla/.env
46+
cd /opt/horilla
47+
set -a && source /opt/horilla/.env && set +a
48+
$STD /opt/horilla/.venv/bin/python manage.py compilemessages
49+
$STD /opt/horilla/.venv/bin/python manage.py collectstatic --noinput
50+
$STD /opt/horilla/.venv/bin/python manage.py migrate --noinput
51+
msg_ok "Configured Horilla HR"
52+
53+
msg_info "Creating Services"
54+
cat <<EOF >/etc/systemd/system/horilla.service
55+
[Unit]
56+
Description=Horilla HR
57+
After=network.target postgresql.service
58+
Wants=postgresql.service
59+
60+
[Service]
61+
Type=simple
62+
WorkingDirectory=/opt/horilla
63+
EnvironmentFile=/opt/horilla/.env
64+
ExecStart=/opt/horilla/.venv/bin/gunicorn horilla.wsgi:application --bind 0.0.0.0:8000
65+
Restart=on-failure
66+
RestartSec=5
67+
68+
[Install]
69+
WantedBy=multi-user.target
70+
EOF
71+
cat <<EOF >/etc/systemd/system/horilla-scheduler.service
72+
[Unit]
73+
Description=Horilla HR Scheduler
74+
After=network.target horilla.service
75+
Wants=horilla.service
76+
77+
[Service]
78+
Type=simple
79+
WorkingDirectory=/opt/horilla
80+
EnvironmentFile=/opt/horilla/.env
81+
ExecStart=/opt/horilla/.venv/bin/python manage.py run_scheduler
82+
Restart=on-failure
83+
RestartSec=5
84+
85+
[Install]
86+
WantedBy=multi-user.target
87+
EOF
88+
systemctl enable -q --now horilla horilla-scheduler
89+
msg_ok "Created Services"
90+
91+
motd_ssh
92+
customize
93+
cleanup_lxc

‎json/horilla-hr.json‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "Horilla HR",
3+
"slug": "horilla-hr",
4+
"categories": [
5+
25
6+
],
7+
"date_created": "2026-11-30",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 8000,
12+
"documentation": "https://docs.horilla.com/",
13+
"website": "https://www.horilla.com/",
14+
"repository": "https://github.com/horilla-opensource/horilla",
15+
"architectures": ["amd64", "arm64"],
16+
"platforms": ["pve"],
17+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/horilla.webp",
18+
"description": "Horilla HR is an open source human resource management system. It covers employee records, attendance and leave, recruitment, payroll, performance, helpdesk tickets, and role-based dashboards with reports.",
19+
"install_methods": [
20+
{
21+
"type": "default",
22+
"script": "ct/horilla-hr.sh",
23+
"config_path": "/opt/horilla/.env",
24+
"resources": {
25+
"cpu": 2,
26+
"ram": 4096,
27+
"hdd": 12,
28+
"os": "Debian",
29+
"version": "13"
30+
}
31+
}
32+
],
33+
"default_credentials": {
34+
"username": null,
35+
"password": null
36+
},
37+
"notes": [
38+
{
39+
"text": "On first visit choose \"Initialize Database\" and enter DB_INIT_PASSWORD from /opt/horilla/.env to create the admin account.",
40+
"type": "info"
41+
},
42+
{
43+
"text": "Served by gunicorn with DEBUG=False; put a reverse proxy with HTTPS in front before exposing it.",
44+
"type": "warning"
45+
}
46+
],
47+
"app_vars": []
48+
}

0 commit comments

Comments
 (0)