Compare commits

...
Author SHA1 Message Date
push-app-to-main[bot] a96a736ffd Add trailbase (ct) 2026-11-13 07:41:57 +00:00
2 changed files with 119 additions and 0 deletions

No files matched your search

+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/trailbaseio/trailbase
APP="TrailBase"
var_tags="${var_tags:-backend;database;api}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
export var_admin_email="${var_admin_email:-}"
export var_admin_pass="${var_admin_pass:-}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/trailbase ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "trailbase" "trailbaseio/trailbase"; then
msg_info "Stopping TrailBase"
systemctl stop trailbase
msg_ok "Stopped TrailBase"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "trailbase" "trailbaseio/trailbase" "prebuild" "latest" "/opt/trailbase" "trailbase_v*_$(arch_resolve "x86_64" "aarch64")_linux.zip"
msg_info "Starting TrailBase"
systemctl start trailbase
msg_ok "Started TrailBase"
msg_ok "Updated successfully!"
fi
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 "${GATEWAY}${BGN}http://${IP}:4000/_/admin/${CL}"
echo -e "${INFO}${YW}Admin login: /opt/trailbase_data/.env (inside the container)${CL}"
+59
View File
@@ -0,0 +1,59 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/trailbaseio/trailbase
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
fetch_and_deploy_gh_release "trailbase" "trailbaseio/trailbase" "prebuild" "latest" "/opt/trailbase" "trailbase_v*_$(arch_resolve "x86_64" "aarch64")_linux.zip"
msg_info "Configuring TrailBase"
ADMIN_EMAIL="${var_admin_email:-admin@localhost}"
ADMIN_PASS="${var_admin_pass:-$(random_password)}"
mkdir -p /opt/trailbase_data
cat <<EOF >/opt/trailbase_data/.env
DEPOT=/opt/trailbase_data/traildepot
ADDRESS=0.0.0.0:4000
PUBLIC_URL=http://${LOCAL_IP}:4000
TRAILBASE_ADMIN_EMAIL=${ADMIN_EMAIL}
TRAILBASE_ADMIN_PASSWORD=${ADMIN_PASS}
EOF
chmod 600 /opt/trailbase_data/.env
# The first CLI call creates the depot and the admin user admin@localhost
$STD /opt/trailbase/trail --depot /opt/trailbase_data/traildepot user change-password admin@localhost "$ADMIN_PASS"
if [[ "$ADMIN_EMAIL" != "admin@localhost" ]]; then
$STD /opt/trailbase/trail --depot /opt/trailbase_data/traildepot user change-email admin@localhost "$ADMIN_EMAIL"
fi
msg_ok "Configured TrailBase"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/trailbase.service
[Unit]
Description=TrailBase
After=network.target
[Service]
Type=simple
WorkingDirectory=/opt/trailbase_data
EnvironmentFile=/opt/trailbase_data/.env
ExecStart=/opt/trailbase/trail run
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now trailbase
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc