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

Commit 9a704c2

Browse files
committed
feat(webpanel): initialize UnrealIRCd WebPanel with Docker support
- Removed the empty .gitkeep file from the web directory. - Added a new .dockerignore file to exclude unnecessary files from the Docker build context. - Introduced config.php for webpanel configuration, including authentication and security settings. - Created a Dockerfile for building the webpanel container with necessary PHP extensions and dependencies. - Added README.md to provide documentation on the webpanel's features, configuration, and access instructions.
1 parent f31b6ae commit 9a704c2

File tree

5 files changed

+227
-0
lines changed

5 files changed

+227
-0
lines changed

web/.gitkeep

Whitespace-only changes.

web/webpanel/.dockerignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Git files
2+
.git
3+
.gitignore
4+
5+
# Documentation
6+
README.md
7+
*.md
8+
9+
# IDE files
10+
.vscode/
11+
.idea/
12+
*.swp
13+
*.swo
14+
15+
# OS files
16+
.DS_Store
17+
Thumbs.db
18+
19+
# Temporary files
20+
*.tmp
21+
*.log
22+
*.cache
23+
24+
# Development files
25+
node_modules/
26+
vendor/
27+
composer.lock

web/webpanel/Dockerfile

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# UnrealIRCd WebPanel Dockerfile
2+
# Provides web-based administration interface for UnrealIRCd
3+
# Based on official documentation: https://www.unrealircd.org/docs/UnrealIRCd_webpanel
4+
5+
FROM php:8.2-apache
6+
7+
# Add metadata labels
8+
LABEL maintainer="AllThingsLinux IRC Infrastructure" \
9+
description="UnrealIRCd WebPanel - Web-based administration interface" \
10+
version="1.0.0" \
11+
org.opencontainers.image.source="https://github.com/allthingslinux/irc.atl.chat"
12+
13+
# Set environment variables
14+
ENV DEBIAN_FRONTEND=noninteractive \
15+
DEBCONF_NONINTERACTIVE_SEEN=true \
16+
APACHE_DOCUMENT_ROOT=/var/www/html/unrealircd-webpanel
17+
18+
# Install system dependencies
19+
RUN apt-get update && \
20+
apt-get install -y --no-install-recommends \
21+
git=1:2.39.2-1.1 \
22+
curl=7.88.1-10+deb12u12 \
23+
unzip=6.0-28 \
24+
libzip-dev=1.9.2-1 \
25+
libcurl4-openssl-dev=7.88.1-10+deb12u12 \
26+
libonig-dev=6.9.8-1 \
27+
libmbstring-dev=8.2.7-1 \
28+
libxml2-dev=2.9.14+dfsg-1.1 \
29+
libssl-dev=3.0.17-1~deb12u2 \
30+
pkg-config=1.8.1-1 \
31+
ca-certificates=20230311+deb12u1 && \
32+
apt-get clean && \
33+
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* /tmp/* /var/tmp/*
34+
35+
# Install PHP extensions
36+
RUN docker-php-ext-install \
37+
zip \
38+
curl \
39+
mbstring \
40+
xml \
41+
pdo \
42+
pdo_mysql \
43+
mysqli
44+
45+
# Install Composer
46+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
47+
48+
# Configure Apache
49+
RUN a2enmod rewrite && \
50+
sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/000-default.conf && \
51+
sed -ri -e 's!Directory /var/www/!Directory ${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf && \
52+
echo "ServerName localhost" >> /etc/apache2/apache2.conf
53+
54+
# Create webpanel user
55+
RUN groupadd --system --gid 1001 webpanel && \
56+
useradd --create-home --system --uid 1001 --gid webpanel webpanel
57+
58+
# Set working directory
59+
WORKDIR /var/www/html
60+
61+
# Clone UnrealIRCd webpanel repository
62+
RUN git clone --depth 1 https://github.com/unrealircd/unrealircd-webpanel.git && \
63+
chown -R webpanel:webpanel unrealircd-webpanel
64+
65+
# Switch to webpanel user for composer operations
66+
USER webpanel:webpanel
67+
68+
# Install PHP dependencies
69+
WORKDIR /var/www/html/unrealircd-webpanel
70+
RUN composer install --no-dev --optimize-autoloader
71+
72+
# Switch back to root for final setup
73+
USER root
74+
75+
# Set proper permissions
76+
RUN chown -R webpanel:webpanel /var/www/html/unrealircd-webpanel && \
77+
chmod -R 755 /var/www/html/unrealircd-webpanel && \
78+
chmod -R 775 /var/www/html/unrealircd-webpanel/data && \
79+
chmod -R 775 /var/www/html/unrealircd-webpanel/config
80+
81+
# Create startup script
82+
RUN echo '#!/bin/bash\n\
83+
# Wait for UnrealIRCd to be ready\n\
84+
echo "Waiting for UnrealIRCd JSON-RPC API..."\n\
85+
until curl -f "http://${UNREALIRCD_HOST:-ircd}:${UNREALIRCD_PORT:-8600}/" >/dev/null 2>&1; do\n\
86+
echo "Waiting for UnrealIRCd..."\n\
87+
sleep 5\n\
88+
done\n\
89+
echo "UnrealIRCd is ready!"\n\
90+
\n\
91+
# Start Apache in foreground\n\
92+
exec apache2-foreground' > /usr/local/bin/start-webpanel.sh && \
93+
chmod +x /usr/local/bin/start-webpanel.sh
94+
95+
# Expose port
96+
EXPOSE 80
97+
98+
# Health check
99+
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
100+
CMD curl -f http://localhost/unrealircd-webpanel/ || exit 1
101+
102+
# Default command
103+
CMD ["/usr/local/bin/start-webpanel.sh"]

web/webpanel/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# UnrealIRCd WebPanel
2+
3+
This directory contains the UnrealIRCd WebPanel - a web-based administration interface for managing your IRC network.
4+
5+
## Files
6+
7+
- **`Dockerfile`** - Container build configuration for the webpanel
8+
- **`config.php`** - PHP configuration file for the webpanel (template)
9+
10+
## What is the WebPanel?
11+
12+
The UnrealIRCd WebPanel provides a user-friendly web interface to:
13+
- Monitor your IRC network in real-time
14+
- Manage users, channels, and server settings
15+
- Configure bans, spamfilters, and other administrative tasks
16+
- View network statistics and performance metrics
17+
18+
## Access
19+
20+
Once running, access the webpanel at: **http://localhost:8080**
21+
22+
## Configuration
23+
24+
The webpanel automatically configures itself during the first run. You can customize:
25+
- Authentication backend (file-based or SQL)
26+
- RPC connection settings
27+
- Security parameters
28+
- Feature toggles
29+
30+
## Dependencies
31+
32+
- **UnrealIRCd**: Must be running with JSON-RPC enabled (port 8600)
33+
- **PHP 8.2+**: With required extensions (zip, curl, mbstring, etc.)
34+
- **Apache**: Web server for hosting the interface
35+
36+
## Security
37+
38+
- **IP Restrictions**: By default, only accessible from localhost (127.*)
39+
- **Authentication**: File-based or SQL backend authentication
40+
- **RPC Access**: Secure JSON-RPC communication with UnrealIRCd
41+
42+
## Troubleshooting
43+
44+
If the webpanel fails to start:
45+
1. Check that UnrealIRCd is running and healthy
46+
2. Verify port 8600 is accessible for JSON-RPC
47+
3. Check container logs: `docker-compose logs webpanel`
48+
4. Ensure proper volume permissions
49+
50+
## More Information
51+
52+
- [Official Documentation](https://www.unrealircd.org/docs/UnrealIRCd_webpanel)
53+
- [GitHub Repository](https://github.com/unrealircd/unrealircd-webpanel)
54+
- [JSON-RPC API](https://www.unrealircd.org/docs/JSON-RPC)

web/webpanel/config.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
/**
3+
* UnrealIRCd WebPanel Configuration
4+
* This file will be automatically generated during setup
5+
*
6+
* For manual configuration, see:
7+
* https://www.unrealircd.org/docs/UnrealIRCd_webpanel
8+
*/
9+
10+
return [
11+
'unrealircd' => [
12+
'host' => $_ENV['UNREALIRCD_HOST'] ?? 'ircd',
13+
'port' => (int)($_ENV['UNREALIRCD_PORT'] ?? 8600),
14+
'rpc_user' => $_ENV['UNREALIRCD_RPC_USER'] ?? 'adminpanel',
15+
'rpc_password' => $_ENV['UNREALIRCD_RPC_PASSWORD'] ?? 'webpanel_password_2024',
16+
],
17+
18+
'auth' => [
19+
'backend' => 'file', // or 'sql' for database authentication
20+
'file' => [
21+
'path' => __DIR__ . '/data/users.json',
22+
],
23+
'sql' => [
24+
'host' => $_ENV['DB_HOST'] ?? 'localhost',
25+
'port' => (int)($_ENV['DB_PORT'] ?? 3306),
26+
'database' => $_ENV['DB_NAME'] ?? 'unrealircdwebpanel',
27+
'username' => $_ENV['DB_USER'] ?? 'unrealircdwebpanel',
28+
'password' => $_ENV['DB_PASSWORD'] ?? '',
29+
],
30+
],
31+
32+
'security' => [
33+
'session_timeout' => 3600, // 1 hour
34+
'max_login_attempts' => 5,
35+
'lockout_duration' => 900, // 15 minutes
36+
],
37+
38+
'features' => [
39+
'plugins' => true,
40+
'updates' => true,
41+
'backups' => true,
42+
],
43+
];

0 commit comments

Comments
 (0)