From 7f3dfaf31c618f7c4dc6bb1a6c10fc0127df007c Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Thu, 23 Oct 2025 09:59:27 +0000 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=B7=BB=E5=8A=A0=E8=8B=B1?= =?UTF-8?q?=E6=96=87qa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/guide/oneclickvirt/oneclickvirt_qa.md | 68 ++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/docs/en/guide/oneclickvirt/oneclickvirt_qa.md b/docs/en/guide/oneclickvirt/oneclickvirt_qa.md index 182103f8ed..5000f51a14 100644 --- a/docs/en/guide/oneclickvirt/oneclickvirt_qa.md +++ b/docs/en/guide/oneclickvirt/oneclickvirt_qa.md @@ -2,4 +2,70 @@ outline: deep --- -Occupancy pending construction \ No newline at end of file +# Please Report Issues to the Corresponding Repository + +## What to Do If You Forgot the Administrator Password + +You need to forcibly change the password through database operations + +1. Generate Password Hash + +```bash +# Generate using Python (replace NewPassword123! with your new password) +python3 -c "import bcrypt; print(bcrypt.hashpw(b'NewPassword123!', bcrypt.gensalt()).decode('utf-8'))" +``` + +Example output: `$2b$12$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` + +2. Enter the Database + +**Docker Deployment (All-in-One Version):** +```bash +docker exec -it oneclickvirt mysql -u root oneclickvirt +``` + +**Standalone Database Deployment:** +```bash +mysql -h 127.0.0.1 -P 3306 -u root -p oneclickvirt +``` + +3. Update Password + +```sql +-- View administrator account +SELECT id, username, user_type FROM users WHERE user_type = 'admin'; + +-- Update password (replace with the hash value generated in step 1) +UPDATE users +SET password = '$2b$12$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +WHERE username = 'admin'; + +-- Exit +EXIT; +``` + +4. Login Test + +Log in to the system with the new password to verify. + +**Notes** + +- The hash value must start with `$2a$`, `$2b$`, or `$2y$` +- The default administrator username is `admin`, which can be confirmed through a query +- It is recommended to use a strong password (≥8 characters, containing uppercase and lowercase letters, numbers, and special characters) +- It is recommended to backup the database before modification: + ```bash + docker exec oneclickvirt mysqldump -u root oneclickvirt > backup.sql + ``` + +## How to Delete Persistent Database and Storage Volumes in Docker + +After deleting the corresponding container + +Execute + +```shell +docker volume rm oneclickvirt-data oneclickvirt-storage oneclickvirt-config +``` + +to delete \ No newline at end of file