Refactor SurrealDB: remove msg wrapper, remove creds file, add JSON

This commit is contained in:
CanbiZ (MickLesk)
2026-03-27 13:59:27 +01:00
parent 2543033369
commit 8fcc515303
2 changed files with 33 additions and 7 deletions

View File

@@ -13,11 +13,9 @@ setting_up_container
network_check
update_os
msg_info "Installing SurrealDB"
fetch_and_deploy_gh_release "surrealdb" "surrealdb/surrealdb" "prebuild" "latest" "/opt/surrealdb" "surreal-v*.linux-amd64.tgz"
chmod +x /opt/surrealdb/surreal
ln -sf /opt/surrealdb/surreal /usr/local/bin/surreal
msg_ok "Installed SurrealDB"
msg_info "Configuring SurrealDB"
mkdir -p /opt/surrealdb/data
@@ -25,11 +23,6 @@ SURREALDB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
cat <<EOF >/opt/surrealdb/.env
SURREALDB_PASS=${SURREALDB_PASS}
EOF
{
echo "SurrealDB Credentials"
echo "Username: root"
echo "Password: ${SURREALDB_PASS}"
} >>~/surrealdb.creds
msg_ok "Configured SurrealDB"
msg_info "Creating Service"

33
json/surrealdb.json Normal file
View File

@@ -0,0 +1,33 @@
{
"name": "SurrealDB",
"slug": "surrealdb",
"categories": [8],
"date_created": "2026-03-27",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 8000,
"documentation": "https://surrealdb.com/docs",
"website": "https://surrealdb.com",
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/surrealdb.webp",
"config_path": "/opt/surrealdb/.env",
"description": "SurrealDB is a scalable, distributed, collaborative, document-graph database for the realtime web, combining the best of relational, document, and graph databases.",
"install_methods": [
{
"type": "default",
"script": "ct/surrealdb.sh",
"resources": {
"cpu": 2,
"ram": 1024,
"hdd": 4,
"os": "Debian",
"version": "13"
}
}
],
"default_credentials": {
"username": "root",
"password": "auto-generated (see /opt/surrealdb/.env)"
},
"notes": []
}