From c62a38a9d4c647b6e5aff34df36bf15966c40ae8 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Sun, 3 Aug 2025 19:54:15 +0200 Subject: [PATCH] test --- ct/ots.sh | 54 +++++++++++++++++------------------ frontend/public/json/ots | 40 -------------------------- frontend/public/json/ots.json | 40 ++++++++++++++++++++++++++ install/ots-install.sh | 21 +++++++------- 4 files changed, 77 insertions(+), 78 deletions(-) delete mode 100644 frontend/public/json/ots create mode 100644 frontend/public/json/ots.json diff --git a/ct/ots.sh b/ct/ots.sh index 26a224e8..9c711ae7 100644 --- a/ct/ots.sh +++ b/ct/ots.sh @@ -20,35 +20,33 @@ 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!" + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/ots ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + RELEASE=$(curl -fsSL https://api.github.com/repos/Luzifer/ots/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') + if [[ "${RELEASE}" != "$(cat ~/.ots 2>/dev/null)" ]] || [[ ! -f ~/.ots ]]; then + + msg_info "Stopping ${APP} Service" + systemctl stop ots + systemctl stop nginx + msg_ok "Stopped ${APP} Service" + + fetch_and_deploy_gh_release "ots" "Luzifer/ots" "prebuild" "latest" "/opt/ots" "ots_linux_amd64.tgz" + + msg_info "Stopping ${APP} Service" + systemctl start ots + systemctl start nginx + msg_ok "Stopped ${APP} Service" + + else + msg_ok "No update required. ${APP} is already at ${RELEASE}" + fi exit - fi - - RELEASE=$(curl -fsSL https://api.github.com/repos/Luzifer/ots/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat ~/.ots 2>/dev/null)" ]] || [[ ! -f ~/.ots ]]; then - - msg_info "Stopping ${APP} Service" - systemctl stop ots - systemctl stop nginx - msg_ok "Stopped ${APP} Service" - - msg_info "Updating ${APP} to v${RELEASE}" - fetch_and_deploy_gh_release "ots" "Luzifer/ots" "prebuild" "latest" "/opt/ots" "ots_linux_amd64.tgz" - msg_ok "Updated ${APP} to v${RELEASE}" - - msg_info "Stopping ${APP} Service" - systemctl start ots - systemctl start nginx - msg_ok "Stopped ${APP} Service" - - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" - fi - exit } start diff --git a/frontend/public/json/ots b/frontend/public/json/ots deleted file mode 100644 index a9f042f9..00000000 --- a/frontend/public/json/ots +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "OTS", - "slug": "ots", - "categories": [ - 6 - ], - "date_created": "2025-07-28", - "type": "ct", - "updateable": true, - "privileged": false, - "interface_port": 443, - "documentation": "https://github.com/Luzifer/ots/wiki", - "config_path": "/opt/ots/env", - "website": "https://github.com/Luzifer/ots", - "logo": null, - "description": "One-Time-Secret sharing platform with a symmetric 256bit AES encryption in the browser.", - "install_methods": [ - { - "type": "default", - "script": "ct/ots.sh", - "resources": { - "cpu": 1, - "ram": 512, - "hdd": 3, - "os": "Debian", - "version": "12" - } - } - ], - "default_credentials": { - "username": null, - "password": null - }, - "notes": [ - { - "text": "When it is in used external please use it behind reverse proxy or create your own certificates", - "type": "info" - } - ] -} diff --git a/frontend/public/json/ots.json b/frontend/public/json/ots.json new file mode 100644 index 00000000..2bec84e8 --- /dev/null +++ b/frontend/public/json/ots.json @@ -0,0 +1,40 @@ +{ + "name": "OTS", + "slug": "ots", + "categories": [ + 6 + ], + "date_created": "2025-07-28", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 443, + "documentation": "https://github.com/Luzifer/ots/wiki", + "config_path": "/opt/ots/.env", + "website": "https://github.com/Luzifer/ots", + "logo": null, + "description": "One-Time-Secret sharing platform with a symmetric 256bit AES encryption in the browser.", + "install_methods": [ + { + "type": "default", + "script": "ct/ots.sh", + "resources": { + "cpu": 1, + "ram": 512, + "hdd": 3, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "When it is in used external please use it behind reverse proxy or create your own certificates", + "type": "info" + } + ] +} diff --git a/install/ots-install.sh b/install/ots-install.sh index 6bbfe81f..526d64bd 100644 --- a/install/ots-install.sh +++ b/install/ots-install.sh @@ -15,27 +15,28 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ - redis-server \ - nginx \ - openssl + redis-server \ + nginx \ + openssl msg_ok "Installed Dependencies" -msg_info "Installing OTS" fetch_and_deploy_gh_release "ots" "Luzifer/ots" "prebuild" "latest" "/opt/ots" "ots_linux_amd64.tgz" -cat </opt/ots/env + +msg_info "Setup OTS" +cat </opt/ots/.env LISTEN=127.0.0.1:3000 REDIS_URL=redis://127.0.0.1:6379 SECRET_EXPIRY=604800 STORAGE_TYPE=redis EOF -msg_ok "Installed OTS" +msg_ok "Setup OTS" msg_info "Generating Universal SSL Certificate" mkdir -p /etc/ssl/ots $STD openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \ - -keyout /etc/ssl/ots/key.pem \ - -out /etc/ssl/ots/cert.pem \ - -subj "/CN=ots" + -keyout /etc/ssl/ots/key.pem \ + -out /etc/ssl/ots/cert.pem \ + -subj "/CN=ots" msg_ok "Certificate Generated" msg_info "Setting up nginx" @@ -82,7 +83,7 @@ After=network-online.target Requires=network-online.target [Service] -EnvironmentFile=/opt/ots/env +EnvironmentFile=/opt/ots/.env ExecStart=/opt/ots/ots Restart=Always RestartSecs=5