Files
ProxmoxVEDHelperScripts/install/colanode-install.sh
MickLesk c744b10caa Add installers and CT templates for four apps
Add container templates (ct/) and install scripts (install/) plus metadata JSON entries for BunkerM, Colanode, Edit-Mind, and ExcaliDash. Each app includes an LXC template script with update routines, a corresponding installer that provisions dependencies, builds the app, configures services (systemd/nginx/supervisor), and example default environment/config. JSON metadata files register interface ports, recommended resources, documentation/website links, and notes for each app.
2026-05-12 21:09:00 +02:00

94 lines
2.3 KiB
Bash

#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
# Source: https://colanode.com/
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 \
redis-server \
nginx
msg_ok "Installed Dependencies"
PG_VERSION="17" PG_MODULES="pgvector" setup_postgresql
PG_DB_NAME="colanode_db" PG_DB_USER="colanode" setup_postgresql_db
NODE_VERSION="22" setup_nodejs
fetch_and_deploy_gh_release "colanode" "colanode/colanode" "tarball"
msg_info "Building Application"
cd /opt/colanode
$STD npm ci
$STD npm run build -w @colanode/core
$STD npm run build -w @colanode/crdt
$STD npm run build -w @colanode/server
$STD npm run build -w @colanode/client
$STD npm run build -w @colanode/ui
$STD npm run build -w @colanode/web
$STD npm prune --production
msg_ok "Built Application"
msg_info "Configuring Application"
mkdir -p /var/lib/colanode/storage /var/www/colanode
cp -r /opt/colanode/apps/web/dist/. /var/www/colanode/
cat <<EOF >/opt/colanode/.env
POSTGRES_URL=postgresql://${PG_DB_USER}:${PG_DB_PASS}@127.0.0.1:5432/${PG_DB_NAME}
REDIS_URL=redis://127.0.0.1:6379
NODE_ENV=production
EOF
msg_ok "Configured Application"
msg_info "Configuring Nginx"
cat <<EOF >/etc/nginx/sites-available/colanode
server {
listen 4000;
server_name _;
root /var/www/colanode;
index index.html;
location / {
try_files \$uri \$uri/ /index.html;
}
}
EOF
ln -sf /etc/nginx/sites-available/colanode /etc/nginx/sites-enabled/colanode
rm -f /etc/nginx/sites-enabled/default
systemctl reload nginx
msg_ok "Configured Nginx"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/colanode-server.service
[Unit]
Description=Colanode Server
After=network.target postgresql.service redis-server.service
Requires=postgresql.service redis-server.service
[Service]
Type=simple
User=root
WorkingDirectory=/opt/colanode
EnvironmentFile=/opt/colanode/.env
ExecStart=/usr/bin/node apps/server/dist/index.js
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now colanode-server
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc