-
Notifications
You must be signed in to change notification settings - Fork 31
Administrator procedures
By default, Codabench uses Caddy with Let's Encrypt certificate for serving HTTPS. Let's Encrypt has the limit of 5 certificates (duplicate) per week and the limit of 5 failures per account, per hostname, per hour. Therefore, you should not restart Codabench stack too many times per week by using command docker-compose down
and docker-compose up -d
. Because, everytime Caddy container restated, it requests Let's Encrypt new certificate. If your requests exceed the rate limits, you will be banded for a week. (See more at : https://letsencrypt.org/docs/rate-limits/)
During the development, if you want to update or restart some services (e.g : django), you should follow the bellowing steps:
docker-compose stop django
docker-compose rm django # remove old django container
docker-compose create django # create new django container with the changes from your development
docker-compose start django
This procedure helps you update changes of your development on Django without restarting all Codabench stack (included Caddy).
With superuser privileges, the user can edit any benchmark and can access the Django admin interface.
docker-compose exec django bash
python manage.py shell_plus --plain
>>> u = User.objects.get(username=<USERNAME>) # can also use email
>>> u.is_staff = True
>>> u.is_superuser = True
>>> u.save()
docker-compose exec django ./manage.py makemigrations
docker-compose exec django ./manage.py migrate
docker-compose exec django ./manage.py collectstatic --noinput
# Begin in codabench root directory
cd codabench
# See data we are going to purge
ls var
# Purge data
sudo rm -r var/postgres/*
sudo rm -r var/minio/*
# Restart services and recreate database tables
docker-compose down
docker-compose up -d
docker-compose exec django ./manage.py migrate
Once you are logged in an account with superuser privileges, you have access to the "Django Admin" interface:
From this interface, you can manage user accounts and more.
In the Django admin interface, click on Announcements
or New posts
:
For announcement, only the first announcement is read by the front page. For news, all objects are read as separate news. You can create and edit objects using the interface. Write the announcement and news using HTML to format the text, add links, and more:
Go to Users
:
Select it, select the Delete selected users
action and click on Go
: