diff --git a/ct/usesend.sh b/ct/usesend.sh deleted file mode 100644 index a223652118..0000000000 --- a/ct/usesend.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env bash -_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main" -_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/DevScripts/raw/main/LICENSE -# Source: https://github.com/usesend/useSend - -APP="useSend" -var_tags="${var_tags:-email;smtp;newsletter}" -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}" -var_testurl="${var_testurl:-https://github.com/community-scripts/DevScripts/issues/2403}" - -export var_github_id="${var_github_id:-}" -export var_github_secret="${var_github_secret:-}" - -header_info "$APP" -variables -color -catch_errors - -function update_script() { - header_info - check_container_storage - check_container_resources - - if [[ ! -d /opt/usesend ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - if check_for_gh_release "usesend" "usesend/useSend"; then - msg_info "Stopping useSend" - systemctl stop usesend usesend-smtp - msg_ok "Stopped useSend" - - CLEAN_INSTALL=1 fetch_and_deploy_gh_release "usesend" "usesend/useSend" "tarball" - NODE_VERSION="22" NODE_MODULE="pnpm@$(jq -r '.packageManager | split("@")[1]' /opt/usesend/package.json)" setup_nodejs - - msg_info "Building useSend" - cd /opt/usesend - PUPPETEER_SKIP_DOWNLOAD=true $STD pnpm install --frozen-lockfile --filter "web..." --filter smtp-server - $STD pnpm --filter web db:generate - SKIP_ENV_VALIDATION=true DOCKER_OUTPUT=1 NEXT_TELEMETRY_DISABLED=1 NEXT_PUBLIC_APP_VERSION="v$(cat ~/.usesend)" $STD pnpm --filter "web..." --filter smtp-server build - cp -r apps/web/.next/static apps/web/.next/standalone/apps/web/.next/ - cp -r apps/web/public apps/web/.next/standalone/apps/web/ - rm -rf apps/web/.next/cache - msg_ok "Built useSend" - - msg_info "Migrating useSend Database" - set -a && source /opt/usesend_data/.env && set +a - $STD pnpm --filter web db:migrate-deploy - msg_ok "Migrated useSend Database" - - msg_info "Starting useSend" - systemctl start usesend usesend-smtp - msg_ok "Started useSend" - 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}:3000${CL}" -echo -e "${INFO}${YW}Login needs a GitHub OAuth app with the callback URL http://${IP}:3000/api/auth/callback/github${CL}" -echo -e "${INFO}${YW}If you skipped it, set GITHUB_ID/GITHUB_SECRET in /opt/usesend_data/.env, then run: systemctl enable --now usesend usesend-smtp${CL}" diff --git a/install/usesend-install.sh b/install/usesend-install.sh deleted file mode 100644 index 2ecea1787f..0000000000 --- a/install/usesend-install.sh +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2021-2026 community-scripts ORG -# Author: MickLesk (CanbiZ) -# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE -# Source: https://github.com/usesend/useSend - -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 redis-server -msg_ok "Installed Dependencies" - -PG_VERSION="16" setup_postgresql -PG_DB_NAME="usesend" PG_DB_USER="usesend" setup_postgresql_db - -fetch_and_deploy_gh_release "usesend" "usesend/useSend" "tarball" -NODE_VERSION="22" NODE_MODULE="pnpm@$(jq -r '.packageManager | split("@")[1]' /opt/usesend/package.json)" setup_nodejs - -msg_info "Building useSend" -cd /opt/usesend -# Puppeteer only comes with the docs tooling (Mintlify) in the root devDependencies; useSend never runs a browser -PUPPETEER_SKIP_DOWNLOAD=true $STD pnpm install --frozen-lockfile --filter "web..." --filter smtp-server -$STD pnpm --filter web db:generate -SKIP_ENV_VALIDATION=true DOCKER_OUTPUT=1 NEXT_TELEMETRY_DISABLED=1 NEXT_PUBLIC_APP_VERSION="v$(cat ~/.usesend)" $STD pnpm --filter "web..." --filter smtp-server build -cp -r apps/web/.next/static apps/web/.next/standalone/apps/web/.next/ -cp -r apps/web/public apps/web/.next/standalone/apps/web/ -rm -rf apps/web/.next/cache -msg_ok "Built useSend" - -if [[ -t 0 && ( -z "${var_github_id:-}" || -z "${var_github_secret:-}" ) ]]; then - echo -e "${INFO}${YW} useSend has no local accounts; logging in needs a GitHub OAuth app.${CL}" - echo -e "${TAB}Create one at https://github.com/settings/developers with this callback URL:" - echo -e "${TAB}${BGN}http://${LOCAL_IP}:3000/api/auth/callback/github${CL}" - if [[ -z "${var_github_id:-}" ]]; then - read -t 300 -rp "${TAB3}GitHub Client ID (Enter to set it up later): " var_github_id || true - fi - if [[ -n "${var_github_id:-}" && -z "${var_github_secret:-}" ]]; then - read -t 300 -rsp "${TAB3}GitHub Client Secret: " var_github_secret || true - echo - fi -fi - -msg_info "Configuring useSend" -mkdir -p /opt/usesend_data -cat </opt/usesend_data/.env -PORT=3000 -NEXTAUTH_URL=http://${LOCAL_IP}:3000 -NEXTAUTH_SECRET=$(openssl rand -base64 32) -DATABASE_URL=postgresql://usesend:${PG_DB_PASS}@localhost:5432/usesend -REDIS_URL=redis://localhost:6379 -SMTP_HOST=${LOCAL_IP} -SMTP_USER=usesend -# Sending goes through AWS SES: an IAM user with AmazonSESFullAccess and AmazonSNSFullAccess. -# The SES region and callback URL are set in the web UI under Admin after the first login. -AWS_DEFAULT_REGION=us-east-1 -#AWS_ACCESS_KEY_ID= -#AWS_SECRET_ACCESS_KEY= -EOF -if [[ -n "${var_github_id:-}" && -n "${var_github_secret:-}" ]]; then - cat <>/opt/usesend_data/.env -GITHUB_ID=${var_github_id} -GITHUB_SECRET=${var_github_secret} -EOF -else - cat <>/opt/usesend_data/.env -# useSend has no local accounts. Create a GitHub OAuth app with the callback URL -# http://${LOCAL_IP}:3000/api/auth/callback/github, fill in the two lines below -# (or GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET, which needs an HTTPS domain), then run: -# systemctl enable --now usesend usesend-smtp -#GITHUB_ID= -#GITHUB_SECRET= -EOF -fi -chmod 600 /opt/usesend_data/.env -create_self_signed_cert "usesend" -msg_ok "Configured useSend" - -msg_info "Migrating useSend Database" -set -a && source /opt/usesend_data/.env && set +a -$STD pnpm --filter web db:migrate-deploy -msg_ok "Migrated useSend Database" - -msg_info "Creating useSend Services" -cat </etc/systemd/system/usesend.service -[Unit] -Description=useSend -After=network.target postgresql.service redis-server.service -Requires=postgresql.service redis-server.service - -[Service] -Type=simple -User=root -WorkingDirectory=/opt/usesend/apps/web/.next/standalone -EnvironmentFile=/opt/usesend_data/.env -ExecStart=/usr/bin/node apps/web/server.js -Restart=on-failure -RestartSec=5 - -[Install] -WantedBy=multi-user.target -EOF -cat </etc/systemd/system/usesend-smtp.service -[Unit] -Description=useSend SMTP Proxy -After=network.target usesend.service - -[Service] -Type=simple -User=root -WorkingDirectory=/opt/usesend/apps/smtp-server -Environment=USESEND_BASE_URL=http://127.0.0.1:3000 -Environment=SMTP_AUTH_USERNAME=usesend -Environment=USESEND_API_KEY_PATH=/etc/ssl/usesend/usesend.key -Environment=USESEND_API_CERT_PATH=/etc/ssl/usesend/usesend.crt -ExecStart=/usr/bin/node dist/server.js -Restart=on-failure -RestartSec=5 - -[Install] -WantedBy=multi-user.target -EOF -if [[ -n "${var_github_id:-}" && -n "${var_github_secret:-}" ]]; then - systemctl enable -q --now usesend usesend-smtp -fi -msg_ok "Created useSend Services" - -motd_ssh -customize -cleanup_lxc diff --git a/json/usesend.json b/json/usesend.json deleted file mode 100644 index 9fea339226..0000000000 --- a/json/usesend.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "useSend", - "slug": "usesend", - "categories": [ - 18 - ], - "date_created": "2026-10-07", - "type": "ct", - "platforms": ["pve"], - "updateable": true, - "privileged": false, - "architectures": [ - "amd64", - "arm64" - ], - "interface_port": 3000, - "documentation": "https://docs.usesend.com/", - "website": "https://usesend.com/", - "repository": "https://github.com/usesend/useSend", - "logo": "https://cdn.jsdelivr.net/gh/usesend/useSend@main/apps/web/public/logo-squircle.png", - "description": "useSend is an open-source email sending platform and self-hosted alternative to Resend, SendGrid or Postmark. It sends transactional email through a REST API, SDKs or SMTP and marketing campaigns from a visual editor, with tracking, bounce handling and webhooks, delivered through Amazon SES.", - "install_methods": [ - { - "type": "default", - "script": "ct/usesend.sh", - "config_path": "/opt/usesend_data/.env", - "resources": { - "cpu": 2, - "ram": 4096, - "hdd": 10, - "os": "Debian", - "version": "13" - } - } - ], - "default_credentials": { - "username": null, - "password": null - }, - "app_vars": [ - { - "name": "var_github_id", - "label": "GitHub OAuth Client ID", - "type": "text", - "help": "From a GitHub OAuth app whose callback URL is http://:3000/api/auth/callback/github. Leave empty to configure it after the install; useSend starts once it is set." - }, - { - "name": "var_github_secret", - "label": "GitHub OAuth Client Secret", - "type": "password", - "secret": true - } - ], - "notes": [ - { - "text": "Sign-in is GitHub OAuth only, and the first sign-in claims the instance. Anyone with a GitHub account who reaches the port can do that, so sign in right after setting up OAuth.", - "type": "warning" - }, - { - "text": "Sending needs Amazon SES: set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in /opt/usesend_data/.env, then add SES under Admin with a callback URL reachable from the internet.", - "type": "info" - }, - { - "text": "Behind a domain or after an IP change, update NEXTAUTH_URL in /opt/usesend_data/.env and the OAuth callback URL, then restart usesend.", - "type": "info" - } - ] -}