Remove PostgreSQL support: pure SQLite architecture
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled

BREAKING CHANGE: Remove all PostgreSQL functionality

Changes:
- Remove dependencies: tokio-postgres, postgres from Cargo.toml
- Delete files: pg_client.rs (330 lines), sync.rs (370 lines), provider/pg.rs (300 lines)
- Remove modules from lib.rs: pg_client, sync
- Remove pg module from provider/mod.rs
- Remove PostgreSQL sync code from server.rs (lines 126-165)
- Remove auth_db field and with_sync() from auth.rs
- Simplify SSH server to use SqliteProvider only
- Convert sync API endpoints to return 410 Gone with error message
- Remove [postgresql] config section from markbase.toml

Rationale:
- Simplify architecture by using SQLite exclusively
- Remove complexity of PostgreSQL synchronization
- Reduce dependencies and maintenance burden
- SQLite is sufficient for MarkBase use case

Code removed: ~1000 lines
Files deleted: 3
Files modified: 8
This commit is contained in:
Warren
2026-10-24 19:43:22 +08:00
parent cb9810490a
commit 0802a47a5f
11 changed files with 26 additions and 1275 deletions
+2 -11
View File
@@ -1,7 +1,6 @@
// SSH服务器完整实现(Phase 1-7集成版 + Phase 13端口转发)
// 参考OpenSSH sshd.c: complete SSH/SFTP flow + port forwarding
use crate::provider::pg::PgProvider;
use crate::provider::sqlite::SqliteProvider;
use crate::provider::DataProvider;
use crate::ssh_server::auth::{AuthHandler, AuthResult};
@@ -167,16 +166,8 @@ fn handle_connection_complete(
)?;
info!("Key exchange completed, encryption channel ready");
// Phase 5: SSH认证(SFTPGo兼容 — PostgreSQL或SQLite)
let provider: Box<dyn DataProvider> = if let Some(ref conn_str) = pg_conn {
info!(
"Using PostgreSQL auth provider (SFTPGo-compatible): {}",
conn_str
);
Box::new(
PgProvider::new(conn_str).map_err(|e| anyhow!("Failed to init PgProvider: {}", e))?,
)
} else {
// Phase 5: SSH认证(SQLite only)
let provider: Box<dyn DataProvider> = {
info!("Using SQLite auth provider");
Box::new(
SqliteProvider::new("data/auth.sqlite")