Compare commits

..
Author SHA1 Message Date
push-app-to-main[bot] 56e7ff25e1 Add faraday (ct) 2026-11-19 18:38:40 +00:00
4 changed files with 169 additions and 137 deletions

No files matched your search

+65
View File
@@ -0,0 +1,65 @@
#!/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/infobyte/faraday
APP="Faraday"
var_tags="${var_tags:-security;vulnerability}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
export var_faraday_password="${var_faraday_password:-}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/faraday ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "faraday" "infobyte/faraday"; then
msg_info "Stopping Faraday"
systemctl stop faraday-beat faraday-worker faraday-server
msg_ok "Stopped Faraday"
PYTHON_VERSION="3.11" setup_uv
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "faraday" "infobyte/faraday" "tarball"
msg_info "Updating Faraday"
cd /opt/faraday
UV_PROJECT_ENVIRONMENT=/opt/faraday/venv $STD uv sync --frozen --no-dev --no-editable
FARADAY_HOME=/opt/faraday_data $STD venv/bin/faraday-manage migrate
msg_ok "Updated Faraday"
msg_info "Starting Faraday"
systemctl start faraday-server faraday-worker faraday-beat
msg_ok "Started Faraday"
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}:5985${CL}"
-72
View File
@@ -1,72 +0,0 @@
#!/usr/bin/env bash
# Engine comes from community-scripts/core; this repo only ships the scripts.
# A local core checkout wins (COMMUNITY_SCRIPTS_CORE_DIR, else a sibling ../core),
# so a fork or branch of core can be tested without editing this file.
_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: lukdz
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/pingdotgg/t3code
APP="T3Code"
var_tags="${var_tags:-ai;dev-tools}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-10}"
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 ! command -v t3 >/dev/null 2>&1; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Stopping Service"
systemctl stop t3code
msg_ok "Stopped Service"
msg_info "Updating T3 Code"
$STD npm install -g t3@latest
msg_ok "Updated T3 Code"
msg_info "Configuring T3 Code Service"
mkdir -p /etc/systemd/system/t3code.service.d
cat <<EOF >/etc/systemd/system/t3code.service.d/claude.conf
[Service]
# Allow Claude Full access mode as root inside the LXC.
Environment=IS_SANDBOX=1
EOF
systemctl daemon-reload
msg_ok "Configured T3 Code Service"
msg_info "Starting Service"
systemctl start t3code
msg_ok "Started Service"
msg_ok "Updated successfully!"
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}Pair a device using the QR code or URL below:${CL}"
pct exec "$CTID" -- env NODE_NO_WARNINGS=1 t3 pair --base-dir /opt/t3code --ttl 1h | grep -v "127.0.0.1"
echo -e ""
echo -e "${INFO}${YW}The pairing URL above expires after 1 hour. Generate a fresh one from the Proxmox host:${CL}"
echo -e "${TAB}${BGN}pct exec ${CTID} -- t3 pair --base-dir /opt/t3code${CL}"
+104
View File
@@ -0,0 +1,104 @@
#!/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/infobyte/faraday
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 \
libpq-dev \
libmagic1 \
redis-server
msg_ok "Installed Dependencies"
PG_VERSION="17" setup_postgresql
PG_DB_NAME="faraday" PG_DB_USER="faraday" PG_DB_CREDS_FILE="/dev/null" setup_postgresql_db
PYTHON_VERSION="3.11" setup_uv
fetch_and_deploy_gh_release "faraday" "infobyte/faraday" "tarball"
msg_info "Installing Faraday"
cd /opt/faraday
UV_PROJECT_ENVIRONMENT=/opt/faraday/venv $STD uv sync --frozen --no-dev --no-editable
msg_ok "Installed Faraday"
msg_info "Configuring Faraday"
FARADAY_PASSWORD="${var_faraday_password:-$(random_password)}"
mkdir -p /opt/faraday_data/.faraday/config
cat <<EOF >/opt/faraday_data/.faraday/config/server.ini
[faraday_server]
port = 5985
bind_address = 0.0.0.0
secret_key = $(random_password 32)
[database]
connection_string = postgresql+psycopg2://${PG_DB_USER}:${PG_DB_PASS}@localhost/${PG_DB_NAME}
EOF
cat <<EOF >/opt/faraday_data/.env
FARADAY_HOME=/opt/faraday_data
FARADAY_USER=faraday
FARADAY_PASSWORD=${FARADAY_PASSWORD}
EOF
chmod 600 /opt/faraday_data/.env /opt/faraday_data/.faraday/config/server.ini
FARADAY_HOME=/opt/faraday_data $STD venv/bin/faraday-manage create-tables
FARADAY_HOME=/opt/faraday_data $STD venv/bin/faraday-manage create-superuser --username faraday --email faraday@example.com --password "$FARADAY_PASSWORD"
msg_ok "Configured Faraday"
msg_info "Creating Services"
cat <<EOF >/etc/systemd/system/faraday-server.service
[Unit]
Description=Faraday Server
After=network.target postgresql.service redis-server.service
[Service]
Type=exec
Environment=FARADAY_HOME=/opt/faraday_data
ExecStart=/opt/faraday/venv/bin/faraday-server
Restart=always
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/faraday-worker.service
[Unit]
Description=Faraday Worker
After=network.target postgresql.service redis-server.service
[Service]
Type=exec
Environment=FARADAY_HOME=/opt/faraday_data
ExecStart=/opt/faraday/venv/bin/faraday-worker
Restart=always
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/faraday-beat.service
[Unit]
Description=Faraday Beat
After=network.target postgresql.service redis-server.service
[Service]
Type=exec
Environment=FARADAY_HOME=/opt/faraday_data
ExecStart=/opt/faraday/venv/bin/faraday-beat
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now faraday-server faraday-worker faraday-beat
msg_ok "Created Services"
motd_ssh
customize
cleanup_lxc
-65
View File
@@ -1,65 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: lukdz
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/pingdotgg/t3code
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 \
git \
build-essential \
bubblewrap
msg_ok "Installed Dependencies"
NODE_VERSION="24" setup_nodejs
msg_info "Installing T3 Code and Provider CLIs"
$STD npm install -g \
t3 \
@openai/codex \
@anthropic-ai/claude-code \
@xai-official/grok \
opencode-ai
msg_ok "Installed T3 Code and Provider CLIs"
fetch_and_deploy_gh_release "gh" "cli/cli" "binary"
msg_info "Creating Service"
mkdir -p /opt/t3code
cat <<EOF >/etc/systemd/system/t3code.service
[Unit]
Description=T3 Code Server
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=root
Environment=PATH=/usr/local/bin:/usr/bin:/bin
Environment=T3CODE_TELEMETRY_ENABLED=false
# Allow Claude Full access mode as root inside the LXC.
Environment=IS_SANDBOX=1
WorkingDirectory=/opt/t3code
ExecStart=/usr/bin/t3 serve --host 0.0.0.0 --base-dir /opt/t3code
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now t3code
sleep 5
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc