{"id":49357723,"url":"https://github.com/arifintahu/astral","last_synced_at":"2026-04-27T14:06:04.537Z","repository":{"id":353764500,"uuid":"1174514414","full_name":"arifintahu/astral","owner":"arifintahu","description":"Ultra-lightweight server monitoring dashboard","archived":false,"fork":false,"pushed_at":"2026-04-25T12:51:14.000Z","size":298,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-25T13:26:58.964Z","etag":null,"topics":["dashboard","monitoring","rust","server","svelte"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/arifintahu.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-06T14:30:32.000Z","updated_at":"2026-04-22T13:42:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/arifintahu/astral","commit_stats":null,"previous_names":["arifintahu/astral"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/arifintahu/astral","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifintahu%2Fastral","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifintahu%2Fastral/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifintahu%2Fastral/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifintahu%2Fastral/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arifintahu","download_url":"https://codeload.github.com/arifintahu/astral/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arifintahu%2Fastral/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32339362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["dashboard","monitoring","rust","server","svelte"],"created_at":"2026-04-27T14:06:02.413Z","updated_at":"2026-04-27T14:06:04.527Z","avatar_url":"https://github.com/arifintahu.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Astral\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/icon.svg\" alt=\"Astral icon\" width=\"128\" height=\"128\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/arifintahu/astral/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/arifintahu/astral\" alt=\"GitHub stars\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nAstral is a pragmatic, ultra-lightweight server monitoring dashboard. It bridges the gap between basic CLI tools like `htop` and complex observability stacks like Prometheus/Grafana.\n\nAstral provides a modern, single-page web UI that displays real-time system health and historical trends, secured by default, with built-in webhook alerting—all packaged into a single, easily deployable binary.\n\n![Astral App Screenshot](demo.jpeg)\n\n## Features\n\n-   **Real-time Monitoring:** Live updates (1-second intervals) for CPU, Memory, Network, and Disk usage via Server-Sent Events (SSE).\n-   **Historical Data:** Interactive charts for viewing trends over 6 hours, 24 hours, or 7 days, backed by an embedded SQLite database.\n-   **Single Binary Deployment:** The Svelte frontend is embedded directly into the Rust binary. No external runtime dependencies (Node.js, Python, etc.) required on the host.\n-   **Secure by Default:** HMAC-SHA256 session tokens with per-login nonces, `HttpOnly; SameSite=Strict` cookies, Argon2 password hashing, login rate limiting, server-side session revocation, and a full set of security headers (CSP, HSTS, X-Frame-Options).\n-   **Alerting:** Configurable webhook alerts (HTTPS only) for high CPU or memory usage (sustained 5 minutes), with a 15-minute per-kind cooldown to prevent alert floods.\n-   **Lightweight:** Minimal resource footprint, designed for small to medium-sized VPS and servers.\n\n## Benchmarks\n\nRunning `./benchmark.sh` on a standard development environment:\n\n| Metric | Value |\n| :--- | :--- |\n| **Binary Size** | 7.1M (7362848 bytes) |\n| **Execution Time** | 1.53ms (Time to Ready) |\n| **Peak Memory (RSS)** | 8.88 MB |\n\n## Installation\n\n### Download Binary\n\nPre-built binaries for Linux (amd64), Windows (amd64), and macOS (Apple Silicon) are available on the [Releases](https://github.com/yourusername/astral/releases) page.\n\n1.  Download the latest release for your platform.\n2.  Make the binary executable (Linux/macOS):\n    ```bash\n    chmod +x astral-linux-amd64\n    ```\n3.  Run it:\n    ```bash\n    ./astral-linux-amd64\n    ```\n\n### Docker Deployment\n\nFor production environments, deploying via Docker ensures a consistent runtime and easy updates.\n\nThe provided `docker-compose.yml` is configured to run Astral with host networking and PID access, allowing it to monitor the host system accurately.\n\n1.  **Set credentials via environment variable:**\n    ```bash\n    cp .env.example .env\n    # Set ASTRAL_AUTH=youruser:yourpassword in .env\n    ```\n\n2.  **Start the service:**\n    ```bash\n    docker-compose up -d --build\n    ```\n\n3.  **Access the dashboard:**\n    Open `http://\u003cyour-server-ip\u003e:8080` (behind a TLS-terminating reverse proxy in production — see [TLS](#tls) below).\n\n**Important Notes:**\n-   **Host Monitoring:** Astral requires `--network host` and `--pid host` (along with `/proc` and `/sys` mounts) to accurately monitor the host system's CPU, memory, and network usage from within a container. Without these, it will only monitor the container's isolated environment.\n-   **Data Persistence:** The SQLite database is stored in `/app/data` inside the container. Use a volume (e.g., `astral_data`) to persist historical data across restarts.\n-   **Credentials:** Pass `ASTRAL_AUTH=user:pass` as an environment variable rather than a CLI flag. This keeps the password out of `docker inspect` output and process lists.\n\n### Build from Source\n\nTo build Astral from source, you need:\n-   **Rust:** Latest stable version (install via [rustup](https://rustup.rs/)).\n-   **Node.js \u0026 npm:** For building the frontend assets.\n\n1.  **Clone the repository:**\n    ```bash\n    git clone https://github.com/arifintahu/astral.git\n    cd astral\n    ```\n\n2.  **Build the Frontend:**\n    ```bash\n    cd web\n    npm install\n    npm run build\n    cd ..\n    ```\n\n3.  **Build \u0026 Run the Backend:**\n    ```bash\n    cargo run --release\n    ```\n\n    Or build a release binary:\n    ```bash\n    cargo build --release\n    # Binary will be at target/release/astral\n    ```\n\n## Usage\n\nBy default, Astral listens on port `8080`.\n\n```bash\n./astral [OPTIONS]\n```\n\n### Configuration\n\nCredentials can be supplied via environment variable (recommended — avoids exposing the password in `ps` output and shell history) or via the `--auth` flag:\n\n```bash\n# Preferred: environment variable\nASTRAL_AUTH=admin:secret123 ./astral\n\n# Alternative: flag (visible in process list — avoid on shared hosts)\n./astral --auth admin:secret123\n```\n\nIf neither is provided, Astral generates random credentials and prints them once to stderr on startup.\n\n### Flags\n\n| Flag | Env var | Description | Default |\n| :--- | :--- | :--- | :--- |\n| `--port \u003cPORT\u003e` | — | Port to listen on. | `8080` |\n| `--auth \u003cUSER:PASS\u003e` | `ASTRAL_AUTH` | Login credentials. | auto-generated |\n| `--webhook \u003cURL\u003e` | — | HTTPS webhook URL for alerts. | `None` |\n| `--alert-cpu \u003c%\u003e` | — | CPU threshold for alerts (0–100). | `90` |\n| `--alert-ram \u003c%\u003e` | — | Memory threshold for alerts (0–100). | `90` |\n| `--enable-process-list` | — | Include top processes in the live feed. | off |\n\n\u003e **Note:** `--webhook` only accepts `https://` URLs. HTTP webhook URLs are rejected to prevent SSRF.\n\n### Examples\n\n**Run with default settings (auto-generated credentials printed to stderr):**\n```bash\n./astral\n```\n\n**Run with custom credentials and port:**\n```bash\nASTRAL_AUTH=admin:secret123 ./astral --port 3000\n```\n\n**Run with webhook alerting and process list enabled:**\n```bash\nASTRAL_AUTH=admin:secret123 ./astral \\\n  --webhook https://discord.com/api/webhooks/... \\\n  --alert-cpu 80 \\\n  --enable-process-list\n```\n\n## TLS\n\nAstral does not terminate TLS itself. For any network-exposed deployment, place it behind a reverse proxy that handles TLS:\n\n**Caddy** (automatic HTTPS):\n```caddyfile\nmonitor.example.com {\n    reverse_proxy localhost:8080\n}\n```\n\n**nginx:**\n```nginx\nserver {\n    listen 443 ssl;\n    server_name monitor.example.com;\n    ssl_certificate     /etc/ssl/certs/cert.pem;\n    ssl_certificate_key /etc/ssl/private/key.pem;\n\n    location / {\n        proxy_pass http://127.0.0.1:8080;\n        proxy_set_header X-Forwarded-Proto https;\n    }\n}\n```\n\nWithout TLS, the session cookie and login credentials are transmitted in plaintext.\n\n## Development\n\nTo run the project in development mode:\n\n1.  **Start the Frontend (HMR):**\n    ```bash\n    cd web\n    npm run dev\n    ```\n    *Note: The Rust backend expects the frontend to be built in `web/dist`. For true hot-reloading dev experience, you might need to proxy requests or rebuild the frontend on changes.*\n\n2.  **Run the Backend:**\n    ```bash\n    cargo run\n    ```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farifintahu%2Fastral","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farifintahu%2Fastral","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farifintahu%2Fastral/lists"}