No description
  • Shell 94.7%
  • Dockerfile 5.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-17 10:21:32 +02:00
.dockerignore initial commit 2026-07-17 10:21:32 +02:00
.gitignore initial commit 2026-07-17 10:21:32 +02:00
compose.yml initial commit 2026-07-17 10:21:32 +02:00
Dockerfile initial commit 2026-07-17 10:21:32 +02:00
example.env initial commit 2026-07-17 10:21:32 +02:00
README.md initial commit 2026-07-17 10:21:32 +02:00
setup.sh initial commit 2026-07-17 10:21:32 +02:00

HaDiDate Docker Setup

HaDiDate was an April Fool's joke 2016 for HaDiKo, once live at hadidate.hadiko.de (now offline). Behind the joke sat a real pH7CMS dating-site installation — complete with users, messages, and admin panel.

This repository lets you spin up a dockerized local copy of that old site from your own backup. Useful for nostalgia, debugging, or recovering data from the archive.

The backup itself is not included in this repo. You need your own hadidate.tar.gz and place it in the project root before running setup.

Prerequisites

  • Docker and Docker Compose
  • sudo (used for extracting the archive, writing into mariadb/, and updating app config files)
  • Your backup file: hadidate.tar.gz

Quick start

  1. Clone this repository.

  2. Copy your backup into the project root:

    cp /path/to/your/hadidate.tar.gz .
    
  3. Run the setup script:

    ./setup.sh
    
  4. Open the app:

The default port is 8099. Change it in .env via HADIDATE_PORT if needed.

What setup.sh does

The script walks you through the full setup:

  1. Extract the backup

    • Looks for hadidate.tar.gz in the project root.
    • Extracts it into ./hadidate/ (preserving numeric UID/GID from the archive).
    • If hadidate/ already exists, asks whether to delete and re-extract.
  2. Create .env

    • Copies example.env to .env (or keeps an existing .env if you choose).
    • Reads database name, user, and password from hadidate/_protected/app/configs/config.ini.
    • Asks for a MariaDB root password (press Enter to use the default your_root_password_here).
  3. Configure the app for Docker

    • Sets database hostname to database (the Docker Compose service name).
    • Adjusts cookie/session domains for local access.
    • Fixes the protected path in _constants.php.
    • Clears stale cache and sets permissions for the web server user in the container.
  4. Start MariaDB

    • Pulls and starts the database container.
    • If ./mariadb/ already exists, asks whether to wipe it and start fresh.
  5. Import the SQL dump

    • Loads hadidate/2026-07-17-hadidate.sql into MariaDB.
    • Drops and recreates the database first, so the dump is the only source of data.
    • Grants the app user access from any host inside Docker (%).
  6. Reset the admin password

    • Shows admin username, email, and name from the imported database.
    • Asks for a new admin password (leave empty to keep the one from the backup).
    • Updates the password in PH7_admins using the same bcrypt format as the app.
  7. Build and start the app

    • Builds the hadidate PHP/Apache image from Dockerfile.
    • Starts the app container on port 8099.

Prompts during setup

Question Typical answer
Delete existing hadidate/ and re-extract? y on first run, n later
Overwrite .env from example.env? y on first run, n if you already configured it
MariaDB root password Enter a password, or leave empty for the default
Wipe existing MariaDB data? y if you want a clean database import
New admin password Enter a new password, or leave empty to keep the backup password
Confirm admin password Re-enter the new password

Project layout

.
├── compose.yml          # Docker Compose services (database + hadidate)
├── Dockerfile           # PHP 7.4 + Apache image for the app
├── example.env          # Template for environment variables
├── setup.sh             # Main setup script
├── hadidate.tar.gz      # Your backup (not in git — you provide this)
├── hadidate/            # Extracted app (not in git)
├── mariadb/             # MariaDB data volume (not in git)
└── .env                 # Local config (not in git)

Useful commands after setup

# View logs
docker compose logs -f

# Stop everything
docker compose down

# Start again (without re-running setup)
docker compose up -d

# Rebuild app image after Dockerfile changes
docker compose build hadidate
docker compose up -d hadidate

Re-running setup

You can run ./setup.sh again at any time. It will ask before overwriting or deleting anything important (hadidate/, .env, mariadb/).

To fully reset the database and re-import the dump, answer y when asked to wipe existing MariaDB data.

Notes

  • The SQL dump filename is currently fixed to hadidate/2026-07-17-hadidate.sql. If your backup uses a different dump name, rename it or adjust setup.sh.
  • Database credentials for Docker are taken from config.ini and written into .env. The app inside the container connects to hostname database, not localhost.
  • hadidate.tar.gz, hadidate/, mariadb/, and .env are gitignored and must be created locally.