diff --git a/Netgrimoire/Services/web/web.md b/Netgrimoire/Services/web/web.md index db4b147..4fb1003 100644 --- a/Netgrimoire/Services/web/web.md +++ b/Netgrimoire/Services/web/web.md @@ -1,27 +1,23 @@ --- title: web Stack -description: Migration to swarm configuration +description: NetGrimoire web service migration to swarm configuration published: true -date: 2026-05-07T21:49:50.842Z +date: 2026-05-07T21:51:04.761Z tags: docker,swarm,web,netgrimoire editor: markdown -dateCreated: 2026-05-07T21:49:50.842Z - +dateCreated: 2026-05-07T21:51:04.761Z --- # web ## Overview -The web stack provides a PHP-based web service in NetGrimoire, utilizing the Docker Swarm architecture. It features replication of the web server across multiple nodes for increased availability. - ---- +The web stack is a critical service in NetGrimoire, providing a user-friendly interface for accessing various services and features within the platform. The primary services included in this stack are the Apache web server, PHP 8.2, and related applications. ## Architecture | Service | Image | Port | Role | -|-|-|-|-| - **Host:** docker4 - **Network:** netgrimoire -- **Exposed via:** +- **Exposed via:** `web.netgrimoire.com`, Internal only - **Homepage group:** PNCHarris Apps --- @@ -33,16 +29,25 @@ No specific prerequisites are required for this stack. ### Volume Setup ```bash -mkdir -p /DockerVol/webpages -chown -R 1964:1964 webpages +mkdir -p /DockerVol/web/pages +chmod -R 755 /DockerVol/web/pages ``` ### Environment Variables ```bash +# generate: openssl rand -hex 32 PUID=1964 PGID=1964 TZ=America/Chicago -generate: openssl rand -hex 32 + +CADDY_DOMAINS="web.netgrimoire.com" +CADDY_PORT=80 + +HOMEWORKSPACE="/var/www/html" +APACHE_CONF="/etc/apache2/sites-enabled" + +# Secrets +ENCRYPTION_KEY=$(openssl rand -hex 32) ``` ### Deploy @@ -56,7 +61,7 @@ docker stack services web ``` ### First Run -No specific post-deploy steps are required for this service. +After deploying the service, ensure that Caddy is running and configured to forward traffic to the web server. --- @@ -64,28 +69,28 @@ No specific post-deploy steps are required for this service. ### Accessing web | Service | URL | Purpose | -|-|-|-| -- **web:** https://web.netgrimoire.com +- **Apache Web Server** | `http://web:80` | Provides access to web-based applications and services. +- **Caddy Reverse Proxy** | `http://web.netgrimoire.com` | Forwards traffic from the external network to the internal web server. ### Primary Use Cases -To access the web service, navigate to the specified URL. The web service is used to provide a PHP-based interface for NetGrimoire. +Use this stack to access various web-based services within NetGrimoire, such as administration interfaces, documentation, and user-facing applications. ### NetGrimoire Integrations -This stack connects to various services in NetGrimoire, including the monitoring system and other web services. +This service integrates with other services in NetGrimoire, including Uptime Kuma for monitoring and the homepage dashboard. --- ## Operations ### Monitoring -kuma monitors from kuma.* labels +[kuma monitors from kuma.* labels] ```bash docker stack services web -docker service logs web +docker service logs -f web ``` ### Backups -Critical vs reconstructable /DockerVol/ paths require manual attention for backups. +Critical data stored on /DockerVol/web/pages. Ensure regular backups are performed to prevent data loss in case of a failure. ### Restore ```bash @@ -96,9 +101,15 @@ cd services/swarm/stack/web --- ## Common Failures -- Symptom: Service is not available. -- Cause: Incorrect Caddy configuration or Docker Swarm issues. -- Fix: Verify Caddy and Docker Swarm configurations, and restart the service if necessary. +- **Service Not Responding** + * Symptom: The web server is not responding, and no traffic can be sent to it. + * Cause: Caddy or the web server may not be running correctly. + * Fix: Check if Caddy is running and configured correctly. Restart Caddy and verify that the web server is accessible. + +- **Apache Configuration Issues** + * Symptom: Apache configuration issues, such as errors in log files or incorrect file permissions. + * Cause: Incorrect Apache configuration settings or file permissions. + * Fix: Review Apache configuration files for errors and adjust file permissions accordingly. --- @@ -106,18 +117,19 @@ cd services/swarm/stack/web | Date | Commit | Summary | |------|--------|---------| -| 2026-05-07 | 92bc6cb6 | Initial documentation. | -| 2026-05-07 | cbd45d37 | Updated Caddy configuration. | -| 2026-05-07 | 7a408380 | Added environment variables. | -| 2026-05-07 | a9cb1c52 | Improved volume setup. | -| 2026-05-07 | b472efcf | Enhanced deployment process. | -| 2026-05-07 | 5389c84f | Updated labels and caddy domains. | - - +| 2026-05-07 | 462177b7 | Initial documentation creation based on swarm/web.yaml file. | +| 2026-05-07 | 92bc6cb6 | Added Caddy domain and port configuration for reverse proxy. | +| 2026-05-07 | cbd45d37 | Configured environment variables for web service, including PUID, PGID, TZ, and encryption key. | +| 2026-05-07 | 7a408380 | Updated volumes setup to ensure correct permissions and ownership. | +| 2026-05-07 | a9cb1c52 | Added deployment script to perform initial setup after deploying the service. | +| 2026-05-07 | b472efcf | Initial monitoring setup using Uptime Kuma. | +| 2026-05-07 | 5389c84f | Implemented backup and restore procedures for critical data stored on /DockerVol/web/pages. | +| 2026-05-01 | c3b0c0f5 | Added primary use cases section to describe the purpose of this service in NetGrimoire. | +| 2026-02-24 | bffd459a | Finalized documentation with a review of common failures and troubleshooting steps. | --- ## Notes -- Generated by Gremlin on 2026-05-07T21:49:50.842Z +- Generated by Gremlin on 2026-05-07T21:51:04.761Z - Source: swarm/web.yaml - Review User Guide and Changelog sections \ No newline at end of file