Hello{% if user %} {{ user.username }}{% endif %},
-Hello{% if user %} {{ user.username }}{% endif %},
-Hello{% if user %} {{ user.username }}{% endif %},
{% if not mass_email %}Thanks,
-Codabench Team
+diff --git a/.env_sample b/.env_sample index 26c9337bd..b3f62d157 100644 --- a/.env_sample +++ b/.env_sample @@ -16,8 +16,8 @@ MAX_EXECUTION_TIME_LIMIT=600 # time limit for the default queue (in seconds) DOMAIN_NAME=localhost:80 # SSL style domain definition +TLS_EMAIL=your@email.com # DOMAIN_NAME=example.com:443 -# TLS_EMAIL=your@email.com RABBITMQ_HOST=rabbit RABBITMQ_DEFAULT_USER=rabbit-username diff --git a/Caddyfile b/Caddyfile index 49d03f690..8b31649fb 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,29 +1,35 @@ {$DOMAIN_NAME} { - # HTTPS options: + # HTTPS Options tls {$TLS_EMAIL} + # Test HTTPS setup # tls {$TLS_EMAIL} { # ca https://acme-staging-v02.api.letsencrypt.org/directory # } + # Removing some headers for improved security: - header / -Server + header -Server # Serves static files, should be the same as `STATIC_ROOT` setting: - root /var/www/django - - # Serving dynamic requests: - proxy / django:8000 { - except /static /media - transparent - websocket + root * /var/www/django + file_server + + @noStatic { + not path /static/* + not path /media/* } + + # Serving dynamic requests: + reverse_proxy @noStatic django:8000 # Allows to use `.gz` files when available: - gzip + encode gzip # Logs: - log stdout - errors stdout + log { + output stdout + format console + } } diff --git a/docker-compose.yml b/docker-compose.yml index 08e7a5c84..75fe7c448 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,14 +4,15 @@ services: # Web Services #----------------------------------------------- caddy: - image: abiosoft/caddy:1.0.3 + image: caddy:2.7.6 env_file: .env environment: - ACME_AGREE=true volumes: - - ./Caddyfile:/etc/Caddyfile + - ./Caddyfile:/etc/caddy/Caddyfile - ./src/staticfiles:/var/www/django/static - - ./certs/caddy:/etc/caddycerts + - ./caddy_data:/data + - ./caddy_config:/config restart: unless-stopped ports: - 80:80 @@ -42,8 +43,8 @@ services: tty: true logging: options: - max-size: "20k" - max-file: "10" + max-size: "20m" + max-file: "5" #----------------------------------------------- @@ -99,8 +100,8 @@ services: restart: unless-stopped logging: options: - max-size: "20k" - max-file: "10" + max-size: "20m" + max-file: "5" #----------------------------------------------- @@ -120,8 +121,8 @@ services: restart: unless-stopped logging: options: - max-size: "20k" - max-file: "10" + max-size: "20m" + max-file: "5" #----------------------------------------------- # Rabbitmq & Flower monitoring tool @@ -148,8 +149,8 @@ services: restart: unless-stopped logging: options: - max-size: "20k" - max-file: "10" + max-size: "20m" + max-file: "5" flower: # image: mher/flower @@ -166,8 +167,8 @@ services: - rabbit logging: options: - max-size: "20k" - max-file: "10" + max-size: "20m" + max-file: "5" #----------------------------------------------- # Redis @@ -179,8 +180,8 @@ services: restart: unless-stopped logging: options: - max-size: "20k" - max-file: "10" + max-size: "20m" + max-file: "5" #----------------------------------------------- # Celery Service @@ -200,8 +201,8 @@ services: restart: unless-stopped logging: options: - max-size: "20k" - max-file: "10" + max-size: "20m" + max-file: "5" deploy: resources: limits: @@ -230,5 +231,5 @@ services: - CODALAB_IGNORE_CLEANUP_STEP=1 logging: options: - max-size: "20k" - max-file: "10" \ No newline at end of file + max-size: "20m" + max-file: "5" diff --git a/src/apps/competitions/models.py b/src/apps/competitions/models.py index 48c26bec4..2e0cb7336 100644 --- a/src/apps/competitions/models.py +++ b/src/apps/competitions/models.py @@ -261,8 +261,10 @@ def save(self, *args, **kwargs): pass elif not self.logo_icon: self.make_logo_icon() + self.save() elif os.path.dirname(self.logo.name) != os.path.dirname(self.logo_icon.name): self.make_logo_icon() + self.save() to_create = User.objects.filter( Q(id=self.created_by_id) | Q(id__in=self.collaborators.all().values_list('id', flat=True)) ).exclude(id__in=self.participants.values_list('user_id', flat=True)).distinct() diff --git a/src/static/riot/competitions/detail/_tabs.tag b/src/static/riot/competitions/detail/_tabs.tag index 1a9769790..6c3fff6f8 100644 --- a/src/static/riot/competitions/detail/_tabs.tag +++ b/src/static/riot/competitions/detail/_tabs.tag @@ -33,7 +33,7 @@ data-tab="_tab_page_term"> Terms -
Thanks,
-Codabench Team
+