================================================================================ MATTERMOST LOCAL API - QUICK SETUP GUIDE ================================================================================ ๐ŸŽฏ **SIMPLE SSH-BASED SOLUTION** Instead of complex web routing, this runs a LOCAL API on your Mattermost server that uses SSH to retrieve onion addresses from the VPS. ================================================================================ SETUP STEPS ================================================================================ ๐Ÿ“ฆ **1. ON YOUR MATTERMOST SERVER:** mkdir ~/btcpay-api cd ~/btcpay-api # Copy files (adjust paths for your environment): cp /path/to/mattermost_local_api.js ./ cp /path/to/mattermost-local-package.json ./package.json cp /path/to/vps_hardening_key ./ # Install dependencies: npm install # Fix SSH key permissions: chmod 600 ./vps_hardening_key ๐Ÿ”ง **2. UPDATE CONFIGURATION:** Edit mattermost_local_api.js and update: ssh_key_path: '/home/your-user/btcpay-api/vps_hardening_key' ๐Ÿš€ **3. START THE API:** node mattermost_local_api.js ๐Ÿ“ฑ **4. CONFIGURE MATTERMOST SLASH COMMAND:** System Console โ†’ Integrations โ†’ Slash Commands โ†’ Add Slash Command: Command: /btcpay URL: http://localhost:3333/btcpay Method: POST Token: dr7gz6xwmt8qjg71wxcqjwqz1r ================================================================================ USAGE ================================================================================ ๐Ÿ’ฌ **IN MATTERMOST:** /btcpay โ†’ Get onion addresses /btcpay status โ†’ Get system status /btcpay help โ†’ Show commands ๐Ÿ“ค **EXAMPLE RESPONSE:** ## ๐Ÿง… BTCPay Tor Onion Addresses ๐ŸŒ Domain: https://thebankofdebbie.giize.com ๐Ÿง… Tor Hidden Services: โ€ข BTCPay Server: gs76yqhlb4oysidnnswfoigxtwz3kmlmz4ekp2r6knmerpvsjdtbpxyd.onion โ€ข Bitcoin P2P: p4gve626jjn73ia35ikr7zhnmwknokrzv2eb2gfbqlytlgbckhaeibyd.onion ๐Ÿ” Access Methods: โ€ข Clearnet: https://thebankofdebbie.giize.com โ€ข Tor Browser: http://gs76yqhlb4oysidnnswfoigxtwz3kmlmz4ekp2r6knmerpvsjdtbpxyd.onion ๐Ÿ“… Retrieved: 2025-09-10 17:25:30 ๐Ÿ‘ค Requested by: bankofdebbie ================================================================================ SECURITY ================================================================================ โœ… **SECURE DESIGN:** - Local API only (localhost:3333) - SSH key authentication to VPS - No VPS ports exposed for webhook - Token validation for Mattermost - On-demand connections only โŒ **NO PERSISTENT CONNECTIONS:** - No permanent SSH tunnels - No exposed VPS webhook ports - No authentication issues - Clean, simple architecture ================================================================================ TESTING ================================================================================ ๐Ÿงช **TEST COMMANDS:** # Test SSH connectivity: curl http://localhost:3333/test # Test health: curl http://localhost:3333/health # Test Mattermost webhook: curl -X POST http://localhost:3333/btcpay -H "Content-Type: application/json" -d '{"token":"dr7gz6xwmt8qjg71wxcqjwqz1r","user_name":"bankofdebbie","text":"onion"}' ================================================================================ FINAL RESULT ================================================================================ ๐ŸŽฏ **PERFECT SOLUTION:** - No complex nginx routing - No VPS web services - No authentication issues - Simple SSH-based retrieval - Secure localhost-only API - Clean Mattermost integration ๐Ÿš€ **READY TO USE!** Your BTCPay Server with Tor is fully operational. Your Mattermost bot can now retrieve onion addresses securely via SSH. No exposed ports, maximum security maintained. ================================================================================