viewer
@@ -72,35 +72,35 @@ Located in: **Settings → Git Hooks → post-receive**
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
/usr/local/bin/app-deploy diagram
|
||||
/usr/local/bin/app-deploy viewer
|
||||
```
|
||||
|
||||
#### 3. App Deploy Script (Server)
|
||||
Runs as Linux user `git`:
|
||||
|
||||
```bash
|
||||
app-deploy diagram
|
||||
app-deploy viewer
|
||||
```
|
||||
|
||||
This script performs:
|
||||
1. `cd /opt/apps/diagram`
|
||||
2. `git pull --ff-only` from `git@git.appmodel.nl:Tour/diagram.git`
|
||||
3. `cd /home/tour/infra/diagram`
|
||||
4. `docker compose up -d --build diagram`
|
||||
1. `cd /opt/apps/viewer`
|
||||
2. `git pull --ff-only` from `git@git.appmodel.nl:Tour/viewer.git`
|
||||
3. `cd /home/tour/infra/viewer`
|
||||
4. `docker compose up -d --build viewer`
|
||||
|
||||
#### 4. Docker Build (Server)
|
||||
Multi-stage build process:
|
||||
- **Stage 1**: Build diagrams using Python + Graphviz
|
||||
- **Stage 1**: Build viewer using Python + Graphviz
|
||||
- **Stage 2**: Serve with Nginx
|
||||
|
||||
#### 5. Traefik Routing (Server)
|
||||
Traefik automatically detects the container via labels and publishes:
|
||||
```
|
||||
https://diagram.appmodel.nl
|
||||
https://viewer.appmodel.nl
|
||||
```
|
||||
|
||||
#### 6. DNS Resolution (AdGuard)
|
||||
AdGuard resolves `diagram.appmodel.nl` → Build server IP
|
||||
AdGuard resolves `viewer.appmodel.nl` → Build server IP
|
||||
|
||||
Result: Both internal and external clients use the same URL.
|
||||
|
||||
@@ -108,7 +108,7 @@ Result: Both internal and external clients use the same URL.
|
||||
|
||||
```
|
||||
/opt/apps/
|
||||
└── diagram/ # Git repository (pulled from Gitea)
|
||||
└── viewer/ # Git repository (pulled from Gitea)
|
||||
├── Dockerfile
|
||||
├── docker-compose.yml
|
||||
├── requirements.txt
|
||||
@@ -118,12 +118,12 @@ Result: Both internal and external clients use the same URL.
|
||||
└── index.html
|
||||
|
||||
/home/tour/infra/
|
||||
└── diagram/
|
||||
└── viewer/
|
||||
├── docker-compose.yml # Docker Compose config (may differ from repo)
|
||||
└── logs/ # Nginx logs (optional)
|
||||
|
||||
/var/log/
|
||||
└── app-deploy-diagram.log # Deployment logs
|
||||
└── app-deploy-viewer.log # Deployment logs
|
||||
```
|
||||
|
||||
## Setup Instructions
|
||||
@@ -133,19 +133,19 @@ Result: Both internal and external clients use the same URL.
|
||||
1. Navigate to: https://git.appmodel.nl
|
||||
2. Create new repository:
|
||||
- **Owner**: `Tour`
|
||||
- **Name**: `diagram`
|
||||
- **Name**: `viewer`
|
||||
- **Visibility**: Private
|
||||
|
||||
### 2. Initialize Local Repository
|
||||
|
||||
```bash
|
||||
# On dev machine
|
||||
git clone git@git.appmodel.nl:Tour/diagram.git
|
||||
cd diagram
|
||||
git clone git@git.appmodel.nl:Tour/viewer.git
|
||||
cd viewer
|
||||
|
||||
# Add project files
|
||||
git add Dockerfile docker-compose.yml requirements.txt *.py public/
|
||||
git commit -m "Initial commit: diagram viewer"
|
||||
git commit -m "Initial commit: viewer"
|
||||
git push origin main
|
||||
```
|
||||
|
||||
@@ -153,23 +153,23 @@ git push origin main
|
||||
|
||||
```bash
|
||||
# On server as appropriate user
|
||||
sudo -u git mkdir -p /opt/apps/diagram
|
||||
sudo -u git git clone git@git.appmodel.nl:Tour/diagram.git /opt/apps/diagram
|
||||
sudo -u git mkdir -p /opt/apps/viewer
|
||||
sudo -u git git clone git@git.appmodel.nl:Tour/viewer.git /opt/apps/viewer
|
||||
|
||||
mkdir -p /home/tour/infra/diagram
|
||||
cp /opt/apps/diagram/docker-compose.yml /home/tour/infra/diagram/
|
||||
mkdir -p /home/tour/infra/viewer
|
||||
cp /opt/apps/viewer/docker-compose.yml /home/tour/infra/viewer/
|
||||
```
|
||||
|
||||
### 4. Configure Gitea Post-Receive Hook
|
||||
|
||||
1. Go to: https://git.appmodel.nl/Tour/diagram
|
||||
1. Go to: https://git.appmodel.nl/Tour/viewer
|
||||
2. Navigate to: **Settings → Git Hooks**
|
||||
3. Select: **post-receive**
|
||||
4. Add script:
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
/usr/local/bin/app-deploy diagram
|
||||
/usr/local/bin/app-deploy viewer
|
||||
```
|
||||
|
||||
5. Save and test
|
||||
@@ -178,24 +178,24 @@ cp /opt/apps/diagram/docker-compose.yml /home/tour/infra/diagram/
|
||||
|
||||
Add DNS record in AdGuard:
|
||||
```
|
||||
diagram.appmodel.nl → <server-ip>
|
||||
viewer.appmodel.nl → <server-ip>
|
||||
```
|
||||
|
||||
### 6. Test Deployment
|
||||
|
||||
```bash
|
||||
# Manual test on server
|
||||
app-deploy diagram
|
||||
app-deploy viewer
|
||||
|
||||
# Verify container is running
|
||||
cd /home/tour/infra/diagram
|
||||
cd /home/tour/infra/viewer
|
||||
docker compose ps
|
||||
|
||||
# Check logs
|
||||
docker compose logs -f diagram
|
||||
docker compose logs -f viewer
|
||||
|
||||
# Test endpoint
|
||||
curl -I https://diagram.appmodel.nl
|
||||
curl -I https://viewer.appmodel.nl
|
||||
```
|
||||
|
||||
## Docker Configuration
|
||||
@@ -231,21 +231,21 @@ CMD ["nginx", "-g", "daemon off;"]
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
diagram:
|
||||
viewer:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: diagram-viewer
|
||||
container_name: viewer
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- traefik_net
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.diagram.rule=Host(`diagram.appmodel.nl`)"
|
||||
- "traefik.http.routers.diagram.entrypoints=websecure"
|
||||
- "traefik.http.routers.diagram.tls=true"
|
||||
- "traefik.http.routers.diagram.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.services.diagram.loadbalancer.server.port=80"
|
||||
- "traefik.http.routers.viewer.rule=Host(`viewer.appmodel.nl`)"
|
||||
- "traefik.http.routers.viewer.entrypoints=websecure"
|
||||
- "traefik.http.routers.viewer.tls=true"
|
||||
- "traefik.http.routers.viewer.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.services.viewer.loadbalancer.server.port=80"
|
||||
|
||||
networks:
|
||||
traefik_net:
|
||||
@@ -274,7 +274,7 @@ python lan_architecture.py
|
||||
|
||||
# Commit and push
|
||||
git add .
|
||||
git commit -m "Update diagram architecture"
|
||||
git commit -m "Update viewer architecture"
|
||||
git push
|
||||
```
|
||||
|
||||
@@ -295,13 +295,13 @@ If needed, manually trigger deployment:
|
||||
|
||||
```bash
|
||||
# On server
|
||||
app-deploy diagram
|
||||
app-deploy viewer
|
||||
|
||||
# Or manually
|
||||
cd /opt/apps/diagram
|
||||
cd /opt/apps/viewer
|
||||
git pull
|
||||
cd /home/tour/infra/diagram
|
||||
docker compose up -d --build diagram
|
||||
cd /home/tour/infra/viewer
|
||||
docker compose up -d --build viewer
|
||||
```
|
||||
|
||||
## Monitoring & Troubleshooting
|
||||
@@ -310,39 +310,39 @@ docker compose up -d --build diagram
|
||||
|
||||
```bash
|
||||
# Deployment logs
|
||||
tail -f /var/log/app-deploy-diagram.log
|
||||
tail -f /var/log/app-deploy-viewer.log
|
||||
|
||||
# Container logs
|
||||
cd /home/tour/infra/diagram
|
||||
docker compose logs -f diagram
|
||||
cd /home/tour/infra/viewer
|
||||
docker compose logs -f viewer
|
||||
|
||||
# Nginx access logs (if volume mounted)
|
||||
tail -f /home/tour/infra/diagram/logs/access.log
|
||||
tail -f /home/tour/infra/viewer/logs/access.log
|
||||
```
|
||||
|
||||
### Check Container Status
|
||||
|
||||
```bash
|
||||
cd /home/tour/infra/diagram
|
||||
cd /home/tour/infra/viewer
|
||||
|
||||
# List running containers
|
||||
docker compose ps
|
||||
|
||||
# Inspect container
|
||||
docker compose exec diagram sh
|
||||
docker compose exec viewer sh
|
||||
|
||||
# Test nginx config
|
||||
docker compose exec diagram nginx -t
|
||||
docker compose exec viewer nginx -t
|
||||
```
|
||||
|
||||
### Debug Build Issues
|
||||
|
||||
```bash
|
||||
# Rebuild without cache
|
||||
docker compose build --no-cache diagram
|
||||
docker compose build --no-cache viewer
|
||||
|
||||
# View build output
|
||||
docker compose up --build diagram
|
||||
docker compose up --build viewer
|
||||
|
||||
# Check image layers
|
||||
docker image history diagram-viewer
|
||||
@@ -356,7 +356,7 @@ docker image history diagram-viewer
|
||||
|
||||
**Solution**: Verify `requirements.txt` is correct
|
||||
```bash
|
||||
cd /opt/apps/diagram
|
||||
cd /opt/apps/viewer
|
||||
cat requirements.txt
|
||||
```
|
||||
|
||||
@@ -366,7 +366,7 @@ cat requirements.txt
|
||||
|
||||
**Solution**: Check if files were copied correctly
|
||||
```bash
|
||||
docker compose exec diagram ls -la /usr/share/nginx/html/
|
||||
docker compose exec viewer ls -la /usr/share/nginx/html/
|
||||
```
|
||||
|
||||
#### 3. Traefik Not Routing
|
||||
@@ -375,8 +375,8 @@ docker compose exec diagram ls -la /usr/share/nginx/html/
|
||||
|
||||
**Solution**:
|
||||
- Verify container is on `traefik_net`: `docker network inspect traefik_net`
|
||||
- Check Traefik labels: `docker inspect diagram-viewer | grep traefik`
|
||||
- Verify DNS: `nslookup diagram.appmodel.nl`
|
||||
- Check Traefik labels: `docker inspect viewer | grep traefik`
|
||||
- Verify DNS: `nslookup viewer.appmodel.nl`
|
||||
|
||||
#### 4. Git Pull Fails
|
||||
|
||||
@@ -384,7 +384,7 @@ docker compose exec diagram ls -la /usr/share/nginx/html/
|
||||
|
||||
**Solution**:
|
||||
- Check SSH keys for git user: `sudo -u git ssh -T git@git.appmodel.nl`
|
||||
- Verify remote: `cd /opt/apps/diagram && git remote -v`
|
||||
- Verify remote: `cd /opt/apps/viewer && git remote -v`
|
||||
|
||||
## Security Considerations
|
||||
|
||||
@@ -407,7 +407,7 @@ For apps requiring secrets:
|
||||
```yaml
|
||||
# In docker-compose.yml
|
||||
services:
|
||||
diagram:
|
||||
viewer:
|
||||
environment:
|
||||
- SECRET_KEY=${SECRET_KEY}
|
||||
env_file:
|
||||
@@ -416,8 +416,8 @@ services:
|
||||
|
||||
Create `.env` file on server:
|
||||
```bash
|
||||
echo "SECRET_KEY=your-secret-here" > /home/tour/infra/diagram/.env
|
||||
chmod 600 /home/tour/infra/diagram/.env
|
||||
echo "SECRET_KEY=your-secret-here" > /home/tour/infra/viewer/.env
|
||||
chmod 600 /home/tour/infra/viewer/.env
|
||||
```
|
||||
|
||||
## Scaling & Future Improvements
|
||||
@@ -490,7 +490,7 @@ Add monitoring stack:
|
||||
| Service | URL |
|
||||
|---------|-----|
|
||||
| Gitea | https://git.appmodel.nl |
|
||||
| Diagram Viewer | https://diagram.appmodel.nl |
|
||||
| Diagram Viewer | https://viewer.appmodel.nl |
|
||||
| Traefik Dashboard | https://traefik.appmodel.nl/dashboard/ |
|
||||
|
||||
## Support
|
||||
|
||||
54
Home.md
54
Home.md
@@ -25,8 +25,8 @@ This project provides a static web interface for viewing and managing network ar
|
||||
|
||||
```bash
|
||||
# Clone repository
|
||||
git clone git@git.appmodel.nl:Tour/diagram.git
|
||||
cd diagram
|
||||
git clone git@git.appmodel.nl:Tour/viewer.git
|
||||
cd viewer
|
||||
|
||||
# Create virtual environment
|
||||
python -m venv .venv
|
||||
@@ -47,7 +47,7 @@ python main.py
|
||||
### Project Structure
|
||||
|
||||
```
|
||||
diagram/
|
||||
viewer/
|
||||
├── Dockerfile # Multi-stage build for production
|
||||
├── docker-compose.yml # Docker Compose configuration
|
||||
├── requirements.txt # Python dependencies
|
||||
@@ -121,11 +121,11 @@ The project uses a fully automated Docker-based deployment pipeline:
|
||||
|
||||
```bash
|
||||
# On server: Create app structure
|
||||
apps-create diagram static-fe
|
||||
apps-create viewer static-fe
|
||||
|
||||
# This creates:
|
||||
# - /opt/apps/diagram (git repository)
|
||||
# - /home/tour/infra/diagram/docker-compose.yml
|
||||
# - /opt/apps/viewer (git repository)
|
||||
# - /home/tour/infra/viewer/docker-compose.yml
|
||||
```
|
||||
|
||||
#### 2. Configure Gitea Hook
|
||||
@@ -134,7 +134,7 @@ In repository **Settings → Git Hooks → post-receive**:
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
/usr/local/bin/app-deploy diagram
|
||||
/usr/local/bin/app-deploy viewer
|
||||
```
|
||||
|
||||
#### 3. Deploy
|
||||
@@ -149,7 +149,7 @@ The server automatically:
|
||||
- Pulls latest code
|
||||
- Rebuilds Docker image
|
||||
- Restarts container
|
||||
- Updates live site at https://diagram.appmodel.nl
|
||||
- Updates live site at https://viewer.appmodel.nl
|
||||
|
||||
### Manual Deployment
|
||||
|
||||
@@ -157,24 +157,24 @@ If needed:
|
||||
|
||||
```bash
|
||||
# On server
|
||||
app-deploy diagram
|
||||
app-deploy viewer
|
||||
|
||||
# Or step-by-step
|
||||
cd /opt/apps/diagram
|
||||
cd /opt/apps/viewer
|
||||
git pull
|
||||
cd /home/tour/infra/diagram
|
||||
docker compose up -d --build diagram
|
||||
cd /home/tour/infra/viewer
|
||||
docker compose up -d --build viewer
|
||||
```
|
||||
|
||||
### Monitoring
|
||||
|
||||
```bash
|
||||
# View deployment logs
|
||||
tail -f /var/log/app-deploy-diagram.log
|
||||
tail -f /var/log/app-deploy-viewer.log
|
||||
|
||||
# View container logs
|
||||
cd /home/tour/infra/diagram
|
||||
docker compose logs -f diagram
|
||||
cd /home/tour/infra/viewer
|
||||
docker compose logs -f viewer
|
||||
|
||||
# Check container status
|
||||
docker compose ps
|
||||
@@ -193,7 +193,7 @@ docker compose ps
|
||||
│ │
|
||||
│ ┌──────────────┐ │
|
||||
│ │ Gitea │ (Source of Truth) │
|
||||
│ │ Tour/diagram │ │
|
||||
│ │ Tour/viewer │ │
|
||||
│ └──────┬───────┘ │
|
||||
│ │ git push │
|
||||
│ ↓ │
|
||||
@@ -201,10 +201,10 @@ docker compose ps
|
||||
│ │ Post-Receive │ (Auto-trigger) │
|
||||
│ │ Hook │ │
|
||||
│ └──────┬───────┘ │
|
||||
│ │ app-deploy diagram │
|
||||
│ │ app-deploy viewer │
|
||||
│ ↓ │
|
||||
│ ┌──────────────────────┐ │
|
||||
│ │ /opt/apps/diagram/ │ │
|
||||
│ │ /opt/apps/viewer/ │ │
|
||||
│ │ (Git Repository) │ │
|
||||
│ └──────┬───────────────┘ │
|
||||
│ │ git pull │
|
||||
@@ -238,7 +238,7 @@ docker compose ps
|
||||
│ └──────┬───────────────┘ │
|
||||
│ │ HTTPS │
|
||||
│ ↓ │
|
||||
│ diagram.appmodel.nl │
|
||||
│ viewer.appmodel.nl │
|
||||
│ │
|
||||
└─────────────────────────────────────────────┘
|
||||
```
|
||||
@@ -262,7 +262,7 @@ The diagram viewer documents our home lab infrastructure:
|
||||
|
||||
| Service | URL | Description |
|
||||
|---------|-----|-------------|
|
||||
| Diagram Viewer | https://diagram.appmodel.nl | This application |
|
||||
| Diagram Viewer | https://viewer.appmodel.nl | This application |
|
||||
| Gitea | https://git.appmodel.nl | Git hosting |
|
||||
| Auction Frontend | https://auction.appmodel.nl | Auction platform |
|
||||
| Aupi API | https://aupi.appmodel.nl | Backend API |
|
||||
@@ -328,11 +328,11 @@ pip install --upgrade diagrams
|
||||
**Solution**:
|
||||
```bash
|
||||
# Check deployment logs
|
||||
tail -f /var/log/app-deploy-diagram.log
|
||||
tail -f /var/log/app-deploy-viewer.log
|
||||
|
||||
# Rebuild manually with verbose output
|
||||
cd /home/tour/infra/diagram
|
||||
docker compose build --no-cache --progress=plain diagram
|
||||
cd /home/tour/infra/viewer
|
||||
docker compose build --no-cache --progress=plain viewer
|
||||
```
|
||||
|
||||
#### Site Not Accessible
|
||||
@@ -340,8 +340,8 @@ docker compose build --no-cache --progress=plain diagram
|
||||
**Problem**: Container runs but site not reachable
|
||||
|
||||
**Solution**:
|
||||
1. Check DNS: `nslookup diagram.appmodel.nl`
|
||||
2. Verify Traefik labels: `docker inspect diagram-viewer | grep traefik`
|
||||
1. Check DNS: `nslookup viewer.appmodel.nl`
|
||||
2. Verify Traefik labels: `docker inspect viewer-viewer | grep traefik`
|
||||
3. Check Traefik logs: `docker logs traefik`
|
||||
4. Test container directly: `curl http://localhost:PORT`
|
||||
|
||||
@@ -352,9 +352,9 @@ docker compose build --no-cache --progress=plain diagram
|
||||
**Solution**:
|
||||
```bash
|
||||
# Force rebuild on server
|
||||
cd /home/tour/infra/diagram
|
||||
cd /home/tour/infra/viewer
|
||||
docker compose down
|
||||
docker compose up -d --build --force-recreate diagram
|
||||
docker compose up -d --build --force-recreate viewer
|
||||
|
||||
# Clear browser cache
|
||||
# Ctrl+Shift+R (Windows/Linux) or Cmd+Shift+R (macOS)
|
||||
|
||||
@@ -7,8 +7,8 @@ Get up and running with the Diagram Viewer in minutes.
|
||||
### 1. Clone Repository
|
||||
|
||||
```bash
|
||||
git clone git@git.appmodel.nl:Tour/diagram.git
|
||||
cd diagram
|
||||
git clone git@git.appmodel.nl:Tour/viewer.git
|
||||
cd viewer
|
||||
```
|
||||
|
||||
### 2. Setup Environment
|
||||
@@ -74,7 +74,7 @@ git push origin main
|
||||
|
||||
Simply navigate to:
|
||||
```
|
||||
https://diagram.appmodel.nl
|
||||
https://viewer.appmodel.nl
|
||||
```
|
||||
|
||||
### Manual Deployment
|
||||
@@ -83,13 +83,13 @@ On the server:
|
||||
|
||||
```bash
|
||||
# Trigger deployment
|
||||
app-deploy diagram
|
||||
app-deploy viewer
|
||||
|
||||
# View logs
|
||||
tail -f /var/log/app-deploy-diagram.log
|
||||
tail -f /var/log/app-deploy-viewer.log
|
||||
|
||||
# Check status
|
||||
cd /home/tour/infra/diagram
|
||||
cd /home/tour/infra/viewer
|
||||
docker compose ps
|
||||
```
|
||||
|
||||
@@ -97,27 +97,27 @@ docker compose ps
|
||||
|
||||
```bash
|
||||
# Deployment logs
|
||||
tail -f /var/log/app-deploy-diagram.log
|
||||
tail -f /var/log/app-deploy-viewer.log
|
||||
|
||||
# Container logs
|
||||
cd /home/tour/infra/diagram
|
||||
docker compose logs -f diagram
|
||||
cd /home/tour/infra/viewer
|
||||
docker compose logs -f viewer
|
||||
|
||||
# Last 100 lines
|
||||
docker compose logs --tail=100 diagram
|
||||
docker compose logs --tail=100 viewer
|
||||
```
|
||||
|
||||
### Restart Service
|
||||
|
||||
```bash
|
||||
cd /home/tour/infra/diagram
|
||||
cd /home/tour/infra/viewer
|
||||
|
||||
# Restart container
|
||||
docker compose restart diagram
|
||||
docker compose restart viewer
|
||||
|
||||
# Full restart (rebuild)
|
||||
docker compose down
|
||||
docker compose up -d --build diagram
|
||||
docker compose up -d --build viewer
|
||||
```
|
||||
|
||||
---
|
||||
@@ -176,10 +176,10 @@ git push
|
||||
docker compose ps
|
||||
|
||||
# Health check
|
||||
docker inspect diagram-viewer | grep -A 10 Health
|
||||
docker inspect viewer | grep -A 10 Health
|
||||
|
||||
# Test endpoint
|
||||
curl -I https://diagram.appmodel.nl
|
||||
curl -I https://viewer.appmodel.nl
|
||||
```
|
||||
|
||||
---
|
||||
@@ -190,11 +190,11 @@ curl -I https://diagram.appmodel.nl
|
||||
|
||||
```bash
|
||||
# Check logs
|
||||
tail -f /var/log/app-deploy-diagram.log
|
||||
tail -f /var/log/app-deploy-viewer.log
|
||||
|
||||
# Rebuild with verbose output
|
||||
cd /home/tour/infra/diagram
|
||||
docker compose build --no-cache --progress=plain diagram
|
||||
cd /home/tour/infra/viewer
|
||||
docker compose build --no-cache --progress=plain viewer
|
||||
```
|
||||
|
||||
### Site Not Loading
|
||||
@@ -204,10 +204,10 @@ docker compose build --no-cache --progress=plain diagram
|
||||
docker compose ps
|
||||
|
||||
# Check Traefik routing
|
||||
docker logs traefik | grep diagram
|
||||
docker logs traefik | grep viewer
|
||||
|
||||
# Test DNS
|
||||
nslookup diagram.appmodel.nl
|
||||
nslookup viewer.appmodel.nl
|
||||
|
||||
# Test directly
|
||||
curl http://localhost:PORT
|
||||
@@ -217,8 +217,8 @@ curl http://localhost:PORT
|
||||
|
||||
```bash
|
||||
# Force rebuild
|
||||
cd /home/tour/infra/diagram
|
||||
docker compose up -d --build --force-recreate diagram
|
||||
cd /home/tour/infra/viewer
|
||||
docker compose up -d --build --force-recreate viewer
|
||||
|
||||
# Clear browser cache
|
||||
# Ctrl+Shift+R (Windows/Linux)
|
||||
@@ -232,7 +232,7 @@ docker compose up -d --build --force-recreate diagram
|
||||
- Read the [Home](Home.md) page for comprehensive documentation
|
||||
- Review [DEPLOY_SERVER_SETUP.md](../DEPLOY_SERVER_SETUP.md) for deployment details
|
||||
- Check [Diagrams Library docs](https://diagrams.mingrammer.com/) for icon options
|
||||
- Explore the [Mermaid editor](https://diagram.appmodel.nl) for live diagram editing
|
||||
- Explore the [Mermaid editor](https://viewer.appmodel.nl) for live diagram editing
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ git commit -m "Initialize wiki with documentation"
|
||||
git push origin master
|
||||
|
||||
# 4. View on Gitea
|
||||
# Navigate to: https://git.appmodel.nl/Tour/diagram/wiki
|
||||
# Navigate to: https://git.appmodel.nl/Tour/viewer/wiki
|
||||
```
|
||||
|
||||
### Option 2: Use Git Submodule (Bidirectional Sync)
|
||||
@@ -43,8 +43,8 @@ git push origin master
|
||||
Keep the wiki as a submodule in the main repository for easy synchronization.
|
||||
|
||||
```bash
|
||||
# In the main diagram repository
|
||||
cd /c/vibe/diagram
|
||||
# In the main viewer repository
|
||||
cd /c/vibe/viewer
|
||||
|
||||
# Remove local wiki folder
|
||||
rm -rf wiki/
|
||||
@@ -88,13 +88,13 @@ Similar to submodule but integrates the wiki history into the main repository.
|
||||
|
||||
```bash
|
||||
# Add wiki as subtree
|
||||
git subtree add --prefix=wiki git@git.appmodel.nl:Tour/diagram.wiki.git master --squash
|
||||
git subtree add --prefix=wiki git@git.appmodel.nl:Tour/viewer.wiki.git master --squash
|
||||
|
||||
# Push changes to wiki
|
||||
git subtree push --prefix=wiki git@git.appmodel.nl:Tour/diagram.wiki.git master
|
||||
git subtree push --prefix=wiki git@git.appmodel.nl:Tour/viewer.wiki.git master
|
||||
|
||||
# Pull changes from wiki
|
||||
git subtree pull --prefix=wiki git@git.appmodel.nl:Tour/diagram.wiki.git master --squash
|
||||
git subtree pull --prefix=wiki git@git.appmodel.nl:Tour/viewer.wiki.git master --squash
|
||||
```
|
||||
|
||||
### Option 4: Automated Sync Script
|
||||
@@ -106,7 +106,7 @@ Create `sync-wiki.sh`:
|
||||
#!/bin/bash
|
||||
# sync-wiki.sh - Sync local wiki with Gitea
|
||||
|
||||
WIKI_REPO="git@git.appmodel.nl:Tour/diagram.wiki.git"
|
||||
WIKI_REPO="git@git.appmodel.nl:Tour/viewer.wiki.git"
|
||||
WIKI_DIR="wiki"
|
||||
TEMP_WIKI="/tmp/gitea-wiki-$$"
|
||||
|
||||
@@ -145,7 +145,7 @@ For your deployment pipeline, I recommend **Option 1** with a manual push:
|
||||
### Step-by-Step Setup
|
||||
|
||||
1. **Create wiki repository on Gitea** (if not exists):
|
||||
- Go to: https://git.appmodel.nl/Tour/diagram
|
||||
- Go to: https://git.appmodel.nl/Tour/viewer
|
||||
- Click "Wiki" tab
|
||||
- Create first page (triggers wiki repo creation)
|
||||
|
||||
@@ -153,11 +153,11 @@ For your deployment pipeline, I recommend **Option 1** with a manual push:
|
||||
```bash
|
||||
# Clone wiki repository
|
||||
cd /c/vibe
|
||||
git clone git@git.appmodel.nl:Tour/diagram.wiki.git
|
||||
git clone git@git.appmodel.nl:Tour/viewer.wiki.git
|
||||
|
||||
# Copy your wiki files
|
||||
cd diagram.wiki
|
||||
cp ../diagram/wiki/*.md .
|
||||
cd viewer.wiki
|
||||
cp ../viewer/wiki/*.md .
|
||||
|
||||
# Verify files
|
||||
ls -la
|
||||
@@ -174,7 +174,7 @@ git push origin master
|
||||
```
|
||||
|
||||
3. **Verify on Gitea**:
|
||||
- Navigate to: https://git.appmodel.nl/Tour/diagram/wiki
|
||||
- Navigate to: https://git.appmodel.nl/Tour/viewer/wiki
|
||||
- You should see your wiki pages
|
||||
|
||||
4. **Keep local wiki in main repo** (optional):
|
||||
@@ -226,13 +226,13 @@ To automatically sync wiki on deployment, add to Gitea post-receive hook:
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Deploy main app
|
||||
/usr/local/bin/app-deploy diagram
|
||||
/usr/local/bin/app-deploy viewer
|
||||
|
||||
# Sync wiki (if wiki/ folder exists in repo)
|
||||
if [ -d "/opt/apps/diagram/wiki" ]; then
|
||||
if [ -d "/opt/apps/viewer/wiki" ]; then
|
||||
cd /tmp
|
||||
git clone git@git.appmodel.nl:Tour/diagram.wiki.git gitea-wiki-$$
|
||||
cp /opt/apps/diagram/wiki/*.md /tmp/gitea-wiki-$$/
|
||||
git clone git@git.appmodel.nl:Tour/viewer.wiki.git gitea-wiki-$$
|
||||
cp /opt/apps/viewer/wiki/*.md /tmp/gitea-wiki-$$/
|
||||
cd /tmp/gitea-wiki-$$
|
||||
git add .
|
||||
if ! git diff --staged --quiet; then
|
||||
@@ -249,24 +249,24 @@ fi
|
||||
Based on your current setup, here's what to do:
|
||||
|
||||
```bash
|
||||
# 1. Navigate to your diagram project
|
||||
cd /c/vibe/diagram
|
||||
# 1. Navigate to your viewer project
|
||||
cd /c/vibe/viewer
|
||||
|
||||
# 2. Clone the wiki repository (for viewer, adjust as needed)
|
||||
cd ..
|
||||
git clone git@git.appmodel.nl:Tour/diagram.wiki.git
|
||||
git clone git@git.appmodel.nl:Tour/viewer.wiki.git
|
||||
|
||||
# 3. Copy wiki files
|
||||
cp diagram/wiki/*.md diagram.wiki/
|
||||
cp viewer/wiki/*.md viewer.wiki/
|
||||
|
||||
# 4. Push to Gitea
|
||||
cd diagram.wiki
|
||||
cd viewer.wiki
|
||||
git add .
|
||||
git commit -m "Initialize wiki with deployment documentation"
|
||||
git push origin master
|
||||
|
||||
# 5. Verify
|
||||
# Open: https://git.appmodel.nl/Tour/diagram/wiki
|
||||
# Open: https://git.appmodel.nl/Tour/viewer/wiki
|
||||
```
|
||||
|
||||
## Maintaining Both Wikis
|
||||
@@ -276,9 +276,9 @@ If you want to keep both local and Gitea wikis in sync:
|
||||
### Manual Sync (Simple)
|
||||
```bash
|
||||
# After editing local wiki files
|
||||
cd /c/vibe/diagram/wiki
|
||||
cp *.md /c/vibe/diagram.wiki/
|
||||
cd /c/vibe/diagram.wiki
|
||||
cd /c/vibe/viewer/wiki
|
||||
cp *.md /c/vibe/viewer.wiki/
|
||||
cd /c/vibe/viewer.wiki
|
||||
git add .
|
||||
git commit -m "Update documentation"
|
||||
git push
|
||||
@@ -288,7 +288,7 @@ git push
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"sync-wiki": "cp wiki/*.md ../diagram.wiki/ && cd ../diagram.wiki && git add . && git commit -m 'Sync wiki' && git push"
|
||||
"sync-wiki": "cp wiki/*.md ../viewer.wiki/ && cd ../viewer.wiki && git add . && git commit -m 'Sync wiki' && git push"
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -299,8 +299,8 @@ Or create a `Makefile`:
|
||||
|
||||
sync-wiki:
|
||||
@echo "Syncing wiki to Gitea..."
|
||||
@cp wiki/*.md ../diagram.wiki/
|
||||
@cd ../diagram.wiki && git add . && git commit -m "Sync wiki from main repo" && git push
|
||||
@cp wiki/*.md ../viewer.wiki/
|
||||
@cd ../viewer.wiki && git add . && git commit -m "Sync wiki from main repo" && git push
|
||||
@echo "Wiki synced successfully!"
|
||||
```
|
||||
|
||||
@@ -320,11 +320,11 @@ Usage: `make sync-wiki`
|
||||
### Wiki Repository Doesn't Exist
|
||||
|
||||
Create the wiki first in Gitea UI:
|
||||
1. Go to repository: https://git.appmodel.nl/Tour/diagram
|
||||
1. Go to repository: https://git.appmodel.nl/Tour/viewer
|
||||
2. Click "Wiki" tab
|
||||
3. Click "Create New Page"
|
||||
4. Create a dummy page (will be overwritten)
|
||||
5. Now you can clone `diagram.wiki.git`
|
||||
5. Now you can clone `viewer.wiki.git`
|
||||
|
||||
### Permission Denied
|
||||
|
||||
@@ -337,7 +337,7 @@ ssh -T git@git.appmodel.nl
|
||||
|
||||
If both local and Gitea wiki are edited:
|
||||
```bash
|
||||
cd diagram.wiki
|
||||
cd viewer.wiki
|
||||
git pull origin master
|
||||
# Resolve conflicts manually
|
||||
git add .
|
||||
|
||||
Reference in New Issue
Block a user