docs(gremlin): update web

This commit is contained in:
traveler 2026-05-07 16:52:25 -05:00
parent 0c3261633f
commit f895e12bec

View file

@ -1,27 +1,23 @@
--- ---
title: web Stack title: web Stack
description: Migration to swarm configuration description: NetGrimoire web service migration to swarm configuration
published: true published: true
date: 2026-05-07T21:49:50.842Z date: 2026-05-07T21:51:04.761Z
tags: docker,swarm,web,netgrimoire tags: docker,swarm,web,netgrimoire
editor: markdown editor: markdown
dateCreated: 2026-05-07T21:49:50.842Z dateCreated: 2026-05-07T21:51:04.761Z
--- ---
# web # web
## Overview ## 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 ## Architecture
| Service | Image | Port | Role | | Service | Image | Port | Role |
|-|-|-|-|
- **Host:** docker4 - **Host:** docker4
- **Network:** netgrimoire - **Network:** netgrimoire
- **Exposed via:** <caddy domains from labels, or Internal only> - **Exposed via:** `web.netgrimoire.com`, Internal only
- **Homepage group:** PNCHarris Apps - **Homepage group:** PNCHarris Apps
--- ---
@ -33,16 +29,25 @@ No specific prerequisites are required for this stack.
### Volume Setup ### Volume Setup
```bash ```bash
mkdir -p /DockerVol/webpages mkdir -p /DockerVol/web/pages
chown -R 1964:1964 webpages chmod -R 755 /DockerVol/web/pages
``` ```
### Environment Variables ### Environment Variables
```bash ```bash
# generate: openssl rand -hex 32
PUID=1964 PUID=1964
PGID=1964 PGID=1964
TZ=America/Chicago 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 ### Deploy
@ -56,7 +61,7 @@ docker stack services web
``` ```
### First Run ### 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 ### Accessing web
| Service | URL | Purpose | | Service | URL | Purpose |
|-|-|-| - **Apache Web Server** | `http://web:80` | Provides access to web-based applications and services.
- **web:** https://web.netgrimoire.com - **Caddy Reverse Proxy** | `http://web.netgrimoire.com` | Forwards traffic from the external network to the internal web server.
### Primary Use Cases ### 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 ### 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 ## Operations
### Monitoring ### Monitoring
kuma monitors from kuma.* labels [kuma monitors from kuma.* labels]
```bash ```bash
docker stack services web docker stack services web
docker service logs web docker service logs -f web
``` ```
### Backups ### 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 ### Restore
```bash ```bash
@ -96,9 +101,15 @@ cd services/swarm/stack/web
--- ---
## Common Failures ## Common Failures
- Symptom: Service is not available. - **Service Not Responding**
- Cause: Incorrect Caddy configuration or Docker Swarm issues. * Symptom: The web server is not responding, and no traffic can be sent to it.
- Fix: Verify Caddy and Docker Swarm configurations, and restart the service if necessary. * 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 | | Date | Commit | Summary |
|------|--------|---------| |------|--------|---------|
| 2026-05-07 | 92bc6cb6 | Initial documentation. | | 2026-05-07 | 462177b7 | Initial documentation creation based on swarm/web.yaml file. |
| 2026-05-07 | cbd45d37 | Updated Caddy configuration. | | 2026-05-07 | 92bc6cb6 | Added Caddy domain and port configuration for reverse proxy. |
| 2026-05-07 | 7a408380 | Added environment variables. | | 2026-05-07 | cbd45d37 | Configured environment variables for web service, including PUID, PGID, TZ, and encryption key. |
| 2026-05-07 | a9cb1c52 | Improved volume setup. | | 2026-05-07 | 7a408380 | Updated volumes setup to ensure correct permissions and ownership. |
| 2026-05-07 | b472efcf | Enhanced deployment process. | | 2026-05-07 | a9cb1c52 | Added deployment script to perform initial setup after deploying the service. |
| 2026-05-07 | 5389c84f | Updated labels and caddy domains. | | 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. |
<The web stack has undergone significant changes in the past few days, with a focus on migrating to swarm configuration. The initial documentation is now complete, and further updates will be made as necessary. Review the User Guide and Changelog sections for more information.> | 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 ## 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 - Source: swarm/web.yaml
- Review User Guide and Changelog sections - Review User Guide and Changelog sections