diff --git a/.circleci/config.yml b/.circleci/config.yml index 14ce6ddd0..250ff65ec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2 jobs: test: machine: - image: ubuntu-2004:2022.07.1 + image: ubuntu-2204:2024.01.2 steps: - checkout @@ -34,18 +34,18 @@ jobs: - run: name: Build containers and collect static command: | - docker-compose -f docker-compose.yml -f docker-compose.selenium.yml up -d - docker-compose -f docker-compose.yml -f docker-compose.selenium.yml exec django python manage.py collectstatic --noinput + docker compose -f docker-compose.yml -f docker-compose.selenium.yml up -d + docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django python manage.py collectstatic --noinput - run: docker-compose exec django flake8 src/ - run: name: pytest - command: docker-compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/ -m "not e2e" + command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/ -m "not e2e" - run: name: e2e tests - command: docker-compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/tests/functional/ -m e2e + command: docker compose -f docker-compose.yml -f docker-compose.selenium.yml exec django py.test src/tests/functional/ -m e2e no_output_timeout: 60m - store_artifacts: diff --git a/.env_sample b/.env_sample index 51c6b60b8..a60000460 100644 --- a/.env_sample +++ b/.env_sample @@ -44,6 +44,7 @@ SELENIUM_HOSTNAME=selenium #DEFAULT_FROM_EMAIL="Codabench " #SERVER_EMAIL=noreply@example.com + # ----------------------------------------------------------------------------- # Storage # @@ -65,6 +66,7 @@ AWS_STORAGE_PRIVATE_BUCKET_NAME=private AWS_S3_ENDPOINT_URL=http://minio:9000/ AWS_QUERYSTRING_AUTH=False + # ----------------------------------------------------------------------------- # Limit for re-running submission # This is used to limit users to rerun submissions @@ -73,6 +75,13 @@ AWS_QUERYSTRING_AUTH=False RERUN_SUBMISSION_LIMIT=30 +# ----------------------------------------------------------------------------- +# Enable or disbale regular email sign-in an sign-up +# ----------------------------------------------------------------------------- +ENABLE_SIGN_UP=True +ENABLE_SIGN_IN=True + + # # S3 storage example # STORAGE_TYPE=s3 # AWS_ACCESS_KEY_ID=12312312312312312331223 diff --git a/docker-compose.selenium.yml b/docker-compose.selenium.yml index b918d72f7..450f2c3e4 100644 --- a/docker-compose.selenium.yml +++ b/docker-compose.selenium.yml @@ -8,7 +8,7 @@ services: - 36475:36475 selenium: - image: selenium/standalone-firefox-debug:3.141.59 + image: selenium/standalone-firefox:124.0 volumes: - ./src/tests/functional/test_files:/test_files/ - ./artifacts:/artifacts/:z diff --git a/src/apps/api/views/competitions.py b/src/apps/api/views/competitions.py index 774fd0df6..74f13e4e6 100644 --- a/src/apps/api/views/competitions.py +++ b/src/apps/api/views/competitions.py @@ -195,6 +195,8 @@ def get_permissions(self): def get_serializer_class(self): if self.action == 'list': return CompetitionSerializerSimple + if self.action == 'public': + return CompetitionSerializerSimple elif self.action in ['get_phases', 'results', 'get_leaderboard_frontend_object']: return LeaderboardPhaseSerializer elif self.request.method == 'GET': diff --git a/src/apps/profiles/urls_accounts.py b/src/apps/profiles/urls_accounts.py index 03acf8254..779292962 100644 --- a/src/apps/profiles/urls_accounts.py +++ b/src/apps/profiles/urls_accounts.py @@ -8,10 +8,6 @@ urlpatterns = [ url(r'^signup', views.sign_up, name="signup"), path('login/', views.log_in, name='login'), - # url(r'^user_profile', views.user_profile, name="user_profile"), - # path('login/', auth_views.LoginView.as_view(extra_context=extra_context), name='login'), - # path('login/', views.LoginView.as_view(), name='login'), - # path('logout/', auth_views.LogoutView.as_view(), name='logout'), path('logout/', views.LogoutView.as_view(), name='logout'), path('password_reset/', views.CustomPasswordResetView.as_view(), name='password_reset'), path('password_reset/done/', auth_views.PasswordResetDoneView.as_view(), name='password_reset_done'), diff --git a/src/apps/profiles/views.py b/src/apps/profiles/views.py index 33ab6235d..3b6b22169 100644 --- a/src/apps/profiles/views.py +++ b/src/apps/profiles/views.py @@ -104,6 +104,12 @@ def activateEmail(request, user, to_email): def sign_up(request): + + # If sign up is not enabled then redirect to login + # this is for security as some users may access sign up page using the url + if not settings.ENABLE_SIGN_UP: + return redirect('accounts:login') + context = {} context['chahub_signup_url'] = "{}/profiles/signup?next={}/social/login/chahub".format( settings.SOCIAL_AUTH_CHAHUB_BASE_URL, diff --git a/src/settings/base.py b/src/settings/base.py index d5047db82..b8d133a05 100644 --- a/src/settings/base.py +++ b/src/settings/base.py @@ -469,3 +469,10 @@ # on default queue when number of submissions are < RERUN_SUBMISSION_LIMIT # ============================================================================= RERUN_SUBMISSION_LIMIT = os.environ.get('RERUN_SUBMISSION_LIMIT', 30) + + +# ============================================================================= +# Enable or disbale regular email sign-in an sign-up +# ============================================================================= +ENABLE_SIGN_UP = os.environ.get('ENABLE_SIGN_UP', 'True').lower() == 'true' +ENABLE_SIGN_IN = os.environ.get('ENABLE_SIGN_IN', 'True').lower() == 'true' diff --git a/src/static/img/partners/4paradigm.jpg b/src/static/img/partners/4paradigm.jpg index 8ce01a855..80821eeed 100644 Binary files a/src/static/img/partners/4paradigm.jpg and b/src/static/img/partners/4paradigm.jpg differ diff --git a/src/static/img/partners/anr.png b/src/static/img/partners/anr.png index 6a7d198bf..4665577bc 100644 Binary files a/src/static/img/partners/anr.png and b/src/static/img/partners/anr.png differ diff --git a/src/static/img/partners/anr2.jpg b/src/static/img/partners/anr2.jpg index 0ce57f4d8..ffeb84ef4 100644 Binary files a/src/static/img/partners/anr2.jpg and b/src/static/img/partners/anr2.jpg differ diff --git a/src/static/img/partners/barcelona.png b/src/static/img/partners/barcelona.png index 03ed5d5ee..2ccdf0151 100644 Binary files a/src/static/img/partners/barcelona.png and b/src/static/img/partners/barcelona.png differ diff --git a/src/static/img/partners/chalearn.png b/src/static/img/partners/chalearn.png index 2a0fb89a5..1965dae7a 100644 Binary files a/src/static/img/partners/chalearn.png and b/src/static/img/partners/chalearn.png differ diff --git a/src/static/img/partners/cnrs.png b/src/static/img/partners/cnrs.png index 3384434fa..434d6a653 100644 Binary files a/src/static/img/partners/cnrs.png and b/src/static/img/partners/cnrs.png differ diff --git a/src/static/img/partners/eit_health.jpg b/src/static/img/partners/eit_health.jpg index eb21d3c73..ab7c32709 100644 Binary files a/src/static/img/partners/eit_health.jpg and b/src/static/img/partners/eit_health.jpg differ diff --git a/src/static/img/partners/google.jpg b/src/static/img/partners/google.jpg index ba7f0d97d..133a9dcf7 100644 Binary files a/src/static/img/partners/google.jpg and b/src/static/img/partners/google.jpg differ diff --git a/src/static/img/partners/idf.jpg b/src/static/img/partners/idf.jpg index e31e219b0..1fafd4bd0 100644 Binary files a/src/static/img/partners/idf.jpg and b/src/static/img/partners/idf.jpg differ diff --git a/src/static/img/partners/inria.png b/src/static/img/partners/inria.png index 494c9736c..5632b6e0e 100644 Binary files a/src/static/img/partners/inria.png and b/src/static/img/partners/inria.png differ diff --git a/src/static/img/partners/lisn.png b/src/static/img/partners/lisn.png index 1b5c2c44a..a9dd600c4 100644 Binary files a/src/static/img/partners/lisn.png and b/src/static/img/partners/lisn.png differ diff --git a/src/static/img/partners/microsoft.png b/src/static/img/partners/microsoft.png index a25e74a9a..4f9e99c3d 100644 Binary files a/src/static/img/partners/microsoft.png and b/src/static/img/partners/microsoft.png differ diff --git a/src/static/img/partners/paris-saclay.png b/src/static/img/partners/paris-saclay.png index eedbc3b17..9d63b43ad 100644 Binary files a/src/static/img/partners/paris-saclay.png and b/src/static/img/partners/paris-saclay.png differ diff --git a/src/static/img/partners/stanford.png b/src/static/img/partners/stanford.png index 48ae628ff..c1d724694 100644 Binary files a/src/static/img/partners/stanford.png and b/src/static/img/partners/stanford.png differ diff --git a/src/static/riot/profiles/profile_detail.tag b/src/static/riot/profiles/profile_detail.tag index 3281ad99b..ad918ac2f 100644 --- a/src/static/riot/profiles/profile_detail.tag +++ b/src/static/riot/profiles/profile_detail.tag @@ -122,7 +122,7 @@
-
Website:
+
GitHub:
diff --git a/src/templates/base.html b/src/templates/base.html index 87ef997ed..fd54b5ab6 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -177,7 +177,9 @@
{% else %} Login - Sign-up + {% if ENABLE_SIGN_UP %} + Sign-up + {% endif %} {% endif %}
diff --git a/src/templates/pages/home.html b/src/templates/pages/home.html index 5dcdd03c2..3dc54ed95 100644 --- a/src/templates/pages/home.html +++ b/src/templates/pages/home.html @@ -8,23 +8,23 @@ {% block top_div_extra_content %}
- +
@@ -233,56 +233,57 @@

{{post.title}}

+ {% endblock %} diff --git a/src/templates/registration/login.html b/src/templates/registration/login.html index 55d8f10cf..2f1372819 100644 --- a/src/templates/registration/login.html +++ b/src/templates/registration/login.html @@ -3,6 +3,7 @@ {% block content %}
+ {% if ENABLE_SIGN_IN %}

Login

@@ -52,11 +53,14 @@

-

New to us? Sign Up

+ {% if ENABLE_SIGN_UP %} +

Don't have an account? Sign Up

+ {% endif %}

Forgot your password?

+ {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/src/tests/functional/test_competitions.py b/src/tests/functional/test_competitions.py index 860b3db55..3335afa83 100644 --- a/src/tests/functional/test_competitions.py +++ b/src/tests/functional/test_competitions.py @@ -28,7 +28,7 @@ def current_server_time_exists(self): # Check that the text is a valid datetime by loading it with strptime. # This will raise a ValueError if the format is incorrect. - assert datetime.strptime(text, '%B %d, %Y, %I:%M %p %Z') + assert datetime.strptime(text, '%B %d, %Y At %I:%M %p %Z') def _upload_competition(self, competition_zip_path): """Creates a competition and waits for success message. diff --git a/src/utils/context_processors.py b/src/utils/context_processors.py index 4b6d77fab..dd49ccbbb 100644 --- a/src/utils/context_processors.py +++ b/src/utils/context_processors.py @@ -23,4 +23,6 @@ def common_settings(request): 'USER_JSON_DATA': json.dumps(user_json_data), 'RABBITMQ_MANAGEMENT_URL': f"http://{settings.DOMAIN_NAME}:{settings.RABBITMQ_MANAGEMENT_PORT}", 'FLOWER_URL': f"http://{settings.DOMAIN_NAME}:{settings.FLOWER_PUBLIC_PORT}", + 'ENABLE_SIGN_UP': settings.ENABLE_SIGN_UP, + 'ENABLE_SIGN_IN': settings.ENABLE_SIGN_IN, }