From fb4d313d382025da0fcf4a8d44edd1381495dd7e Mon Sep 17 00:00:00 2001 From: tdruez Date: Thu, 4 Jun 2026 21:03:04 +0400 Subject: [PATCH 01/14] add ability to start a demo container Signed-off-by: tdruez --- .devcontainer/devcontainer.json | 11 ++++++++++ README.rst | 2 ++ docker-compose.codespaces.yml | 38 +++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 docker-compose.codespaces.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..2e8784aa --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,11 @@ +{ + "name": "dejacode-demo", + "dockerComposeFile": "../docker-compose.codespaces.yml", + "service": "web", + "workspaceFolder": "/opt/dejacode", + "overrideCommand": false, + "forwardPorts": [8000], + "portsAttributes": { + "8000": { "label": "DejaCode", "onAutoForward": "openPreview" } + } +} diff --git a/README.rst b/README.rst index bee274be..83099ae2 100644 --- a/README.rst +++ b/README.rst @@ -6,6 +6,8 @@ DejaCode provides an enterprise-level application to automate open source licens compliance and ensure software supply chain integrity, powered by `ScanCode `_, the industry-leading code scanner. +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/aboutcode-org/dejacode) + Why Use DejaCode? ================= diff --git a/docker-compose.codespaces.yml b/docker-compose.codespaces.yml new file mode 100644 index 00000000..8d043fd2 --- /dev/null +++ b/docker-compose.codespaces.yml @@ -0,0 +1,38 @@ +name: dejacode +services: + db: + image: docker.io/library/postgres:16.13 + env_file: + - docker.env + volumes: + - ./data/postgresql:/docker-entrypoint-initdb.d/ + shm_size: "1gb" + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}" ] + interval: 10s + timeout: 5s + retries: 5 + + redis: + image: docker.io/library/redis:8.6-alpine + command: redis-server --appendonly yes + + web: + image: ghcr.io/aboutcode-org/dejacode:latest + command: sh -c " + ./manage.py migrate --check || ./manage.py migrate; + ./manage.py runserver --insecure --skip-checks 0.0.0.0:8000" + env_file: + - docker.env + environment: + SECRET_KEY: "insecure-demo-key" + ALLOWED_HOSTS: "*" + DEJACODE_ASYNC: "False" + CLAMD_ENABLED: "False" + ports: + - "8000:8000" + depends_on: + db: + condition: service_healthy + redis: + condition: service_started From e5b2d9b4b02c64688a4d3634b0ed0c3ec0cdf46f Mon Sep 17 00:00:00 2001 From: tdruez Date: Thu, 4 Jun 2026 21:10:57 +0400 Subject: [PATCH 02/14] adjust the config Signed-off-by: tdruez --- .devcontainer/devcontainer.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2e8784aa..98e74e08 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,10 +2,13 @@ "name": "dejacode-demo", "dockerComposeFile": "../docker-compose.codespaces.yml", "service": "web", - "workspaceFolder": "/opt/dejacode", + "workspaceFolder": "/workspaces/dejacode", "overrideCommand": false, "forwardPorts": [8000], "portsAttributes": { - "8000": { "label": "DejaCode", "onAutoForward": "openPreview" } + "8000": { + "label": "DejaCode", + "onAutoForward": "openBrowser" + } } } From ccf435ae700217eed5b8fec0b9d9719862c88c08 Mon Sep 17 00:00:00 2001 From: tdruez Date: Thu, 4 Jun 2026 21:26:46 +0400 Subject: [PATCH 03/14] adjust the config Signed-off-by: tdruez --- .devcontainer/devcontainer.json | 2 +- README.rst | 2 +- docker-compose.codespaces.yml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 98e74e08..72b40c2a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "name": "dejacode-demo", "dockerComposeFile": "../docker-compose.codespaces.yml", "service": "web", - "workspaceFolder": "/workspaces/dejacode", + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "overrideCommand": false, "forwardPorts": [8000], "portsAttributes": { diff --git a/README.rst b/README.rst index 83099ae2..6dfc0507 100644 --- a/README.rst +++ b/README.rst @@ -6,7 +6,7 @@ DejaCode provides an enterprise-level application to automate open source licens compliance and ensure software supply chain integrity, powered by `ScanCode `_, the industry-leading code scanner. -[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/aboutcode-org/dejacode) +`Demo `_ Why Use DejaCode? ================= diff --git a/docker-compose.codespaces.yml b/docker-compose.codespaces.yml index 8d043fd2..781f2f68 100644 --- a/docker-compose.codespaces.yml +++ b/docker-compose.codespaces.yml @@ -27,6 +27,7 @@ services: environment: SECRET_KEY: "insecure-demo-key" ALLOWED_HOSTS: "*" + CSRF_TRUSTED_ORIGINS: "https://*.app.github.dev" DEJACODE_ASYNC: "False" CLAMD_ENABLED: "False" ports: From 24ef5a28d210c4470848cb395bd85dc2595fd7ff Mon Sep 17 00:00:00 2001 From: tdruez Date: Fri, 5 Jun 2026 09:24:44 +0400 Subject: [PATCH 04/14] adjust the config Signed-off-by: tdruez --- .devcontainer/devcontainer.json | 12 +++++++++++- README.rst | 7 ++++++- docker-compose.codespaces.yml | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 72b40c2a..63549151 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,11 +4,21 @@ "service": "web", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "overrideCommand": false, + "customizations": { + "vscode": { + "settings": { + "chat.disableAIFeatures": true, + "workbench.startupEditor": "none", + "workbench.tips.enabled": false, + "git.openRepositoryInParentFolders": "never" + } + } + }, "forwardPorts": [8000], "portsAttributes": { "8000": { "label": "DejaCode", - "onAutoForward": "openBrowser" + "onAutoForward": "openPreview" } } } diff --git a/README.rst b/README.rst index 6dfc0507..26e12ecc 100644 --- a/README.rst +++ b/README.rst @@ -6,7 +6,12 @@ DejaCode provides an enterprise-level application to automate open source licens compliance and ensure software supply chain integrity, powered by `ScanCode `_, the industry-leading code scanner. -`Demo `_ +Demo DejaCode in GitHub Codespaces +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. image:: https://github.com/codespaces/badge.svg + :target: https://github.com/codespaces/new/aboutcode-org/dejacode?ref=dejacode-demo&devcontainer_path=.devcontainer%2Fdevcontainer.json&quickstart=true + :alt: Open in GitHub Codespaces Why Use DejaCode? ================= diff --git a/docker-compose.codespaces.yml b/docker-compose.codespaces.yml index 781f2f68..5d098948 100644 --- a/docker-compose.codespaces.yml +++ b/docker-compose.codespaces.yml @@ -26,6 +26,7 @@ services: - docker.env environment: SECRET_KEY: "insecure-demo-key" + DEBUG: "True" ALLOWED_HOSTS: "*" CSRF_TRUSTED_ORIGINS: "https://*.app.github.dev" DEJACODE_ASYNC: "False" From c62f253f4f8ff9793bbaa0c8e5f322302fadf64a Mon Sep 17 00:00:00 2001 From: tdruez Date: Fri, 5 Jun 2026 09:34:40 +0400 Subject: [PATCH 05/14] adjust the config Signed-off-by: tdruez --- .devcontainer/devcontainer.json | 9 +++++---- docker-compose.codespaces.yml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 63549151..97e3bc4f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,12 +5,13 @@ "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "overrideCommand": false, "customizations": { + "codespaces": { + "openFiles": [] + }, "vscode": { "settings": { "chat.disableAIFeatures": true, - "workbench.startupEditor": "none", - "workbench.tips.enabled": false, - "git.openRepositoryInParentFolders": "never" + "workbench.startupEditor": "none" } } }, @@ -18,7 +19,7 @@ "portsAttributes": { "8000": { "label": "DejaCode", - "onAutoForward": "openPreview" + "onAutoForward": "openBrowser" } } } diff --git a/docker-compose.codespaces.yml b/docker-compose.codespaces.yml index 5d098948..91246a3d 100644 --- a/docker-compose.codespaces.yml +++ b/docker-compose.codespaces.yml @@ -26,7 +26,7 @@ services: - docker.env environment: SECRET_KEY: "insecure-demo-key" - DEBUG: "True" + DEJACODE_DEBUG: "True" ALLOWED_HOSTS: "*" CSRF_TRUSTED_ORIGINS: "https://*.app.github.dev" DEJACODE_ASYNC: "False" From 2353353bad0fc035c71b93e394b697513ec288f4 Mon Sep 17 00:00:00 2001 From: tdruez Date: Fri, 5 Jun 2026 09:46:18 +0400 Subject: [PATCH 06/14] adjust the config Signed-off-by: tdruez --- .devcontainer/devcontainer.json | 3 ++- docker-compose.codespaces.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 97e3bc4f..9efbc3ef 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,6 +4,7 @@ "service": "web", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "overrideCommand": false, + "postAttachCommand": "printf '\\n\\n DejaCode: https://%s-8000.%s\\n\\n' \"$CODESPACE_NAME\" \"$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN\"", "customizations": { "codespaces": { "openFiles": [] @@ -19,7 +20,7 @@ "portsAttributes": { "8000": { "label": "DejaCode", - "onAutoForward": "openBrowser" + "onAutoForward": "notify" } } } diff --git a/docker-compose.codespaces.yml b/docker-compose.codespaces.yml index 91246a3d..eb0936d2 100644 --- a/docker-compose.codespaces.yml +++ b/docker-compose.codespaces.yml @@ -28,7 +28,7 @@ services: SECRET_KEY: "insecure-demo-key" DEJACODE_DEBUG: "True" ALLOWED_HOSTS: "*" - CSRF_TRUSTED_ORIGINS: "https://*.app.github.dev" + CSRF_TRUSTED_ORIGINS: "https://*.app.github.dev,http://localhost:8000" DEJACODE_ASYNC: "False" CLAMD_ENABLED: "False" ports: From 3a785678278e46b9c25f424f56803c622b91e87e Mon Sep 17 00:00:00 2001 From: tdruez Date: Fri, 5 Jun 2026 10:08:31 +0400 Subject: [PATCH 07/14] adjust the config Signed-off-by: tdruez --- .devcontainer/devcontainer.json | 5 +++-- docker-compose.codespaces.yml | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9efbc3ef..ccbe212d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,7 +4,6 @@ "service": "web", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "overrideCommand": false, - "postAttachCommand": "printf '\\n\\n DejaCode: https://%s-8000.%s\\n\\n' \"$CODESPACE_NAME\" \"$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN\"", "customizations": { "codespaces": { "openFiles": [] @@ -12,7 +11,9 @@ "vscode": { "settings": { "chat.disableAIFeatures": true, - "workbench.startupEditor": "none" + "workbench.startupEditor": "none", + "workbench.tips.enabled": false, + "git.openRepositoryInParentFolders": "never" } } }, diff --git a/docker-compose.codespaces.yml b/docker-compose.codespaces.yml index eb0936d2..55b885b3 100644 --- a/docker-compose.codespaces.yml +++ b/docker-compose.codespaces.yml @@ -20,8 +20,9 @@ services: web: image: ghcr.io/aboutcode-org/dejacode:latest command: sh -c " - ./manage.py migrate --check || ./manage.py migrate; - ./manage.py runserver --insecure --skip-checks 0.0.0.0:8000" + ./manage.py migrate && + (./manage.py createsuperuser --noinput || true) && + ./manage.py runserver --insecure --skip-checks 0.0.0.0:8000" env_file: - docker.env environment: @@ -31,6 +32,10 @@ services: CSRF_TRUSTED_ORIGINS: "https://*.app.github.dev,http://localhost:8000" DEJACODE_ASYNC: "False" CLAMD_ENABLED: "False" + DJANGO_SUPERUSER_USERNAME: "demo" + DJANGO_SUPERUSER_EMAIL: "demo@example.com" + DJANGO_SUPERUSER_PASSWORD: "demo-pass" + LOGIN_FORM_ALERT: "Username: ${DJANGO_SUPERUSER_USERNAME} / Password: ${DJANGO_SUPERUSER_PASSWORD}" ports: - "8000:8000" depends_on: From 6bf634c614ecf16ea771bc7d52f810e22114050d Mon Sep 17 00:00:00 2001 From: tdruez Date: Fri, 5 Jun 2026 10:22:27 +0400 Subject: [PATCH 08/14] adjust the config Signed-off-by: tdruez --- docker-compose.codespaces.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.codespaces.yml b/docker-compose.codespaces.yml index 55b885b3..bdfbb5ad 100644 --- a/docker-compose.codespaces.yml +++ b/docker-compose.codespaces.yml @@ -34,8 +34,8 @@ services: CLAMD_ENABLED: "False" DJANGO_SUPERUSER_USERNAME: "demo" DJANGO_SUPERUSER_EMAIL: "demo@example.com" - DJANGO_SUPERUSER_PASSWORD: "demo-pass" - LOGIN_FORM_ALERT: "Username: ${DJANGO_SUPERUSER_USERNAME} / Password: ${DJANGO_SUPERUSER_PASSWORD}" + DJANGO_SUPERUSER_PASSWORD: "demo" + LOGIN_FORM_ALERT: "Username: demo / Password: demo" ports: - "8000:8000" depends_on: From 98c88ee1c97ed33cee7a73cd530dc905bf0f12d9 Mon Sep 17 00:00:00 2001 From: tdruez Date: Fri, 5 Jun 2026 10:42:34 +0400 Subject: [PATCH 09/14] adjust the config Signed-off-by: tdruez --- .env.demo | 22 ++++++++++++++++++++++ docker-compose.codespaces.yml | 19 ++----------------- 2 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 .env.demo diff --git a/.env.demo b/.env.demo new file mode 100644 index 00000000..afedd9bd --- /dev/null +++ b/.env.demo @@ -0,0 +1,22 @@ +POSTGRES_DB=dejacode_demo_db +POSTGRES_USER=dejacode +POSTGRES_PASSWORD=dejacode +POSTGRES_INITDB_ARGS="--encoding=UTF-8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8" + +DATABASE_HOST=db +DATABASE_NAME=dejacode_demo_db +DATABASE_USER=dejacode +DATABASE_PASSWORD=dejacode + +SECRET_KEY=insecure-demo-key +DEJACODE_DEBUG=True +ALLOWED_HOSTS=* +CSRF_TRUSTED_ORIGINS="https://*.app.github.dev,http://localhost:8000" + +DEJACODE_ASYNC=False +CLAMD_ENABLED=False + +DJANGO_SUPERUSER_USERNAME=demo +DJANGO_SUPERUSER_EMAIL=demo@example.com +DJANGO_SUPERUSER_PASSWORD=demo +LOGIN_FORM_ALERT="Username: demo / Password: demo" diff --git a/docker-compose.codespaces.yml b/docker-compose.codespaces.yml index bdfbb5ad..700978b5 100644 --- a/docker-compose.codespaces.yml +++ b/docker-compose.codespaces.yml @@ -3,7 +3,7 @@ services: db: image: docker.io/library/postgres:16.13 env_file: - - docker.env + - .env.demo volumes: - ./data/postgresql:/docker-entrypoint-initdb.d/ shm_size: "1gb" @@ -13,10 +13,6 @@ services: timeout: 5s retries: 5 - redis: - image: docker.io/library/redis:8.6-alpine - command: redis-server --appendonly yes - web: image: ghcr.io/aboutcode-org/dejacode:latest command: sh -c " @@ -24,18 +20,7 @@ services: (./manage.py createsuperuser --noinput || true) && ./manage.py runserver --insecure --skip-checks 0.0.0.0:8000" env_file: - - docker.env - environment: - SECRET_KEY: "insecure-demo-key" - DEJACODE_DEBUG: "True" - ALLOWED_HOSTS: "*" - CSRF_TRUSTED_ORIGINS: "https://*.app.github.dev,http://localhost:8000" - DEJACODE_ASYNC: "False" - CLAMD_ENABLED: "False" - DJANGO_SUPERUSER_USERNAME: "demo" - DJANGO_SUPERUSER_EMAIL: "demo@example.com" - DJANGO_SUPERUSER_PASSWORD: "demo" - LOGIN_FORM_ALERT: "Username: demo / Password: demo" + - .env.demo ports: - "8000:8000" depends_on: From 3163a7bce6d5cc8f20ee2cacad234b3c3ecf9273 Mon Sep 17 00:00:00 2001 From: tdruez Date: Fri, 5 Jun 2026 10:55:32 +0400 Subject: [PATCH 10/14] adjust the config Signed-off-by: tdruez --- .env.demo | 2 +- README.rst | 29 ++++++++++++++++++++++------- docker-compose.codespaces.yml | 2 -- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.env.demo b/.env.demo index afedd9bd..82472c6a 100644 --- a/.env.demo +++ b/.env.demo @@ -19,4 +19,4 @@ CLAMD_ENABLED=False DJANGO_SUPERUSER_USERNAME=demo DJANGO_SUPERUSER_EMAIL=demo@example.com DJANGO_SUPERUSER_PASSWORD=demo -LOGIN_FORM_ALERT="Username: demo / Password: demo" +LOGIN_FORM_ALERT='
Username: demo
Password: demo
' diff --git a/README.rst b/README.rst index 26e12ecc..b77a67cd 100644 --- a/README.rst +++ b/README.rst @@ -6,13 +6,6 @@ DejaCode provides an enterprise-level application to automate open source licens compliance and ensure software supply chain integrity, powered by `ScanCode `_, the industry-leading code scanner. -Demo DejaCode in GitHub Codespaces -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. image:: https://github.com/codespaces/badge.svg - :target: https://github.com/codespaces/new/aboutcode-org/dejacode?ref=dejacode-demo&devcontainer_path=.devcontainer%2Fdevcontainer.json&quickstart=true - :alt: Open in GitHub Codespaces - Why Use DejaCode? ================= @@ -21,6 +14,28 @@ licenses, vulnerabilities, and package provenance and metadata, enabling you to FOSS compliance with enterprise-grade features and integrations for DevOps and software systems. +Try DejaCode in GitHub Codespaces +================================= + +You can try DejaCode instantly in your browser, without installing anything, +using GitHub Codespaces. Click the badge below to launch a ready-to-use demo +instance: the application starts automatically, with a demo account already +created for you. + +.. image:: https://github.com/codespaces/badge.svg + :target: https://github.com/codespaces/new/aboutcode-org/dejacode?ref=dejacode-demo&devcontainer_path=.devcontainer%2Fdevcontainer.json&quickstart=true + :alt: Open in GitHub Codespaces + +Once you click the badge, confirm the creation of the Codespace. +Wait for the environment to finish starting: a notification will offer to open it +in your browser. +You can also open it at any time from the Ports tab by clicking the globe icon next +to port 8000. + +Log in with the demo credentials shown on the login page. This demo instance is +ephemeral and meant for evaluation only: data is not preserved, and the instance +shuts down after a period of inactivity. + Getting Started =============== diff --git a/docker-compose.codespaces.yml b/docker-compose.codespaces.yml index 700978b5..6ea5fff9 100644 --- a/docker-compose.codespaces.yml +++ b/docker-compose.codespaces.yml @@ -26,5 +26,3 @@ services: depends_on: db: condition: service_healthy - redis: - condition: service_started From e7a2e3bb7a20ea55ad1b5d78e911f3503d1bd5c3 Mon Sep 17 00:00:00 2001 From: tdruez Date: Fri, 5 Jun 2026 11:31:06 +0400 Subject: [PATCH 11/14] adjust the config Signed-off-by: tdruez --- .env.demo | 1 + dejacode/settings.py | 2 +- docker-compose.codespaces.yml | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env.demo b/.env.demo index 82472c6a..f4fddc7b 100644 --- a/.env.demo +++ b/.env.demo @@ -12,6 +12,7 @@ SECRET_KEY=insecure-demo-key DEJACODE_DEBUG=True ALLOWED_HOSTS=* CSRF_TRUSTED_ORIGINS="https://*.app.github.dev,http://localhost:8000" +X_FRAME_OPTIONS=SAMEORIGIN DEJACODE_ASYNC=False CLAMD_ENABLED=False diff --git a/dejacode/settings.py b/dejacode/settings.py index eb1040cf..fb026ceb 100644 --- a/dejacode/settings.py +++ b/dejacode/settings.py @@ -202,8 +202,8 @@ def gettext_noop(s): SECURE_CROSS_ORIGIN_OPENER_POLICY = env.str( "SECURE_CROSS_ORIGIN_OPENER_POLICY", default="same-origin" ) +X_FRAME_OPTIONS = env.str("X_FRAME_OPTIONS", default="DENY") -X_FRAME_OPTIONS = "DENY" # Note: The CSRF_COOKIE_HTTPONLY cannot be activated yet without breaking all # the AJAX (POST, PUT, etc..) requests, like the annotation system for example. # It will be required to configure the following: diff --git a/docker-compose.codespaces.yml b/docker-compose.codespaces.yml index 6ea5fff9..131c7381 100644 --- a/docker-compose.codespaces.yml +++ b/docker-compose.codespaces.yml @@ -14,7 +14,8 @@ services: retries: 5 web: - image: ghcr.io/aboutcode-org/dejacode:latest + build: . + #image: ghcr.io/aboutcode-org/dejacode:latest command: sh -c " ./manage.py migrate && (./manage.py createsuperuser --noinput || true) && From af58c1f95be0f46f9bd14a01ad8207631d131d32 Mon Sep 17 00:00:00 2001 From: tdruez Date: Fri, 5 Jun 2026 11:50:12 +0400 Subject: [PATCH 12/14] adjust the config Signed-off-by: tdruez --- .devcontainer/{ => demo}/devcontainer.json | 18 +++++++++--------- .env.demo | 1 + README.rst | 2 +- dejacode/settings.py | 2 +- ...e.codespaces.yml => docker-compose.demo.yml | 0 5 files changed, 12 insertions(+), 11 deletions(-) rename .devcontainer/{ => demo}/devcontainer.json (84%) rename docker-compose.codespaces.yml => docker-compose.demo.yml (100%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/demo/devcontainer.json similarity index 84% rename from .devcontainer/devcontainer.json rename to .devcontainer/demo/devcontainer.json index ccbe212d..e016c8ee 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/demo/devcontainer.json @@ -1,9 +1,16 @@ { - "name": "dejacode-demo", - "dockerComposeFile": "../docker-compose.codespaces.yml", + "name": "DejaCode Demo (Codespaces only)", + "dockerComposeFile": "../../docker-compose.demo.yml", "service": "web", "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", "overrideCommand": false, + "forwardPorts": [8000], + "portsAttributes": { + "8000": { + "label": "DejaCode", + "onAutoForward": "notify" + } + }, "customizations": { "codespaces": { "openFiles": [] @@ -16,12 +23,5 @@ "git.openRepositoryInParentFolders": "never" } } - }, - "forwardPorts": [8000], - "portsAttributes": { - "8000": { - "label": "DejaCode", - "onAutoForward": "notify" - } } } diff --git a/.env.demo b/.env.demo index f4fddc7b..a6c7b5f9 100644 --- a/.env.demo +++ b/.env.demo @@ -13,6 +13,7 @@ DEJACODE_DEBUG=True ALLOWED_HOSTS=* CSRF_TRUSTED_ORIGINS="https://*.app.github.dev,http://localhost:8000" X_FRAME_OPTIONS=SAMEORIGIN +SECURE_CROSS_ORIGIN_OPENER_POLICY=None DEJACODE_ASYNC=False CLAMD_ENABLED=False diff --git a/README.rst b/README.rst index b77a67cd..23055854 100644 --- a/README.rst +++ b/README.rst @@ -23,7 +23,7 @@ instance: the application starts automatically, with a demo account already created for you. .. image:: https://github.com/codespaces/badge.svg - :target: https://github.com/codespaces/new/aboutcode-org/dejacode?ref=dejacode-demo&devcontainer_path=.devcontainer%2Fdevcontainer.json&quickstart=true + :target: https://github.com/codespaces/new/aboutcode-org/dejacode?ref=dejacode-demo&devcontainer_path=.devcontainer%2Fdemo%2Fdevcontainer.json&quickstart=true :alt: Open in GitHub Codespaces Once you click the badge, confirm the creation of the Codespace. diff --git a/dejacode/settings.py b/dejacode/settings.py index fb026ceb..329bc0cb 100644 --- a/dejacode/settings.py +++ b/dejacode/settings.py @@ -178,7 +178,7 @@ def gettext_noop(s): "django.middleware.security.SecurityMiddleware", "dje.middleware.ProhibitInQueryStringMiddleware", "django.middleware.http.ConditionalGetMiddleware", - "django.middleware.clickjacking.XFrameOptionsMiddleware", + #"django.middleware.clickjacking.XFrameOptionsMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", diff --git a/docker-compose.codespaces.yml b/docker-compose.demo.yml similarity index 100% rename from docker-compose.codespaces.yml rename to docker-compose.demo.yml From 97c42c3e3e6755ecf0e2dd9f43827ba53c0b0d86 Mon Sep 17 00:00:00 2001 From: tdruez Date: Fri, 5 Jun 2026 14:51:00 +0400 Subject: [PATCH 13/14] adjust the config Signed-off-by: tdruez --- README.rst | 24 ++++++++++++------------ dejacode/settings.py | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.rst b/README.rst index 23055854..bb93113d 100644 --- a/README.rst +++ b/README.rst @@ -17,24 +17,24 @@ software systems. Try DejaCode in GitHub Codespaces ================================= -You can try DejaCode instantly in your browser, without installing anything, -using GitHub Codespaces. Click the badge below to launch a ready-to-use demo -instance: the application starts automatically, with a demo account already -created for you. +You can try DejaCode instantly in your browser, **without installing anything**, +using GitHub Codespaces. The badge below launches a ready-to-use demo instance: +the application starts automatically, with a demo account already created for you. .. image:: https://github.com/codespaces/badge.svg :target: https://github.com/codespaces/new/aboutcode-org/dejacode?ref=dejacode-demo&devcontainer_path=.devcontainer%2Fdemo%2Fdevcontainer.json&quickstart=true :alt: Open in GitHub Codespaces -Once you click the badge, confirm the creation of the Codespace. -Wait for the environment to finish starting: a notification will offer to open it -in your browser. -You can also open it at any time from the Ports tab by clicking the globe icon next -to port 8000. +#. **Click** the badge above and **confirm** the creation of the Codespace. +#. **Wait** for the environment to finish starting. This takes a few minutes the + first time. +#. **Open the app** when the notification offers to. You can also open it anytime + from the **Ports** tab by clicking the globe icon next to port ``8000``. +#. **Log in** with the demo credentials shown on the login page. -Log in with the demo credentials shown on the login page. This demo instance is -ephemeral and meant for evaluation only: data is not preserved, and the instance -shuts down after a period of inactivity. +.. note:: + This demo instance is **ephemeral** and meant for evaluation only. Data is not + preserved, and the instance shuts down after a period of inactivity. Getting Started =============== diff --git a/dejacode/settings.py b/dejacode/settings.py index 329bc0cb..fb026ceb 100644 --- a/dejacode/settings.py +++ b/dejacode/settings.py @@ -178,7 +178,7 @@ def gettext_noop(s): "django.middleware.security.SecurityMiddleware", "dje.middleware.ProhibitInQueryStringMiddleware", "django.middleware.http.ConditionalGetMiddleware", - #"django.middleware.clickjacking.XFrameOptionsMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", From b92b553eacb3b3f28c16577501eaab26b8c8421c Mon Sep 17 00:00:00 2001 From: tdruez Date: Mon, 8 Jun 2026 19:59:43 +0400 Subject: [PATCH 14/14] prepare for the merge Signed-off-by: tdruez --- README.rst | 4 ++-- docker-compose.demo.yml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index bb93113d..c7057e72 100644 --- a/README.rst +++ b/README.rst @@ -22,7 +22,7 @@ using GitHub Codespaces. The badge below launches a ready-to-use demo instance: the application starts automatically, with a demo account already created for you. .. image:: https://github.com/codespaces/badge.svg - :target: https://github.com/codespaces/new/aboutcode-org/dejacode?ref=dejacode-demo&devcontainer_path=.devcontainer%2Fdemo%2Fdevcontainer.json&quickstart=true + :target: https://github.com/codespaces/new/aboutcode-org/dejacode?ref=main&devcontainer_path=.devcontainer%2Fdemo%2Fdevcontainer.json&quickstart=true :alt: Open in GitHub Codespaces #. **Click** the badge above and **confirm** the creation of the Codespace. @@ -32,7 +32,7 @@ the application starts automatically, with a demo account already created for yo from the **Ports** tab by clicking the globe icon next to port ``8000``. #. **Log in** with the demo credentials shown on the login page. -.. note:: +**Note:** This demo instance is **ephemeral** and meant for evaluation only. Data is not preserved, and the instance shuts down after a period of inactivity. diff --git a/docker-compose.demo.yml b/docker-compose.demo.yml index 131c7381..6ea5fff9 100644 --- a/docker-compose.demo.yml +++ b/docker-compose.demo.yml @@ -14,8 +14,7 @@ services: retries: 5 web: - build: . - #image: ghcr.io/aboutcode-org/dejacode:latest + image: ghcr.io/aboutcode-org/dejacode:latest command: sh -c " ./manage.py migrate && (./manage.py createsuperuser --noinput || true) &&