Skip to content
This repository was archived by the owner on Dec 30, 2025. It is now read-only.

Commit 19c63e4

Browse files
committed
feat(docker-compose, configuration): update volume paths and enhance Atheme service configuration
Refactor the docker-compose configuration to use local paths for data and logs for UnrealIRCd and Atheme services, improving clarity and accessibility. Introduce a new Atheme service configuration with dependencies and environment variables, ensuring proper setup for the IRC services. Additionally, add example configuration files for Atheme and update the webpanel configuration to align with the new structure. This enhances the overall usability and maintainability of the service configurations.
1 parent eb7237d commit 19c63e4

File tree

15 files changed

+6310
-3189
lines changed

15 files changed

+6310
-3189
lines changed

Containerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ COPY --chown=ircd:ircd scripts/start-services.sh /usr/local/bin/start-services
146146
COPY --chown=ircd:ircd scripts/manage-modules.sh /usr/local/bin/manage-modules
147147
COPY --chown=ircd:ircd scripts/module-config.sh /usr/local/bin/module-config
148148
COPY --chown=ircd:ircd scripts/start-webpanel.sh /usr/local/bin/start-webpanel
149+
150+
# Create directory for prepare-config script and copy it
151+
RUN mkdir -p /opt/irc/scripts
149152
COPY --chown=ircd:ircd scripts/prepare-config.sh /opt/irc/scripts/prepare-config.sh
150153

151154
# Set proper permissions and create necessary symlinks
@@ -165,7 +168,7 @@ USER ircd:ircd
165168
WORKDIR /usr/local/unrealircd
166169

167170
# Expose default IRC ports
168-
EXPOSE 6667 6697
171+
EXPOSE 6667 6697 6900 8600
169172

170173
# Health check for both services
171174
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \

compose.yaml

Lines changed: 59 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ services:
2121
volumes:
2222
- ./unrealircd/conf:/usr/local/unrealircd/conf:ro
2323
- ./scripts:/opt/irc/scripts:ro
24-
- unrealircd_data:/usr/local/unrealircd/data
25-
- unrealircd_logs:/usr/local/unrealircd/logs
24+
- ./data/unrealircd:/usr/local/unrealircd/data
25+
- ./logs/unrealircd:/usr/local/unrealircd/logs
2626
# Use the ircd user (non-root) for security
2727
user: 1001:1001
2828

@@ -70,68 +70,69 @@ services:
7070

7171
# Volume mounts - persist certificates and credentials
7272
volumes:
73-
- letsencrypt_data:/etc/letsencrypt
73+
- ./data/letsencrypt:/etc/letsencrypt
7474
- ./cloudflare-credentials.ini:/etc/letsencrypt/cloudflare-credentials.ini:ro
7575

7676
# Network access for DNS challenges
7777
networks:
7878
- irc_network
7979

80-
# atheme:
81-
# build:
82-
# context: .
83-
# dockerfile: Containerfile
84-
# target: runtime
85-
# args:
86-
# UNREALIRCD_VERSION: "6.1.10"
87-
# ATHEME_VERSION: "7.2.12"
88-
# container_name: atheme
89-
# hostname: atheme
90-
# depends_on:
91-
# unrealircd:
92-
# condition: service_healthy
93-
# volumes:
94-
# - atheme_data:/usr/local/atheme/data
95-
# - atheme_logs:/usr/local/atheme/logs
96-
# - ./services/atheme:/usr/local/atheme/etc:ro
97-
# environment:
98-
# - TZ=UTC
99-
# - ATHEME_CONF=/usr/local/atheme/etc/atheme-minimal.conf
100-
# - ATHEME_DATA=/usr/local/atheme/data
101-
# networks:
102-
# - irc_network
103-
# command: ["/usr/local/bin/atheme-services", "-c", "/usr/local/atheme/etc/atheme-minimal.conf"]
104-
# restart: unless-stopped
80+
atheme:
81+
build:
82+
context: .
83+
dockerfile: Containerfile
84+
target: runtime
85+
args:
86+
UNREALIRCD_VERSION: "6.1.10"
87+
ATHEME_VERSION: "7.2.12"
88+
container_name: atheme
89+
hostname: atheme
90+
depends_on:
91+
unrealircd:
92+
condition: service_healthy
93+
volumes:
94+
- ./data/atheme:/usr/local/atheme/data
95+
- ./logs/atheme:/usr/local/atheme/logs
96+
- ./services/atheme:/usr/local/atheme/etc:ro
97+
environment:
98+
- TZ=UTC
99+
- ATHEME_CONF=/usr/local/atheme/etc/atheme.conf
100+
- ATHEME_DATA=/usr/local/atheme/data
101+
networks:
102+
- irc_network
103+
command: ["/usr/local/bin/atheme-services", "-c", "/usr/local/atheme/etc/atheme.conf"]
104+
restart: unless-stopped
105105

106-
# unrealircd-webpanel:
107-
# build:
108-
# context: .
109-
# dockerfile: web/webpanel/Containerfile
110-
# container_name: unrealircd-webpanel
111-
# hostname: unrealircd-webpanel
112-
# depends_on:
113-
# unrealircd:
114-
# condition: service_healthy
115-
# volumes:
116-
# - unrealircd-webpanel_data:/var/www/html/unrealircd-webpanel/data
117-
# - unrealircd-webpanel_config:/var/www/html/unrealircd-webpanel/config
118-
# environment:
119-
# - TZ=UTC
120-
# - UNREALIRCD_HOST=unrealircd
121-
# - UNREALIRCD_PORT=8600
122-
# - UNREALIRCD_RPC_USER=adminpanel
123-
# - UNREALIRCD_RPC_PASSWORD=webpanel_password_2024
124-
# ports:
125-
# - '8080:80' # Web interface
126-
# networks:
127-
# - irc_network
128-
# restart: unless-stopped
129-
# healthcheck:
130-
# test: ["CMD", "curl", "-f", "http://localhost/unrealircd-webpanel/"]
131-
# interval: 30s
132-
# timeout: 10s
133-
# retries: 3
134-
# start_period: 60s
106+
unrealircd-webpanel:
107+
build:
108+
context: .
109+
dockerfile: web/webpanel/Containerfile
110+
container_name: unrealircd-webpanel
111+
hostname: unrealircd-webpanel
112+
depends_on:
113+
unrealircd:
114+
condition: service_healthy
115+
volumes:
116+
- ./data/webpanel:/var/www/html/unrealircd-webpanel/data
117+
- ./config/webpanel:/var/www/html/unrealircd-webpanel/config
118+
env_file:
119+
- path: .env
120+
required: false
121+
environment:
122+
- TZ=UTC
123+
- UNREALIRCD_HOST=unrealircd
124+
- UNREALIRCD_PORT=${IRC_RPC_PORT:-8600}
125+
ports:
126+
- '8080:80'
127+
networks:
128+
- irc_network
129+
restart: unless-stopped
130+
healthcheck:
131+
test: ["CMD", "curl", "-f", "http://localhost/"]
132+
interval: 30s
133+
timeout: 10s
134+
retries: 3
135+
start_period: 60s
135136

136137
# gamja:
137138
# build:
@@ -166,7 +167,7 @@ services:
166167
# unrealircd:
167168
# condition: service_healthy
168169
# volumes:
169-
# - thelounge_data:/var/opt/thelounge
170+
# - ./data/thelounge:/var/opt/thelounge
170171
# networks:
171172
# - irc_network
172173
# ports:
@@ -177,25 +178,4 @@ networks:
177178
irc_network:
178179
driver: bridge
179180

180-
volumes:
181-
unrealircd_data:
182-
driver: local
183-
unrealircd_logs:
184-
driver: local
185-
unrealircd_modules:
186-
driver: local
187-
unrealircd_contrib:
188-
driver: local
189-
# atheme_data:
190-
# driver: local
191-
# atheme_logs:
192-
# driver: local
193-
# unrealircd-webpanel_data:
194-
# driver: local
195-
# unrealircd-webpanel_config:
196-
# driver: local
197-
# thelounge_data:
198-
# driver: local
199-
letsencrypt_data:
200-
driver: local
201181

docs/SECRET_MANAGEMENT.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,20 @@ docker compose up unrealircd
8787
- `IRC_SSL_CERT_PATH` - SSL certificate path
8888
- `IRC_SSL_KEY_PATH` - SSL key path
8989

90+
### **Atheme Services**
91+
- `ATHEME_SERVER_NAME` - Services server name
92+
- `ATHEME_SERVER_DESC` - Services server description
93+
- `ATHEME_UPLINK_HOST` - IRC server hostname/IP
94+
- `ATHEME_UPLINK_PORT` - IRC server port
95+
- `ATHEME_SEND_PASSWORD` - Password sent to IRC server
96+
- `ATHEME_RECEIVE_PASSWORD` - Password received from IRC server
97+
- `ATHEME_HELP_CHANNEL` - Help channel for users
98+
- `ATHEME_HELP_URL` - Help website URL
99+
100+
### **Webpanel**
101+
- `WEBPANEL_RPC_USER` - RPC username for webpanel
102+
- `WEBPANEL_RPC_PASSWORD` - RPC password for webpanel
103+
90104
## 📝 **Making Configuration Changes**
91105

92106
### **✅ DO: Edit the Template**

env.example

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ IRC_PORT=6667
77
IRC_TLS_PORT=6697
88
IRC_SERVER_PORT=6900
99
IRC_RPC_PORT=8600
10+
IRC_ROOT_DOMAIN=atl.chat
11+
IRC_SERVICES_SERVER=services.atl.chat
12+
IRC_SERVICES_PASSWORD=change_me_services_password_here
1013

1114
# IRC Server Security
1215
@@ -20,16 +23,37 @@ IRC_OPER_PASSWORD='$argon2id$v=19$m=6144,t=2,p=2$WXOLpTE+DPDr8q6OBVTx3w$bqXpBsaA
2023

2124
# SSL/TLS Configuration
2225
23-
SSL_CERT_PATH=./.runtime/certs
26+
IRC_SSL_CERT_PATH=./data/letsencrypt/live/irc.atl.chat/fullchain.pem
27+
IRC_SSL_KEY_PATH=./data/letsencrypt/live/irc.atl.chat/privkey.pem
2428

2529
# Cloudflare DNS-01 Challenge (for automatic certificates)
26-
# Create cloudflare-credentials.ini from template
27-
28-
# CLOUDFLARE_API_KEY=your-api-key-here
30+
# Create cloudflare-credentials.ini from cloudflare-credentials.ini.template
31+
# Add your API token to the credentials file (NOT as environment variable)
32+
33+
# Atheme Services Configuration
34+
ATHEME_SERVER_NAME=services.atl.chat
35+
ATHEME_SERVER_DESC=All Things Linux IRC Services
36+
ATHEME_UPLINK_HOST=irc.atl.chat
37+
ATHEME_UPLINK_PORT=6900
38+
ATHEME_SEND_PASSWORD=change_me_atheme_send_password_here
39+
ATHEME_RECEIVE_PASSWORD=change_me_atheme_receive_password_here
40+
ATHEME_HELP_CHANNEL=#help
41+
ATHEME_HELP_URL=https://discord.gg/linux
2942

3043
# Webpanel Configuration
44+
UNREALIRCD_HOST=unrealircd
45+
UNREALIRCD_PORT=8600
46+
UNREALIRCD_RPC_USER=adminpanel
47+
UNREALIRCD_RPC_PASSWORD=test1234
3148
WEBPANEL_RPC_USER=adminpanel
32-
WEBPANEL_RPC_PASSWORD=change_me_webpanel_password_here
49+
WEBPANEL_RPC_PASSWORD=test1234
50+
51+
# Webpanel Database Configuration (for SQL authentication backend)
52+
DB_HOST=localhost
53+
DB_PORT=3306
54+
DB_NAME=unrealircdwebpanel
55+
DB_USER=unrealircdwebpanel
56+
DB_PASSWORD=change_me_webpanel_db_password_here
3357

3458
# TheLounge Configuration
3559
THELOUNGE_PORT=9000

scripts/prepare-config.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,22 @@ prepare_config() {
7575
fi
7676

7777
# Prepare Atheme configuration
78-
if [ -f "$atheme_config" ]; then
78+
local atheme_template="$PROJECT_ROOT/services/atheme/atheme.conf.template"
79+
if [ -f "$atheme_template" ]; then
80+
log_info "Preparing Atheme configuration from template..."
81+
local temp_file="/tmp/atheme.conf.tmp"
82+
envsubst < "$atheme_template" > "$temp_file"
83+
mv "$temp_file" "$atheme_config"
84+
log_success "Atheme configuration prepared from template"
85+
elif [ -f "$atheme_config" ]; then
7986
log_info "Preparing Atheme configuration..."
8087
local temp_file="/tmp/atheme.conf.tmp"
8188
envsubst < "$atheme_config" > "$temp_file"
8289
mv "$temp_file" "$atheme_config"
8390
log_success "Atheme configuration prepared"
8491
else
8592
log_warning "Atheme configuration file not found: $atheme_config"
93+
log_warning "Template file not found: $atheme_template"
8694
fi
8795

8896
log_success "All configuration files prepared successfully"
@@ -98,6 +106,10 @@ prepare_config() {
98106
echo " IRC_ROOT_DOMAIN: ${IRC_ROOT_DOMAIN:-'not set'}"
99107
echo " IRC_SERVICES_PASSWORD: ${IRC_SERVICES_PASSWORD:-'not set'}"
100108
echo " IRC_OPER_PASSWORD: ${IRC_OPER_PASSWORD:-'not set'}"
109+
echo " ATHEME_SERVER_NAME: ${ATHEME_SERVER_NAME:-'not set'}"
110+
echo " ATHEME_UPLINK_HOST: ${ATHEME_UPLINK_HOST:-'not set'}"
111+
echo " ATHEME_UPLINK_PORT: ${ATHEME_UPLINK_PORT:-'not set'}"
112+
echo " ATHEME_SEND_PASSWORD: ${ATHEME_SEND_PASSWORD:-'not set'}"
101113
}
102114

103115
# Main function

scripts/start-webpanel.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ WAIT_INTERVAL="${WAIT_INTERVAL:-5}" # 5 seconds between checks
3636

3737
print_status "Starting UnrealIRCd WebPanel..."
3838

39+
# Set proper permissions for mounted directories
40+
print_status "Setting permissions for mounted directories..."
41+
if [ -d "/var/www/html/unrealircd-webpanel/data" ]; then
42+
chown -R webpanel:webpanel /var/www/html/unrealircd-webpanel/data
43+
chmod -R 775 /var/www/html/unrealircd-webpanel/data
44+
print_success "Data directory permissions set"
45+
fi
46+
47+
if [ -d "/var/www/html/unrealircd-webpanel/config" ]; then
48+
chown -R webpanel:webpanel /var/www/html/unrealircd-webpanel/config
49+
chmod -R 775 /var/www/html/unrealircd-webpanel/config
50+
print_success "Config directory permissions set"
51+
fi
52+
3953
# Skip JSON-RPC API check for now - start WebPanel directly
4054
print_status "Starting WebPanel without JSON-RPC API check..."
4155
print_warning "Note: WebPanel may need manual configuration to connect to UnrealIRCd"

services/atheme/atheme-minimal.conf

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)