commit 071ab86f2b98471c9568aa98e99c75ff689c90ce Author: Beda Schmid Date: Sat Oct 24 17:54:41 2026 +0000 Reset history to current sanitized state diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..4d9b1a2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +** +!Dockerfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26e8acc --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +.env +.env.* +!.env.example +.DS_Store +*.log +*.sql +*.sql.gz +*.dump +*.key +*.pem +.gnupg/ +secrets/ +html/ +tmp/ + +# BEGIN reset-history environment exclusions +.env +.env.* +*.env +*.env.* +!.env.example +!.env.*.example +!*.env.example +!*.env.*.example +# END reset-history environment exclusions diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c0b57bc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM php:8.2-apache + +RUN a2enmod rewrite + +RUN apt-get update && \ + apt-get install -y gnupg2 libgpgme-dev && \ + pecl install gnupg && \ + docker-php-ext-enable gnupg + +EXPOSE 80 + +CMD ["apache2-foreground"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..fa3cbbd --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# Anamaka + +Anamaka runs the PHP/Apache website at https://anamaka.net, including GnuPG processing and file downloads. + +## Deployment layout + +- **Compose:** `/srv/docker/anamaka/docker-compose.yml` +- **Static configuration/source:** `/srv/docker/anamaka/Dockerfile` and `/srv/docker/anamaka/apache.conf`; application source is maintained separately at https://git.yoonect.com/Anamaka/Anamaka-LLC-Website +- **Non-secret environment:** `GNUPGHOME=/var/www/.gnupg`, declared inline in Compose +- **Secrets:** `/srv/docker/secrets/anamaka/gnupg`, mounted at `/var/www/.gnupg`; preserve the existing keys and numeric ownership +- **NVMe application state:** `/srv/appdata/anamaka/html` for deployed website files, `/srv/appdata/anamaka/mta-sts` for deployed MTA-STS files, and `/srv/appdata/anamaka/tmp` for temporary processing files +- **Bulk HDD data:** none required by the migrated deployment +- **Other mounts:** none + +Secrets are never committed to this deployment repository. The GnuPG home and temporary processing directory are owned by UID/GID `33:33` with directory mode `0700`. + +The temporary directory is mounted at `/var/www/html/tmp`. Apache denies direct HTTP access to it; PHP serves authorized downloads through `download.php` and deletes files after serving them. Cleanup of abandoned files remains unverified. + +## Dependencies and recovery + +- **Networks/dependencies:** external `npm_proxy`, fixed address `192.168.99.16`, existing reverse proxy and DNS, and the locally built `anamaka-anamaka` image +- **Back up:** the complete GnuPG home, deployment configuration, and deployed website/MTA-STS files unless their exact deployed versions can be recovered from application source control; temporary files may contain sensitive user data and are not a durable content library +- **Re-creatable:** the PHP/Apache/GnuPG image from the Dockerfile, subject to upstream dependency availability; temporary files are transient but may belong to in-progress downloads diff --git a/apache.conf b/apache.conf new file mode 100644 index 0000000..cd09eff --- /dev/null +++ b/apache.conf @@ -0,0 +1,33 @@ + + ServerName anamaka.net + DocumentRoot /var/www/html + + + Options -Indexes +FollowSymLinks + AllowOverride All + Require all granted + + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + + ServerName mta-sts.anamaka.net + + DocumentRoot /var/www/mta-sts + + + Options -Indexes +FollowSymLinks + AllowOverride None + Require all granted + + + ErrorLog ${APACHE_LOG_DIR}/mta-sts-error.log + CustomLog ${APACHE_LOG_DIR}/mta-sts-access.log combined + + +# Temporary files are served only through the PHP download handler. + + AllowOverride None + Require all denied + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fd83776 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,54 @@ +name: anamaka + +services: + anamaka: + image: anamaka-anamaka + build: + context: . + network: host + container_name: anamaka + restart: unless-stopped + environment: + GNUPGHOME: /var/www/.gnupg + volumes: + - type: bind + source: /srv/docker/anamaka/apache.conf + target: /etc/apache2/sites-available/000-default.conf + read_only: true + bind: + create_host_path: false + - type: bind + source: /srv/appdata/anamaka/html + target: /var/www/html + bind: + create_host_path: false + - type: bind + source: /srv/appdata/anamaka/tmp + target: /var/www/html/tmp + bind: + create_host_path: false + - type: bind + source: /srv/docker/secrets/anamaka/gnupg + target: /var/www/.gnupg + bind: + create_host_path: false + - type: bind + source: /srv/appdata/anamaka/mta-sts + target: /var/www/mta-sts + read_only: true + bind: + create_host_path: false + networks: + npm_proxy: + ipv4_address: 192.168.99.16 + cap_drop: + - ALL + cap_add: + - CHOWN + - SETGID + - SETUID + - DAC_OVERRIDE + +networks: + npm_proxy: + external: true