Password Pusher bundles an Admin dashboard for self-hosted instances available at /admin. This dashboard allows for direct database access, so care should be taken.

It is only enabled when logins are enabled (enable_logins) and access is limited to accounts marked as “Administrator” only.

Note: Make sure you are running v1.40.3 or newer to have access to the Admin Dashboard.

Security & Access

Access to the Admin dashboard grants direct access to the application’s database.

Accessing the admin dashboard is accessible by accounts that you specifically mark as “Administrator”. Make sure to restrict access to authorized personnel only to prevent unauthorized access and potential security breaches.

To access the Admin dashboard, you must have:

  • Logins enabled for your instance
  • An account registered, confirmed and marked as an “Administrator”

For instructions on enabling logins and account registration, see previous sections above.

Marking a User as an Administrator

Application Console

To mark a user account as an Administrator, you will need the email that the account registered with. With that email, follow these steps:

  1. Open an application console by accessing the server where the application code resides. For example, if using Docker, navigate to /opt/PasswordPusher:

     docker exec -it <container_id> bash
     cd /opt/PasswordPusher
     bin/pwpush console
    
  2. From the application console, call the PasswordPusher.grant_system_admin! method with the email of the target account:

     PasswordPusher.grant_system_admin!('user@example.com')
    

    This grants System Administrator privileges to the specified user account.

    Note: Ensure to replace 'user@example.com' with the actual email address of the target account.

  3. Upon successful execution, you will receive a confirmation message indicating that the user account has been granted System Administrator privileges.

Tip: There is extended documentation on how to access an application console here.

Alternative: Direct Database Access

If for some reason you are having trouble with the above, you can alternatively directly access the database and set the admin field to true.

UPDATE users
SET admin = 1
WHERE email = 'myemail@example.com';

Make sure only the accounts you want are marked as admin.

You can re-validate which users are marked as “admin” with the following query:

select email from users where admin = 1;

admin is a boolean column - you might have to use true instead depending on the DB type you are using.

Error Handling

If the specified email address is invalid or if the command fails to execute successfully, an appropriate error message will be displayed. Verify the email address and troubleshoot any issues encountered.

Revoking Administrator Privilege

To revoke Administrator privileges from a user account, use the PasswordPusher.revoke_system_admin! method:

PasswordPusher.revoke_system_admin!('user@example.com')

This revokes System Administrator privileges from the specified user account. Ensure to replace ‘user@example.com’ with the actual email address of the target account.

Upon successful execution, you will receive a confirmation message indicating that Administrator privileges have been revoked from the user account.

Updated: