From 21ba802667e65a1837f17141c1eba90cc2d15e0e Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 07:57:07 +0000 Subject: [PATCH] Add teable (ct) --- ct/headers/teable | 6 +++ ct/teable.sh | 82 ++++++++++++++++++++++++++++++++++ install/teable-install.sh | 94 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 182 insertions(+) create mode 100644 ct/headers/teable create mode 100644 ct/teable.sh create mode 100644 install/teable-install.sh diff --git a/ct/headers/teable b/ct/headers/teable new file mode 100644 index 000000000..527e78860 --- /dev/null +++ b/ct/headers/teable @@ -0,0 +1,6 @@ + ______ __ __ + /_ __/__ ____ _/ /_ / /__ + / / / _ \/ __ `/ __ \/ / _ \ + / / / __/ /_/ / /_/ / / __/ +/_/ \___/\__,_/_.___/_/\___/ + diff --git a/ct/teable.sh b/ct/teable.sh new file mode 100644 index 000000000..de253b80b --- /dev/null +++ b/ct/teable.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: community-scripts +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/teableio/teable + +APP="Teable" +var_tags="${var_tags:-database;no-code;spreadsheet}" +var_cpu="${var_cpu:-4}" +var_ram="${var_ram:-10240}" +var_disk="${var_disk:-25}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -d /opt/teable ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "teable" "teableio/teable"; then + msg_info "Stopping Service" + systemctl stop teable + msg_ok "Stopped Service" + + msg_info "Backing up Configuration" + cp /opt/teable/.env /opt/teable.env.bak + msg_ok "Backed up Configuration" + + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "teable" "teableio/teable" "tarball" + + msg_info "Restoring Configuration" + mv /opt/teable.env.bak /opt/teable/.env + msg_ok "Restored Configuration" + + msg_info "Rebuilding Teable" + cd /opt/teable + TEABLE_VERSION=$(cat ~/.teable) + echo "NEXT_PUBLIC_BUILD_VERSION=\"${TEABLE_VERSION}\"" >>apps/nextjs-app/.env + export HUSKY=0 + export NODE_OPTIONS="--max-old-space-size=8192" + $STD pnpm install --frozen-lockfile + $STD pnpm -F @teable/db-main-prisma prisma-generate --schema ./prisma/postgres/schema.prisma + NODE_ENV=production NEXT_BUILD_ENV_TYPECHECK=false \ + $STD pnpm -r --filter '!playground' run build + msg_ok "Rebuilt Teable" + + msg_info "Running Database Migrations" + source /opt/teable/.env + $STD pnpm -F @teable/db-main-prisma prisma-migrate deploy --schema ./prisma/postgres/schema.prisma + msg_ok "Ran Database Migrations" + + msg_info "Starting Service" + systemctl start teable + msg_ok "Started Service" + msg_ok "Updated successfully!" + else + msg_ok "No update available." + 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 "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/install/teable-install.sh b/install/teable-install.sh new file mode 100644 index 000000000..203cd5d85 --- /dev/null +++ b/install/teable-install.sh @@ -0,0 +1,94 @@ +#!/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/teableio/teable + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y \ + build-essential \ + python3 \ + git +msg_ok "Installed Dependencies" + +NODE_VERSION="24" NODE_MODULE="pnpm" setup_nodejs +PG_VERSION="16" setup_postgresql +PG_DB_NAME="teable" PG_DB_USER="teable" setup_postgresql_db + +fetch_and_deploy_gh_release "teable" "teableio/teable" "tarball" + +msg_info "Setting up Teable" +cd /opt/teable +TEABLE_VERSION=$(cat ~/.teable) +echo "NEXT_PUBLIC_BUILD_VERSION=\"${TEABLE_VERSION}\"" >>apps/nextjs-app/.env +export HUSKY=0 +export NODE_OPTIONS="--max-old-space-size=8192" +$STD pnpm install --frozen-lockfile +$STD pnpm -F @teable/db-main-prisma prisma-generate --schema ./prisma/postgres/schema.prisma +msg_ok "Set up Teable" + +msg_info "Building Teable" +NODE_ENV=production NEXT_BUILD_ENV_TYPECHECK=false \ + $STD pnpm -r --filter '!playground' run build +msg_ok "Built Teable" + +msg_info "Running Database Migrations" +PRISMA_DATABASE_URL="postgresql://teable:${PG_DB_PASS}@localhost:5432/teable?schema=public" \ + $STD pnpm -F @teable/db-main-prisma prisma-migrate deploy --schema ./prisma/postgres/schema.prisma +msg_ok "Ran Database Migrations" + +msg_info "Configuring Teable" +mkdir -p /opt/teable/.assets /opt/teable/.temporary +SECRET_KEY=$(openssl rand -base64 32) +cat </opt/teable/.env +PRISMA_DATABASE_URL=postgresql://teable:${PG_DB_PASS}@localhost:5432/teable?schema=public&statement_cache_size=1 +PUBLIC_ORIGIN=http://${LOCAL_IP}:3000 +SECRET_KEY=${SECRET_KEY} +PORT=3000 +NODE_ENV=production +NEXT_TELEMETRY_DISABLED=1 +BACKEND_CACHE_PROVIDER=sqlite +BACKEND_CACHE_SQLITE_URI=sqlite:///opt/teable/.assets/.cache.db +NEXTJS_DIR=apps/nextjs-app +EOF +ln -sf /opt/teable /app +rm -rf /opt/teable/static +if [ -d "/opt/teable/apps/nestjs-backend/static/static" ]; then + ln -sf /opt/teable/apps/nestjs-backend/static/static /opt/teable/static +else + ln -sf /opt/teable/apps/nestjs-backend/static /opt/teable/static +fi +msg_ok "Configured Teable" + +msg_info "Creating Service" +cat </etc/systemd/system/teable.service +[Unit] +Description=Teable +After=network.target postgresql.service + +[Service] +Type=simple +WorkingDirectory=/opt/teable +EnvironmentFile=/opt/teable/.env +ExecStart=/usr/bin/node apps/nestjs-backend/dist/index.js +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now teable +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc