{"id":46993711,"url":"https://github.com/dionipe/ndash","last_synced_at":"2026-03-11T14:39:00.167Z","repository":{"id":325795145,"uuid":"1094712616","full_name":"dionipe/ndash","owner":"dionipe","description":"NDash adalah dashboard administrasi modern untuk PowerDNS yang dibangun dengan Express.js, EJS, Alpine.js, dan Shadcn UI components.","archived":false,"fork":false,"pushed_at":"2025-11-23T12:15:14.000Z","size":172,"stargazers_count":36,"open_issues_count":0,"forks_count":15,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-23T14:09:10.272Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"EJS","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/dionipe.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":"2025-11-12T04:28:43.000Z","updated_at":"2025-11-23T13:25:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dionipe/ndash","commit_stats":null,"previous_names":["dionipe/ndash"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/dionipe/ndash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dionipe%2Fndash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dionipe%2Fndash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dionipe%2Fndash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dionipe%2Fndash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dionipe","download_url":"https://codeload.github.com/dionipe/ndash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dionipe%2Fndash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30384143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T14:10:17.325Z","status":"ssl_error","status_checked_at":"2026-03-11T14:09:37.934Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2026-03-11T14:38:59.918Z","updated_at":"2026-03-11T14:39:00.154Z","avatar_url":"https://github.com/dionipe.png","language":"EJS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NDash - PowerDNS Admin Dashboard\n\n![NDash Dashboard](https://img.shields.io/badge/version-1.0.0-blue.svg)\n![License](https://img.shields.io/badge/license-MIT-green.svg)\n![Built with](https://img.shields.io/badge/Built%20with-GitHub%20Copilot-000000.svg)\n\n**Built with GitHub Copilot (Grok Code Fast 1)** - AI-assisted development for enhanced productivity and code quality.\n\n**Copyright (c) 2025 NDash Project** - All rights reserved.\n\nNDash adalah dashboard administrasi modern untuk PowerDNS yang dibangun dengan Express.js, EJS, Alpine.js, dan Shadcn UI components.\n\n## ✨ Fitur\n\n- 🎨 **Modern UI**: Menggunakan Tailwind CSS dengan komponen Shadcn UI\n- ⚡ **Reactive**: Alpine.js untuk interaktivitas yang ringan\n- 🔌 **PowerDNS API**: Integrasi lengkap dengan PowerDNS API\n- 📊 **Dashboard**: Overview statistik dan monitoring\n- 🌐 **Zone Management**: Kelola DNS zones dengan mudah\n- 📝 **Record Management**: CRUD operations untuk DNS records\n- 📈 **Statistics**: Visualisasi statistik server PowerDNS\n- ⚠️ **Error Handling**: Banner notifikasi error dengan tombol retry otomatis\n- 🔄 **Auto Refresh**: Refresh data secara manual dengan loading indicator\n\n## 🎯 Error Handling\n\nNDash dilengkapi dengan sistem error handling yang user-friendly:\n\n- **Error Banner**: Muncul secara otomatis ketika ada masalah koneksi ke PowerDNS API\n- **Detailed Messages**: Menampilkan pesan error yang jelas dan actionable\n- **Retry Button**: Tombol retry untuk mencoba koneksi ulang\n- **Visual Indicators**: Status server berubah warna (Online = hijau, Error/Offline = merah)\n- **Graceful Degradation**: UI tetap stabil meskipun backend error\n\nContoh error yang ditangani:\n- `ECONNRESET`: PowerDNS API tidak berjalan atau tidak dapat dijangkau\n- `Network Error`: Masalah koneksi jaringan\n- `HTTP 500`: Internal server error dari PowerDNS\n- `Invalid Data`: Format data yang tidak sesuai dari API\n\n## 🌐 Split-Horizon DNS\n\nNDash includes a built-in **Split-Horizon DNS Proxy** that provides different DNS responses based on client subnet:\n\n### Features\n- **Client-aware responses**: Different answers for internal vs external clients\n- **CIDR subnet support**: Configure IP ranges for internal/external networks\n- **Real-time configuration**: Changes apply immediately without restarting\n- **DNS proxy server**: Runs on port 5353 (configurable)\n\n### Configuration\n\n```json\n{\n  \"enabled\": true,\n  \"zones\": [\n    {\n      \"name\": \"dionipe.local\",\n      \"internal\": [\n        {\"name\": \"@\", \"type\": \"A\", \"value\": \"192.168.203.5\"}\n      ],\n      \"external\": [\n        {\"name\": \"@\", \"type\": \"A\", \"value\": \"8.8.8.8\"}\n      ]\n    }\n  ],\n  \"subnets\": {\n    \"internal\": [\"192.168.0.0/16\", \"10.0.0.0/8\", \"172.16.0.0/12\"],\n    \"external\": [\"0.0.0.0/0\"]\n  }\n}\n```\n\n### Testing\n\n```bash\n# Test external response (from 127.0.0.1)\n$ dig @127.0.0.1 -p 5353 dionipe.local\n# Answer: 8.8.8.8\n\n# Test internal response (from PowerDNS directly)\n$ dig @127.0.0.1 dionipe.local  \n# Answer: 192.168.203.5\n```\n\n### How It Works\n\n1. **Client Detection**: Proxy identifies client IP and determines if it's internal or external\n2. **Record Selection**: Serves appropriate records based on client type\n3. **Fallback**: Forwards non-Split-Horizon queries to upstream DNS server\n4. **Real-time Updates**: Configuration reloads automatically when changed via web UI\n\n### Benchmarks (Local Development)\n- **Server Response**: ~19ms\n- **HTML Size**: ~23KB\n- **API Response**: ~20ms\n- **Alpine.js Bindings**: 76 (optimized)\n\n### Further Optimizations\nUntuk production deployment, jalankan:\n```bash\n./bundle-resources.sh  # Bundle CDN resources locally\n```\n\nIni akan mengurangi external requests dan meningkatkan loading speed.\n\n### Prerequisites\n\n- Node.js v16 atau lebih tinggi\n- PowerDNS server dengan API diaktifkan\n- npm atau yarn\n\n### Installation\n\n1. Clone atau extract project ini:\n```bash\ncd /opt/ndash\n```\n\n2. Install dependencies:\n```bash\nnpm install\n```\n\n3. Copy file konfigurasi dan edit sesuai kebutuhan:\n```bash\ncp .env.example .env\nnano .env\n```\n\n4. Konfigurasi file `.env`:\n```env\nPORT=3000\nNODE_ENV=development\n\n# PowerDNS API Configuration\nPDNS_API_URL=http://localhost:8081\nPDNS_API_KEY=your-powerdns-api-key-here\n\n# Session Secret\nSESSION_SECRET=change-this-to-a-random-secret-key\n```\n\n5. Jalankan aplikasi:\n```bash\n# Development mode (dengan auto-reload)\nnpm run dev\n\n# Production mode\nnpm start\n```\n\n6. Buka browser dan akses:\n```\nhttp://localhost:3000\n```\n\n## 🔧 Konfigurasi PowerDNS\n\nPastikan PowerDNS API sudah diaktifkan. Edit file konfigurasi PowerDNS (biasanya `/etc/powerdns/pdns.conf`):\n\n```conf\n# Enable API\napi=yes\napi-key=your-secure-api-key-here\n\n# Bind API to localhost (atau IP tertentu)\nwebserver=yes\nwebserver-address=0.0.0.0\nwebserver-port=8081\nwebserver-allow-from=127.0.0.0/8,::1\n```\n\nRestart PowerDNS setelah mengubah konfigurasi:\n```bash\nsystemctl restart pdns\n```\n\n### Troubleshooting Authentication\n\nJika mendapat error `Authentication by API Key failed`:\n\n1. **Periksa API Key**: Pastikan `api-key` di PowerDNS config sama dengan `PDNS_API_KEY` di `.env`\n2. **Periksa webserver-allow-from**: Konfigurasi ini harus mengizinkan akses dari IP NDash server\n3. **Test Direct API**: `curl -H \"X-API-Key: your-key\" http://localhost:8081/api/v1/servers`\n4. **Restart Services**: Restart PowerDNS dan NDash setelah perubahan config\n\n### Environment Variables\n\n```env\n# PowerDNS API Configuration\nPDNS_API_URL=http://localhost:8081\nPDNS_API_KEY=your-powerdns-api-key\n\n# NDash Configuration\nPORT=3000\nNODE_ENV=development\nSESSION_SECRET=your-session-secret\n```\n\n## 📁 Struktur Project\n\n```\nndash/\n├── lib/\n│   └── pdns-client.js      # PowerDNS API client\n├── public/\n│   ├── css/\n│   │   └── style.css       # Custom styles\n│   └── js/\n│       └── app.js          # Frontend JavaScript\n├── views/\n│   ├── partials/\n│   │   ├── header.ejs      # Header template\n│   │   └── footer.ejs      # Footer template\n│   ├── index.ejs           # Dashboard page\n│   └── error.ejs           # Error page\n├── .env.example            # Environment variables template\n├── .gitignore             # Git ignore rules\n├── package.json           # Project dependencies\n└── server.js              # Main application file\n```\n\n## 🎯 API Endpoints\n\n### Servers\n- `GET /api/servers` - Get all servers\n- `GET /api/servers/:serverId/statistics` - Get server statistics\n\n### Zones\n- `GET /api/servers/:serverId/zones` - Get all zones\n- `GET /api/servers/:serverId/zones/:zoneId` - Get specific zone\n- `POST /api/servers/:serverId/zones` - Create new zone\n- `DELETE /api/servers/:serverId/zones/:zoneId` - Delete zone\n\n### Records\n- `PATCH /api/servers/:serverId/zones/:zoneId` - Update records\n\n## 🛠️ Development\n\n### Running in Development Mode\n\n```bash\nnpm run dev\n```\n\nIni akan menjalankan aplikasi dengan `nodemon` yang akan otomatis restart saat ada perubahan file.\n\n### Technology Stack\n\n- **Backend**: Express.js\n- **View Engine**: EJS (Embedded JavaScript)\n- **Frontend Framework**: Alpine.js\n- **CSS Framework**: Tailwind CSS\n- **UI Components**: Shadcn-inspired components\n- **Icons**: Lucide Icons\n- **HTTP Client**: Axios\n\n## 🔒 Security\n\n- Gunakan HTTPS di production\n- Ubah `SESSION_SECRET` dengan nilai random yang aman\n- Jangan expose PowerDNS API ke internet\n- Implementasikan authentication jika diperlukan\n- Batasi akses API PowerDNS dengan firewall\n\n## 📝 TODO / Roadmap\n\n- [ ] Authentication \u0026 Authorization\n- [ ] Record editing interface\n- [ ] Bulk operations\n- [ ] Search functionality\n- [ ] Export/Import zones\n- [ ] Activity logs\n- [ ] DNSSEC management\n- [ ] Multi-server support\n- [ ] Dark mode\n- [ ] Responsive mobile view improvements\n\n## 🤝 Contributing\n\nKontribusi sangat diterima! Silakan fork project ini dan submit pull request.\n\n## 📄 License\n\nMIT License - lihat file LICENSE untuk detail.\n\n## 👨‍💻 Author\n\nCreated with ❤️ for the PowerDNS community\n\n## 🐛 Bug Reports\n\nJika menemukan bug atau masalah, silakan buat issue di repository ini.\n\n## 💡 Tips\n\n1. **Backup**: Selalu backup konfigurasi PowerDNS sebelum melakukan perubahan\n2. **Testing**: Test di environment development sebelum deploy ke production\n3. **Monitoring**: Pantau log aplikasi untuk debugging\n4. **Performance**: Gunakan reverse proxy (nginx/apache) di production\n\n## 📚 Resources\n\n- [PowerDNS Documentation](https://doc.powerdns.com/)\n- [Express.js Guide](https://expressjs.com/)\n- [Alpine.js Documentation](https://alpinejs.dev/)\n- [Tailwind CSS](https://tailwindcss.com/)\n\n---\n\n**NDash** - Modern PowerDNS Administration Made Easy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdionipe%2Fndash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdionipe%2Fndash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdionipe%2Fndash/lists"}