diff --git a/ct/ots.sh b/ct/ots.sh new file mode 100644 index 00000000..d089bd80 --- /dev/null +++ b/ct/ots.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +source <(curl -s https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: BvdBerg01 +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/Luzifer/ots + +APP="OTS" +var_tags="${var_tags:-analytics}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-512}" +var_disk="${var_disk:-3}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/ots ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Updating $APP LXC" + $STD apt-get update + $STD apt-get -y upgrade + msg_ok "Updated $APP LXC" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/install/ots-install.sh b/install/ots-install.sh new file mode 100644 index 00000000..437e3010 --- /dev/null +++ b/install/ots-install.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE +# Source: https://github.com/Luzifer/ots + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + caddy \ + apt-transport-https \ + ca-certificates +msg_ok "Installed Dependencies" + +msg_info "Installing OTS" +fetch_and_deploy_gh_release "ots" "Luzifer/ots" "tarball" "latest" "/opt/ots" "ots_linux_amd64.tgz" +cat </opt/ots/env" +LISTEN=0.0.0.0:3000 +REDIS_URL=redis://127.0.0.1:6379 +SECRET_EXPIRY=604800 +STORAGE_TYPE=redis +EOF +msg_ok "Installed OTS" + +msg_info "Creating Services" +cat </etc/systemd/system/ots.service +[Unit] +Description=One-Time-Secret Service +After=network-online.target +Requires=network-online.target + +[Service] +EnvironmentFile=/opt/ots/env +ExecStart=/opt/ots/ots +Restart=Always +RestartSecs=5 + +[Install] +WantedBy=multi-user.target +EOF +msg_ok "Created Services" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned"