diff --git a/ct/gomft.sh b/ct/gomft.sh index 5effb2ed7..aba25e05a 100644 --- a/ct/gomft.sh +++ b/ct/gomft.sh @@ -40,8 +40,10 @@ function update_script() { wget -q "https://github.com/StarFleetCPTN/GoMFT/archive/refs/tags/v${RELEASE}.tar.gz" -O $temp_file tar -xzf $temp_file cp -rf GoMFT-${RELEASE}/* /opt/gomft + cd /opt/gomft + $STD go mod download + $STD go build -o gomft $STD $HOME/go/bin/templ generate - wget -q "https://github.com/StarFleetCPTN/GoMFT/releases/download/v${RELEASE}/gomft-v${RELEASE}-linux-amd64" -O /opt/gomft/gomft chmod +x /opt/gomft/gomft echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Updated $APP to ${RELEASE}" diff --git a/install/gomft-install.sh b/install/gomft-install.sh index 72f314bdc..d398cad9e 100644 --- a/install/gomft-install.sh +++ b/install/gomft-install.sh @@ -35,16 +35,17 @@ set -o pipefail msg_ok "Setup Golang" msg_info "Setup ${APPLICATION}" -temp_file2=$(mktemp) +temp_file=$(mktemp) RELEASE=$(curl -s https://api.github.com/repos/StarFleetCPTN/GoMFT/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') -wget -q "https://github.com/StarFleetCPTN/GoMFT/archive/refs/tags/v${RELEASE}.tar.gz" -O $temp_file2 -tar -xzf $temp_file2 +wget -q "https://github.com/StarFleetCPTN/GoMFT/archive/refs/tags/v${RELEASE}.tar.gz" -O $temp_file +tar -xzf $temp_file mv GoMFT-${RELEASE}/ /opt/gomft cd /opt/gomft -$STD go install github.com/a-h/templ/cmd/templ@latest -wget -q "https://github.com/StarFleetCPTN/GoMFT/releases/download/v${RELEASE}/gomft-v${RELEASE}-linux-amd64" -O gomft -$STD $HOME/go/bin/templ generate +$STD go mod download +$STD go build -o gomft chmod +x gomft +$STD go install github.com/a-h/templ/cmd/templ@latest +$STD $HOME/go/bin/templ generate JWT_SECRET_KEY=$(openssl rand -base64 24 | tr -d '/+=') cat </opt/gomft/.env @@ -93,7 +94,7 @@ motd_ssh customize msg_info "Cleaning up" -rm -f $temp_file $temp_file2 +rm -f $temp_file $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"