forked from forge/documentation
Update known issue documentation with comprehensive script usage guide
- Expand automated workaround section with detailed installation and usage instructions - Update dependencies from API-based to Selenium web automation packages - Add browser setup requirements and Firefox installation instructions - Include detailed explanation of how the update_users.py script works - Correct Fedora group name from sysadmin-main to sysadmin-forge - Add important notes about manual login and processing requirements
This commit is contained in:
parent
85afca1ff9
commit
4ea51ddd68
1 changed files with 91 additions and 8 deletions
|
|
@ -48,21 +48,104 @@ An administrator can manually fix this issue for a single user by performing the
|
|||
|
||||
For administrators dealing with a large number of affected users, the `update_users.py` script provides an automated solution. This script automates the tedious manual process of visiting each user's edit page and saving changes, ensuring that all migrated accounts are properly enabled.
|
||||
|
||||
==== Step 1: Open a Terminal
|
||||
==== Prerequisites for Automated Workaround
|
||||
|
||||
Start by opening a new terminal window on your Fedora system.
|
||||
* *Administrator Access:* You must have administrator privileges on Fedora Forge and be a member of the `sysadmin-forge` group in Fedora Accounts
|
||||
* *Python Environment:* Python 3.6 or later with pip installed
|
||||
* *Required Dependencies:* The following Python packages must be installed:
|
||||
** `selenium` - For web browser automation
|
||||
** `webdriver-manager` - For automatic browser driver management
|
||||
** `click` - For command-line interface
|
||||
* *Browser Requirements:* Firefox browser installed on your system
|
||||
* *Manual Login:* You will need to manually log in with your Fedora Accounts credentials during script execution
|
||||
|
||||
==== Step 2: Create a Python Virtual Environment
|
||||
==== Installation
|
||||
|
||||
It's a best practice to use a virtual environment to isolate the script's dependencies from your system's Python packages.
|
||||
===== Installing Required Dependencies
|
||||
|
||||
==== Step 3: Install Required Dependencies
|
||||
It's recommended to use a Python virtual environment to avoid conflicts with system packages. Create and activate a virtual environment, then install the required packages:
|
||||
|
||||
Install the necessary Python packages for the script to function properly.
|
||||
[source,bash]
|
||||
----
|
||||
python -m venv user-fix-env
|
||||
source user-fix-env/bin/activate
|
||||
pip install selenium webdriver-manager click
|
||||
----
|
||||
|
||||
==== Step 4: Run the Update Script
|
||||
When you're done with the user account fixes, you can deactivate the virtual environment:
|
||||
|
||||
Execute the `update_users.py` script to automatically fix all affected user accounts.
|
||||
[source,bash]
|
||||
----
|
||||
deactivate
|
||||
----
|
||||
|
||||
===== Obtaining the Script
|
||||
|
||||
The `update_users.py` script is available in the official Fedora Forge deployment repository. You can download it directly from:
|
||||
|
||||
link:https://codeberg.org/fedora/forgejo-deployment/src/branch/main/scripts/update_users.py[update_users.py]
|
||||
|
||||
To download the script:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
curl -O https://codeberg.org/fedora/forgejo-deployment/raw/branch/main/scripts/update_users.py
|
||||
----
|
||||
|
||||
===== Browser Setup
|
||||
|
||||
The script uses Firefox for web automation. Ensure Firefox is installed on your system:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
sudo dnf install firefox
|
||||
----
|
||||
|
||||
The `webdriver-manager` package will automatically download and manage the GeckoDriver for Firefox, so no manual driver installation is required.
|
||||
|
||||
==== Usage
|
||||
|
||||
===== Basic Command Structure
|
||||
|
||||
The script uses the following command structure:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
python update_users.py --forgejo-base-url "https://forge.fedoraproject.org/"
|
||||
----
|
||||
|
||||
===== Command-Line Options
|
||||
|
||||
* `--forgejo-base-url`: Base URL of the Forgejo instance (default: `https://forge.fedoraproject.org/`)
|
||||
|
||||
===== How the Script Works
|
||||
|
||||
The script automates the manual process by:
|
||||
|
||||
. *Opening Firefox:* Launches a Firefox browser window
|
||||
. *Navigating to Login:* Goes to the Forgejo login page
|
||||
. *Manual Login Required:* You must manually log in with your Fedora Accounts credentials (30-second timeout)
|
||||
. *Accessing Admin Panel:* Navigates to the admin users management page
|
||||
. *Processing Users:* For each user account:
|
||||
** Opens the user's edit page in a new tab
|
||||
** Clicks the "Update user account" button
|
||||
** Waits for the success confirmation
|
||||
** Closes the tab and continues to the next user
|
||||
. *Pagination Handling:* Automatically handles multiple pages of users
|
||||
|
||||
===== Example Usage
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
python update_users.py --forgejo-base-url "https://forge.fedoraproject.org/"
|
||||
----
|
||||
|
||||
===== Important Notes
|
||||
|
||||
* *Manual Login Required:* The script will pause for 30 seconds to allow you to log in manually with your Fedora Accounts credentials
|
||||
* *Administrator Access:* Your Fedora Accounts user must be a member of the `sysadmin-forge` group
|
||||
* *Browser Window:* Keep the Firefox window visible and don't close it during execution
|
||||
* *Processing Time:* The script may take several minutes depending on the number of users
|
||||
|
||||
== Verification
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue