{"id":28796162,"url":"https://github.com/bocaletto-luca/server-gen","last_synced_at":"2026-04-13T20:32:37.652Z","repository":{"id":298841542,"uuid":"1001297313","full_name":"bocaletto-luca/server-gen","owner":"bocaletto-luca","description":"Server Generator Author: Bocaletto Luca Server-Gen is a multi-platform Go application that collects system metrics (IP, OS, CPU, memory, users) and emails a templated report on a configurable schedule. It also exposes a /healthz endpoint for basic health checks.","archived":false,"fork":false,"pushed_at":"2025-06-13T07:00:33.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T07:36:23.027Z","etag":null,"topics":["admin","admin-tools","administration","auto-mail","auto-send-message","bocaletto-luca","generator","information","linux","opensource","send-mail","sendmail","server","server-generator","system","tools","windows"],"latest_commit_sha":null,"homepage":"https://bocaletto-luca.github.io/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bocaletto-luca.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,"zenodo":null}},"created_at":"2025-06-13T06:33:40.000Z","updated_at":"2025-06-13T07:02:53.000Z","dependencies_parsed_at":"2025-06-13T07:36:32.092Z","dependency_job_id":"1d3984ea-47db-4e30-806c-35800a2109e4","html_url":"https://github.com/bocaletto-luca/server-gen","commit_stats":null,"previous_names":["bocaletto-luca/server-gen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bocaletto-luca/server-gen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2Fserver-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2Fserver-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2Fserver-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2Fserver-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bocaletto-luca","download_url":"https://codeload.github.com/bocaletto-luca/server-gen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bocaletto-luca%2Fserver-gen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31770720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["admin","admin-tools","administration","auto-mail","auto-send-message","bocaletto-luca","generator","information","linux","opensource","send-mail","sendmail","server","server-generator","system","tools","windows"],"created_at":"2025-06-18T03:11:25.870Z","updated_at":"2026-04-13T20:32:37.644Z","avatar_url":"https://github.com/bocaletto-luca.png","language":"Go","readme":"# Server Generator\n#### Author: Bocaletto Luca\n\n**Server-Gen** is a multi-platform Go application that collects system metrics (IP, OS, CPU, memory, users) and emails a templated report on a configurable schedule. It also exposes a `/healthz` endpoint for basic health checks.\n\n---\n\n## 🚀 Features\n\n- Cron-style scheduling (`@every 30m`, `0 8 * * *`, etc.)  \n- Collects:  \n  - Network interfaces \u0026 IPs  \n  - Hostname \u0026 OS version  \n  - CPU utilization  \n  - Memory usage  \n  - Active users  \n- Sends HTML/text email via SMTP with TLS + retry  \n- Configuration via YAML + environment‐variable overrides  \n- Built-in HTTP health endpoint (`/healthz`)  \n- Structured JSON+console logging (zerolog)  \n- Docker multi-stage build  \n- CI with GitHub Actions (matrix builds, tests, linting)\n\n---\n\n## 📁 Repository Layout\n\n```\nserver-gen/\n├── .github/\n│   └── workflows/ci.yml\n├── cmd/\n│   └── server-gen/\n│       └── main.go\n├── configs/\n│   └── config.yaml\n├── internal/\n│   ├── config/\n│   │   └── config.go\n│   ├── mailer/\n│   │   └── mailer.go\n│   └── sysinfo/\n│       └── sysinfo.go\n├── Dockerfile\n├── go.mod\n└── README.md\n```\n\n---\n\n## ⚙️ Requirements\n\n- Go ≥ 1.21  \n- Docker (optional)  \n- SMTP server (StartTLS or SMTPS)\n\n---\n\n## 🔧 Installation\n\n```bash\n# Clone the repo\ngit clone https://github.com/bocaletto-luca/server-gen.git\ncd server-gen\n\n# Build binary\ngo build -o server-gen ./cmd/server-gen\n```\n\n---\n\n## 🛠️ Configuration\n\nCopy `configs/config.yaml` and fill in your settings. You can also override any value via environment variables.\n\n```yaml\n# configs/config.yaml\nschedule: \"@every 30m\"\n\nsmtp:\n  host: \"${SMTP_HOST}\"\n  port: ${SMTP_PORT}\n  username: \"${SMTP_USER}\"\n  password: \"${SMTP_PASS}\"\n  from: \"${SMTP_FROM}\"\n  to:\n    - \"${SMTP_TO1}\"\n    - \"${SMTP_TO2}\"\n\nmodules:\n  - ip\n  - os\n  - cpu\n  - mem\n  - users\n\nhttp:\n  addr: \":8080\"\n```\n\n**Env vars**  \n```bash\nexport SMTP_HOST=smtp.example.com\nexport SMTP_PORT=587\nexport SMTP_USER=alert@example.com\nexport SMTP_PASS=supersecret\nexport SMTP_FROM=alert@example.com\nexport SMTP_TO1=admin1@example.com\nexport SMTP_TO2=admin2@example.com\n```\n\n---\n\n## ▶️ Usage\n\n```bash\n./server-gen --config configs/config.yaml\n```\n\n- The app starts an HTTP server on `http://localhost:8080/healthz`.  \n- It schedules jobs per `schedule` in the config.  \n- Each run gathers metrics and emails the report.\n\n---\n\n## 🐳 Docker\n\nBuild and run with Docker:\n\n```bash\n# Build image\ndocker build -t bocaletto-luca/server-gen .\n\n# Run container\ndocker run -d \\\n  -v $(pwd)/configs/config.yaml:/app/configs/config.yaml:ro \\\n  -e SMTP_HOST -e SMTP_PORT -e SMTP_USER -e SMTP_PASS \\\n  -e SMTP_FROM -e SMTP_TO1 -e SMTP_TO2 \\\n  --name server-gen \\\n  bocaletto-luca/server-gen\n```\n\n---\n\n## 🧪 Testing \u0026 CI\n\n- **Unit tests**:  \n  ```bash\n  go test ./internal/config\n  go test ./internal/sysinfo\n  go test ./internal/mailer\n  ```\n- **Lint \u0026 vet**:  \n  ```bash\n  go vet ./...\n  ```\n- **GitHub Actions** runs tests \u0026 builds for Go 1.19–1.21.\n\n---\n\n## 🤝 Contributing\n\n1. Fork the repository  \n2. Create a feature branch (`git checkout -b feat/your-feature`)  \n3. Commit your changes (`git commit -m \"feat: ...\"`); run tests  \n4. Push to your branch (`git push origin feat/your-feature`)  \n5. Open a Pull Request\n\n---\n\n## 📄 License\n\nThis project is licensed under the **MGPL License**.  \nSee [LICENSE](LICENSE) for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbocaletto-luca%2Fserver-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbocaletto-luca%2Fserver-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbocaletto-luca%2Fserver-gen/lists"}