Compare commits

..
Author SHA1 Message Date
push-app-to-main[bot] 277941dc05 Add activepieces (ct) 2026-11-23 07:42:27 +00:00
4 changed files with 184 additions and 153 deletions

No files matched your search

+70
View File
@@ -0,0 +1,70 @@
#!/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/activepieces/activepieces
APP="Activepieces"
var_tags="${var_tags:-automation;workflow;ai}"
var_cpu="${var_cpu:-4}"
var_ram="${var_ram:-6144}"
var_disk="${var_disk:-12}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
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/activepieces ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "activepieces" "activepieces/activepieces"; then
msg_info "Stopping Activepieces"
systemctl stop activepieces activepieces-worker
msg_ok "Stopped Activepieces"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "activepieces" "activepieces/activepieces" "tarball"
NODE_VERSION="24" NODE_MODULE="$(jq -r '.packageManager' /opt/activepieces/package.json)" setup_nodejs
fetch_and_deploy_gh_release "deno" "denoland/deno" "prebuild" "v$(jq -r '.devDependencies.deno' /opt/activepieces/packages/server/engine/package.json)" "/usr/local/bin" "deno-$(arch_resolve "x86_64" "aarch64")-unknown-linux-gnu.zip"
msg_info "Building Activepieces"
cd /opt/activepieces
REDISMS_DISABLE_POSTINSTALL=1 $STD bun install --frozen-lockfile
$STD npx turbo run build --filter=web --filter=@activepieces/engine --filter=api --filter=worker
find dist/packages/web -name '*.map' -delete
rm -rf node_modules bun.lock packages/pieces/core packages/pieces/custom packages/web packages/cli packages/tests-e2e packages/ee
find packages/pieces/community -mindepth 1 -maxdepth 1 -type d ! -name slack ! -name square ! -name facebook-leads ! -name intercom ! -name microsoft-teams-bot -exec rm -rf {} +
node -e "const fs=require('fs');const p=JSON.parse(fs.readFileSync('package.json','utf8'));p.workspaces=p.workspaces.filter(w=>fs.existsSync(w.replace('/*','')));fs.writeFileSync('package.json',JSON.stringify(p,null,2))"
REDISMS_DISABLE_POSTINSTALL=1 $STD bun install --production
rm -rf ~/.bun/install/cache
msg_ok "Built Activepieces"
msg_info "Starting Activepieces"
systemctl start activepieces activepieces-worker
msg_ok "Started Activepieces"
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}${CL}"
-70
View File
@@ -1,70 +0,0 @@
#!/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/typecho/typecho
APP="Typecho"
var_tags="${var_tags:-blog;cms}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
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_user="${var_admin_user:-admin}"
export var_admin_pass="${var_admin_pass:-$(random_password)}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/typecho ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "typecho" "typecho/typecho"; then
msg_info "Stopping Typecho"
systemctl stop nginx
msg_ok "Stopped Typecho"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "typecho" "typecho/typecho" "prebuild" "latest" "/opt/typecho" "typecho.zip"
fetch_and_deploy_from_url "https://github.com/typecho/languages/releases/download/ci/langs.zip" "/opt/typecho_data/usr/langs"
msg_info "Linking Typecho Data"
rm -rf /opt/typecho/usr /opt/typecho/install.php
ln -s /opt/typecho_data/usr /opt/typecho/usr
ln -s /opt/typecho_data/config.inc.php /opt/typecho/config.inc.php
msg_ok "Linked Typecho Data"
msg_info "Starting Typecho"
systemctl start nginx
msg_ok "Started Typecho"
msg_ok "Updated successfully!"
echo -e "${INFO}${YW}Open http://${LOCAL_IP}/admin/ and confirm the database upgrade if Typecho asks for one${CL}"
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}${CL}"
echo -e "${INFO}${YW}Admin panel: http://${IP}/admin/${CL}"
echo -e "${INFO}${YW}Admin Username: ${var_admin_user}${CL}"
echo -e "${INFO}${YW}Admin Password: ${var_admin_pass}${CL}"
+114
View File
@@ -0,0 +1,114 @@
#!/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/activepieces/activepieces
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 \
poppler-utils \
redis-server
msg_ok "Installed Dependencies"
PG_VERSION="16" PG_MODULES="pgvector" setup_postgresql
PG_DB_NAME="activepieces" PG_DB_USER="activepieces" PG_DB_EXTENSIONS="vector" setup_postgresql_db
fetch_and_deploy_gh_release "activepieces" "activepieces/activepieces" "tarball"
NODE_VERSION="24" NODE_MODULE="$(jq -r '.packageManager' /opt/activepieces/package.json)" setup_nodejs
fetch_and_deploy_gh_release "deno" "denoland/deno" "prebuild" "v$(jq -r '.devDependencies.deno' /opt/activepieces/packages/server/engine/package.json)" "/usr/local/bin" "deno-$(arch_resolve "x86_64" "aarch64")-unknown-linux-gnu.zip"
msg_info "Building Activepieces"
cd /opt/activepieces
REDISMS_DISABLE_POSTINSTALL=1 $STD bun install --frozen-lockfile
$STD npx turbo run build --filter=web --filter=@activepieces/engine --filter=api --filter=worker
find dist/packages/web -name '*.map' -delete
rm -rf node_modules bun.lock packages/pieces/core packages/pieces/custom packages/web packages/cli packages/tests-e2e packages/ee
find packages/pieces/community -mindepth 1 -maxdepth 1 -type d ! -name slack ! -name square ! -name facebook-leads ! -name intercom ! -name microsoft-teams-bot -exec rm -rf {} +
node -e "const fs=require('fs');const p=JSON.parse(fs.readFileSync('package.json','utf8'));p.workspaces=p.workspaces.filter(w=>fs.existsSync(w.replace('/*','')));fs.writeFileSync('package.json',JSON.stringify(p,null,2))"
REDISMS_DISABLE_POSTINSTALL=1 $STD bun install --production
rm -rf ~/.bun/install/cache
msg_ok "Built Activepieces"
msg_info "Configuring Activepieces"
mkdir -p /opt/activepieces_data/cache
JWT_SECRET=$(openssl rand -hex 32)
cat <<EOF >/opt/activepieces_data/.env
NODE_ENV=production
AP_ENVIRONMENT=prod
AP_PORT=80
AP_FRONTEND_URL=http://${LOCAL_IP}
AP_API_KEY=$(openssl rand -hex 64)
AP_ENCRYPTION_KEY=$(openssl rand -hex 16)
AP_JWT_SECRET=${JWT_SECRET}
AP_WORKER_TOKEN=$(node -e "process.stdout.write(require('jsonwebtoken').sign({ id: require('crypto').randomUUID(), type: 'WORKER' }, process.argv[1], { expiresIn: '100y', keyid: '1', algorithm: 'HS256', issuer: 'activepieces' }))" "${JWT_SECRET}")
AP_POSTGRES_HOST=localhost
AP_POSTGRES_PORT=5432
AP_POSTGRES_DATABASE=activepieces
AP_POSTGRES_USERNAME=activepieces
AP_POSTGRES_PASSWORD=${PG_DB_PASS}
AP_REDIS_HOST=localhost
AP_REDIS_PORT=6379
AP_EXECUTION_MODE=UNSANDBOXED
AP_DENO_PATH=/usr/local/bin/deno
AP_CACHE_BASE_PATH=/opt/activepieces_data/cache
AP_CONFIG_PATH=/opt/activepieces_data
AP_TELEMETRY_ENABLED=false
EOF
chmod 600 /opt/activepieces_data/.env
msg_ok "Configured Activepieces"
msg_info "Creating Services"
cat <<EOF >/etc/systemd/system/activepieces.service
[Unit]
Description=Activepieces
After=network.target postgresql.service redis-server.service
Wants=activepieces-worker.service
[Service]
Type=simple
User=root
WorkingDirectory=/opt/activepieces
EnvironmentFile=/opt/activepieces_data/.env
Environment=AP_CONTAINER_TYPE=APP
ExecStart=/usr/bin/node --enable-source-maps packages/server/api/dist/src/bootstrap.js
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/activepieces-worker.service
[Unit]
Description=Activepieces Worker
After=activepieces.service
PartOf=activepieces.service
[Service]
Type=simple
User=root
WorkingDirectory=/opt/activepieces
EnvironmentFile=/opt/activepieces_data/.env
ExecStart=/usr/bin/node --enable-source-maps packages/server/worker/dist/src/bootstrap.js
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now activepieces activepieces-worker
msg_ok "Created Services"
motd_ssh
customize
cleanup_lxc
-83
View File
@@ -1,83 +0,0 @@
#!/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/typecho/typecho
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 \
nginx \
sqlite3
msg_ok "Installed Dependencies"
PHP_FPM="YES" setup_php
fetch_and_deploy_gh_release "typecho" "typecho/typecho" "prebuild" "latest" "/opt/typecho" "typecho.zip"
fetch_and_deploy_from_url "https://github.com/typecho/languages/releases/download/ci/langs.zip" "/opt/typecho/usr/langs"
var_admin_user="${var_admin_user:-admin}"
var_admin_pass="${var_admin_pass:-$(random_password 16)}"
msg_info "Installing Typecho"
mkdir -p /opt/typecho_data
mv /opt/typecho/usr /opt/typecho_data/usr
ln -s /opt/typecho_data/usr /opt/typecho/usr
cd /opt/typecho
TYPECHO_SITE_URL="http://${LOCAL_IP}" \
TYPECHO_LANG="en_US" \
TYPECHO_DB_ADAPTER="Pdo_SQLite" \
TYPECHO_DB_FILE="/opt/typecho_data/typecho.db" \
TYPECHO_USER_NAME="${var_admin_user}" \
TYPECHO_USER_PASSWORD="${var_admin_pass}" \
$STD php install.php
# PHP resolves symlinks in __FILE__, so a linked config has to name the root itself
sed -i "s|dirname(__FILE__)|'/opt/typecho'|" config.inc.php
mv config.inc.php /opt/typecho_data/config.inc.php
ln -s /opt/typecho_data/config.inc.php /opt/typecho/config.inc.php
rm -f install.php
# upstream defaults to UTC+8 and index.php URLs; the vhost below handles rewritten ones
sqlite3 /opt/typecho_data/typecho.db "UPDATE typecho_options SET value = '1' WHERE name = 'rewrite'; UPDATE typecho_options SET value = '0' WHERE name = 'timezone';"
chown -R www-data:www-data /opt/typecho_data
cat <<EOF >~/typecho.creds
Typecho Admin
URL: http://${LOCAL_IP}/admin/
Username: ${var_admin_user}
Password: ${var_admin_pass}
EOF
chmod 600 ~/typecho.creds
msg_ok "Installed Typecho"
msg_info "Configuring Nginx"
PHP_SOCK=$(get_php_fpm_socket)
cat <<EOF >/etc/nginx/sites-available/typecho
server {
listen 80 default_server;
server_name _;
root /opt/typecho;
index index.php;
client_max_body_size 128M;
location / {
try_files \$uri \$uri/ /index.php\$is_args\$args;
}
location ~ [^/]\.php(/|\$) {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:${PHP_SOCK};
}
}
EOF
nginx_enable_site "typecho"
msg_ok "Configured Nginx"
motd_ssh
customize
cleanup_lxc