This commit is contained in:
CanbiZ 2025-08-03 19:54:15 +02:00
parent 3a0508677b
commit c62a38a9d4
4 changed files with 77 additions and 78 deletions

View File

@ -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

View File

@ -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"
}
]
}

View File

@ -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"
}
]
}

View File

@ -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 <<EOF >/opt/ots/env
msg_info "Setup OTS"
cat <<EOF >/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