Compare commits

..

3 Commits

Author SHA1 Message Date
goyban 468111a52a Remove allowed_users.txt from tracking, add local/umbrel mode, UMBREL_IP support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 20:35:11 +00:00
goyban 0c5c1589b8 Add local/umbrel mode, rename containers to telegtrum, revert to named volumes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 18:02:17 +00:00
goyban e6f86843df Initial commit: Electrum Telegram wallet bot with Tor support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 16:44:21 +00:00
6 changed files with 71 additions and 12 deletions
+5
View File
@@ -3,3 +3,8 @@ ELECTRUM_VERSION=4.7.2
# Telegram bot token from @BotFather # Telegram bot token from @BotFather
TELEGRAM_BOT_TOKEN=your_bot_token_here TELEGRAM_BOT_TOKEN=your_bot_token_here
# Local / Umbrel mode only: IP address of your Umbrel node.
# umbrel.local will NOT resolve inside the container — use the actual IP.
# Example: UMBREL_IP=192.168.1.100
UMBREL_IP=
+1
View File
@@ -1,3 +1,4 @@
.env .env
allowed_users.txt
*.pyc *.pyc
__pycache__/ __pycache__/
+56
View File
@@ -50,6 +50,7 @@ TELEGRAM_BOT_TOKEN=your_bot_token_here
### 3. Add your Telegram user ID to the allowed users list ### 3. Add your Telegram user ID to the allowed users list
```bash ```bash
cp allowed_users.txt.example allowed_users.txt
nano allowed_users.txt nano allowed_users.txt
``` ```
@@ -82,6 +83,61 @@ You should see `Electrum daemon started. Launching bot...` followed by the bot s
--- ---
## Local / Umbrel Mode
Use this mode to connect to your own Electrum server running on Umbrel (or any local node) on your home network.
> **Note:** `umbrel.local` does not resolve inside Docker containers — mDNS is host-only. Use the actual **IP address** of your Umbrel device (e.g. `192.168.1.100`).
### Setup
```bash
cp .env.example .env
nano .env
```
Fill in `TELEGRAM_BOT_TOKEN` and set your Umbrel's IP:
```
UMBREL_IP=192.168.1.100
```
```bash
cp allowed_users.txt.example allowed_users.txt
nano allowed_users.txt
```
### Start
```bash
docker compose -f docker-compose.local.yml up -d --build
```
### How it works
On first start, the entrypoint writes `./electrum-data/config` with:
```json
{
"auto_connect": false,
"enable_proxy": false,
"oneserver": true,
"server": "192.168.1.100:50001:t"
}
```
If the config file already exists it is left untouched, so manual edits survive restarts.
> **If the connection doesn't work:** check `./electrum-data/config` after the first run and make sure the server string still ends in `:t` (TCP). Electrum may rewrite it to `:s` (SSL) on first connect. If it did, stop the container, change it back to `:t`, and restart.
### Check logs
```bash
docker compose -f docker-compose.local.yml logs -f
```
---
## Tor Mode ## Tor Mode
Tor mode runs Electrum through the Tor network. It uses a separate Docker Compose file and Dockerfile so the standard setup is not affected. Tor mode runs Electrum through the Tor network. It uses a separate Docker Compose file and Dockerfile so the standard setup is not affected.
-10
View File
@@ -1,10 +0,0 @@
# Allowed Telegram user IDs
# Format: userid, comment
# One user per line. Lines starting with # are ignored.
#
# Example:
# 123456789, Alice (admin)
# 987654321, Bob
69027304, Me (Goyban)
85794988, Momo
8031636275, TheBaaaaan
+5
View File
@@ -0,0 +1,5 @@
# Add one Telegram user per line in the format: userid, Name
# Find your user ID by messaging @userinfobot on Telegram.
# Example:
# 123456789, Alice
# 987654321, Bob
+4 -2
View File
@@ -1,17 +1,19 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
: "${UMBREL_IP:?UMBREL_IP is not set. Add it to your .env file (e.g. UMBREL_IP=192.168.1.100)}"
mkdir -p /root/.electrum/wallets mkdir -p /root/.electrum/wallets
CONFIG="/root/.electrum/config" CONFIG="/root/.electrum/config"
if [ ! -f "$CONFIG" ]; then if [ ! -f "$CONFIG" ]; then
echo "Writing default config..." echo "Writing default config..."
cat > "$CONFIG" <<'EOF' cat > "$CONFIG" <<EOF
{ {
"auto_connect": false, "auto_connect": false,
"enable_proxy": false, "enable_proxy": false,
"oneserver": true, "oneserver": true,
"server": "umbrel.local:50001:t" "server": "${UMBREL_IP}:50001:t"
} }
EOF EOF
fi fi