From 9f9244df328896e60f914fe65a3e520c38fbbb23 Mon Sep 17 00:00:00 2001 From: bunker-admin Date: Fri, 27 Feb 2026 09:14:09 -0700 Subject: [PATCH] Simplify SMS phone setup to single setup.sh script Replaced multi-step manual instructions (heredocs, printf, individual echo commands) with a single convenience script. Users now just clone the repo and run: bash setup.sh YOUR_API_KEY The script handles package install, key config, permissions, Termux:Boot, and starting the server. Updated both the admin wizard and MkDocs docs. Bunker Admin --- admin/src/pages/sms/SmsSetupPage.tsx | 138 ++++++++------------ campaign_connector | 2 +- mkdocs/docs/docs/admin/broadcast/sms.md | 159 +++++------------------- 3 files changed, 89 insertions(+), 210 deletions(-) diff --git a/admin/src/pages/sms/SmsSetupPage.tsx b/admin/src/pages/sms/SmsSetupPage.tsx index d1d87eb3..040734d3 100644 --- a/admin/src/pages/sms/SmsSetupPage.tsx +++ b/admin/src/pages/sms/SmsSetupPage.tsx @@ -300,12 +300,12 @@ export default function SmsSetupPage() { {/* Step 0: Phone Preparation */} {currentStep === 0 && ( - {/* Part 1: Install Apps */} + {/* Part 1: Install F-Droid Apps */} } - message="Step 1 — Install Apps on Android" + message="Step 1 — Install Apps from F-Droid" description={
@@ -315,56 +315,35 @@ export default function SmsSetupPage() {
The Play Store version of Termux is abandoned and incompatible with the API plugin. - If you have Termux from the Play Store, uninstall it first and reinstall from F-Droid. + If you have Termux from the Play Store, uninstall it first.
  1. Termux — terminal emulator for Android -
    Install from F-Droid (f-droid.org). If already installed from Play Store, uninstall it first. +
    Install from F-Droid (f-droid.org)
  2. - Termux:API — gives Termux access to SMS, contacts, battery, GPS -
    Also from F-Droid. Both apps must come from the same source or SMS commands won't work. + Termux:API — gives Termux access to SMS, contacts, battery +
    Also from F-Droid. Must be same source as Termux.
  3. - Tailscale — VPN mesh for stable IP addressing (recommended) -
    Install from Play Store. Creates a persistent 100.x.x.x IP so the server can always reach your phone. + Termux:Boot (optional) — auto-start server on phone reboot +
    Also from F-Droid. Open once after install to register. +
  4. +
  5. + Tailscale (recommended) — VPN mesh for stable IP addressing +
    Install from Play Store. Creates a persistent 100.x.x.x IP.
} /> - {/* Part 2: Termux Setup */} - } - message="Step 2 — Set Up Termux" - description={ -
- Open Termux on the phone and run each command (tap the copy icon): -
- - - - - -
- - Tap Allow when Android asks for SMS and Contacts permissions. - If you miss the prompt, go to Android Settings → Apps → Termux:API → Permissions. - -
- } - /> - - {/* Part 3: API Key */} - Step 3 — Generate & Set API Key + {/* Part 2: Generate API Key */} + Step 2 — Generate API Key - Generate a shared secret key. Both the server and phone use this to authenticate API requests. - Click the button below, then paste the key into Termux. + Generate a shared secret key. The setup script on the phone will use this to authenticate with the server. @@ -401,7 +380,7 @@ export default function SmsSetupPage() { message.success('Copied to clipboard'); }} > - Copy + Copy Key @@ -410,76 +389,67 @@ export default function SmsSetupPage() { {generatedKey} )} - - - Now run these in Termux on the phone: -
- - > ~/.bashrc`} /> -
} /> )} - {/* Part 4: Start the server */} + {/* Part 3: Run setup script */} {generatedKey && ( } - message="Step 4 — Start the SMS Server" + message="Step 3 — Run Setup on Phone" description={
- With the API key set, start the Flask server: + + Open Termux on the phone and run these two commands. + The setup script handles everything: installs packages, saves the key, requests permissions, + configures auto-start, and launches the server. +
- - + +
+ + The script will: + +
    +
  • Install Python, Flask, and termux-api
  • +
  • Save the API key to ~/.bashrc
  • +
  • Request SMS and Contacts permissions (tap Allow)
  • +
  • Set up Termux:Boot auto-start (if installed)
  • +
  • Start the server with the watchdog
  • +
- You should see output like: Termux SMS API Server Starting with the device IP and port 5001. + When done, note the Phone URL displayed (e.g. http://100.x.x.x:5001) — you'll need it in the next step. - To keep it running permanently: -
- -
- - Auto-start on phone reboot: - - Install Termux:Boot from F-Droid, then run these commands one at a time: - -
- - - - - -
- - Also disable battery optimization: Android Settings → Apps → Termux → Battery → Unrestricted. + + Also recommended: Disable battery optimization for Termux — Android Settings → Apps → Termux → Battery → Unrestricted.
} /> )} - {/* Access methods info */} - - You can run these commands on the phone via: -
    -
  • Directly on phone — open the Termux app and type commands
  • -
  • SSH — run sshd in Termux, then ssh -p 8022 phone-ip from your computer
  • -
  • scrcpy — mirror the phone screen to your computer via USB or WiFi
  • -
- - } - /> + {/* Already set up? */} + {generatedKey && ( + + If you've already set up the phone, you can update the server with: +
+ +
+ + } + /> + )}