Admin CLI
Manage users and roles from the command line.
The AirTrail Docker image includes airtrail-admin, a command-line tool for tasks you cannot do from the web interface, such as resetting a password when you are locked out.
Usage
Run commands inside the running AirTrail container:
docker exec -it airtrail airtrail-admin <command>airtrail is the container name from the default Compose file. Find yours with docker ps if you changed it. Run airtrail-admin help for the list of commands.
Keep the -it flags. The interactive commands read your answers from the
terminal.
For a manual installation, run the same script with Node from the installation directory:
node --env-file=.env docker/admin.js <command>Commands
list-users
Lists every user with their role. The owner is shown as Owner.
docker exec -it airtrail airtrail-admin list-usersUsers (3):
Username Display Name Role OAuth ID
-------- ------------ ------------- ----- ---------------
alice Alice Smith Owner no abc123def456ghi
bob Bob Jones Administrator yes jkl789mno012pqr
charlie Charlie Lee User no stu345vwx678yzalist-roles
Lists the roles, how many users have each, and which one new users get by default.
docker exec -it airtrail airtrail-admin list-rolesreset-password
Sets a new password for any user, including the owner. You are asked for the username and the new password twice. Passwords must be at least 8 characters, and typing is hidden.
docker exec -it airtrail airtrail-admin reset-passwordset-role
Assigns a role to a user. You are asked for the username and the role, by name or ID (see list-roles).
docker exec -it airtrail airtrail-admin set-roleThe owner's role cannot be changed. Roles assigned here count as manual assignments, so OAuth role mapping does not overwrite them at the next sign-in.
grant-admin and revoke-admin
Shortcuts for set-role. grant-admin assigns the built-in Administrator role; revoke-admin assigns the default role for new users.
docker exec -it airtrail airtrail-admin grant-admin
docker exec -it airtrail airtrail-admin revoke-adminversion
Prints the installed AirTrail version.
docker exec -it airtrail airtrail-admin versionLast updated on
