Artwo Academy: Chronological Engineering & Progress Log
This engineering log documents the complete chronological evolution of the Artwo Academy (artwo.ir) infrastructure—from its initial deployment on a restrictive managed Platform-as-a-Service (PaaS) to a self-hosted, kernel-tuned hybrid Ubuntu 22.04 LTS and Docker production stack. Every architectural milestone, migration decision, configuration artifact, and incident post-mortem is recorded below in sequential order.
(Note: All IP addresses, database identifiers, cryptographic keys, and local workstation paths in this public documentation have been replaced with RFC 5737 documentation blocks and environment variable placeholders.)
Phase 1: Managed PaaS Baseline & Bottleneck Identification (Early 2026)
1.1 Initial LMS Deployment & External Virtual Classroom Integration
The initial iteration of Artwo Academy was deployed using Moodle 4.5.1 and a managed MariaDB instance hosted on a containerized Platform-as-a-Service (Chabokan), fronted by ArvanCloud CDN. To avoid saturating web application memory with real-time WebRTC video/audio transcoding, synchronous virtual classrooms (BigBlueButton) were decoupled onto a dedicated external server node and connected to Moodle via SHA1 checksum API authentication.
1.2 Architectural Bottlenecks on Managed PaaS
As course material volume and concurrent student sessions scaled, three hard infrastructure limitations surfaced within the managed PaaS container environment:
- Ingress Payload Rejections (HTTP 413 Request Entity Too Large): Upstream PaaS reverse proxies enforced a rigid
1MBto8MBrequest body limit, causing course backup restorations, SCORM/H5P uploads, and audio submissions to fail unless manually split or sideloaded via FTP. - Inability to Tune PHP-FPM & InnoDB Buffers: Lack of root access prevented modifying
max_input_vars,fastcgi_read_timeout, or MariaDBinnodb_buffer_pool_size, resulting in mid-upgrade timeouts and slow query execution. - Unreliable Web-Based Cron Execution: Without host-level
systemdorcrontabaccess under thewww-datauser, scheduled Moodle tasks (forum digests, assignment cleanup, and analytics processing) suffered from execution drift.
Engineering Decision: Decommission the managed PaaS environment and migrate the entire educational stack to a self-managed Ubuntu 22.04.5 LTS Virtual Private Server utilizing a hybrid host-native and Docker Compose architecture, validated first on a local Ubuntu staging server (192.168.1.x).
Phase 2: Bare-Metal VPS Provisioning & Hybrid Stack Architecture (July 2026)
2.1 OS Hardening, IPv4 Precedence & DNS Hierarchy Stabilization
Upon provisioning the Ubuntu 22.04.5 LTS VPS (2 vCPU, 4 GB RAM, 40 GB SSD /dev/vda1), initial apt repository operations to external mirrors (ppa.launchpadcontent.net and download.docker.com) experienced severe latency and 403 Forbidden / IPv6 timeout drops caused by upstream data center DHCP DNS overrides and broken IPv6 routing paths.
- IPv4 Transport Precedence: Modified
/etc/gai.conf(precedence ::ffff:0:0/96 100) to force the Linux networking stack to prefer IPv4 over IPv6 across all package management and outbound API calls. - Deterministic DNS Resolution: Configured
systemd-resolvedand Netplan on the primary network interface (ens3) to neutralize volatile DHCP overrides, locking primary domestic resolvers alongside fallback global resolvers (8.8.8.8,1.1.1.1) verified viaresolvectl query artwo.ir. - SSH & Perimeter Security: Enforced
0600permissions on cryptographic identity keys, disabled root password logins, restricted administrative operations to a non-root sudo user, and locked UFW perimeter rules strictly to proxied ingress ports.
Technical Implementation: Network & DNS Stabilization Commands
# 1. Prioritize IPv4 over IPv6 to eliminate apt repository timeouts
sudo sed -i 's/^#precedence ::ffff:0:0\/96 100/precedence ::ffff:0:0\/96 100/' /etc/gai.conf
# 2. Verify active DNS routing hierarchy on primary interface
resolvectl status ens3
resolvectl query artwo.ir
# 3. Add Ondrej PHP 8.3 PPA and install required Moodle runtime extensions
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update
sudo apt-get install -y nginx php8.3-fpm php8.3-mysql php8.3-xml php8.3-curl \
php8.3-gd php8.3-mbstring php8.3-intl php8.3-soap php8.3-zip php8.3-sodium
2.2 Hybrid Execution Stack Deployment (Host Nginx/PHP-FPM + Docker MariaDB/NPM)
To maximize disk I/O throughput for Moodle's file-heavy caching engine while preserving container isolation for databases and multi-domain SSL routing, a split architecture was implemented:
- Containerized Ingress & Database Layer: Deployed Nginx Proxy Manager (NPM) on
nginx-proxy_defaultand MariaDB inside an isolated Docker Compose stack bound to127.0.0.1:3306withutf8mb4_unicode_cicollation. - Host-Native Application Layer: Installed Nginx (listening on internal port
8080) and PHP 8.3-FPM directly on the Ubuntu host serving/srv/artwo/moodle. - Resolving Initial
max_input_vars& Gateway Timeouts: Executingsudo -u www-data php8.3 /srv/artwo/moodle/admin/cli/upgrade.phpisolated an upstream timeout caused by PHP's defaultmax_input_vars = 1000limit. Updating/etc/php/8.3/fpm/php.iniand/etc/php/8.3/cli/php.initomax_input_vars = 5000,upload_max_filesize = 512M, andpost_max_size = 512Mpermanently cleared both CLI upgrade halts and HTTP 413 upload errors. - System-Level CLI Cron Runner: Migrated Moodle background tasks out of the web layer into a dedicated
www-datacrontab entry executing/usr/bin/php8.3 /srv/artwo/moodle/admin/cli/cron.phpevery minute.
Technical Implementation: PHP 8.3-FPM Tuning & Systemd Persistence
# 1. Enforce Moodle environment requirements in PHP 8.3 FPM & CLI
sudo sed -i 's/^;max_input_vars = 1000/max_input_vars = 5000/' /etc/php/8.3/fpm/php.ini
sudo sed -i 's/^;max_input_vars = 1000/max_input_vars = 5000/' /etc/php/8.3/cli/php.ini
sudo sed -i 's/^upload_max_filesize = .*/upload_max_filesize = 512M/' /etc/php/8.3/fpm/php.ini
sudo sed -i 's/^post_max_size = .*/post_max_size = 512M/' /etc/php/8.3/fpm/php.ini
# 2. Enable and verify boot-time persistence for host web services
sudo systemctl enable nginx php8.3-fpm docker
sudo systemctl restart php8.3-fpm nginx
# 3. Configure host-level www-data cron runner (1-minute interval)
echo "* * * * * /usr/bin/php8.3 /srv/artwo/moodle/admin/cli/cron.php >/dev/null 2>&1" | sudo crontab -u www-data -
Phase 3: Dedicated Block Storage & Custom Media Server (August 2026)
3.1 Provisioning & Mounting the 70GB /dev/vdb Volume
Storing 50+ GB of instructional textbooks, audio files, and presentation PDFs on external cloud storage incurred ongoing storage/egress overhead, while placing them on the 40 GB root SSD (/dev/vda1) risked exhausting OS disk space. A secondary 70 GB virtual block device (/dev/vdb) was attached to the VPS, formatted with an ext4 filesystem, and permanently mounted at /srv/media via UUID in /etc/fstab.
Technical Implementation: /dev/vdb Formatting & Persistent /etc/fstab Mount
# 1. Format unallocated 70GB block volume as ext4
sudo mkfs.ext4 /dev/vdb
# 2. Create mount directory and set web group permissions
sudo mkdir -p /srv/media
sudo mount /dev/vdb /srv/media
sudo chown -R sysadmin:www-data /srv/media
sudo chmod -R 750 /srv/media
# 3. Persist mount across reboots via UUID in /etc/fstab
BLK_UUID=$(sudo blkid -s UUID -o value /dev/vdb)
echo "UUID=${BLK_UUID} /srv/media ext4 defaults,nofail 0 2" | sudo tee -a /etc/fstab
3.2 Migrating from Nginx FancyIndex to a Zero-Dependency JSON/JS SPA (media.artwo.ir)
Initially, directory browsing on media.artwo.ir was tested with the third-party ngx-fancyindex module. However, external C modules introduce package dependency fragility during Nginx security updates.
Engineering Decision: Replace third-party Nginx modules with native autoindex_format json; on internal port 8081, paired with a custom, zero-dependency Vanilla JavaScript and CSS Single-Page Application (SPA). The frontend fetches Nginx's raw JSON directory output and renders a modern, responsive file browser with live search, breadcrumb navigation, and strict CORS headers (Access-Control-Allow-Origin) so BigBlueButton virtual classrooms can load presentation slides directly from /srv/media.
Technical Implementation: Host Nginx JSON Autoindex & CORS Virtual Host
server {
listen 8081;
server_name media.artwo.ir;
root /srv/media;
# Enable native JSON directory listing for the custom JS SPA
location /files/ {
autoindex on;
autoindex_format json;
autoindex_exact_size on;
autoindex_localtime on;
# CORS headers for external BigBlueButton classroom nodes
add_header 'Access-Control-Allow-Origin' 'https://classroom.artwo.ir' always;
add_header 'Access-Control-Allow-Methods' 'GET, HEAD, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Range, Origin, Accept' always;
}
}
3.3 Automated 3-2-1 Nightly Backup Pipeline (run_backups.sh)
Before onboarding additional services, an automated 3-2-1 backup architecture was deployed to protect the MariaDB database and moodledata directory:
* Zero-Plaintext Credential Mounting: Stored database credentials inside a 0600 permission-locked .my.cnf file and mounted it read-only (/srv/secrets/.my.cnf:/root/.my.cnf:ro) inside the MariaDB container.
* Nightly 03:00 AM Execution & S3 Sync: Configured run_backups.sh to dump and gzip-compress the database, archive moodledata, synchronize backups to S3-Compatible Object Storage, and prune local archives older than 7 days (find -mtime +7 -delete), complemented by an S3 bucket 7-day lifecycle rule and an on-demand workstation SSH pull script.
Phase 4: Cross-Border Split-Subdomain Reverse Tunnel — global.artwo.ir (August 2026)
4.1 Engineering Context & DPI Evasion Architecture
During periods of severe international gateway degradation and Deep Packet Inspection (DPI) throttling, students connecting from outside Iran experienced packet loss and hanging PHP sessions when accessing artwo.ir.
To guarantee low-latency access for international students without migrating the primary database out of the country, a split-subdomain encrypted reverse tunnel (global.artwo.ir) was engineered using Rathole (a high-performance Rust reverse proxy) bridging an edge VPS in Frankfurt, Germany (198.51.100.25) back to the origin server (203.0.113.10).
sequenceDiagram
participant Student as International Student (EU/CA)
participant FraNginx as Frankfurt Bridge VPS (Nginx :443)
participant FraRathole as Rathole Server (:2333 / :8080)
participant Tunnel as Encrypted Noise Protocol Tunnel
participant IrRathole as Origin Rathole Client
participant IrMoodle as Origin Host (Nginx & Moodle)
Student->>FraNginx: HTTPS Request (global.artwo.ir)
FraNginx->>FraRathole: Proxy Pass (127.0.0.1:8080 + X-Forwarded-For)
FraRathole->>Tunnel: Multiplexed Stream (Noise_NK_25519_ChaChaPoly)
Tunnel->>IrRathole: Bypass ISP DPI Inspection
IrRathole->>IrMoodle: Forward to Local Ingress (127.0.0.1:80)
IrMoodle-->>Student: Dynamic LMS Response (Dynamic $CFG->wwwroot)
4.2 Root Cause Analysis: Resolving Raw TCP Drops with the Noise Protocol Framework
- Firewall & Socket Diagnostics: Initial deployment of
rathole-server.serviceon the Frankfurt node (0.0.0.0:2333) resulted in504 Gateway Time-outresponses onglobal.artwo.ir. Inspection viass -tulpn | grep 2333andufw statusrevealed two issues: port2333/tcprequired explicit allowance in the Frankfurt UFW firewall, and unencrypted raw TCP tunnel handshakes across port2333were being signature-matched and silently dropped by international border gateway DPI filters. - Cryptographic Obfuscation via Noise Protocol: Upgraded the Rathole transport layer from raw TCP to the Noise Protocol Framework (
type = "noise"). Generated an asymmetric X25519 keypair (rathole --genkey), bindinglocal_private_keyon the Frankfurt server andremote_public_keyon the origin client. This wrapped all cross-border tunnel traffic in high-entropy cryptographic frames indistinguishable from random noise, immediately establishing the handshake. - Dynamic Multi-Domain Moodle Routing & Real-IP Preservation: Configured Moodle's
config.phpto dynamically evaluate$_SERVER['HTTP_HOST']against an explicit allowlist so the single Moodle instance seamlessly served both[https://artwo.ir](https://artwo.ir)(domestic) and[https://global.artwo.ir](https://global.artwo.ir)(international) without hard-coded redirect loops, while preserving student client IPs viaX-Forwarded-For.
Technical Implementation: Rathole Noise Protocol Server & Client Configurations
# --- 1. Frankfurt Bridge VPS (/etc/rathole/server.toml) ---
[server]
bind_addr = "0.0.0.0:2333"
[server.transport]
type = "noise"
[server.transport.noise]
local_private_key = "${RATHOLE_SERVER_PRIVATE_KEY}"
[server.services.moodle_web]
token = "${RATHOLE_TUNNEL_TOKEN}"
bind_addr = "127.0.0.1:8080"
# --- 2. Origin VPS (/etc/rathole/client.toml) ---
[client]
remote_addr = "198.51.100.25:2333"
[client.transport]
type = "noise"
[client.transport.noise]
remote_public_key = "${RATHOLE_SERVER_PUBLIC_KEY}"
[client.services.moodle_web]
token = "${RATHOLE_TUNNEL_TOKEN}"
local_addr = "127.0.0.1:80"
4.3 Subsequent Tunnel Decommissioning & Edge 301 Unification (Late August 2026)
Once direct international BGP routing through ArvanCloud's anycast edge stabilized, maintaining a separate Frankfurt bridge VPS was no longer necessary. The Frankfurt node and rathole-client service were cleanly decommissioned, and an ArvanCloud Edge 301 Permanent Redirect rule was implemented to automatically unify all legacy global.artwo.ir bookmarks back to [https://artwo.ir](https://artwo.ir).
Phase 5: Multi-Service Co-Hosting & Microservice Isolation (August–September 2026)
5.1 Containerized WordPress Migration (Poustine)
To co-host the Poustine e-commerce platform on the same VPS without polluting the host PHP 8.3 environment or Moodle's MariaDB instance, the entire stack was migrated into an isolated Docker Compose environment:
* Provisioned dedicated ecommerce_wp (WordPress/Apache) and ecommerce_db (MariaDB 10.11) containers communicating over a private internal bridge network, with only the web frontend linked to nginx-proxy_default.
5.2 Hesabix ERP Deployment & 502 Upstream Troubleshooting (acc.artwo.ir)
Deployed the self-hosted Hesabix accounting and ERP platform as an isolated multi-container stack (acc.artwo.ir). Resolved domestic Docker Hub registry mirror pull failures and diagnosed HTTP 502 Bad Gateway errors during container initialization by aligning internal FastCGI/proxy port bindings with Nginx Proxy Manager.
5.3 Safe Local Staging Environment (192.168.1.x:8090)
To prevent third-party Moodle plugins (such as custom certificate generators, video conferencing extensions, or language packs) from corrupting the production database, a local staging replica was established on a dedicated home lab Ubuntu server, enabling full upgrade dry-runs prior to production deployment.
Phase 6: Kernel jbd2 I/O Deadlock Post-Mortem & Resource Tuning (October 2026)
6.1 Incident Symptom: Simultaneous HTTP 504 Timeouts & SSH Connection Drops
In October 2026, web properties routed through Nginx Proxy Manager began returning 504 Gateway Time-out, while SSH connections dropped immediately after the TCP handshake (Connection closed by 203.0.113.10 port 22). Following a hard reboot, Nginx Proxy Manager's admin interface temporarily reported API is not healthy while the CDN edge returned 502 Bad Gateway for approximately 120 seconds before self-healing.
6.2 Root Cause Analysis (RCA)
Investigation of system logs (journalctl, dmesg), disk utilization (df -h), and socket listeners isolated a multi-stage cascade triggered by a kernel filesystem journal lock:
- Primary Trigger (
ext4jbd2/vda1-8Deadlock): Over weeks of continuous container and system logging,systemd-journaldaccumulated 1.8 GB of un-vacuumed binary logs on the 40 GB root SSD (/dev/vda1). During a burst of uncommitted file buffer flushes, the Linux kernel'sext4journaling thread (jbd2/vda1-8) blocked for over 241 seconds, placingsystemd-journald,mariadbd,php8.3-fpm, andsshdinto uninterruptible sleep (Dstate). - Secondary Boot-Time Delay (NPM Foreign IP List Fetch): Upon reboot, the
nginx-proxy-managerNode.js backend attempted to fetch updated public IP ranges from external cloud endpoints before binding to internal port3000, explaining the temporary 2-minute502window after reboot. - Duplicate Nginx Server Block Warning: Inspection of
/etc/nginx/sites-available/moodlerevealed two concatenatedserver { listen 8080; ... }blocks causingconflicting server namewarnings during daemon reload.
6.3 Permanent Remediation & Kernel Virtual Memory Tuning
To permanently prevent jbd2 I/O stalls while maintaining optimal performance on the 2-core / 4 GB RAM VPS (where total active memory across all 4 Docker containers and host PHP-FPM averaged just 1.18 GB / 3.91 GB with 0 MB swap usage):
* Vacuumed stale journals (journalctl --vacuum-size=100M) reclaiming 1.8 GB of SSD space (9.6 GB free on /dev/vda1).
* Capped systemd-journald storage permanently to 200M in /etc/systemd/journald.conf.
* Tuned Linux kernel virtual memory dirty-page ratios (vm.dirty_background_ratio = 5, vm.dirty_ratio = 10, vm.swappiness = 10) in /etc/sysctl.conf to force small, continuous asynchronous disk writebacks instead of blocking I/O bursts.
Technical Implementation: journald Caps & Kernel sysctl.conf I/O Tuning
# 1. Vacuum existing systemd journals and enforce permanent 200MB ceiling
sudo journalctl --vacuum-size=100M
sudo sed -i 's/^#SystemMaxUse=.*/SystemMaxUse=200M/' /etc/systemd/journald.conf
sudo sed -i 's/^#SystemMaxFileSize=.*/SystemMaxFileSize=50M/' /etc/systemd/journald.conf
sudo systemctl restart systemd-journald
# 2. Tune kernel dirty-page writeback thresholds to prevent jbd2 freezes
sudo tee -a /etc/sysctl.conf << 'EOF'
# Optimize disk writeback and eliminate ext4 jbd2 I/O spikes
vm.dirty_background_ratio = 5
vm.dirty_ratio = 10
vm.swappiness = 10
EOF
sudo sysctl -p
Phase 7: Custom RTL UI Engineering & Moodle 5.x Upgrade (Oct–Nov 2026)
7.1 Custom Boost SCSS & Responsive RTL Dashboard Engineering
To unify the visual identity of Artwo Academy and provide an intuitive bilingual (Farsi/English) interface across mobile and desktop viewports:
* Engineered custom Raw SCSS overrides for the Moodle Boost theme, fixing horizontal overflow on responsive grading and syllabus tables (overflow-x: auto, custom flexbox wrappers).
* Built a custom, auto-linked RTL Student Dashboard featuring structured course cards, localized typography, and direct one-click classroom and media portal navigation.
7.2 Migration to Moodle 5.3 LTS (/public Root & /r.php Front-Controller)
Upgraded the core LMS engine through Moodle 5.2 to Moodle 5.3 LTS:
* Reconfigured the host Nginx document root to /srv/artwo/moodle/public and implemented the /r.php front-controller routing rule (try_files $uri $uri/ /r.php$is_args$args;) alongside fastcgi_split_path_info to support Moodle 5.x slash arguments natively.
* Compiled missing host OS locales (en_US.UTF-8, fa_IR.UTF-8) to resolve Moodle language pack rendering warnings.
Phase 8: MariaDB 11.4 Upgrade, CIS Hardening & Single-Pass DR Kit (November 2026)
8.1 MariaDB 11.4 LTS Upgrade & Port 3306 Boot Collision RCA
During the November 2026 maintenance window, Ubuntu kernel security patches were applied followed by an upgrade of the containerized database image to mariadb:11.4. Upon rebooting the VPS and running docker compose up -d, the database container failed to initialize:
Bind for 0.0.0.0:3306 failed: port is already allocated.
- Root Cause: An unmasked host-level
mariadb.servicepackage installed on Ubuntu had automatically initialized during thesystemdboot sequence, seizing TCP port3306before the Docker daemon startedartwo-mariadb-1. - Resolution: Identified the conflicting daemon via
sudo ss -tulpn | grep :3306, permanently stopped and masked the host service (sudo systemctl stop mariadb mysql && sudo systemctl mask mariadb), broughtartwo-mariadb-1online, and executeddocker compose exec mariadb mariadb-upgrade -u root -pto update system tablespaces cleanly.
8.2 Post-Upgrade Security Hardening & Operational Audit
Following the Moodle 5.3 and MariaDB 11.4 migration, a full security and reliability audit was enforced across /srv/artwo:
| Security & Reliability Control | Architectural Risk Mitigated | Engineering Implementation |
|---|---|---|
1. Strict config.php Access Control (0440) |
Prevents unauthorized local processes from reading database connection strings or cryptographic salts. | Enforced chmod 0440 config.php with sysadmin:www-data ownership and isolated Moodle DB user privileges from MariaDB root. |
| 2. Third-Party Plugin Migration Verification | Prevents "Missing from disk" errors after swapping clean core codebases during major version upgrades. | Audited plugins overview and migrated required third-party modules (mod_bigbluebuttonbn extensions, custom themes) into the Moodle 5.3 tree. |
3. Web Root Group Ownership (sysadmin:www-data) |
Ensures the PHP-FPM www-data worker pool can read core files while restricting write access to authorized directories. |
Enforced sysadmin:www-data group ownership with 0750 directory and 0640 file permissions across /srv/artwo/moodle. |
| 4. Removal of Legacy InitDB Bind Mounts | Prevents Docker from creating empty host directories if an initial .sql seed file is removed after first boot. |
Removed obsolete /docker-entrypoint-initdb.d/ bind mounts from docker-compose.yml. |
| 5. Container Namespace Alignment in DR Scripts | Prevents silent cron backup failures when Docker Compose v2 updates container naming conventions (artwo-mariadb-1). |
Updated create_dr_kit.sh and cron jobs to target the active container identifier and .my.cnf authentication. |
| 6. Single-Pass Streamlined Archive Packaging | Prevents temporary double-compression archives from exhausting headroom on the 40 GB /dev/vda1 root SSD. |
Purged legacy staging directories and engineered a single-pass, fail-fast (set -eo pipefail) Disaster Recovery script. |
8.3 Single-Pass Full VPS Disaster Recovery Kit (create_dr_kit.sh + Workstation Pull Automation)
Replaced legacy multi-step backup scripts with a unified, zero-downtime Full VPS Disaster Recovery Kit (create_dr_kit.sh):
* Uses set -eo pipefail to halt immediately if any database dump or file copy fails.
* Exports consistent --single-transaction compressed SQL dumps across all active database containers.
* Captures all host OS configurations (/etc/nginx, /etc/php, /etc/netplan, /etc/ufw, /etc/letsencrypt, /etc/systemd/system, crontabs), installed apt package lists (dpkg --get-selections), and Docker network/container states.
* Packages all application stacks in a single tar -czf pass with live checkpoint progress dots (--checkpoint=500 --checkpoint-action=dot), excluding volatile Moodle cache/session folders and raw binary database directories (mariadb/, db_data/) to prevent archive corruption and save gigabytes of SSD space.
* Paired with an automated workstation batch script (pull_full_vps_kit.bat) that triggers the kit build over SSH, downloads the resulting 1.3 GB archive directly to offline storage, and cleans up the temporary archive on /dev/vda1 (maintaining 17%+ free SSD headroom).
Technical Implementation: CIS Permission Hardening & Workstation Automated DR Pull Script
# --- 1. Ubuntu Host: Lock Down Moodle 5.3 Permissions & config.php ---
sudo chown -R sysadmin:www-data /srv/artwo/moodle
sudo find /srv/artwo/moodle -type d -exec chmod 750 {} \;
sudo find /srv/artwo/moodle -type f -exec chmod 640 {} \;
sudo chmod 440 /srv/artwo/moodle/config.php
:: --- 2. Local Workstation: Automated DR Kit Generation & Pull Script ---
@echo off
set KEY_PATH="C:\Users\Admin\.ssh\id_ed25519_vps"
set VPS_USER=sysadmin
set VPS_IP=203.0.113.10
set LOCAL_DEST="D:\Backups\Artwo_VPS_Vault"
echo [1/3] Generating fresh Disaster Recovery Kit on Production VPS...
ssh -i %KEY_PATH% %VPS_USER%@%VPS_IP% "/srv/scripts/create_dr_kit.sh"
echo [2/3] Downloading archive to %LOCAL_DEST%...
scp -i %KEY_PATH% %VPS_USER%@%VPS_IP%:/srv/artwo_full_vps_kit_*.tar.gz %LOCAL_DEST%\
echo [3/3] Cleaning up temporary archive on VPS SSD...
ssh -i %KEY_PATH% %VPS_USER%@%VPS_IP% "rm -f /srv/artwo_full_vps_kit_*.tar.gz && df -h /"
echo Done! Latest full VPS backup saved in %LOCAL_DEST%.
pause
Phase 9: Isolated Technical Documentation Portal — docs.artwo.ir (November 2026)
9.1 Two-Stage Static Build & Hardened Container Isolation
To document the Artwo Academy architecture and host future engineering projects without introducing runtime dependencies (such as Python or Node.js servers) onto the production host:
* Created an isolated environment utilizing a two-stage Docker Compose workflow: an on-demand squidfunk/mkdocs-material builder container (user: "1000:1000", --strict mode) compiles Markdown sources into static HTML/CSS/JS inside ./site, and an always-on nginx:stable-alpine-slim (portfolio_web) container serves the compiled assets read-only (./site:/usr/share/nginx/html:ro).
* Hardened portfolio_web by dropping all Linux kernel capabilities (cap_drop: ALL), enforcing no-new-privileges:true, and capping container memory at 128M.
* Resolved an initial OpenResty 504 Gateway Time-out caused by host loopback port-binding isolation (127.0.0.1:8085 vs. Docker bridge 172.18.0.1) by removing host port exposure entirely and attaching portfolio_web directly to the external nginx-proxy_default bridge network, routing docs.artwo.ir internally via Docker DNS (http://portfolio_web:80).