- db/db.go: Add write-time username sync in AddLog to prevent duplicate leaderboard entries when users change display names. Revert correlated subqueries back to GROUP BY user_id, username (simpler approach). - db/db.go: Early return in onMessageCreate if bot already reacted (prevents duplicate emoji reactions on Discord reconnection). - bot/bot.go: Add /version slash command with build version injection. - main.go: Add version variable with ldflags support. - Makefile: Add dns-fix, test, vet, build-native, pg-*, boot targets. Prepend test+vet to deploy pipeline. Add version ldflags to build. - db/migrations/002_fix_usernames.sql: One-time SQL to backfill old usernames. - scripts/fix-jail-dns.sh: Script to update jail resolv.conf from 8.8.8.8 to reachable nameservers (1.1.1.1, 9.9.9.9, 172.16.0.1). Signed-off-by: Blake Ridgway <blake@blakeridgway.com>
33 lines
740 B
Bash
33 lines
740 B
Bash
#!/bin/sh
|
|
# Fix DNS for the cyclingbot jail.
|
|
# The jail's resolv.conf currently points to 8.8.8.8 which is unreachable
|
|
# from the 172.16.0.x network. Replace with reachable nameservers.
|
|
#
|
|
# Usage: sh scripts/fix-jail-dns.sh
|
|
# or: ssh root@172.16.0.101 "sh -s" < scripts/fix-jail-dns.sh
|
|
|
|
JAIL_ROOT="/jails/cyclingbot"
|
|
RESOLV_CONF="${JAIL_ROOT}/etc/resolv.conf"
|
|
|
|
if [ ! -f "$RESOLV_CONF" ]; then
|
|
echo "Error: $RESOLV_CONF not found (is the jail running?)"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Current contents:"
|
|
cat "$RESOLV_CONF"
|
|
echo ""
|
|
|
|
cat > "$RESOLV_CONF" << 'EOF'
|
|
nameserver 1.1.1.1
|
|
nameserver 9.9.9.9
|
|
nameserver 172.16.0.1
|
|
search cassville.internal
|
|
EOF
|
|
|
|
echo "Updated contents:"
|
|
cat "$RESOLV_CONF"
|
|
echo ""
|
|
echo "DNS configuration updated."
|
|
|