test
This commit is contained in:
parent
3a0508677b
commit
c62a38a9d4
54
ct/ots.sh
54
ct/ots.sh
@ -20,35 +20,33 @@ color
|
|||||||
catch_errors
|
catch_errors
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -d /opt/ots ]]; then
|
if [[ ! -d /opt/ots ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
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
|
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
|
start
|
||||||
|
@ -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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
40
frontend/public/json/ots.json
Normal file
40
frontend/public/json/ots.json
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -15,27 +15,28 @@ update_os
|
|||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt-get install -y \
|
$STD apt-get install -y \
|
||||||
redis-server \
|
redis-server \
|
||||||
nginx \
|
nginx \
|
||||||
openssl
|
openssl
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Installing OTS"
|
|
||||||
fetch_and_deploy_gh_release "ots" "Luzifer/ots" "prebuild" "latest" "/opt/ots" "ots_linux_amd64.tgz"
|
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
|
LISTEN=127.0.0.1:3000
|
||||||
REDIS_URL=redis://127.0.0.1:6379
|
REDIS_URL=redis://127.0.0.1:6379
|
||||||
SECRET_EXPIRY=604800
|
SECRET_EXPIRY=604800
|
||||||
STORAGE_TYPE=redis
|
STORAGE_TYPE=redis
|
||||||
EOF
|
EOF
|
||||||
msg_ok "Installed OTS"
|
msg_ok "Setup OTS"
|
||||||
|
|
||||||
msg_info "Generating Universal SSL Certificate"
|
msg_info "Generating Universal SSL Certificate"
|
||||||
mkdir -p /etc/ssl/ots
|
mkdir -p /etc/ssl/ots
|
||||||
$STD openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \
|
$STD openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \
|
||||||
-keyout /etc/ssl/ots/key.pem \
|
-keyout /etc/ssl/ots/key.pem \
|
||||||
-out /etc/ssl/ots/cert.pem \
|
-out /etc/ssl/ots/cert.pem \
|
||||||
-subj "/CN=ots"
|
-subj "/CN=ots"
|
||||||
msg_ok "Certificate Generated"
|
msg_ok "Certificate Generated"
|
||||||
|
|
||||||
msg_info "Setting up nginx"
|
msg_info "Setting up nginx"
|
||||||
@ -82,7 +83,7 @@ After=network-online.target
|
|||||||
Requires=network-online.target
|
Requires=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
EnvironmentFile=/opt/ots/env
|
EnvironmentFile=/opt/ots/.env
|
||||||
ExecStart=/opt/ots/ots
|
ExecStart=/opt/ots/ots
|
||||||
Restart=Always
|
Restart=Always
|
||||||
RestartSecs=5
|
RestartSecs=5
|
||||||
|
Loading…
x
Reference in New Issue
Block a user