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:56:06 +02:00
.gitignore initial commit 2026-07-17 10:56:06 +02:00
compose.yml initial commit 2026-07-17 10:56:06 +02:00
Dockerfile initial commit 2026-07-17 10:56:06 +02:00
example.env initial commit 2026-07-17 10:56:06 +02:00
README.md initial commit 2026-07-17 10:56:06 +02:00
setup.sh initial commit 2026-07-17 10:56:06 +02:00

HaDiCoin Docker Setup

HaDiCoin was an April Fool's joke in 2022 for HaDiKo, once live at hadicoin.hadiko.de (now offline). Behind the prank sat a WordPress site promoting a bitcoin-based cryptocurrency for HaDiKo — a fork of an old repo, complete with its own blockchain narrative and the usual WordPress admin.

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 hadicoin.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 wp-config.php)
  • Your backup file: hadicoin.tar.gz

Quick start

  1. Clone this repository.

  2. Copy your backup into the project root:

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

    ./setup.sh
    
  4. Open the site:

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

What setup.sh does

The script walks you through the full setup:

  1. Extract the backup

    • Looks for hadicoin.tar.gz in the project root.
    • Extracts it into ./wordpress-hadicoin/ (preserving numeric UID/GID from the archive).
    • If wordpress-hadicoin/ 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 wordpress-hadicoin/wp-config.php.
    • Asks for a MariaDB root password (press Enter to use the default your_root_password_here).
  3. Configure WordPress for Docker

    • Sets DB_HOST to database (the Docker Compose service name).
    • Adds or updates WP_HOME and WP_SITEURL for http://localhost:8099 so the site works locally instead of redirecting to hadicoin.hadiko.de.
    • Sets permissions on wp-content/ 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 wordpress-hadicoin/2026-07-17-hadicoin.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 administrator username and email from the imported database.
    • Asks for a new admin password (leave empty to keep the one from the backup).
    • Updates all administrator accounts using WordPress's phpass hash format.
  7. Build and start the app

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

Prompts during setup

Question Typical answer
Delete existing wordpress-hadicoin/ 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 + hadicoin)
├── Dockerfile               # PHP 7.4 + Apache image for WordPress
├── example.env              # Template for environment variables
├── setup.sh                 # Main setup script
├── hadicoin.tar.gz          # Your backup (not in git — you provide this)
├── wordpress-hadicoin/      # Extracted WordPress site (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 hadicoin
docker compose up -d hadicoin

Re-running setup

You can run ./setup.sh again at any time. It will ask before overwriting or deleting anything important (wordpress-hadicoin/, .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 wordpress-hadicoin/2026-07-17-hadicoin.sql. If your backup uses a different dump name, rename it or adjust setup.sh.
  • Database credentials for Docker are taken from wp-config.php and written into .env. The app inside the container connects to hostname database, not localhost.
  • WP_HOME and WP_SITEURL in wp-config.php override the URLs stored in the database. Comment them out or remove them if you deploy this copy back to a live server.
  • hadicoin.tar.gz, wordpress-hadicoin/, mariadb/, and .env are gitignored and must be created locally.