diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index b3100b72..b324d37c 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -18,7 +18,7 @@ A clear and concise description of what you expected to happen (or code). 3. And then the bug happens! **Environment** -- publish version: +- Impress version: - Platform: **Possible Solution** diff --git a/.github/ISSUE_TEMPLATE/Support_question.md b/.github/ISSUE_TEMPLATE/Support_question.md index cae28a74..14bb7caf 100644 --- a/.github/ISSUE_TEMPLATE/Support_question.md +++ b/.github/ISSUE_TEMPLATE/Support_question.md @@ -9,9 +9,9 @@ We primarily use GitHub as an issue tracker. If however you're encountering an i --- -Please make sure you have read our [main Readme](https://github.com/numerique-gouv/publish). +Please make sure you have read our [main Readme](https://github.com/numerique-gouv/impress). -Also make sure it was not already answered in [an open or close issue](https://github.com/numerique-gouv/publish/issues). +Also make sure it was not already answered in [an open or close issue](https://github.com/numerique-gouv/impress/issues). If your question was not covered, and you feel like it should be, fire away! We'd love to improve our docs! 👌 diff --git a/.github/workflows/publish.yml b/.github/workflows/impress.yml similarity index 87% rename from .github/workflows/publish.yml rename to .github/workflows/impress.yml index 860486e9..104c0944 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/impress.yml @@ -1,4 +1,4 @@ -name: publish Workflow +name: impress Workflow on: push: @@ -23,7 +23,7 @@ jobs: run: git log - name: Enforce absence of print statements in code run: | - ! git diff origin/${{ github.event.pull_request.base.ref }}..HEAD -- . ':(exclude)**/publish.yml' | grep "print(" + ! git diff origin/${{ github.event.pull_request.base.ref }}..HEAD -- . ':(exclude)**/impress.yml' | grep "print(" - name: Check absence of fixup commits run: | ! git log | grep 'fixup!' @@ -79,13 +79,13 @@ jobs: uses: actions/checkout@v2 - name: Generate a version.json file describing app release run: | - printf '{"commit":"${{ github.sha }}","version":"${{ github.ref }}","source":"https://github.com/${{ github.repository_owner }}/${{ github.repository }}","build":"${{ github.run_id }}"}\n' > src/backend/publish/version.json + printf '{"commit":"${{ github.sha }}","version":"${{ github.ref }}","source":"https://github.com/${{ github.repository_owner }}/${{ github.repository }}","build":"${{ github.run_id }}"}\n' > src/backend/impress/version.json - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Build production image - run: docker build -t publish:${{ github.sha }} --target production . + run: docker build -t impress:${{ github.sha }} --target production . - name: Check built image availability - run: docker images "publish:${{ github.sha }}*" + run: docker images "impress:${{ github.sha }}*" lint-back: runs-on: ubuntu-latest @@ -102,11 +102,11 @@ jobs: - name: Install development dependencies run: pip install --user .[dev] - name: Check code formatting with ruff - run: ~/.local/bin/ruff format publish --diff + run: ~/.local/bin/ruff format impress --diff - name: Lint code with ruff - run: ~/.local/bin/ruff check publish + run: ~/.local/bin/ruff check impress - name: Lint code with pylint - run: ~/.local/bin/pylint publish + run: ~/.local/bin/pylint impress test-back: runs-on: ubuntu-latest @@ -118,7 +118,7 @@ jobs: postgres: image: postgres:16 env: - POSTGRES_DB: publish + POSTGRES_DB: impress POSTGRES_USER: dinum POSTGRES_PASSWORD: pass ports: @@ -128,11 +128,11 @@ jobs: env: DJANGO_CONFIGURATION: Test - DJANGO_SETTINGS_MODULE: publish.settings + DJANGO_SETTINGS_MODULE: impress.settings DJANGO_SECRET_KEY: ThisIsAnExampleKeyForTestPurposeOnly OIDC_OP_JWKS_ENDPOINT: /endpoint-for-test-purpose-only DB_HOST: localhost - DB_NAME: publish + DB_NAME: impress DB_USER: dinum DB_PASSWORD: pass DB_PORT: 5432 @@ -196,13 +196,13 @@ jobs: uses: actions/checkout@v2 - name: Generate a version.json file describing app release run: | - printf '{"commit":"${{ github.sha }}","version":"${{ github.ref }}","source":"https://github.com/${{ github.repository_owner }}/${{ github.repository }}","build":"${{ github.run_id }}"}\n' > src/backend/publish/version.json + printf '{"commit":"${{ github.sha }}","version":"${{ github.ref }}","source":"https://github.com/${{ github.repository_owner }}/${{ github.repository }}","build":"${{ github.run_id }}"}\n' > src/backend/impress/version.json - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Build production image - run: docker build -t publish:${{ github.sha }} --target production . + run: docker build -t impress:${{ github.sha }} --target production . - name: Check built images availability - run: docker images "publish:${{ github.sha }}*" + run: docker images "impress:${{ github.sha }}*" - name: Login to DockerHub run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_USER }}" --password-stdin - name: Tag images @@ -210,17 +210,17 @@ jobs: DOCKER_TAG=$([[ -z "${{ github.event.ref }}" ]] && echo "${{ github.event.ref }}" || echo "${{ github.event.ref }}" | sed 's/^v//') RELEASE_TYPE=$([[ -z "${{ github.event.ref }}" ]] && echo "branch" || echo "tag ") echo "DOCKER_TAG: ${DOCKER_TAG} (Git ${RELEASE_TYPE}${{ github.event.ref }})" - docker tag publish:${{ github.sha }} numerique-gouv/publish:${DOCKER_TAG} + docker tag impress:${{ github.sha }} numerique-gouv/impress:${DOCKER_TAG} if [[ -n "${{ github.event.ref }}" ]]; then - docker tag publish:${{ github.sha }} numerique-gouv/publish:latest + docker tag impress:${{ github.sha }} numerique-gouv/impress:latest fi - docker images | grep -E "^numerique-gouv/publish\s*(${DOCKER_TAG}.*|latest|main)" - - name: Publish images + docker images | grep -E "^numerique-gouv/impress\s*(${DOCKER_TAG}.*|latest|main)" + - name: impress images run: | DOCKER_TAG=$([[ -z "${{ github.event.ref }}" ]] && echo "${{ github.event.ref }}" || echo "${{ github.event.ref }}" | sed 's/^v//') RELEASE_TYPE=$([[ -z "${{ github.event.ref }}" ]] && echo "branch" || echo "tag ") echo "DOCKER_TAG: ${DOCKER_TAG} (Git ${RELEASE_TYPE}${{ github.event.ref }})" - docker push numerique-gouv/publish:${DOCKER_TAG} + docker push numerique-gouv/impress:${DOCKER_TAG} if [[ -n "${{ github.event.ref }}" ]]; then - docker push numerique-gouv/publish:latest + docker push numerique-gouv/impress:latest fi diff --git a/Dockerfile b/Dockerfile index fc535dab..86f0e966 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# Django publish +# Django impress # ---- base image to inherit from ---- FROM python:3.10-slim-bookworm as base @@ -38,7 +38,7 @@ RUN yarn install --frozen-lockfile && \ # ---- static link collector ---- FROM base as link-collector -ARG publish_STATIC_ROOT=/data/static +ARG IMPRESS_STATIC_ROOT=/data/static # Install rdfind RUN apt-get update && \ @@ -49,7 +49,7 @@ RUN apt-get update && \ # Copy installed python dependencies COPY --from=back-builder /install /usr/local -# Copy publish application (see .dockerignore) +# Copy impress application (see .dockerignore) COPY ./src/backend /app/ WORKDIR /app @@ -60,7 +60,7 @@ RUN DJANGO_CONFIGURATION=Build \ # Replace duplicated file by a symlink to decrease the overall size of the # final image -RUN rdfind -makesymlinks true -followsymlinks true -makeresultsfile false ${publish_STATIC_ROOT} +RUN rdfind -makesymlinks true -followsymlinks true -makeresultsfile false ${IMPRESS_STATIC_ROOT} # ---- Core application image ---- FROM base as core @@ -78,7 +78,7 @@ RUN chmod g=u /etc/passwd # Copy installed python dependencies COPY --from=back-builder /install /usr/local -# Copy publish application (see .dockerignore) +# Copy impress application (see .dockerignore) COPY ./src/backend /app/ WORKDIR /app @@ -99,9 +99,9 @@ RUN apt-get update && \ apt-get install -y postgresql-client && \ rm -rf /var/lib/apt/lists/* -# Uninstall publish and re-install it in editable mode along with development +# Uninstall impress and re-install it in editable mode along with development # dependencies -RUN pip uninstall -y publish +RUN pip uninstall -y impress RUN pip install -e .[dev] # Restore the un-privileged user running the application @@ -119,21 +119,21 @@ CMD python manage.py runserver 0.0.0.0:8000 # ---- Production image ---- FROM core as production -ARG publish_STATIC_ROOT=/data/static +ARG IMPRESS_STATIC_ROOT=/data/static # Gunicorn RUN mkdir -p /usr/local/etc/gunicorn -COPY docker/files/usr/local/etc/gunicorn/publish.py /usr/local/etc/gunicorn/publish.py +COPY docker/files/usr/local/etc/gunicorn/impress.py /usr/local/etc/gunicorn/impress.py # Un-privileged user running the application ARG DOCKER_USER USER ${DOCKER_USER} # Copy statics -COPY --from=link-collector ${publish_STATIC_ROOT} ${publish_STATIC_ROOT} +COPY --from=link-collector ${IMPRESS_STATIC_ROOT} ${IMPRESS_STATIC_ROOT} -# Copy publish mails +# Copy impress mails COPY --from=mail-builder /mail/backend/core/templates/mail /app/core/templates/mail -# The default command runs gunicorn WSGI server in publish's main module -CMD gunicorn -c /usr/local/etc/gunicorn/publish.py publish.wsgi:application +# The default command runs gunicorn WSGI server in impress's main module +CMD gunicorn -c /usr/local/etc/gunicorn/impress.py impress.wsgi:application diff --git a/Makefile b/Makefile index b12c14f9..c1e4fa15 100644 --- a/Makefile +++ b/Makefile @@ -154,14 +154,14 @@ test-back-parallel: ## run all back-end tests in parallel bin/pytest -n auto $${args:-${1}} .PHONY: test-back-parallel -makemigrations: ## run django makemigrations for the publish project. +makemigrations: ## run django makemigrations for the impress project. @echo "$(BOLD)Running makemigrations$(RESET)" @$(COMPOSE) up -d postgresql @$(WAIT_DB) @$(MANAGE) makemigrations .PHONY: makemigrations -migrate: ## run django migrations for the publish project. +migrate: ## run django migrations for the impress project. @echo "$(BOLD)Running migrations$(RESET)" @$(COMPOSE) up -d postgresql @$(WAIT_DB) @@ -276,7 +276,7 @@ clean: ## restore repository state as it was freshly cloned .PHONY: clean help: - @echo "$(BOLD)publish Makefile" + @echo "$(BOLD)impress Makefile" @echo "Please use 'make $(BOLD)target$(RESET)' where $(BOLD)target$(RESET) is one of:" @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "$(GREEN)%-30s$(RESET) %s\n", $$1, $$2}' .PHONY: help diff --git a/README.md b/README.md index 3b7f174d..33211438 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# Publish +# Impress -publish is an application to handle users and templates. +Impress prints your markdown to pdf from predefined templates with user and role based access rights. -publish is built on top of [Django Rest -Framework](https://www.django-rest-framework.org/). +Impress is built on top of [Django Rest +Framework](https://www.django-rest-framework.org/) and [Next.js](https://nextjs.org/). ## Getting started diff --git a/bin/_config.sh b/bin/_config.sh index 11754acf..fe9eaf89 100644 --- a/bin/_config.sh +++ b/bin/_config.sh @@ -7,7 +7,7 @@ UNSET_USER=0 TERRAFORM_DIRECTORY="./env.d/terraform" COMPOSE_FILE="${REPO_DIR}/docker-compose.yml" -COMPOSE_PROJECT="publish" +COMPOSE_PROJECT="impress" # _set_user: set (or unset) default user id used to run docker commands diff --git a/bin/update_openapi_schema b/bin/update_openapi_schema index f8daf153..23514907 100755 --- a/bin/update_openapi_schema +++ b/bin/update_openapi_schema @@ -7,6 +7,6 @@ _dc_run \ app-dev \ python manage.py spectacular \ --api-version 'v1.0' \ - --urlconf 'publish.api_urls' \ + --urlconf 'impress.api_urls' \ --format openapi-json \ --file /app/core/tests/swagger/swagger.json diff --git a/docker-compose.yml b/docker-compose.yml index ea01c8d5..6a011288 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,7 @@ services: args: DOCKER_USER: ${DOCKER_USER:-1000} user: ${DOCKER_USER:-1000} - image: publish:development + image: impress:development environment: - PYLINTHOME=/app/.pylint.d - DJANGO_CONFIGURATION=Development @@ -43,8 +43,8 @@ services: celery-dev: user: ${DOCKER_USER:-1000} - image: publish:development - command: ["celery", "-A", "publish.celery_app", "worker", "-l", "DEBUG"] + image: impress:development + command: ["celery", "-A", "impress.celery_app", "worker", "-l", "DEBUG"] environment: - DJANGO_CONFIGURATION=Development env_file: @@ -64,7 +64,7 @@ services: args: DOCKER_USER: ${DOCKER_USER:-1000} user: ${DOCKER_USER:-1000} - image: publish:production + image: impress:production environment: - DJANGO_CONFIGURATION=Demo env_file: @@ -78,8 +78,8 @@ services: celery: user: ${DOCKER_USER:-1000} - image: publish:production - command: ["celery", "-A", "publish.celery_app", "worker", "-l", "INFO"] + image: impress:production + command: ["celery", "-A", "impress.celery_app", "worker", "-l", "INFO"] environment: - DJANGO_CONFIGURATION=Demo env_file: diff --git a/docker/files/usr/local/bin/entrypoint b/docker/files/usr/local/bin/entrypoint index 9bd8dbec..273a86ab 100755 --- a/docker/files/usr/local/bin/entrypoint +++ b/docker/files/usr/local/bin/entrypoint @@ -13,7 +13,7 @@ # # To pass environment variables, you can either use the -e option of the docker run command: # -# docker run --rm -e USER_NAME=foo -e HOME='/home/foo' publish:latest python manage.py migrate +# docker run --rm -e USER_NAME=foo -e HOME='/home/foo' impress:latest python manage.py migrate # # or define new variables in an environment file to use with docker or docker compose: # @@ -21,7 +21,7 @@ # USER_NAME=foo # HOME=/home/foo # -# docker run --rm --env-file env.d/production publish:latest python manage.py migrate +# docker run --rm --env-file env.d/production impress:latest python manage.py migrate # echo "🐳(entrypoint) creating user running in the container..." diff --git a/docker/files/usr/local/etc/gunicorn/publish.py b/docker/files/usr/local/etc/gunicorn/impress.py similarity index 95% rename from docker/files/usr/local/etc/gunicorn/publish.py rename to docker/files/usr/local/etc/gunicorn/impress.py index 9dd7de97..b822b768 100644 --- a/docker/files/usr/local/etc/gunicorn/publish.py +++ b/docker/files/usr/local/etc/gunicorn/impress.py @@ -1,6 +1,6 @@ # Gunicorn-django settings bind = ["0.0.0.0:8000"] -name = "publish" +name = "impress" python_path = "/app" # Run diff --git a/docs/tsclient.md b/docs/tsclient.md index 81e3cd5c..a7e3c13f 100644 --- a/docs/tsclient.md +++ b/docs/tsclient.md @@ -1,10 +1,10 @@ # Api client TypeScript The backend application can automatically create a TypeScript client to be used in frontend -applications. It is used in the publish front application itself. +applications. It is used in the impress front application itself. This client is made with [openapi-typescript-codegen](https://github.com/ferdikoomen/openapi-typescript-codegen) -and publish's backend OpenAPI schema (available [here](http://localhost:8071/v1.0/swagger/) if you have the backend running). +and impress's backend OpenAPI schema (available [here](http://localhost:8071/v1.0/swagger/) if you have the backend running). ## Requirements diff --git a/env.d/development/common.dist b/env.d/development/common.dist index 4509845b..1f339ba3 100644 --- a/env.d/development/common.dist +++ b/env.d/development/common.dist @@ -1,20 +1,20 @@ # Django DJANGO_ALLOWED_HOSTS=* DJANGO_SECRET_KEY=ThisIsAnExampleKeyForDevPurposeOnly -DJANGO_SETTINGS_MODULE=publish.settings +DJANGO_SETTINGS_MODULE=impress.settings DJANGO_SUPERUSER_PASSWORD=admin # Python PYTHONPATH=/app -# publish settings +# impress settings # Mail DJANGO_EMAIL_HOST="mailcatcher" DJANGO_EMAIL_PORT=1025 # Backend url -publish_BASE_URL="http://localhost:8072" +IMPRESS_BASE_URL="http://localhost:8072" # OIDC OIDC_OP_JWKS_ENDPOINT=http://nginx:8083/realms/impress/protocol/openid-connect/certs diff --git a/env.d/development/postgresql.dist b/env.d/development/postgresql.dist index 3fe020af..a5817257 100644 --- a/env.d/development/postgresql.dist +++ b/env.d/development/postgresql.dist @@ -1,11 +1,11 @@ # Postgresql db container configuration -POSTGRES_DB=publish +POSTGRES_DB=impress POSTGRES_USER=dinum POSTGRES_PASSWORD=pass # App database configuration DB_HOST=postgresql -DB_NAME=publish +DB_NAME=impress DB_USER=dinum DB_PASSWORD=pass DB_PORT=5432 \ No newline at end of file diff --git a/src/backend/MANIFEST.in b/src/backend/MANIFEST.in index a93f75e5..999508bf 100644 --- a/src/backend/MANIFEST.in +++ b/src/backend/MANIFEST.in @@ -1,3 +1,3 @@ include LICENSE include README.md -recursive-include src/backend/publish *.html *.png *.gif *.css *.ico *.jpg *.jpeg *.po *.mo *.eot *.svg *.ttf *.woff *.woff2 +recursive-include src/backend/impress *.html *.png *.gif *.css *.ico *.jpg *.jpeg *.po *.mo *.eot *.svg *.ttf *.woff *.woff2 diff --git a/src/backend/core/api/__init__.py b/src/backend/core/api/__init__.py index 254add18..c8152ab5 100644 --- a/src/backend/core/api/__init__.py +++ b/src/backend/core/api/__init__.py @@ -1,4 +1,4 @@ -"""publish core API endpoints""" +"""Impress core API endpoints""" from django.conf import settings from django.core.exceptions import ValidationError diff --git a/src/backend/core/api/permissions.py b/src/backend/core/api/permissions.py index 4ab55b32..cc7fd1f3 100644 --- a/src/backend/core/api/permissions.py +++ b/src/backend/core/api/permissions.py @@ -1,4 +1,4 @@ -"""Permission handlers for the publish core app.""" +"""Permission handlers for the impress core app.""" from django.core import exceptions from rest_framework import permissions diff --git a/src/backend/core/api/serializers.py b/src/backend/core/api/serializers.py index 8dfdc334..b9cb6e3b 100644 --- a/src/backend/core/api/serializers.py +++ b/src/backend/core/api/serializers.py @@ -1,4 +1,4 @@ -"""Client serializers for the publish core app.""" +"""Client serializers for the impress core app.""" from django.db.models import Q from django.utils.translation import gettext_lazy as _ diff --git a/src/backend/core/apps.py b/src/backend/core/apps.py index 94d311f5..bba7de0f 100644 --- a/src/backend/core/apps.py +++ b/src/backend/core/apps.py @@ -1,11 +1,11 @@ -"""publish Core application""" +"""Impress Core application""" # from django.apps import AppConfig # from django.utils.translation import gettext_lazy as _ # class CoreConfig(AppConfig): -# """Configuration class for the publish core app.""" +# """Configuration class for the impress core app.""" # name = "core" # app_label = "core" -# verbose_name = _("publish core application") +# verbose_name = _("impress core application") diff --git a/src/backend/core/migrations/0001_initial.py b/src/backend/core/migrations/0001_initial.py index 70ccf1f1..00444f7d 100644 --- a/src/backend/core/migrations/0001_initial.py +++ b/src/backend/core/migrations/0001_initial.py @@ -33,7 +33,7 @@ class Migration(migrations.Migration): options={ 'verbose_name': 'Template', 'verbose_name_plural': 'Templates', - 'db_table': 'publish_template', + 'db_table': 'impress_template', 'ordering': ('title',), }, ), @@ -60,7 +60,7 @@ class Migration(migrations.Migration): options={ 'verbose_name': 'user', 'verbose_name_plural': 'users', - 'db_table': 'publish_user', + 'db_table': 'impress_user', }, managers=[ ('objects', django.contrib.auth.models.UserManager()), @@ -80,7 +80,7 @@ class Migration(migrations.Migration): options={ 'verbose_name': 'Template/user relation', 'verbose_name_plural': 'Template/user relations', - 'db_table': 'publish_template_access', + 'db_table': 'impress_template_access', }, ), migrations.AddConstraint( diff --git a/src/backend/core/models.py b/src/backend/core/models.py index 006ed07c..9e4e9b39 100644 --- a/src/backend/core/models.py +++ b/src/backend/core/models.py @@ -1,5 +1,5 @@ """ -Declare and configure the models for the publish core application +Declare and configure the models for the impress core application """ import textwrap import uuid @@ -134,7 +134,7 @@ class User(AbstractBaseUser, BaseModel, auth_models.PermissionsMixin): REQUIRED_FIELDS = [] class Meta: - db_table = "publish_user" + db_table = "impress_user" verbose_name = _("user") verbose_name_plural = _("users") @@ -169,7 +169,7 @@ class Template(BaseModel): ) class Meta: - db_table = "publish_template" + db_table = "impress_template" ordering = ("title",) verbose_name = _("Template") verbose_name_plural = _("Templates") @@ -252,7 +252,7 @@ class TemplateAccess(BaseModel): ) class Meta: - db_table = "publish_template_access" + db_table = "impress_template_access" verbose_name = _("Template/user relation") verbose_name_plural = _("Template/user relations") constraints = [ diff --git a/src/backend/core/tests/conftest.py b/src/backend/core/tests/conftest.py index 7d1daca3..5a6a3e4a 100644 --- a/src/backend/core/tests/conftest.py +++ b/src/backend/core/tests/conftest.py @@ -1,4 +1,4 @@ -"""Fixtures for tests in the publish core application""" +"""Fixtures for tests in the impress core application""" from unittest import mock import pytest diff --git a/src/backend/core/tests/templates/test_api_templates_create.py b/src/backend/core/tests/templates/test_api_templates_create.py index 150f67b6..e26a5a75 100644 --- a/src/backend/core/tests/templates/test_api_templates_create.py +++ b/src/backend/core/tests/templates/test_api_templates_create.py @@ -1,5 +1,5 @@ """ -Tests for Templates API endpoint in publish's core app: create +Tests for Templates API endpoint in impress's core app: create """ import pytest from rest_framework.test import APIClient diff --git a/src/backend/core/tests/templates/test_api_templates_delete.py b/src/backend/core/tests/templates/test_api_templates_delete.py index 27fe1f32..166b6646 100644 --- a/src/backend/core/tests/templates/test_api_templates_delete.py +++ b/src/backend/core/tests/templates/test_api_templates_delete.py @@ -1,5 +1,5 @@ """ -Tests for Templates API endpoint in publish's core app: delete +Tests for Templates API endpoint in impress's core app: delete """ import random diff --git a/src/backend/core/tests/templates/test_api_templates_generate_document.py b/src/backend/core/tests/templates/test_api_templates_generate_document.py index ce9d6d90..9b7aa3a9 100644 --- a/src/backend/core/tests/templates/test_api_templates_generate_document.py +++ b/src/backend/core/tests/templates/test_api_templates_generate_document.py @@ -1,5 +1,5 @@ """ -Test users API endpoints in the publish core app. +Test users API endpoints in the impress core app. """ import pytest from rest_framework.test import APIClient diff --git a/src/backend/core/tests/templates/test_api_templates_list.py b/src/backend/core/tests/templates/test_api_templates_list.py index 130d5d3d..1ffdfcef 100644 --- a/src/backend/core/tests/templates/test_api_templates_list.py +++ b/src/backend/core/tests/templates/test_api_templates_list.py @@ -1,5 +1,5 @@ """ -Tests for Templates API endpoint in publish's core app: list +Tests for Templates API endpoint in impress's core app: list """ from unittest import mock diff --git a/src/backend/core/tests/templates/test_api_templates_retrieve.py b/src/backend/core/tests/templates/test_api_templates_retrieve.py index 02b9aec1..8ed186dd 100644 --- a/src/backend/core/tests/templates/test_api_templates_retrieve.py +++ b/src/backend/core/tests/templates/test_api_templates_retrieve.py @@ -1,5 +1,5 @@ """ -Tests for Templates API endpoint in publish's core app: retrieve +Tests for Templates API endpoint in impress's core app: retrieve """ import pytest from rest_framework.test import APIClient diff --git a/src/backend/core/tests/templates/test_api_templates_update.py b/src/backend/core/tests/templates/test_api_templates_update.py index a3213dba..92fa5415 100644 --- a/src/backend/core/tests/templates/test_api_templates_update.py +++ b/src/backend/core/tests/templates/test_api_templates_update.py @@ -1,5 +1,5 @@ """ -Tests for Templates API endpoint in publish's core app: update +Tests for Templates API endpoint in impress's core app: update """ import random diff --git a/src/backend/core/tests/test_api_template_accesses.py b/src/backend/core/tests/test_api_template_accesses.py index bc73e29b..b6fbbc00 100644 --- a/src/backend/core/tests/test_api_template_accesses.py +++ b/src/backend/core/tests/test_api_template_accesses.py @@ -1,5 +1,5 @@ """ -Test template accesses API endpoints for users in publish's core app. +Test template accesses API endpoints for users in impress's core app. """ import random from uuid import uuid4 diff --git a/src/backend/core/tests/test_api_users.py b/src/backend/core/tests/test_api_users.py index 9a851f81..0e2b8a21 100644 --- a/src/backend/core/tests/test_api_users.py +++ b/src/backend/core/tests/test_api_users.py @@ -1,5 +1,5 @@ """ -Test users API endpoints in the publish core app. +Test users API endpoints in the impress core app. """ import pytest from rest_framework.test import APIClient diff --git a/src/backend/publish/__init__.py b/src/backend/impress/__init__.py similarity index 100% rename from src/backend/publish/__init__.py rename to src/backend/impress/__init__.py diff --git a/src/backend/publish/celery_app.py b/src/backend/impress/celery_app.py similarity index 82% rename from src/backend/publish/celery_app.py rename to src/backend/impress/celery_app.py index d9ee68e5..1cf11953 100644 --- a/src/backend/publish/celery_app.py +++ b/src/backend/impress/celery_app.py @@ -1,16 +1,16 @@ -"""publish celery configuration file.""" +"""Impress celery configuration file.""" import os from celery import Celery from configurations.importer import install # Set the default Django settings module for the 'celery' program. -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "publish.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "impress.settings") os.environ.setdefault("DJANGO_CONFIGURATION", "Development") install(check_options=True) -app = Celery("publish") +app = Celery("impress") # Using a string here means the worker doesn't have to serialize # the configuration object to child processes. diff --git a/src/backend/publish/settings.py b/src/backend/impress/settings.py similarity index 97% rename from src/backend/publish/settings.py rename to src/backend/impress/settings.py index db117245..beefc096 100755 --- a/src/backend/publish/settings.py +++ b/src/backend/impress/settings.py @@ -1,5 +1,5 @@ """ -Django settings for publish project. +Django settings for impress project. Generated by 'django-admin startproject' using Django 3.1.5. @@ -72,8 +72,8 @@ class Base(Configuration): SECRET_KEY = values.Value(None) # Application definition - ROOT_URLCONF = "publish.urls" - WSGI_APPLICATION = "publish.wsgi.application" + ROOT_URLCONF = "impress.urls" + WSGI_APPLICATION = "impress.wsgi.application" # Database DATABASES = { @@ -84,7 +84,7 @@ class Base(Configuration): environ_prefix=None, ), "NAME": values.Value( - "publish", environ_name="DB_NAME", environ_prefix=None + "impress", environ_name="DB_NAME", environ_prefix=None ), "USER": values.Value("dinum", environ_name="DB_USER", environ_prefix=None), "PASSWORD": values.Value( @@ -186,7 +186,7 @@ class Base(Configuration): # Django applications from the highest priority to the lowest INSTALLED_APPS = [ - # publish + # impress "core", "demo", "drf_spectacular", @@ -231,8 +231,8 @@ class Base(Configuration): } SPECTACULAR_SETTINGS = { - "TITLE": "publish API", - "DESCRIPTION": "This is the publish API schema.", + "TITLE": "Impress API", + "DESCRIPTION": "This is the impress API schema.", "VERSION": "1.0.0", "SERVE_INCLUDE_SCHEMA": False, "ENABLE_DJANGO_DEPLOY_CHECK": values.BooleanValue( @@ -415,7 +415,7 @@ class Development(Base): CSRF_TRUSTED_ORIGINS = ["http://localhost:8072"] DEBUG = True - SESSION_COOKIE_NAME = "publish_sessionid" + SESSION_COOKIE_NAME = "impress_sessionid" USE_SWAGGER = True @@ -437,7 +437,7 @@ class Test(Base): }, }, "loggers": { - "publish": { + "impress": { "handlers": ["console"], "level": "DEBUG", }, @@ -528,7 +528,7 @@ class Production(Base): AWS_S3_ENDPOINT_URL = values.Value() AWS_S3_ACCESS_KEY_ID = values.Value() AWS_S3_SECRET_ACCESS_KEY = values.Value() - AWS_STORAGE_BUCKET_NAME = values.Value("tf-default-publish-media-storage") + AWS_STORAGE_BUCKET_NAME = values.Value("tf-default-impress-media-storage") AWS_S3_REGION_NAME = values.Value() diff --git a/src/backend/publish/urls.py b/src/backend/impress/urls.py similarity index 96% rename from src/backend/publish/urls.py rename to src/backend/impress/urls.py index 120adead..5dc490ac 100644 --- a/src/backend/publish/urls.py +++ b/src/backend/impress/urls.py @@ -1,4 +1,4 @@ -"""URL configuration for the publish project""" +"""URL configuration for the impress project""" from django.conf import settings from django.conf.urls.static import static diff --git a/src/backend/publish/wsgi.py b/src/backend/impress/wsgi.py similarity index 77% rename from src/backend/publish/wsgi.py rename to src/backend/impress/wsgi.py index da6b30bb..6076021c 100644 --- a/src/backend/publish/wsgi.py +++ b/src/backend/impress/wsgi.py @@ -1,5 +1,5 @@ """ -WSGI config for the publish project. +WSGI config for the impress project. It exposes the WSGI callable as a module-level variable named ``application``. @@ -11,7 +11,7 @@ import os from configurations.wsgi import get_wsgi_application -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "publish.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "impress.settings") os.environ.setdefault("DJANGO_CONFIGURATION", "Development") application = get_wsgi_application() diff --git a/src/backend/manage.py b/src/backend/manage.py index c892fc52..78b98ee5 100644 --- a/src/backend/manage.py +++ b/src/backend/manage.py @@ -1,12 +1,12 @@ #!/usr/bin/env python """ -publish's sandbox management script. +impress's sandbox management script. """ import os import sys if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "publish.settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "impress.settings") os.environ.setdefault("DJANGO_CONFIGURATION", "Development") from configurations.management import execute_from_command_line diff --git a/src/backend/pyproject.toml b/src/backend/pyproject.toml index 2a6684f4..608c76c3 100644 --- a/src/backend/pyproject.toml +++ b/src/backend/pyproject.toml @@ -1,12 +1,12 @@ # -# publish package +# impress package # [build-system] requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] -name = "publish" +name = "impress" version = "0.1.0" authors = [{ "name" = "DINUM", "email" = "dev@mail.numerique.gouv.fr" }] classifiers = [ @@ -56,10 +56,10 @@ dependencies = [ ] [project.urls] -"Bug Tracker" = "https://github.com/numerique-gouv/publish/issues/new" -"Changelog" = "https://github.com/numerique-gouv/publish/blob/main/CHANGELOG.md" -"Homepage" = "https://github.com/numerique-gouv/publish" -"Repository" = "https://github.com/numerique-gouv/publish" +"Bug Tracker" = "https://github.com/numerique-gouv/impress/issues/new" +"Changelog" = "https://github.com/numerique-gouv/impress/blob/main/CHANGELOG.md" +"Homepage" = "https://github.com/numerique-gouv/impress" +"Repository" = "https://github.com/numerique-gouv/impress" [project.optional-dependencies] dev = [ @@ -119,8 +119,8 @@ select = [ ] [tool.ruff.lint.isort] -section-order = ["future","standard-library","django","third-party","publish","first-party","local-folder"] -sections = { publish=["core"], django=["django"] } +section-order = ["future","standard-library","django","third-party","impress","first-party","local-folder"] +sections = { impress=["core"], django=["django"] } [tool.ruff.per-file-ignores] "**/tests/*" = ["S", "SLF"] diff --git a/src/backend/setup.py b/src/backend/setup.py index 643ae465..8dcbc647 100644 --- a/src/backend/setup.py +++ b/src/backend/setup.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -"""Setup file for the publish module. All configuration stands in the setup.cfg file.""" +"""Setup file for the impress module. All configuration stands in the setup.cfg file.""" # coding: utf-8 from setuptools import setup diff --git a/src/mail/mjml/hello.mjml b/src/mail/mjml/hello.mjml index 52a78348..930c4232 100644 --- a/src/mail/mjml/hello.mjml +++ b/src/mail/mjml/hello.mjml @@ -4,7 +4,7 @@ - + diff --git a/src/mail/package.json b/src/mail/package.json index 7a633ca0..53569c94 100644 --- a/src/mail/package.json +++ b/src/mail/package.json @@ -16,7 +16,7 @@ "volta": { "node": "16.15.1" }, - "repository": "https://github.com/numerique-gouv/publish", + "repository": "https://github.com/numerique-gouv/impress", "author": "DINUM", "license": "MIT" } diff --git a/src/tsclient/package.json b/src/tsclient/package.json index 188ade1b..1d742cea 100644 --- a/src/tsclient/package.json +++ b/src/tsclient/package.json @@ -1,14 +1,14 @@ { - "name": "publish-openapi-client-ts", + "name": "impress-openapi-client-ts", "version": "1.1.0", "private": true, - "description": "Tool to generate Typescript API client for the publish application.", + "description": "Tool to generate Typescript API client for the impress application.", "scripts": { "generate:api:client:local": "./scripts/openapi-typescript-codegen/generate_api_client_local.sh $1" }, "repository": { "type": "git", - "url": "git+https://github.com/numerique-gouv/publish.git" + "url": "git+https://github.com/numerique-gouv/impress.git" }, "author": { "name": "DINUM", @@ -16,9 +16,9 @@ }, "license": "MIT", "bugs": { - "url": "https://github.com/numerique-gouv/publish/issues" + "url": "https://github.com/numerique-gouv/impress/issues" }, - "homepage": "https://github.com/numerique-gouv/publish#readme", + "homepage": "https://github.com/numerique-gouv/impress#readme", "devDependencies": { "openapi-typescript-codegen": "0.25.0" } diff --git a/src/tsclient/scripts/openapi-typescript-codegen/generate_api_client_local.sh b/src/tsclient/scripts/openapi-typescript-codegen/generate_api_client_local.sh index c050a3c4..4a570f68 100755 --- a/src/tsclient/scripts/openapi-typescript-codegen/generate_api_client_local.sh +++ b/src/tsclient/scripts/openapi-typescript-codegen/generate_api_client_local.sh @@ -5,4 +5,4 @@ # OPTIONS: # --output the path folder where types will be generated -openapi --input http://app-dev:8000/v1.0/swagger.json --output $1 --indent='2' --name ApiClientpublish --useOptions +openapi --input http://app-dev:8000/v1.0/swagger.json --output $1 --indent='2' --name ApiClientImpress --useOptions