Get obidian live sync to work and add doc site
This commit is contained in:
@@ -7,3 +7,9 @@ repos:
|
||||
language: system
|
||||
pass_filenames: false
|
||||
always_run: true
|
||||
- id: build-docs-site
|
||||
name: Build docs site
|
||||
entry: make docs
|
||||
language: system
|
||||
pass_filenames: false
|
||||
always_run: true
|
||||
|
||||
8
Makefile
8
Makefile
@@ -1,4 +1,4 @@
|
||||
SERVICES=traefik whoami gitea nextcloud devbox
|
||||
SERVICES=traefik whoami gitea nextcloud devbox docs-site
|
||||
|
||||
.PHONY: up down restart backup init-env env-sync docs generate-docs serve-docs logs status up-% down-%
|
||||
|
||||
@@ -69,12 +69,6 @@ generate-docs:
|
||||
python3 scripts/generate_docs.py
|
||||
|
||||
docs: generate-docs
|
||||
@command -v uvx >/dev/null 2>&1 || { \
|
||||
echo "Error: uvx is not installed or not in PATH."; \
|
||||
echo "Install with: curl -LsSf https://astral.sh/uv/install.sh | sh"; \
|
||||
echo "Then run: source $$HOME/.local/bin/env"; \
|
||||
exit 1; \
|
||||
}
|
||||
uvx --from mkdocs-material --with mkdocs-include-markdown-plugin mkdocs build
|
||||
|
||||
serve-docs: generate-docs
|
||||
|
||||
@@ -28,7 +28,7 @@ Currently includes: Gitea (Git hosting), Nextcloud (cloud storage), Devbox (deve
|
||||
|
||||
## Documentation
|
||||
|
||||
Full documentation is available at the [MkDocs site](https://homelab.sjhl.nz) or build locally with `make docs`.
|
||||
Full documentation is available at the [MkDocs site](https://docs.sjhl.nz) or build locally with `make docs`.
|
||||
|
||||
## Directory Structure
|
||||
|
||||
|
||||
7
docs-site/README.md
Normal file
7
docs-site/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
Serves the generated MkDocs static output from `../site` using NGINX.
|
||||
|
||||
Routing is handled by Traefik with host `docs.${DOMAIN}`.
|
||||
|
||||
Deploy flow:
|
||||
1. Build docs: `make docs`
|
||||
2. Start container: `make up-docs-site` (or `make up`)
|
||||
20
docs-site/docker-compose.yml
Normal file
20
docs-site/docker-compose.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
services:
|
||||
docs-site:
|
||||
image: nginx:alpine
|
||||
container_name: docs-site
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ../site:/usr/share/nginx/html:ro
|
||||
networks:
|
||||
- web
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.docs-site.entrypoints=websecure"
|
||||
- "traefik.http.routers.docs-site.rule=Host(`docs.${DOMAIN}`)"
|
||||
- "traefik.http.routers.docs-site.tls=true"
|
||||
- "traefik.http.routers.docs-site.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.services.docs-site.loadbalancer.server.port=80"
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
@@ -16,6 +16,7 @@ Welcome to Seirian & James' homelab documentation! This is a docs site that is b
|
||||
| Service | Image | Status |
|
||||
|---------|-------|--------|
|
||||
| [devbox](services/devbox.md) | `devbox-devcontainer` | active |
|
||||
| [docs-site](services/docs-site.md) | `nginx:alpine` | active |
|
||||
| [gitea](services/gitea.md) | `gitea/gitea:1.24.3` | active |
|
||||
| [nextcloud](services/nextcloud.md) | `ghcr.io/nextcloud-releases/all-in-one:latest` | active |
|
||||
| [obsidian-livesync](services/obsidian-livesync.md) | `couchdb:latest` | active |
|
||||
|
||||
10
docs/services/docs-site.md
Normal file
10
docs/services/docs-site.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# docs-site
|
||||
|
||||
|
||||
--8<-- "docs-site/README.md"
|
||||
> Below are the configuration files for this service. For details on how to deploy or customize, refer to the README above or the official documentation for the service.
|
||||
## Docker Compose Configuration
|
||||
|
||||
```yaml
|
||||
--8<-- "docs-site/docker-compose.yml"
|
||||
```
|
||||
@@ -1,6 +1,7 @@
|
||||
# obsidian-livesync
|
||||
|
||||
|
||||
--8<-- "obsidian-livesync/README.md"
|
||||
> Below are the configuration files for this service. For details on how to deploy or customize, refer to the README above or the official documentation for the service.
|
||||
## Docker Compose Configuration
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ nav:
|
||||
- Recovery Reference: recovery.md
|
||||
- Services:
|
||||
- Devbox: services/devbox.md
|
||||
- Docs Site: services/docs-site.md
|
||||
- Gitea: services/gitea.md
|
||||
- Nextcloud: services/nextcloud.md
|
||||
- Obsidian Livesync: services/obsidian-livesync.md
|
||||
|
||||
@@ -3,4 +3,3 @@
|
||||
|
||||
COUCHDB_USER=admin
|
||||
COUCHDB_PASSWORD=REPLACE_WITH_STRONG_PASSWORD
|
||||
COUCHDB_PORT=5984
|
||||
|
||||
1
obsidian-livesync/README.md
Normal file
1
obsidian-livesync/README.md
Normal file
@@ -0,0 +1 @@
|
||||
*Note*: When setting up for the first time you need to create the directories for both the etc and the data and make sure they are owned by the same UID as the CouchDB container (default 5984) to avoid permission issues.
|
||||
@@ -3,13 +3,36 @@ services:
|
||||
image: couchdb:latest
|
||||
container_name: obsidian-livesync
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${COUCHDB_PORT:-5984}:5984"
|
||||
volumes:
|
||||
- ${STORAGE_PATH}/obsidian:/opt/couchdb/data
|
||||
env_file:
|
||||
- ../.env
|
||||
- .env
|
||||
environment:
|
||||
- COUCHDB_USER=${COUCHDB_USER:-admin}
|
||||
- COUCHDB_USER=${COUCHDB_USER}
|
||||
- COUCHDB_PASSWORD=${COUCHDB_PASSWORD}
|
||||
volumes:
|
||||
- ${STORAGE_PATH}/obsidian-livesync/data:/opt/couchdb/data
|
||||
- ${STORAGE_PATH}/obsidian-livesync/local.ini:/opt/couchdb/etc/local.d
|
||||
ports:
|
||||
- 5984:5984
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
# The Traefik Network
|
||||
- "traefik.docker.network=web"
|
||||
# Don't forget to replace 'obsidian-livesync.example.org' with your own domain
|
||||
- "traefik.http.routers.obsidian-livesync.rule=Host(`obsidian-livesync.${DOMAIN}`)"
|
||||
# The 'websecure' entryPoint is basically your HTTPS entrypoint. Check the next code snippet if you are encountering problems only; you probably have a working traefik configuration if this is not your first container you are reverse proxying.
|
||||
- "traefik.http.routers.obsidian-livesync.entrypoints=websecure"
|
||||
- "traefik.http.routers.obsidian-livesync.service=obsidian-livesync"
|
||||
- "traefik.http.services.obsidian-livesync.loadbalancer.server.port=5984"
|
||||
- "traefik.http.routers.obsidian-livesync.tls=true"
|
||||
# Replace the string 'letsencrypt' with your own certificate resolver
|
||||
- "traefik.http.routers.obsidian-livesync.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.middlewares.obsidiancors.headers.accessControlAllowOriginList=app://obsidian.md,capacitor://localhost,http://localhost"
|
||||
- "traefik.http.middlewares.obsidiancors.headers.accessControlAllowMethods=GET,POST,PUT,DELETE,OPTIONS,HEAD"
|
||||
- "traefik.http.middlewares.obsidiancors.headers.accessControlAllowHeaders=Authorization,Content-Type,Accept,Origin,X-Requested-With"
|
||||
- "traefik.http.middlewares.obsidiancors.headers.accessControlAllowCredentials=true"
|
||||
- "traefik.http.middlewares.obsidiancors.headers.accessControlMaxAge=86400"
|
||||
- "traefik.http.middlewares.obsidiancors.headers.addVaryHeader=true"
|
||||
- "traefik.http.routers.obsidian-livesync.middlewares=obsidiancors"
|
||||
networks:
|
||||
- web
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
Reference in New Issue
Block a user