Modifying gitea actions.
All checks were successful
Gitea Actions Demo / build-and-push (push) Successful in 29s
All checks were successful
Gitea Actions Demo / build-and-push (push) Successful in 29s
This commit is contained in:
@@ -21,6 +21,7 @@ jobs:
|
||||
else
|
||||
echo "tag=next" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
echo "Image tag is ${{ steps.vars.outputs.tag }}"
|
||||
|
||||
- name: Resolve Gitea Server IP
|
||||
id: gitea_ip
|
||||
|
||||
@@ -45,9 +45,49 @@ Create admin user 'admin@example.com'? (yes/no): yes
|
||||
Role: admin
|
||||
```
|
||||
|
||||
## hash_passwords.py
|
||||
|
||||
Migrates existing plain text passwords in the database to secure hashed passwords.
|
||||
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
cd backend
|
||||
python scripts/hash_passwords.py
|
||||
```
|
||||
|
||||
### Description
|
||||
|
||||
This script should be run once after deploying password hashing to convert any existing plain text passwords to secure hashes. It:
|
||||
|
||||
- Reads all users from the database
|
||||
- Identifies plain text passwords (those not starting with hash prefixes)
|
||||
- Hashes plain text passwords using werkzeug's secure algorithm
|
||||
- Updates user records in the database
|
||||
- Skips already-hashed passwords
|
||||
- Reports the number of users updated
|
||||
|
||||
### Security Notes
|
||||
|
||||
- Run this script only once after password hashing deployment
|
||||
- Execute in a secure environment (admin access only)
|
||||
- Verify a few users can log in after migration
|
||||
- Delete or secure the script after use to prevent accidental re-execution
|
||||
- The script is idempotent - running it multiple times is safe but unnecessary
|
||||
|
||||
### Example
|
||||
|
||||
```bash
|
||||
$ python scripts/hash_passwords.py
|
||||
Password already hashed for user admin@example.com
|
||||
Hashed password for user user1@example.com
|
||||
Hashed password for user user2@example.com
|
||||
Migration complete. Updated 2 users.
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
The script requires the backend virtual environment to be activated:
|
||||
These scripts require the backend virtual environment to be activated:
|
||||
|
||||
```bash
|
||||
# Windows
|
||||
|
||||
Reference in New Issue
Block a user