From f987c7482d7709f5eb90ebf30cc71cae58a74192 Mon Sep 17 00:00:00 2001 From: GoldenSpring Date: Tue, 23 Dec 2025 17:57:03 +0000 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> --- ct/rustypaste.sh | 8 -------- install/rustypaste-install.sh | 24 ++++-------------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/ct/rustypaste.sh b/ct/rustypaste.sh index a28b96f90..39b29e4cb 100644 --- a/ct/rustypaste.sh +++ b/ct/rustypaste.sh @@ -30,7 +30,6 @@ function update_script() { fi if check_for_gh_release "rustypaste" "orhun/rustypaste"; then - msg_info "Stopping rustypaste" systemctl stop rustypaste msg_ok "Stopped rustypaste" @@ -40,15 +39,10 @@ function update_script() { msg_ok "Backup Created" msg_info "Updating rustypaste to latest" - cd /opt/rustypaste - CLEAN_INSTALL=1 fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "tarball" "latest" "/opt/rustypaste" - sed -i 's|^address = ".*"|address = "0.0.0.0:8000"|' config.toml - cargo build --locked --release - msg_ok "Updated rustypaste to latest" msg_info "Starting rustypaste" @@ -56,8 +50,6 @@ function update_script() { msg_ok "Started rustypaste" msg_ok "Update Successful" - else - msg_ok "No update required. rustypaste is already at latest" fi exit } diff --git a/install/rustypaste-install.sh b/install/rustypaste-install.sh index d028cbaf2..bab9586d5 100644 --- a/install/rustypaste-install.sh +++ b/install/rustypaste-install.sh @@ -24,23 +24,13 @@ msg_ok "Dependencies Installed Successfully" RUST_VERSION="1.92.0" setup_rust -msg_info "Setting up rustypaste" - fetch_and_deploy_gh_release "rustypaste" "orhun/rustypaste" "tarball" "latest" "/opt/rustypaste" +msg_info "Setting up rustypaste" cd /opt/rustypaste - sed -i 's|^address = ".*"|address = "0.0.0.0:8000"|' config.toml - -msg_info "Compiling rustypaste" cargo build --locked --release - -if [[ ! -f "/opt/rustypaste/target/release/rustypaste" ]]; then - msg_error "Cargo build failed" - exit -fi - -msg_ok "Setting up rustypaste is Done!" +msg_ok "Set up rustypaste" msg_info "Creating Service" cat </etc/systemd/system/rustypaste.service @@ -57,15 +47,9 @@ Restart=always WantedBy=multi-user.target EOF -systemctl enable -q --now rustypaste.service +systemctl enable -q --now rustypaste msg_ok "Created Service" -msg_ok "RustyPaste is Running!" - motd_ssh customize - -msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" +cleanup_lxc