Experimental branch cleanup and fixes
- Removed miner protection module, config, API routes, and UI - Removed block_postgres firewall feature from dashboard + launcher - Fixed SSH host key policy (WarningPolicy → AutoAddPolicy) - Fixed kick race condition (threading.Lock for iptables) - Tuned Argon2 password parameters (time_cost=3, memory_cost=65536) - Added login rate-limit (10/min) + IP cooldown after 5 failed attempts - Created scripts/db_check.py for launcher pre-flight DB check - Updated README and .gitignore for sanitized repo state
This commit is contained in:
1 parent
18a3253879
commit
c57e6572a9
13 files changed
+131
-499
No files matched your search
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Pre-flight database connectivity check for the launcher scripts."""
|
||||
|
||||
import sys
|
||||
import os
|
||||
import yaml
|
||||
import psycopg2
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: db_check.py <port>")
|
||||
sys.exit(1)
|
||||
|
||||
port = int(sys.argv[1])
|
||||
|
||||
settings_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'settings.yaml')
|
||||
if not os.path.exists(settings_path):
|
||||
print("settings.yaml not found")
|
||||
sys.exit(1)
|
||||
|
||||
with open(settings_path) as f:
|
||||
settings = yaml.safe_load(f) or {}
|
||||
|
||||
db = settings.get('database', {})
|
||||
config = {
|
||||
'host': '127.0.0.1',
|
||||
'port': port,
|
||||
'user': db.get('user', 'postgres'),
|
||||
'password': db.get('password', ''),
|
||||
'dbname': db.get('name', 'dune'),
|
||||
}
|
||||
|
||||
try:
|
||||
conn = psycopg2.connect(**config)
|
||||
cur = conn.cursor()
|
||||
cur.execute('SELECT 1')
|
||||
cur.close()
|
||||
conn.close()
|
||||
print("ok")
|
||||
except Exception as e:
|
||||
print(f"failed: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in new issue
Block a user