From 1623517a02deefb1fe6c47686b856087beeda1ca Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Fri, 23 Jan 2026 11:58:16 +0100 Subject: [PATCH] alpine --- ct/alpine-rustypaste.sh | 38 +++++++--------------------- install/alpine-rustypaste-install.sh | 34 +++++++------------------ 2 files changed, 18 insertions(+), 54 deletions(-) diff --git a/ct/alpine-rustypaste.sh b/ct/alpine-rustypaste.sh index 27565d852..89451084f 100644 --- a/ct/alpine-rustypaste.sh +++ b/ct/alpine-rustypaste.sh @@ -24,40 +24,20 @@ function update_script() { check_container_storage check_container_resources - if [[ ! -f /opt/rustypaste/rustypaste ]]; then + if ! apk info -e rustypaste >/dev/null 2>&1; then msg_error "No ${APP} Installation Found!" exit fi - if check_for_gh_release "rustypaste" "orhun/rustypaste"; then - msg_info "Stopping Services" - rc-service rustypaste stop - msg_ok "Stopped Services" + msg_info "Updating RustyPaste" + $STD apk update + $STD apk upgrade rustypaste rustypaste-cli --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community + msg_ok "Updated RustyPaste" - msg_info "Creating Backup" - tar -czf "/opt/rustypaste_backup_$(date +%F).tar.gz" /opt/rustypaste/upload 2>/dev/null || true - cp /opt/rustypaste/config.toml /tmp/rustypaste_config.toml.bak - msg_ok "Backup Created" - - CLEAN_INSTALL=1 fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "prebuild" "latest" "/opt/rustypaste" "*x86_64-unknown-linux-musl.tar.gz" - - - msg_info "Updating RustyPaste" - CLEAN_INSTALL=1 fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "prebuild" "latest" "/opt/rustypaste" "*x86_64-unknown-linux-musl.tar.gz" - mv /tmp/rustypaste_config.toml.bak /opt/rustypaste/config.toml - msg_ok "Updated RustyPaste" - - msg_info "Starting Services" - rc-service rustypaste start - msg_ok "Started Services" - msg_ok "Updated successfully!" - fi - - if check_for_gh_release "rustypaste-cli" "orhun/rustypaste-cli"; then - msg_info "Updating RustyPaste CLI" - fetch_and_deploy_gh_release "rustypaste-cli" "orhun/rustypaste-cli" "prebuild" "latest" "/usr/local/bin" "*x86_64-unknown-linux-musl.tar.gz" - msg_ok "Updated RustyPaste CLI" - fi + msg_info "Restarting Services" + $STD rc-service rustypaste restart + msg_ok "Restarted Services" + msg_ok "Updated successfully!" exit } diff --git a/install/alpine-rustypaste-install.sh b/install/alpine-rustypaste-install.sh index 18e806270..18aeb3cf0 100644 --- a/install/alpine-rustypaste-install.sh +++ b/install/alpine-rustypaste-install.sh @@ -13,34 +13,18 @@ setting_up_container network_check update_os -fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "prebuild" "latest" "/opt/rustypaste" "*x86_64-unknown-linux-musl.tar.gz" -fetch_and_deploy_gh_release "rustypaste-cli" "orhun/rustypaste-cli" "prebuild" "latest" "/usr/local/bin" "*x86_64-unknown-linux-musl.tar.gz" +msg_info "Installing RustyPaste" +$STD apk add --no-cache rustypaste rustypaste-openrc rustypaste-cli --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community +msg_ok "Installed RustyPaste" -msg_info "Setting up RustyPaste" -cd /opt/rustypaste -sed -i 's|^address = ".*"|address = "0.0.0.0:8000"|' config.toml -msg_ok "Set up RustyPaste" +msg_info "Configuring RustyPaste" +mkdir -p /var/lib/rustypaste +sed -i 's|^address = ".*"|address = "0.0.0.0:8000"|' /etc/rustypaste/config.toml +msg_ok "Configured RustyPaste" msg_info "Creating Service" -cat <<'EOF' >/etc/init.d/rustypaste -#!/sbin/openrc-run - -name="rustypaste" -description="rustypaste Service" -directory="/opt/rustypaste" -command="/opt/rustypaste/rustypaste" -command_args="" -pidfile="/run/${RC_SVCNAME}.pid" -command_background="yes" -start_stop_daemon_args="--user root" - -depend() { - need net -} -EOF -chmod +x /etc/init.d/rustypaste -rc-update add rustypaste default -rc-service rustypaste start +$STD rc-update add rustypaste default +$STD rc-service rustypaste start msg_ok "Created Service" motd_ssh