Skip to main content

Administration

This guide aims to guide you through the administration of the entire ACUBE stack. There is an administration panel at /admin that users in the admin organization can access. This panel provides administrators with the ability to manage various aspects of ACUBE with a user-friendly graphical interface, such as:

  • User creation, modification, and deletion
  • Submission deletion and management (e.g. erroring modules, remapping submissions)
  • Organization creation, modification, and deletion
  • Ability to view Feedback
  • Ability to set and modify the website banner
note

Modifications done to a user, such as changing their organizations, will require the user to re-login for the changes to take effect.

Manual Administration

If you have lost access to a user with administrator privileges, the following section will be useful in manually managing ACUBE.

Adding users to ACUBETotal

note

Knowledge of the PostgreSQL (or even basic SQL) language will be useful.

info

Table names and column names are wrapped in double quotes ", whereas custom input values are wrapped in single quotes '

  1. Launch a shell in the acubetotal-database container
    • docker exec -it acubetotal-database /bin/bash
  2. Connect to the PostgreSQL acubetotal database
    • psql --username acubetotal
  3. Add the relevant rows to the Users table
    • INSERT INTO "Users" ("id", "name", "email", "expiry", "password", "apiKey") VALUES ('<generated_cuid>', '<name>', '<email, or just use the same name>', '<datetime_string>', <bcrypt_password>, <generated_uuid>);
    • Generate a cuid here
    • Generate a uuid here
    • Sample of a datetime_string: 2022-10-19T00:27:54.800Z
      • A simple way to generate it is the enter the Node command line and use new Date
    • You can Use Cyberchef to generate a Bcrypt password (with 10 rounds)

Extending the expiry date of users in ACUBETotal

  1. Launch a shell in the acubetotal-database container
    • docker exec -it acubetotal-database /bin/bash
  2. Connect to the PostgreSQL acubetotal database
    • psql --username acubetotal
  3. List current users in the table
    • SELECT * from "Users";
    • You can use \dt to list all tables in the database
  4. Change the expiry date for the user that you would like to change (note the user in the Name column)
    • UPDATE "Users" SET "expiry" = '<datetime_string>' WHERE "name" = '<username>';

Miscellaneous tips and tricks

  • Save space: Run docker image prune to remove docker images that are untagged, and docker container prune to remove all stopped docker containers
  • Hidden files: Use ls -a or la to list all files, including hidden files (files that start with .)