- Create src/bin directory for temporary tools - Generate correct bcrypt hash (60 chars) for 'admin123' - Update PostgreSQL admins.password (clear corrupted data) - Reinitialize auth.sqlite with complete table structure - Verify admin login working with correct password Key fixes: - PostgreSQL admins.password: varchar(255) accepts 60-char bcrypt hash - auth.sqlite sftpgo_admins: correct password_hash synced - Admin login API: returns token + username - Token verify API: returns ok=true All tests passing: ✅ Admin sync: admins_synced=1 ✅ Hash length: 60 chars (bcrypt standard) ✅ Admin login: success ✅ Token verify: success Status: Admin authentication fully functional
7 lines
215 B
Rust
7 lines
215 B
Rust
fn main() {
|
|
use bcrypt::{hash, DEFAULT_COST};
|
|
let password = std::env::args().nth(1).unwrap_or("admin123".to_string());
|
|
let hashed = hash(&password, DEFAULT_COST).unwrap();
|
|
println!("{}", hashed);
|
|
}
|