feat: v0.3.0-alpha — DNS management, email accounts, suspend/terminate, password change

Backend:
- routes/dns.rs: GET/POST/DELETE /api/dns/:domain (pdnsutil CRUD, SOA hidden, auto-rectify)
- routes/email.rs: GET/POST/DELETE email accounts with Maildir provisioning
- routes/me.rs: POST /api/me/password (verify current, hash new, update users+accounts)
- routes/accounts.rs: GET /api/accounts/:username, suspend, unsuspend, terminate (deprovision+userdel)
- main.rs: register all new routes; import axum::routing::delete
- Cargo.toml: version bump 0.2.0-alpha -> 0.3.0-alpha

NixServer:
- Zone Manager page: lists all PowerDNS zones, click -> DNS editor
- DNS Records page: add/delete records, colour-coded type badges, zone switcher
- Service Manager page: dedicated page with refresh + running/stopped pills
- List Accounts: Suspend/Unsuspend/Terminate buttons with confirmation modal
- Domain cell links to live site

NixClient:
- Domains page: primary domain info, document root, quota, bandwidth
- Email Accounts page: create/list/delete mailboxes with quota display
- Change Password page: Argon2id verify + update server-side
- AccountSidebar: fetches real account data (domain, package, quota)
- api.ts: listMyEmailAccounts, createEmailAccount, deleteEmailAccount, changePassword, getMyAccount(username)

CHANGELOG.md: v0.3.0-alpha entry
This commit is contained in:
NixReaper
2026-04-26 05:23:55 -05:00
parent e79a8a996a
commit 079170b43a
12 changed files with 1547 additions and 434 deletions
+27 -6
View File
@@ -9,7 +9,7 @@ use std::sync::Arc;
use std::net::SocketAddr;
use axum::{
routing::{get, post},
routing::{delete, get, post},
Router,
};
use tower_http::cors::{Any, CorsLayer};
@@ -110,11 +110,32 @@ fn build_router(state: AppState) -> Router {
// Dashboard
.route("/api/dashboard", get(routes::dashboard::get_dashboard))
// Services
.route("/api/services", get(routes::services::list_services))
.route("/api/services/:name/:action", post(routes::services::service_action))
// Accounts
.route("/api/accounts", get(routes::accounts::list_accounts)
.post(routes::accounts::create_account))
.route("/api/services", get(routes::services::list_services))
.route("/api/services/:name/:action", post(routes::services::service_action))
// Accounts — list / create
.route("/api/accounts",
get(routes::accounts::list_accounts)
.post(routes::accounts::create_account))
// Accounts — per-account actions
.route("/api/accounts/:username",
get(routes::accounts::get_account)
.delete(routes::accounts::terminate_account))
.route("/api/accounts/:username/suspend",
post(routes::accounts::suspend_account))
.route("/api/accounts/:username/unsuspend",
post(routes::accounts::unsuspend_account))
// DNS
.route("/api/dns", get(routes::dns::list_zones))
.route("/api/dns/:domain",
get(routes::dns::list_zone_records)
.post(routes::dns::add_record)
.delete(routes::dns::delete_record))
// Email accounts
.route("/api/email", post(routes::email::create_email_account))
.route("/api/email/:username", get(routes::email::list_email_accounts))
.route("/api/email/id/:id", delete(routes::email::delete_email_account))
// Profile / password
.route("/api/me/password", post(routes::me::change_password))
.with_state(state)
.layer(cors)
}