-
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).
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()
Once you are logged in an account with superuser privileges, you have access to the "Django Admin" interface:
![Capture d’écran 2023-01-25 à 15 19 14](https://user-images.githubusercontent.com/11784999/214587579-53b8f79c-dc51-4323-b48d-360dd7b5774f.png)
From this interface, you can manage user accounts and more.
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