diff --git a/.gitignore b/.gitignore index e69b273..29e5061 100644 --- a/.gitignore +++ b/.gitignore @@ -75,10 +75,6 @@ Thumbs.db *.tfstate.backup .terraform/ -# Monitoring & temp -prometheus/ -grafana/ - # Agent / Tool files .github/instructions/TODO.md .github/instructions/DONE.md diff --git a/SETUP.md b/SETUP.md index c541d2e..6bae224 100644 --- a/SETUP.md +++ b/SETUP.md @@ -249,8 +249,38 @@ For testing deployments on a local network server without setting up a full prod #### Test Environment Prerequisites -- A remote server running Docker at IP `192.168.88.40`. -- Docker TCP socket enabled and listening on port `2375` on the remote server (ensure this port is secured/firewalled to trusted local IPs only). +- A remote server running Docker at IP `192.168.88.40` (running Alpine Linux). +- Docker TCP socket enabled and listening on port `2375` on the remote server. + +##### Enabling Docker TCP Socket on Alpine Linux + +To allow the Gitea Actions runner (or your local machine) to deploy to the remote Alpine host, you must configure the Docker daemon to listen on the TCP socket: + +1. Edit `/etc/conf.d/docker` on the Alpine host: + + ```bash + vi /etc/conf.d/docker + ``` + +2. Update the `DOCKER_OPTS` line to include both the unix socket and the TCP socket: + + ```bash + DOCKER_OPTS="-H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375" + ``` + +3. Restart the Docker service: + + ```bash + rc-service docker restart + ``` + +4. Verify that Docker is listening on port `2375`: + + ```bash + netstat -tlnp | grep 2375 + ``` + +5. Ensure any firewall (like `awall` or `iptables`) on the Alpine host allows incoming traffic on port `2375` from your local network subnet (e.g., `192.168.88.0/24`). #### Deployment Steps diff --git a/monitoring/grafana/dashboard.json b/monitoring/grafana/dashboard.json new file mode 100644 index 0000000..bfe3d65 --- /dev/null +++ b/monitoring/grafana/dashboard.json @@ -0,0 +1,39 @@ +{ + "title": "Linear Void Monitoring", + "panels": [ + { + "title": "Concurrent Viewers", + "type": "timeseries", + "targets": [{ "expr": "linearvoid_chat_connected_clients" }] + }, + { + "title": "Stored Messages", + "type": "stat", + "targets": [ + { + "expr": "linearvoid_chat_messages_total" + } + ] + }, + { + "title": "Moderation Actions", + "type": "timeseries", + "targets": [{ "expr": "linearvoid_chat_moderation_actions_total" }] + }, + { + "title": "Redis Reachable", + "type": "stat", + "targets": [{ "expr": "linearvoid_chat_redis_up" }] + }, + { + "title": "Admin Sessions", + "type": "timeseries", + "targets": [{ "expr": "linearvoid_chat_admin_sessions_active" }] + }, + { + "title": "Chat Scrape Health", + "type": "stat", + "targets": [{ "expr": "up{job=\"chat\"}" }] + } + ] +} diff --git a/monitoring/prometheus/prometheus.yml b/monitoring/prometheus/prometheus.yml new file mode 100644 index 0000000..5da67f2 --- /dev/null +++ b/monitoring/prometheus/prometheus.yml @@ -0,0 +1,10 @@ +global: + scrape_interval: 15s + +scrape_configs: + - job_name: "chat" + static_configs: + - targets: ["chat:3000"] + - job_name: "prometheus" + static_configs: + - targets: ["prometheus:9090"]