{"id":26244230,"url":"https://github.com/dirdr/homelab_config","last_synced_at":"2025-03-13T11:18:52.376Z","repository":{"id":281926756,"uuid":"940166474","full_name":"dirdr/homelab_config","owner":"dirdr","description":"Easy Homelab configuration with traefik, grafana and watchtower","archived":false,"fork":false,"pushed_at":"2025-03-11T21:59:23.000Z","size":824,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T22:23:10.969Z","etag":null,"topics":["cadvisor-exporter","grafana","nodeexporter","prometheus","traefik","watchtower"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dirdr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-27T18:09:22.000Z","updated_at":"2025-03-11T21:59:26.000Z","dependencies_parsed_at":"2025-03-11T22:33:15.552Z","dependency_job_id":null,"html_url":"https://github.com/dirdr/homelab_config","commit_stats":null,"previous_names":["dirdr/homelab_config"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirdr%2Fhomelab_config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirdr%2Fhomelab_config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirdr%2Fhomelab_config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirdr%2Fhomelab_config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dirdr","download_url":"https://codeload.github.com/dirdr/homelab_config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243392326,"owners_count":20283565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cadvisor-exporter","grafana","nodeexporter","prometheus","traefik","watchtower"],"created_at":"2025-03-13T11:18:51.918Z","updated_at":"2025-03-13T11:18:52.358Z","avatar_url":"https://github.com/dirdr.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Gitleaks](https://github.com/dirdr/homelab_config/actions/workflows/gitleaks.yaml/badge.svg)\r\n\r\n# Homelab Configuration 🏗️\r\n\r\nTurns a VPS (or any Linux system you have in hand) into a home lab, allowing you to host and expose services to the internet! 🔬\r\n\r\n- **Reverse Proxy:** Uses Traefik to expose Docker services over the internet.\r\n- **Observability Stack:** Includes Prometheus and Grafana to monitor the infrastructure and containers.\r\n- **Automatic Updates:** Watchtower updates Docker images automatically.\r\n\r\n## Services Included 📦\r\n- **Traefik:**\r\n  - Configured with prebuilt middleware (located in `./traefik/dynamic`), such as rate limiting and simple authentication via labels.\r\n  - Exposes the Traefik admin dashboard to the internet.\r\n  - Uses Let's Encrypt HTTP challenge for automatic TLS certificate provisioning.\r\n  \r\n  ![dashboard](./dashboard.png)\r\n\r\n- **Observability:**  \r\n  - **Prometheus:** Collects metrics from cAdvisor (containers) and Node Exporter (infrastructure).  \r\n  - **Grafana:** Visualizes metrics coming from Prometheus.\r\n  \r\n  ![grafana](./grafana.png)\r\n\r\n---\r\n\r\n## Getting Started 🚀\r\n1. Clone the Repository:\r\n2. Install Docker and Docker Compose\r\n3. Create the traefik network : `docker network create traefik_public`\r\n4. **Configure Environment Variables:**  \r\n   - Duplicate the `env.example` files for each service you want to use and rename them to `.env`.\r\n   - Fill in the necessary information in each environment file.\r\n   - **Important:** Do not commit your `.env` files to your repository!\r\n     \r\n### Traefik 🛫\r\n1. The traefik dashboard is exposed over internet, with the domain provided in `DASHBOARD_DOMAIN` environment variable\r\n2. Simple auth `DASHBOARD_AUTH_USERS` environment variable can be generated using the `./traefik/scripts/generate_simple_auth.sh`\r\n3. Launch the stack with Docker Compose: `docker compose up -d`.\r\n\r\n### Grafana Setup 📊\r\n\r\n1. **Deploy Grafana:**  \r\n   Launch the stack with Docker Compose: `docker compose up -d`.\r\n3. **Access the Interface:**  \r\n   Navigate to your Grafana URL (setted in the env file : `GRAFANA_DOMAIN`.\r\n4. **Login \u0026 Update Credentials:**  \r\n   - to connect, use the values specified in the env file : `GF_ADMIN_SECURITY_USER` and `GF_ADMIN_SECURITY_PASSWORD`.\r\n5. **Configure Data Source:**\r\n   - In the Grafana sidebar, click on **Configuration** (gear icon) and then **Data Sources**.\r\n   - Click **Add data source**, choose **Prometheus**, and set the URL to `http://prometheus:9090`.\r\n   - Click **Save \u0026 Test** to verify connectivity.\r\n6. **Dashboard Setup (Optional):**\r\n   - Import pre-built dashboards by clicking the **+** icon on the left sidebar and selecting **Import**.\r\n   - You can use dashboard IDs from the [Grafana Dashboard Library](https://grafana.com/grafana/dashboards) or create your own.\r\n\r\n### TLS Configuration with Let’s Encrypt 🔒\r\n\r\n1. **Traefik Integration:**  \r\n   Traefik is pre-configured to use Let’s Encrypt for automatic TLS certificate provisioning.\r\n   Replace the `ACME_EMAIL` placeholder inside [traefik static config file](./traefik/traefik.yaml).\r\n\r\n3. **Certificate Resolver Configuration:**  \r\n    Create the `acme.json` under `./traefik/data/` file and give it correct rights\r\n    ```sh\r\n    mkdir ./traefik/data \u0026\u0026 touch ./traefik/data/acme.json\r\n    chmod 600 ./traefik/data/acme.json\r\n    ```\r\n### Watchtower 🗼\r\nThe watchtower service just need to be started : `docker compose up -d` in the service directory\r\n\r\n\u003e [!note]\r\n\u003e Watchtower is designed to update tool images automatically to reduce manual work.\r\n\u003e It is **not** intended to replace a continuous delivery pipeline!\r\n    On the next traefik service launch, your http challenge will be resolved, and you will be able to use the `websecure` entrypoint already configured to use TLS with the certificate\r\n\r\n## Contributing\r\n\r\nContributions are welcome and appreciated! 🎉\r\n\r\nIf you have suggestions, ideas, or find any issues, feel free to open an issue or submit a pull request.\r\nIf you're not sure where to start, feel free to reach out or open a discussion.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirdr%2Fhomelab_config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirdr%2Fhomelab_config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirdr%2Fhomelab_config/lists"}