docs: 新增 NPM 管理員密碼重設腳本
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
15
reset_npm_password.sh
Normal file
15
reset_npm_password.sh
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# 重設 Nginx Proxy Manager 管理員密碼為 changeme
|
||||||
|
# 登入後請立即修改密碼
|
||||||
|
# 預設帳號: admin@example.com / changeme
|
||||||
|
|
||||||
|
sudo docker exec nginxproxymanager /opt/certbot/bin/python3 -c "
|
||||||
|
import sqlite3
|
||||||
|
conn = sqlite3.connect('/data/database.sqlite')
|
||||||
|
c = conn.cursor()
|
||||||
|
new_hash = '\$2b\$13\$KMga1dMEtMFLFxJOq3iXBOwWbCFHE5NkvQ3Oeos0MAfvsKVdqGJWy'
|
||||||
|
c.execute('UPDATE auth SET secret=? WHERE id=1', (new_hash,))
|
||||||
|
conn.commit()
|
||||||
|
print('Password reset done. Rows affected:', c.rowcount)
|
||||||
|
conn.close()
|
||||||
|
"
|
||||||
Reference in New Issue
Block a user