44
ct/hoodik.sh
44
ct/hoodik.sh
@@ -8,9 +8,9 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
|
|||||||
|
|
||||||
APP="Hoodik"
|
APP="Hoodik"
|
||||||
var_tags="${var_tags:-cloud;storage}"
|
var_tags="${var_tags:-cloud;storage}"
|
||||||
var_cpu="${var_cpu:-4}"
|
var_cpu="${var_cpu:-1}"
|
||||||
var_ram="${var_ram:-4096}"
|
var_ram="${var_ram:-1024}"
|
||||||
var_disk="${var_disk:-20}"
|
var_disk="${var_disk:-5}"
|
||||||
var_os="${var_os:-debian}"
|
var_os="${var_os:-debian}"
|
||||||
var_version="${var_version:-13}"
|
var_version="${var_version:-13}"
|
||||||
var_unprivileged="${var_unprivileged:-1}"
|
var_unprivileged="${var_unprivileged:-1}"
|
||||||
@@ -25,53 +25,31 @@ function update_script() {
|
|||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
if [[ ! -f /usr/local/bin/hoodik ]]; then
|
if [[ ! -f /opt/hoodik/hoodik ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if check_for_gh_release "hoodik" "hudikhq/hoodik"; then
|
if check_for_gh_release "hoodik" "hudikhq/hoodik"; then
|
||||||
msg_info "Stopping Services"
|
msg_info "Stopping Service"
|
||||||
systemctl stop hoodik
|
systemctl stop hoodik
|
||||||
msg_ok "Stopped Services"
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
msg_info "Backing up Configuration"
|
msg_info "Backing up Configuration"
|
||||||
cp /opt/hoodik/.env /opt/hoodik.env.bak
|
cp /opt/hoodik/.env /opt/hoodik.env.bak
|
||||||
msg_ok "Backed up Configuration"
|
msg_ok "Backed up Configuration"
|
||||||
|
|
||||||
msg_info "Updating Hoodik (Patience - this takes 15-20 minutes)"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "hoodik" "hudikhq/hoodik" "prebuild" "latest" "/opt/hoodik" "*x86_64.tar.gz"
|
||||||
source ~/.cargo/env
|
|
||||||
rm -rf /opt/hoodik
|
|
||||||
fetch_and_deploy_gh_release "hoodik" "hudikhq/hoodik" "tarball" "latest" "/opt/hoodik"
|
|
||||||
cd /opt/hoodik
|
|
||||||
|
|
||||||
msg_info "Building Frontend"
|
|
||||||
$STD yarn install --frozen-lockfile
|
|
||||||
$STD yarn wasm-pack
|
|
||||||
$STD yarn web:build
|
|
||||||
msg_ok "Built Frontend"
|
|
||||||
|
|
||||||
msg_info "Building Backend"
|
|
||||||
$STD cargo build --release
|
|
||||||
cp /opt/hoodik/target/release/hoodik /usr/local/bin/hoodik
|
|
||||||
chmod +x /usr/local/bin/hoodik
|
|
||||||
msg_ok "Updated Hoodik"
|
|
||||||
|
|
||||||
msg_info "Restoring Configuration"
|
msg_info "Restoring Configuration"
|
||||||
cp /opt/hoodik.env.bak /opt/hoodik/.env
|
cp /opt/hoodik.env.bak /opt/hoodik/.env
|
||||||
rm -f /opt/hoodik.env.bak
|
rm -f /opt/hoodik.env.bak
|
||||||
msg_ok "Restored Configuration"
|
msg_ok "Restored Configuration"
|
||||||
|
|
||||||
msg_info "Cleaning Up"
|
msg_info "Starting Service"
|
||||||
rm -rf /opt/hoodik/target
|
|
||||||
rm -rf /root/.cargo/registry
|
|
||||||
rm -rf /opt/hoodik/node_modules
|
|
||||||
msg_ok "Cleaned"
|
|
||||||
|
|
||||||
msg_info "Starting Services"
|
|
||||||
systemctl start hoodik
|
systemctl start hoodik
|
||||||
msg_ok "Started Services"
|
msg_ok "Started Service"
|
||||||
msg_ok "Updated Successfully"
|
msg_ok "Updated successfully!"
|
||||||
fi
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
@@ -83,4 +61,4 @@ description
|
|||||||
msg_ok "Completed successfully!\n"
|
msg_ok "Completed successfully!\n"
|
||||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5443${CL}"
|
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5443/auth/register${CL}"
|
||||||
|
|||||||
@@ -23,8 +23,10 @@ DATA_DIR=/opt/hoodik_data
|
|||||||
HTTP_PORT=5443
|
HTTP_PORT=5443
|
||||||
HTTP_ADDRESS=0.0.0.0
|
HTTP_ADDRESS=0.0.0.0
|
||||||
JWT_SECRET=${JWT_SECRET}
|
JWT_SECRET=${JWT_SECRET}
|
||||||
APP_URL=http://127.0.0.1:5443
|
APP_URL=http://${LOCAL_IP}:5443
|
||||||
SSL_DISABLED=true
|
SSL_DISABLED=true
|
||||||
|
COOKIE_SECURE=false
|
||||||
|
COOKIE_HTTP_ONLY=false
|
||||||
MAILER_TYPE=none
|
MAILER_TYPE=none
|
||||||
RUST_LOG=hoodik=info,error=info
|
RUST_LOG=hoodik=info,error=info
|
||||||
EOF
|
EOF
|
||||||
@@ -41,14 +43,14 @@ Type=simple
|
|||||||
User=root
|
User=root
|
||||||
WorkingDirectory=/opt/hoodik_data
|
WorkingDirectory=/opt/hoodik_data
|
||||||
EnvironmentFile=/opt/hoodik/.env
|
EnvironmentFile=/opt/hoodik/.env
|
||||||
ExecStart=/opt/hoodik
|
ExecStart=/opt/hoodik/hoodik
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
systemctl enable -q --now hoodik.service
|
systemctl enable -q --now hoodik
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
|
|||||||
Reference in New Issue
Block a user