Refactor: Traefik (#6940)

* Refactor

* typo

---------

Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com>
This commit is contained in:
Slaviša Arežina 2025-08-18 22:12:22 +02:00 committed by GitHub
parent 296f4577d0
commit 9aafb65a98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 21 deletions

View file

@ -17,15 +17,8 @@ msg_info "Installing Dependencies"
$STD apt-get install -y apt-transport-https
msg_ok "Installed Dependencies"
RELEASE=$(curl -fsSL https://api.github.com/repos/traefik/traefik/releases | grep -oP '"tag_name":\s*"v\K[\d.]+?(?=")' | sort -V | tail -n 1)
msg_info "Installing Traefik v${RELEASE}"
fetch_and_deploy_gh_release "traefik" "traefik/traefik" "prebuild" "latest" "/usr/bin" "traefik_v*_linux_amd64.tar.gz"
mkdir -p /etc/traefik/{conf.d,ssl}
curl -fsSL "https://github.com/traefik/traefik/releases/download/v${RELEASE}/traefik_v${RELEASE}_linux_amd64.tar.gz" -o "traefik_v${RELEASE}_linux_amd64.tar.gz"
tar -C /tmp -xzf traefik*.tar.gz
mv /tmp/traefik /usr/bin/
rm -rf traefik*.tar.gz
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Installed Traefik v${RELEASE}"
msg_info "Creating Traefik configuration"
cat <<EOF >/etc/traefik/traefik.yaml
@ -84,7 +77,7 @@ EOF
msg_ok "Created Traefik configuration"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/traefik.service
cat <<'EOF' >/etc/systemd/system/traefik.service
[Unit]
Description=Traefik is an open-source Edge Router that makes publishing your services a fun and easy experience
@ -97,7 +90,6 @@ ExecReload=/bin/kill -USR1 \$MAINPID
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now traefik
msg_ok "Created Service"