Skip to content

Commit e1dcced

Browse files
committed
Add droplet deployment scripts for IRC servers
- deploy-9rl.sh: Deployment script for US hub server - deploy-1eu.sh: Deployment script for EU leaf server - quick-deploy.sh: Helper script to detect and run appropriate deployment - Includes Tailscale setup and Docker container configuration
1 parent a38441a commit e1dcced

File tree

3 files changed

+173
-0
lines changed

3 files changed

+173
-0
lines changed

deploy-1eu.sh

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
# ABOUTME: Deployment script for magnet-1eu IRC server on DigitalOcean droplet
3+
# ABOUTME: Builds containers and runs Solanum IRCd with Tailscale networking
4+
5+
set -e
6+
7+
echo "Starting deployment of magnet-1eu IRC server..."
8+
9+
# Wait for Docker to be ready (from user-data script)
10+
while ! docker info > /dev/null 2>&1; do
11+
echo "Waiting for Docker to be ready..."
12+
sleep 5
13+
done
14+
15+
echo "Docker is ready. Proceeding with deployment..."
16+
17+
# Clone repository
18+
cd /opt
19+
if [ ! -d "neodynium" ]; then
20+
git clone https://github.com/perl-irc/neodynium.git
21+
fi
22+
cd neodynium
23+
git checkout digitalocean-migration
24+
git pull
25+
26+
# Build Solanum image
27+
echo "Building Solanum IRC server image..."
28+
docker build -t registry.digitalocean.com/magnet-irc/solanum:1eu -f solanum/Dockerfile solanum/
29+
30+
# Copy server-specific config
31+
cp servers/magnet-1eu/server.conf solanum/server.conf
32+
33+
# Build with server-specific config
34+
docker build -t registry.digitalocean.com/magnet-irc/solanum:1eu -f solanum/Dockerfile solanum/
35+
36+
# Stop and remove any existing container
37+
docker stop magnet-1eu 2>/dev/null || true
38+
docker rm magnet-1eu 2>/dev/null || true
39+
40+
# Run the Solanum container
41+
echo "Starting Solanum IRC server container..."
42+
docker run -d --name magnet-1eu \
43+
--restart unless-stopped \
44+
--cap-add NET_ADMIN \
45+
--device /dev/net/tun \
46+
-p 6667:6667 \
47+
-p 6697:6697 \
48+
-p 7000:7000 \
49+
-e SERVER_NAME=magnet-1eu \
50+
-e SERVER_SID=1EU \
51+
-e SERVER_DESCRIPTION="Magnet IRC Network - EU Leaf" \
52+
-e PRIMARY_REGION=ams \
53+
-e TAILSCALE_AUTHKEY=tskey-auth-k7NgX72hkZ11CNTRL-ReKbmNZu4FQdx2G2KYggEQUdiHxbYzRx \
54+
-e TAILSCALE_DOMAIN=camel-kanyu.ts.net \
55+
-e PASSWORD_9RL=4piymLRtsf4BG0AkYU4mQKeOB3BUT0oy \
56+
-e PASSWORD_1EU=Appe0lOSyzjwc8fVJ2ZJpDJKOl2rs250 \
57+
-e SERVICES_PASSWORD=vRH6PLBIQeZpTrla0QH3iR2Hn42WY1pj \
58+
-e OPERATOR_PASSWORD=jK6NtLemTHoBq9AXbvCZClPI \
59+
-e OPER_PERIGRIN_PASSWORD=Rl9ZymR45Wm7Q \
60+
-e OPER_CORWIN_PASSWORD=exp.Io1AElUUY \
61+
-e OPER_ETHER_PASSWORD='$6$npQvleL/7byRtUhh$w/nMUQ9IC5uKBZfMKbpJCLn4yCaynT6KOZ6PM/RZhId7RczUfd2GnPM50IRGPSMCZvmSh9A1hc8tK7b5zu0Dg0' \
62+
-e OPER_MASON_PASSWORD='$6$CkKAhkuCpBfI0H3n$0iy2s1gnDBZAQeo6C6two6CnACdwgm5JaBdC/pb9x6pQUSu41OCMlWCdviLuuMhjXvzYXiUIbfcbUgj6V5UBd/' \
63+
-e ADMIN_NAME="Chris Prather" \
64+
-e ADMIN_EMAIL="[email protected]" \
65+
registry.digitalocean.com/magnet-irc/solanum:1eu
66+
67+
echo "Waiting for container to start..."
68+
sleep 10
69+
70+
# Check container status
71+
docker ps | grep magnet-1eu
72+
docker logs magnet-1eu --tail 20
73+
74+
echo "Deployment complete! IRC server should be accessible on port 6667"
75+
echo "Server IP: $(curl -s ifconfig.me)"

deploy-9rl.sh

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
# ABOUTME: Deployment script for magnet-9rl IRC server on DigitalOcean droplet
3+
# ABOUTME: Builds containers and runs Solanum IRCd with Tailscale networking
4+
5+
set -e
6+
7+
echo "Starting deployment of magnet-9rl IRC server..."
8+
9+
# Wait for Docker to be ready (from user-data script)
10+
while ! docker info > /dev/null 2>&1; do
11+
echo "Waiting for Docker to be ready..."
12+
sleep 5
13+
done
14+
15+
echo "Docker is ready. Proceeding with deployment..."
16+
17+
# Clone repository
18+
cd /opt
19+
if [ ! -d "neodynium" ]; then
20+
git clone https://github.com/perl-irc/neodynium.git
21+
fi
22+
cd neodynium
23+
git checkout digitalocean-migration
24+
git pull
25+
26+
# Build Solanum image
27+
echo "Building Solanum IRC server image..."
28+
docker build -t registry.digitalocean.com/magnet-irc/solanum:9rl -f solanum/Dockerfile solanum/
29+
30+
# Copy server-specific config
31+
cp servers/magnet-9rl/server.conf solanum/server.conf
32+
33+
# Build with server-specific config
34+
docker build -t registry.digitalocean.com/magnet-irc/solanum:9rl -f solanum/Dockerfile solanum/
35+
36+
# Stop and remove any existing container
37+
docker stop magnet-9rl 2>/dev/null || true
38+
docker rm magnet-9rl 2>/dev/null || true
39+
40+
# Run the Solanum container
41+
echo "Starting Solanum IRC server container..."
42+
docker run -d --name magnet-9rl \
43+
--restart unless-stopped \
44+
--cap-add NET_ADMIN \
45+
--device /dev/net/tun \
46+
-p 6667:6667 \
47+
-p 6697:6697 \
48+
-p 7000:7000 \
49+
-e SERVER_NAME=magnet-9rl \
50+
-e SERVER_SID=9RL \
51+
-e SERVER_DESCRIPTION="Magnet IRC Network - US Hub" \
52+
-e PRIMARY_REGION=tor \
53+
-e TAILSCALE_AUTHKEY=tskey-auth-k7NgX72hkZ11CNTRL-ReKbmNZu4FQdx2G2KYggEQUdiHxbYzRx \
54+
-e TAILSCALE_DOMAIN=camel-kanyu.ts.net \
55+
-e PASSWORD_9RL=4piymLRtsf4BG0AkYU4mQKeOB3BUT0oy \
56+
-e PASSWORD_1EU=Appe0lOSyzjwc8fVJ2ZJpDJKOl2rs250 \
57+
-e SERVICES_PASSWORD=vRH6PLBIQeZpTrla0QH3iR2Hn42WY1pj \
58+
-e OPERATOR_PASSWORD=jK6NtLemTHoBq9AXbvCZClPI \
59+
-e OPER_PERIGRIN_PASSWORD=Rl9ZymR45Wm7Q \
60+
-e OPER_CORWIN_PASSWORD=exp.Io1AElUUY \
61+
-e OPER_ETHER_PASSWORD='$6$npQvleL/7byRtUhh$w/nMUQ9IC5uKBZfMKbpJCLn4yCaynT6KOZ6PM/RZhId7RczUfd2GnPM50IRGPSMCZvmSh9A1hc8tK7b5zu0Dg0' \
62+
-e OPER_MASON_PASSWORD='$6$CkKAhkuCpBfI0H3n$0iy2s1gnDBZAQeo6C6two6CnACdwgm5JaBdC/pb9x6pQUSu41OCMlWCdviLuuMhjXvzYXiUIbfcbUgj6V5UBd/' \
63+
-e ADMIN_NAME="Chris Prather" \
64+
-e ADMIN_EMAIL="[email protected]" \
65+
registry.digitalocean.com/magnet-irc/solanum:9rl
66+
67+
echo "Waiting for container to start..."
68+
sleep 10
69+
70+
# Check container status
71+
docker ps | grep magnet-9rl
72+
docker logs magnet-9rl --tail 20
73+
74+
echo "Deployment complete! IRC server should be accessible on port 6667"
75+
echo "Server IP: $(curl -s ifconfig.me)"

quick-deploy.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# ABOUTME: Quick deployment script for IRC servers on DigitalOcean droplets
3+
# ABOUTME: Run this on each droplet with SERVER_TYPE environment variable
4+
5+
# Detect which server to deploy based on hostname or parameter
6+
if [ "$1" = "9rl" ] || [ "$(hostname)" = "magnet-9rl-droplet" ]; then
7+
SERVER_TYPE="9rl"
8+
elif [ "$1" = "1eu" ] || [ "$(hostname)" = "magnet-1eu-droplet" ]; then
9+
SERVER_TYPE="1eu"
10+
else
11+
echo "Usage: $0 [9rl|1eu]"
12+
echo "Or run on a droplet named magnet-9rl-droplet or magnet-1eu-droplet"
13+
exit 1
14+
fi
15+
16+
echo "Deploying magnet-$SERVER_TYPE server..."
17+
18+
# One-liner to download and run the deployment
19+
if [ "$SERVER_TYPE" = "9rl" ]; then
20+
curl -fsSL https://raw.githubusercontent.com/perl-irc/neodynium/digitalocean-migration/deploy-9rl.sh | bash
21+
else
22+
curl -fsSL https://raw.githubusercontent.com/perl-irc/neodynium/digitalocean-migration/deploy-1eu.sh | bash
23+
fi

0 commit comments

Comments
 (0)