]> git.aero2k.de Git - dfde-docker.git/commitdiff
neues Setup mit quickinstall master
authorThorsten <mail@aero2k.de>
Thu, 5 Feb 2026 21:48:19 +0000 (22:48 +0100)
committerThorsten <mail@aero2k.de>
Thu, 5 Feb 2026 21:48:19 +0000 (22:48 +0100)
13 files changed:
.dockerignore [new file with mode: 0644]
.gitignore
Dockerfile [new file with mode: 0644]
README.md [new file with mode: 0644]
create-board.php [new file with mode: 0644]
ctrl.sh [deleted file]
debianforumde.json [new file with mode: 0644]
docker/Dockerfile [deleted file]
docker/config.php [deleted file]
docker/db [deleted file]
docker/run.sh [deleted file]
phpBB-3.3.15.zip [moved from docker/phpBB-3.2.0.zip with 52% similarity]
run.sh [new file with mode: 0644]

diff --git a/.dockerignore b/.dockerignore
new file mode 100644 (file)
index 0000000..26d406b
--- /dev/null
@@ -0,0 +1,5 @@
+.git/
+.claude/
+git.swp/
+dfde-theme/.git/
+dfde-theme/.idea/
index 1377554ebea6f98a2c748183bc5a96852af12ac2..10cf1cbe2f8a10bdd597ec670b5a27f3cf242913 100644 (file)
@@ -1 +1,2 @@
 *.swp
+dfde-theme/
diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..3d77ead
--- /dev/null
@@ -0,0 +1,51 @@
+FROM php:8.2-apache
+
+RUN apt-get update && apt-get install -y \
+    zip \
+    unzip \
+    libpng-dev \
+    libjpeg-dev \
+    libfreetype6-dev \
+    libsqlite3-dev \
+    imagemagick \
+    && docker-php-ext-configure gd --with-freetype --with-jpeg \
+    && docker-php-ext-install gd pdo pdo_sqlite \
+    && rm -rf /var/lib/apt/lists/*
+
+# Install composer
+COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
+
+# Download and setup QuickInstall
+ADD https://api.github.com/repos/phpbb/quickinstall/zipball/1.6.15 /tmp/quickinstall.zip
+RUN unzip /tmp/quickinstall.zip -d /tmp/qi \
+    && mv /tmp/qi/phpbb-quickinstall-* /var/www/html/quickinstall \
+    && rm /tmp/quickinstall.zip \
+    && cd /var/www/html/quickinstall && composer install --no-dev
+
+# Add phpBB source to QuickInstall's sources directory (extracted)
+COPY phpBB-3.3.15.zip /tmp/
+RUN unzip /tmp/phpBB-3.3.15.zip -d /var/www/html/quickinstall/sources/ \
+    && rm /tmp/phpBB-3.3.15.zip
+
+# Set permissions for QuickInstall
+RUN mkdir -p /var/www/html/quickinstall/boards \
+    && mkdir -p /var/www/html/quickinstall/cache \
+    && mkdir -p /var/www/html/quickinstall/settings
+
+# Add saved profile
+COPY debianforumde.json /var/www/html/quickinstall/settings/
+
+# Copy dfde-theme into sources for board creation
+COPY dfde-theme /var/www/html/quickinstall/sources/phpBB3/styles/dfde
+
+# Copy board creation script
+COPY create-board.php /var/www/html/quickinstall/
+
+# Set permissions before running the script
+RUN chown -R www-data:www-data /var/www/html/quickinstall
+
+# Create the board during build
+RUN cd /var/www/html/quickinstall && php create-board.php dfde
+
+# Fix permissions after board creation
+RUN chown -R www-data:www-data /var/www/html/quickinstall
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..fe70b56
--- /dev/null
+++ b/README.md
@@ -0,0 +1,59 @@
+# debianforum.de Docker-Entwicklungsumgebung
+
+Erstellt eine phpBB-Instanz mit dem debianforum.de-Theme und Testdaten.
+
+## Voraussetzungen
+
+- Docker
+- Verzeichnisstruktur:
+  ```
+  Projekte/
+  ├── dfde-deploy/       ← dieses Repository
+  └── dfde-theme/        ← Theme-Repository (Geschwisterverzeichnis)
+  ```
+
+## Verwendung
+
+```bash
+./run.sh
+```
+
+Das Skript:
+1. Kopiert das Theme in den Build-Kontext
+2. Baut das Docker-Image (inkl. Board-Erstellung)
+3. Startet den Container mit Theme-Mount
+
+## Zugriff
+
+- **URL:** http://localhost:8080/quickinstall/boards/dfde/
+- **Admin-Login:** `admin` / `password`
+
+## Live Theme-Editing
+
+Das Theme wird als Volume gemountet:
+```
+../dfde-theme/ → /var/www/html/quickinstall/boards/dfde/styles/dfde
+```
+
+Änderungen am Theme sind sofort im Browser sichtbar (ggf. reload ohne Cache, Strg+Shift+R).
+
+## Container-Verwaltung
+
+```bash
+# Logs anzeigen
+docker logs -f dfde
+
+# Container stoppen (und ggf. den Zustand löschen, andernfalls lässt sich der Container mit docker start dfde auch wieder starten)
+docker stop dfde && docker rm dfde
+
+# Neustart (ohne Rebuild)
+docker start dfde
+```
+
+## Testdaten
+
+Das Board wurde mit folgenden Parametern erstellt:
+- 100 Benutzer
+- 2 Kategorien, 10 Foren
+- 5-25 Themen pro Forum
+- 0-50 Antworten pro Thema
diff --git a/create-board.php b/create-board.php
new file mode 100644 (file)
index 0000000..e48e34e
--- /dev/null
@@ -0,0 +1,185 @@
+<?php
+/**
+ * CLI script to create a phpBB board using QuickInstall
+ *
+ * Usage: php create-board.php <board_name>
+ *
+ * This script bootstraps QuickInstall and invokes the board creation module
+ * to create a fully populated board during Docker build.
+ */
+
+if (php_sapi_name() !== 'cli') {
+    die("This script must be run from the command line.\n");
+}
+
+if ($argc < 2) {
+    die("Usage: php create-board.php <board_name>\n");
+}
+
+$board_name = $argv[1];
+
+// Change to QuickInstall directory
+chdir('/var/www/html/quickinstall');
+
+// Define required constants
+define('IN_PHPBB', true);
+define('IN_QUICKINSTALL', true);
+define('IN_INSTALL', true);
+
+$quickinstall_path = './';
+$phpbb_root_path = $quickinstall_path . 'sources/phpBB3/';
+$phpEx = 'php';
+
+// Report all errors, except notices
+$level = E_ALL ^ E_NOTICE;
+
+// Include scripts for quickinstall
+require("{$quickinstall_path}includes/qi_constants.$phpEx");
+require("{$quickinstall_path}includes/qi.$phpEx");
+require("{$quickinstall_path}includes/settings.$phpEx");
+require("{$quickinstall_path}includes/qi_functions.$phpEx");
+require("{$quickinstall_path}includes/qi_file.$phpEx");
+require("{$quickinstall_path}includes/qi_module.$phpEx");
+require("{$quickinstall_path}includes/twig.$phpEx");
+require("{$quickinstall_path}vendor/autoload.$phpEx");
+
+if (PHP_VERSION_ID >= 50400) {
+    if (!defined('E_STRICT')) {
+        define('E_STRICT', 2048);
+    }
+    $level &= ~E_STRICT;
+}
+
+if (PHP_VERSION_ID >= 50500) {
+    if (!defined('E_DEPRECATED')) {
+        define('E_DEPRECATED', 8192);
+    }
+    $level &= ~E_DEPRECATED;
+}
+error_reporting($level);
+
+// Define STRIP constant
+define('STRIP', false);
+
+// Set limits
+@set_time_limit(0);
+@ini_set('memory_limit', '256M');
+
+// Set PHP error handler to qi's handler
+set_error_handler(array('qi', 'msg_handler'), E_ALL);
+
+// Load settings from the debianforumde profile
+$settings = new settings($quickinstall_path);
+$settings->import_profile('debianforumde');
+
+// Get phpBB version and load dependencies
+$phpbb_version = get_phpbb_version($phpbb_root_path);
+
+if (file_exists($phpbb_root_path . 'phpbb/class_loader.' . $phpEx)) {
+    define('PHPBB_31', true);
+
+    require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
+    $phpbb_class_loader = new \phpbb\class_loader('phpbb\\', $phpbb_root_path . 'phpbb/', $phpEx);
+    $phpbb_class_loader->register();
+
+    require($phpbb_root_path . 'vendor/autoload.' . $phpEx);
+}
+
+if (!file_exists($phpbb_root_path . 'includes/functions_install.' . $phpEx) || version_compare($phpbb_version, '3.2', '>=')) {
+    define('PHPBB_32', true);
+}
+
+if (file_exists($phpbb_root_path . 'vendor-ext') || version_compare($phpbb_version, '4.0', '>=')) {
+    define('PHPBB_40', true);
+}
+
+require($phpbb_root_path . 'includes/functions.' . $phpEx);
+require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+
+if (!function_exists('phpbb_email_hash') || version_compare($phpbb_version, '3.3', '>=')) {
+    define('PHPBB_33', true);
+}
+
+// Need to set prefix here before constants.php are included
+$table_prefix = $settings->get_config('table_prefix', '');
+
+require($phpbb_root_path . 'includes/constants.' . $phpEx);
+
+if (!qi::phpbb_branch('3.2')) {
+    require($phpbb_root_path . 'includes/functions_install.' . $phpEx);
+}
+
+// Initialize user, cache, auth - mirroring index.php exactly
+if (qi::phpbb_branch('3.1')) {
+    if (qi::phpbb_branch('3.2')) {
+        $cache_dir = $quickinstall_path . $settings->get_config('cache_dir', '');
+        $cache = new \phpbb\cache\driver\file($cache_dir);
+        $user = new \phpbb\user(
+            new \phpbb\language\language(
+                new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
+            '\phpbb\datetime'
+        );
+    } else {
+        $user = new \phpbb\user('\phpbb\datetime');
+        $cache = new \phpbb\cache\driver\file();
+    }
+
+    $auth = new \phpbb\auth\auth();
+    require($phpbb_root_path . 'includes/functions_compatibility.' . $phpEx);
+} else {
+    require($phpbb_root_path . 'includes/acm/acm_file.' . $phpEx);
+    require($phpbb_root_path . 'includes/auth.' . $phpEx);
+    require($phpbb_root_path . 'includes/cache.' . $phpEx);
+    require($phpbb_root_path . 'includes/session.' . $phpEx);
+
+    $user = new user();
+    $auth = new auth();
+    $cache = new cache();
+}
+
+// Initialize template
+$template = new twig($user, $settings->get_cache_dir(), $quickinstall_path);
+
+// Apply QuickInstall language
+qi::apply_lang($settings->get_config('qi_lang', 'en'));
+
+// Validate settings
+if (!$settings->validate()) {
+    $errors = $settings->get_errors();
+    echo "Settings validation errors:\n";
+    foreach ($errors as $error) {
+        if (is_array($error)) {
+            echo "  - " . implode(': ', $error) . "\n";
+        } else {
+            echo "  - $error\n";
+        }
+    }
+    exit(1);
+}
+
+// Set config as per index.php
+if (qi::phpbb_branch('3.1')) {
+    $config = new \phpbb\config\config(array(
+        'load_tplcompile' => '1',
+    ));
+    qi_set_config(false, false, false, $config);
+    qi_set_config_count(null, null, null, $config);
+} else {
+    $config = array(
+        'load_tplcompile' => '1',
+    );
+}
+
+// Set the board name via POST simulation
+$_POST['dbname'] = $board_name;
+$_REQUEST['dbname'] = $board_name;
+
+echo "Creating board '$board_name' with profile 'debianforumde'...\n";
+
+// Load and run the create module
+require("{$quickinstall_path}modules/qi_create.$phpEx");
+
+$create_module = new qi_create();
+$create_module->run();
+
+echo "Board '$board_name' created successfully!\n";
diff --git a/ctrl.sh b/ctrl.sh
deleted file mode 100755 (executable)
index 1bee1ac..0000000
--- a/ctrl.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-cmd=$1
-pushd docker
-
-case $cmd in
-stop)
-       docker ps -q | xargs docker stop -t1
-       ;;
-start)
-       bash run.sh &
-       ;;
-restart)
-       bash $0 stop && bash $0 start
-       ;;
-safedb)
-       docker ps -q | xargs -I_ docker cp _:/tmp/db db
-       chown thorsten:thorsten db
-       ;;
-commit)
-       docker ps -q | xargs -I_ docker commit _
-       ;;
-esac
-
-popd
diff --git a/debianforumde.json b/debianforumde.json
new file mode 100644 (file)
index 0000000..8ae957d
--- /dev/null
@@ -0,0 +1,58 @@
+{
+    "qi_lang": "en",
+    "cache_dir": "cache\/",
+    "boards_dir": "boards\/",
+    "boards_url": "boards\/",
+    "make_writable": "0",
+    "grant_permissions": "",
+    "dbms": "sqlite3",
+    "dbhost": "\/var\/www\/html\/quickinstall\/boards\/",
+    "dbport": "",
+    "dbuser": "dbuser",
+    "dbpasswd": "dbpassword",
+    "no_dbpasswd": "0",
+    "db_prefix": "qi_",
+    "table_prefix": "phpbb_",
+    "server_name": "localhost",
+    "server_port": "80",
+    "cookie_domain": "",
+    "cookie_secure": "0",
+    "admin_name": "admin",
+    "admin_pass": "password",
+    "admin_email": "qi_admin@phpbb-quickinstall.tld",
+    "site_name": "Testing Board",
+    "site_desc": "QuickInstall sandbox",
+    "default_lang": "en",
+    "qi_tz": "UTC",
+    "other_config": "session_length;999999\n#load_tplcompile;1;1\n#This is a comment...",
+    "board_email": "qi_board@phpbb-quickinstall.tld",
+    "email_enable": "0",
+    "smtp_delivery": "0",
+    "smtp_host": "",
+    "smtp_port": "25",
+    "smtp_auth": "PLAIN",
+    "smtp_user": "",
+    "smtp_pass": "",
+    "populate": "1",
+    "num_users": "100",
+    "num_new_group": "10",
+    "email_domain": "phpbb-quickinstall.tld",
+    "create_admin": "1",
+    "create_mod": "1",
+    "num_cats": "2",
+    "num_forums": "10",
+    "num_topics_min": "5",
+    "num_topics_max": "25",
+    "num_replies_min": "0",
+    "num_replies_max": "50",
+    "chunk_post": "1000",
+    "chunk_topic": "2000",
+    "chunk_user": "5000",
+    "alt_env": "",
+    "redirect": "1",
+    "install_styles": "1",
+    "default_style": "debianforum.de",
+    "drop_db": "0",
+    "delete_files": "0",
+    "debug": "0"
+}
\ No newline at end of file
diff --git a/docker/Dockerfile b/docker/Dockerfile
deleted file mode 100644 (file)
index 18c9c22..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-FROM php:5.6-apache
-
-MAINTAINER nobody
-
-RUN apt-get update
-RUN apt-get install -y zip
-COPY phpBB-3.2.0.zip /tmp/
-
-RUN unzip /tmp/phpBB-3.2.0.zip -d /var/www/html/
-
-COPY db /tmp/db
-COPY config.php /var/www/html/phpBB3/
-
-RUN find /var/www/html/phpBB3 -ls >> /var/www/html/sitemap.txt
-RUN chown www-data:www-data -R /var/www/html/phpBB3
-RUN chown www-data:www-data /tmp/db
-
-RUN rm -rf /var/www/html/phpBB3/install
-
diff --git a/docker/config.php b/docker/config.php
deleted file mode 100644 (file)
index bb5bb13..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-// phpBB 3.2.x auto-generated configuration file
-// Do not change anything in this file!
-$dbms = 'phpbb\\db\\driver\\sqlite3';
-$dbhost = '/tmp/db';
-$dbport = '';
-$dbname = 'phpbb';
-$dbuser = 'kekskopf';
-$dbpasswd = 'kekskopf';
-$table_prefix = 'phpbb_';
-$phpbb_adm_relative_path = 'adm/';
-$acm_type = 'phpbb\\cache\\driver\\file';
-
-@define('PHPBB_INSTALLED', true);
-// @define('PHPBB_DISPLAY_LOAD_TIME', true);
-@define('PHPBB_ENVIRONMENT', 'production');
-// @define('DEBUG_CONTAINER', true);
-
-
diff --git a/docker/db b/docker/db
deleted file mode 100755 (executable)
index ad177ba..0000000
Binary files a/docker/db and /dev/null differ
diff --git a/docker/run.sh b/docker/run.sh
deleted file mode 100644 (file)
index c813f95..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash -e
-docker build -t dfde .
-docker run -p 8080:80 -v $PWD/../../dfde-theme/:/var/www/html/phpBB3/styles/dfde dfde
similarity index 52%
rename from docker/phpBB-3.2.0.zip
rename to phpBB-3.3.15.zip
index 02fea18d28381efabf547a0f149a6b2a5e038dac..174a1cb230a6dc552eb5e78b5d7be63e1112e512 100644 (file)
Binary files a/docker/phpBB-3.2.0.zip and b/phpBB-3.3.15.zip differ
diff --git a/run.sh b/run.sh
new file mode 100644 (file)
index 0000000..382d8c2
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,21 @@
+#!/bin/bash -e
+
+# Copy dfde-theme into build context (Docker can't access parent directories)
+rsync -a ../dfde-theme/ ./dfde-theme/
+
+# Build the image with the board pre-created
+docker build -t dfde .
+
+# Start container with pre-created board
+# The board "dfde" is already created during build with populated users/posts
+# Mount the theme for live development
+# Access the board at http://localhost:8080/quickinstall/boards/dfde/
+
+docker run -d -p 8080:80 --name dfde \
+    -v "$PWD/../dfde-theme/:/var/www/html/quickinstall/boards/dfde/styles/dfde" \
+    dfde
+
+echo "Container started. Access the forum at http://localhost:8080/quickinstall/boards/dfde/"
+echo "Login: admin / password"
+echo "View logs: docker logs -f dfde"
+echo "Stop: docker stop dfde && docker rm dfde"