Refactor: HomeBox (#6338)

* Refactor

* Refactor

* Update
This commit is contained in:
Slaviša Arežina 2025-07-29 15:06:52 +02:00 committed by GitHub
parent 815720b59e
commit ab6f2dd24f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 32 deletions

View file

@ -14,18 +14,17 @@ setting_up_container
network_check
update_os
msg_info "Installing Homebox"
RELEASE=$(curl -fsSL https://api.github.com/repos/sysadminsmedia/homebox/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
curl -fsSL "https://github.com/sysadminsmedia/homebox/releases/download/${RELEASE}/homebox_Linux_x86_64.tar.gz" | tar -xzf - -C /opt
chmod +x /opt/homebox
cat <<EOF >/opt/.env
fetch_and_deploy_gh_release "homebox" "sysadminsmedia/homebox" "prebuild" "latest" "/opt/homebox" "homebox_Linux_x86_64.tar.gz"
msg_info "Configuring Homebox"
chmod +x /opt/homebox/homebox
cat <<EOF >/opt/homebox/.env
# For possible environment variables check here: https://homebox.software/en/configure-homebox
HBOX_MODE=production
HBOX_WEB_PORT=7745
HBOX_WEB_HOST=0.0.0.0
EOF
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
msg_ok "Installed Homebox"
msg_ok "Configured Homebox"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/homebox.service
@ -34,9 +33,9 @@ Description=Start Homebox Service
After=network.target
[Service]
WorkingDirectory=/opt
ExecStart=/opt/homebox
EnvironmentFile=/opt/.env
WorkingDirectory=/opt/homebox
ExecStart=/opt/homebox/homebox
EnvironmentFile=/opt/homebox/.env
Restart=on-failure
[Install]