diff --git a/CHANGELOG.md b/CHANGELOG.md index c8b1b39da..e04dde57d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -537,7 +537,7 @@ and this project adheres to - ⚡️(e2e) unique login between tests (#80) - ⚡️(CI) improve e2e job (#86) - ♻️(frontend) improve the error and message info ui (#93) -- ✏️(frontend) change all occurences of pad to doc (#99) +- ✏️(frontend) change all occurrences of pad to doc (#99) ## Fixed diff --git a/Dockerfile b/Dockerfile index 23f26b706..b5450715e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -149,7 +149,7 @@ COPY docker/files/usr/local/etc/gunicorn/impress.py /usr/local/etc/gunicorn/impr ARG DOCKER_USER USER ${DOCKER_USER} -# Copy statics +# Copy statistics COPY --from=link-collector ${IMPRESS_STATIC_ROOT} ${IMPRESS_STATIC_ROOT} # Copy impress mails diff --git a/SECURITY.md b/SECURITY.md index 8ae57564a..0ba904a84 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,7 +4,7 @@ Security is very important to us. -If you have any issue regarding security, please disclose the information responsibly submiting [this form](https://vdp.numerique.gouv.fr/p/Send-a-report?lang=en) and not by creating an issue on the repository. You can also email us at docs@numerique.gouv.fr +If you have any issue regarding security, please disclose the information responsibly submitting [this form](https://vdp.numerique.gouv.fr/p/Send-a-report?lang=en) and not by creating an issue on the repository. You can also email us at docs@numerique.gouv.fr We appreciate your effort to make Docs more secure. diff --git a/docs/env.md b/docs/env.md index cd2aafe33..851aa5f4c 100644 --- a/docs/env.md +++ b/docs/env.md @@ -39,7 +39,7 @@ These are the environmental variables you can set for the impress-backend contai | DJANGO_EMAIL_PORT | port used to connect to email host | | | DJANGO_EMAIL_USE_TLS | use tls for email host connection | false | | DJANGO_EMAIL_USE_SSL | use sstl for email host connection | false | -| DJANGO_EMAIL_FROM | email adress used as sender | from@example.com | +| DJANGO_EMAIL_FROM | email address used as sender | from@example.com | | DJANGO_CORS_ALLOW_ALL_ORIGINS | allow all CORS origins | true | | DJANGO_CORS_ALLOWED_ORIGINS | list of origins allowed for CORS | [] | | DJANGO_CORS_ALLOWED_ORIGIN_REGEXES | list of origins allowed for CORS using regulair expressions | [] | @@ -62,11 +62,11 @@ These are the environmental variables you can set for the impress-backend contai | OIDC_RP_CLIENT_ID | client id used for OIDC | impress | | OIDC_RP_CLIENT_SECRET | client secret used for OIDC | | | OIDC_OP_JWKS_ENDPOINT | JWKS endpoint for OIDC | | -| OIDC_OP_AUTHORIZATION_ENDPOINT | Autorization endpoint for OIDC | | +| OIDC_OP_AUTHORIZATION_ENDPOINT | Authorization endpoint for OIDC | | | OIDC_OP_TOKEN_ENDPOINT | Token endpoint for OIDC | | | OIDC_OP_USER_ENDPOINT | User endpoint for OIDC | | | OIDC_OP_LOGOUT_ENDPOINT | Logout endpoint for OIDC | | -| OIDC_AUTH_REQUEST_EXTRA_PARAMS | OIDC extra auth paramaters | {} | +| OIDC_AUTH_REQUEST_EXTRA_PARAMS | OIDC extra auth parameters | {} | | OIDC_RP_SCOPES | scopes requested for OIDC | openid email | | LOGIN_REDIRECT_URL | login redirect url | | | LOGIN_REDIRECT_URL_FAILURE | login redirect url on failure | | @@ -76,7 +76,7 @@ These are the environmental variables you can set for the impress-backend contai | OIDC_REDIRECT_ALLOWED_HOSTS | Allowed hosts for OIDC redirect url | [] | | OIDC_STORE_ID_TOKEN | Store OIDC token | true | | OIDC_FALLBACK_TO_EMAIL_FOR_IDENTIFICATION | faillback to email for identification | true | -| OIDC_ALLOW_DUPLICATE_EMAILS | Allow dupplicate emails | false | +| OIDC_ALLOW_DUPLICATE_EMAILS | Allow duplicate emails | false | | USER_OIDC_ESSENTIAL_CLAIMS | essential claims in OIDC token | [] | | OIDC_USERINFO_FULLNAME_FIELDS | OIDC token claims to create full name | ["first_name", "last_name"] | | OIDC_USERINFO_SHORTNAME_FIELD | OIDC token claims to create shortname | first_name | diff --git a/docs/examples/impress.values.yaml b/docs/examples/impress.values.yaml index 266595127..ce28e4c48 100644 --- a/docs/examples/impress.values.yaml +++ b/docs/examples/impress.values.yaml @@ -82,13 +82,13 @@ backend: python manage.py createsuperuser --email admin@example.com --password admin restartPolicy: Never - # Exra volume to manage our local custom CA and avoid to set ssl_verify: false + # Extra volume to manage our local custom CA and avoid to set ssl_verify: false extraVolumeMounts: - name: certs mountPath: /usr/local/lib/python3.12/site-packages/certifi/cacert.pem subPath: cacert.pem - # Exra volume to manage our local custom CA and avoid to set ssl_verify: false + # Extra volume to manage our local custom CA and avoid to set ssl_verify: false extraVolumes: - name: certs configMap: diff --git a/docs/installation.md b/docs/installation.md index 6a979fea0..65e7c8dab 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -133,7 +133,7 @@ OIDC_RP_SCOPES: "openid email" You can find these values in **examples/keycloak.values.yaml** -### Find redis server connexion values +### Find redis server connection values Docs needs a redis so we start by deploying one: @@ -146,7 +146,7 @@ keycloak-postgresql-0 1/1 Running 0 26m redis-master-0 1/1 Running 0 35s ``` -### Find postgresql connexion values +### Find postgresql connection values Docs uses a postgresql database as backend, so if you have a provider, obtain the necessary information to use it. If you don't, you can install a postgresql testing environment as follow: @@ -173,7 +173,7 @@ POSTGRES_USER: dinum POSTGRES_PASSWORD: pass ``` -### Find s3 bucket connexion values +### Find s3 bucket connection values Docs uses an s3 bucket to store documents, so if you have a provider obtain the necessary information to use it. If you don't, you can install a local minio testing environment as follow: @@ -191,7 +191,7 @@ redis-master-0 1/1 Running 0 10m ## Deployment -Now you are ready to deploy Docs without AI. AI requires more dependencies (OpenAI API). To deploy Docs you need to provide all previous informations to the helm chart. +Now you are ready to deploy Docs without AI. AI requires more dependencies (OpenAI API). To deploy Docs you need to provide all previous information to the helm chart. ``` $ helm repo add impress https://suitenumerique.github.io/docs/ diff --git a/src/backend/core/api/viewsets.py b/src/backend/core/api/viewsets.py index 544fdb2a9..e69dadc38 100644 --- a/src/backend/core/api/viewsets.py +++ b/src/backend/core/api/viewsets.py @@ -576,7 +576,7 @@ class DocumentViewSet( queryset, filter_data["is_favorite"] ) - # Apply ordering only now that everyting is filtered and annotated + # Apply ordering only now that everything is filtered and annotated queryset = filters.OrderingFilter().filter_queryset( self.request, queryset, self ) @@ -858,8 +858,8 @@ class DocumentViewSet( """ try: current_document = self.queryset.only("depth", "path").get(pk=pk) - except models.Document.DoesNotExist as excpt: - raise drf.exceptions.NotFound from excpt + except models.Document.DoesNotExist as except: + raise drf.exceptions.NotFound from except ancestors = ( (current_document.get_ancestors() | self.queryset.filter(pk=pk)) @@ -889,7 +889,7 @@ class DocumentViewSet( ) # Compute cache for ancestors links to avoid many queries while computing - # abilties for his documents in the tree! + # abilities for his documents in the tree! ancestors_links.append( {"link_reach": ancestor.link_reach, "link_role": ancestor.link_role} ) diff --git a/src/backend/core/models.py b/src/backend/core/models.py index 2c5239ead..05bc70bc8 100644 --- a/src/backend/core/models.py +++ b/src/backend/core/models.py @@ -544,9 +544,9 @@ class Document(MP_Node, BaseModel): response = default_storage.connection.meta.client.head_object( Bucket=default_storage.bucket_name, Key=file_key ) - except ClientError as excpt: + except ClientError as except: # If the error is a 404, the object doesn't exist, so we should create it. - if excpt.response["Error"]["Code"] == "404": + if except.response["Error"]["Code"] == "404": has_changed = True else: raise diff --git a/src/backend/core/services/ai_services.py b/src/backend/core/services/ai_services.py index c14105512..97ad583d8 100644 --- a/src/backend/core/services/ai_services.py +++ b/src/backend/core/services/ai_services.py @@ -44,7 +44,7 @@ AI_ACTIONS = { } AI_TRANSLATE = ( - "Keep the same html stucture and formatting. " + "Keep the same html structure and formatting. " "Translate the content in the html to the specified language {language:s}. " "Check the translation for accuracy and make any necessary corrections. " "Do not provide any other information." diff --git a/src/backend/core/services/collaboration_services.py b/src/backend/core/services/collaboration_services.py index 283a87428..dac16fa6d 100644 --- a/src/backend/core/services/collaboration_services.py +++ b/src/backend/core/services/collaboration_services.py @@ -17,7 +17,7 @@ class CollaborationService: def reset_connections(self, room, user_id=None): """ Reset connections of a room in the collaboration server. - Reseting a connection means that the user will be disconnected and will + Resetting a connection means that the user will be disconnected and will have to reconnect to the collaboration server, with updated rights. """ endpoint = "reset-connections" diff --git a/src/backend/core/tests/documents/test_api_document_invitations.py b/src/backend/core/tests/documents/test_api_document_invitations.py index 9efd21907..16090b7d2 100644 --- a/src/backend/core/tests/documents/test_api_document_invitations.py +++ b/src/backend/core/tests/documents/test_api_document_invitations.py @@ -575,7 +575,7 @@ def test_api_document_invitations_create_cannot_invite_existing_users(): document = factories.DocumentFactory(users=[(user, "owner")]) existing_user = factories.UserFactory() - # Build an invitation to the email of an exising identity in the db + # Build an invitation to the email of an existing identity in the db invitation_values = { "email": existing_user.email, "role": random.choice(models.RoleChoices.values), diff --git a/src/backend/core/tests/documents/test_api_documents_ai_transform.py b/src/backend/core/tests/documents/test_api_documents_ai_transform.py index 41e216ec4..81b691745 100644 --- a/src/backend/core/tests/documents/test_api_documents_ai_transform.py +++ b/src/backend/core/tests/documents/test_api_documents_ai_transform.py @@ -150,7 +150,7 @@ def test_api_documents_ai_transform_authenticated_forbidden(reach, role): @patch("openai.resources.chat.completions.Completions.create") def test_api_documents_ai_transform_authenticated_success(mock_create, reach, role): """ - Autenticated who are not related to a document should be able to request AI transform + Authenticated who are not related to a document should be able to request AI transform if the link reach and role permit it. """ user = factories.UserFactory() diff --git a/src/backend/core/tests/documents/test_api_documents_ai_translate.py b/src/backend/core/tests/documents/test_api_documents_ai_translate.py index a04a427d6..f0d7978c2 100644 --- a/src/backend/core/tests/documents/test_api_documents_ai_translate.py +++ b/src/backend/core/tests/documents/test_api_documents_ai_translate.py @@ -99,7 +99,7 @@ def test_api_documents_ai_translate_anonymous_success(mock_create): { "role": "system", "content": ( - "Keep the same html stucture and formatting. " + "Keep the same html structure and formatting. " "Translate the content in the html to the specified language Spanish. " "Check the translation for accuracy and make any necessary corrections. " "Do not provide any other information." @@ -172,7 +172,7 @@ def test_api_documents_ai_translate_authenticated_forbidden(reach, role): @patch("openai.resources.chat.completions.Completions.create") def test_api_documents_ai_translate_authenticated_success(mock_create, reach, role): """ - Autenticated who are not related to a document should be able to request AI translate + Authenticated who are not related to a document should be able to request AI translate if the link reach and role permit it. """ user = factories.UserFactory() @@ -197,7 +197,7 @@ def test_api_documents_ai_translate_authenticated_success(mock_create, reach, ro { "role": "system", "content": ( - "Keep the same html stucture and formatting. " + "Keep the same html structure and formatting. " "Translate the content in the html to the " "specified language Colombian Spanish. " "Check the translation for accuracy and make any necessary corrections. " @@ -274,7 +274,7 @@ def test_api_documents_ai_translate_success(mock_create, via, role, mock_user_te { "role": "system", "content": ( - "Keep the same html stucture and formatting. " + "Keep the same html structure and formatting. " "Translate the content in the html to the " "specified language Colombian Spanish. " "Check the translation for accuracy and make any necessary corrections. " diff --git a/src/backend/core/tests/documents/test_api_documents_attachment_upload.py b/src/backend/core/tests/documents/test_api_documents_attachment_upload.py index a6324f24d..990f9a169 100644 --- a/src/backend/core/tests/documents/test_api_documents_attachment_upload.py +++ b/src/backend/core/tests/documents/test_api_documents_attachment_upload.py @@ -127,7 +127,7 @@ def test_api_documents_attachment_upload_authenticated_forbidden(reach, role): ) def test_api_documents_attachment_upload_authenticated_success(reach, role): """ - Autenticated users who are not related to a document should be able to upload + Authenticated users who are not related to a document should be able to upload a file when the link reach and role permit it. """ user = factories.UserFactory() @@ -255,7 +255,7 @@ def test_api_documents_attachment_upload_invalid(client): def test_api_documents_attachment_upload_size_limit_exceeded(settings): - """The uploaded file should not exceeed the maximum size in settings.""" + """The uploaded file should not exceed the maximum size in settings.""" settings.DOCUMENT_IMAGE_MAX_SIZE = 1048576 # 1 MB for test user = factories.UserFactory() diff --git a/src/backend/core/tests/documents/test_api_documents_create_for_owner.py b/src/backend/core/tests/documents/test_api_documents_create_for_owner.py index c2e878d16..b2a76e55c 100644 --- a/src/backend/core/tests/documents/test_api_documents_create_for_owner.py +++ b/src/backend/core/tests/documents/test_api_documents_create_for_owner.py @@ -279,7 +279,7 @@ def test_api_documents_create_for_owner_existing_user_email_no_sub_with_fallback """ It should be possible to create a document on behalf of a pre-existing user for who the sub was not found if the settings allow it. This edge case should not - happen in a healthy OIDC federation but can be usefull if an OIDC provider modifies + happen in a healthy OIDC federation but can be useful if an OIDC provider modifies users sub on each login for example... """ user = factories.UserFactory(language="en-us") diff --git a/src/backend/core/tests/documents/test_api_documents_move.py b/src/backend/core/tests/documents/test_api_documents_move.py index d093e4911..a0dd83500 100644 --- a/src/backend/core/tests/documents/test_api_documents_move.py +++ b/src/backend/core/tests/documents/test_api_documents_move.py @@ -310,7 +310,7 @@ def test_api_documents_move_authenticated_deleted_target_as_child(position): def test_api_documents_move_authenticated_deleted_target_as_sibling(position): """ It should not be possible to move a document as a sibling of a deleted target document - if the user has no rigths on its parent. + if the user has no rights on its parent. """ user = factories.UserFactory() client = APIClient() diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/hook/useSaveDoc.tsx b/src/frontend/apps/impress/src/features/docs/doc-editor/hook/useSaveDoc.tsx index 26e518914..6f6147456 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/hook/useSaveDoc.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/hook/useSaveDoc.tsx @@ -61,7 +61,7 @@ const useSaveDoc = (docId: string, yDoc: Y.Doc, canSave: boolean) => { const isSaving = saveDoc(); /** - * Firefox does not trigger the request everytime the user leaves the page. + * Firefox does not trigger the request every time the user leaves the page. * Plus the request is not intercepted by the service worker. * So we prevent the default behavior to have the popup asking the user * if he wants to leave the page, by adding the popup, we let the time to the diff --git a/src/frontend/apps/impress/src/features/docs/doc-export/blocks-mapping/tablePDF.tsx b/src/frontend/apps/impress/src/features/docs/doc-export/blocks-mapping/tablePDF.tsx index f8a2b1dcc..878c88ea5 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-export/blocks-mapping/tablePDF.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-export/blocks-mapping/tablePDF.tsx @@ -4,7 +4,7 @@ * See: * https://github.com/TypeCellOS/BlockNote/blob/004c0bf720fe1415c497ad56449015c5f4dd7ba0/packages/xl-pdf-exporter/src/pdf/util/table/Table.tsx * - * We succeded to manage the colspan, but rowspan is not supported yet. + * We succeeded to manage the colspan, but rowspan is not supported yet. */ import { TD, TR, Table } from '@ag-media/react-pdf-table'; diff --git a/src/frontend/apps/impress/src/features/service-worker/service-worker.ts b/src/frontend/apps/impress/src/features/service-worker/service-worker.ts index b8950beb2..cd6bf564e 100644 --- a/src/frontend/apps/impress/src/features/service-worker/service-worker.ts +++ b/src/frontend/apps/impress/src/features/service-worker/service-worker.ts @@ -181,7 +181,7 @@ registerRoute( ); /** - * Cache stategy static files images (images / svg) + * Cache strategy static files images (images / svg) */ registerRoute( ({ request }) => request.destination === 'image', @@ -197,7 +197,7 @@ registerRoute( ); /** - * Cache stategy static files fonts + * Cache strategy static files fonts */ googleFontsCache(); registerRoute( @@ -214,7 +214,7 @@ registerRoute( ); /** - * Cache stategy static files (css, js, workers) + * Cache strategy static files (css, js, workers) */ registerRoute( ({ request }) => diff --git a/src/helm/env.d/dev/values.impress.yaml.gotmpl b/src/helm/env.d/dev/values.impress.yaml.gotmpl index 28686782b..e6c83ec19 100644 --- a/src/helm/env.d/dev/values.impress.yaml.gotmpl +++ b/src/helm/env.d/dev/values.impress.yaml.gotmpl @@ -93,7 +93,7 @@ backend: mountPath: /usr/local/lib/python3.12/site-packages/certifi/cacert.pem subPath: cacert.pem - # Exra volumes to manage our local custom CA and avoid to set ssl_verify: false + # Extra volumes to manage our local custom CA and avoid to set ssl_verify: false extraVolumes: - name: certs configMap: diff --git a/src/helm/impress/templates/_helpers.tpl b/src/helm/impress/templates/_helpers.tpl index b56b98924..f5158d376 100644 --- a/src/helm/impress/templates/_helpers.tpl +++ b/src/helm/impress/templates/_helpers.tpl @@ -51,7 +51,7 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* -transform dictionnary of environment variables +transform dictionary of environment variables Usage : {{ include "impress.env.transformDict" .Values.envVars }} Example: