From cc9f5bb59c4fab39d3b40bb71621a01b23a68704 Mon Sep 17 00:00:00 2001 From: Nikita Kozlovtsev Date: Wed, 10 Jul 2024 14:03:41 +0300 Subject: [PATCH] [NV-8287] CR fixes --- README.md | 8 ++++---- whole_app/settings.py | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 30ed1e2..042f8a8 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ It runs blazingly fast due to the use of pychant in its kernel, LRU cache usage Also it supports feature called «user dictionaries» — user can add his own word-exceptions to personal dictionary. ## Quickstart -* `docker run -p 10113:10113 -t --mount source=spellcheck-dicts,target=/data/ xfenix/spellcheck-microservice:4.0.0` +* `docker run -p 10113:10113 -t --mount source=spellcheck-dicts,target=/data/ xfenix/spellcheck-microservice:4.1.0` * check http://localhost:10113/docs/ for full REST documentation * main REST endpoint you will be needed is http://localhost:10113/api/check/ (this will be available without authorization) @@ -35,19 +35,19 @@ You can change config of the service by changing the environment variables. Here * `SPELLCHECK_DICTIONARIES_DISABLED` switches off user dictionaries API no matter what. Default value is `False`. * `SPELLCHECK_USERNAME_MIN_LENGTH` minimum length of username. Default value is `3`. * `SPELLCHECK_USERNAME_MAX_LENGTH` maximum length of username. Default value is `60`. -* `SPELLCHECK_EXCLUSION_WORDS` list of words which will ignore by default(string separated by comma) `"Foo, bar"` +* `SPELLCHECK_EXCLUSION_WORDS` list of words which will ignored by default(string separated by comma). Default value is empty string. ### Deployment Note: all docker & docker-compose variants use named volumes to store user dictionaries. #### Plain docker -`docker run -p 10113:10113 -t --mount source=spellcheck-dicts,target=/data/ xfenix/spellcheck-microservice:4.0.0` +`docker run -p 10113:10113 -t --mount source=spellcheck-dicts,target=/data/ xfenix/spellcheck-microservice:4.1.0` #### Docker-compose * Save this example configuration as `docker-compose.yml`: ```yml version: "3.9" services: spellcheck: - image: xfenix/spellcheck-microservice:4.0.0 + image: xfenix/spellcheck-microservice:4.1.0 ports: - "10113:10113" volumes: diff --git a/whole_app/settings.py b/whole_app/settings.py index adfa265..e1e3033 100644 --- a/whole_app/settings.py +++ b/whole_app/settings.py @@ -195,7 +195,12 @@ class SettingsOfMicroservice(BaseSettings): ), ] = 60 username_regex: str = r"^[a-zA-Z0-9-_]*$" - exclusion_words: str = "" + exclusion_words: typing.Annotated[ + str, + pydantic.Field( + description="list of words which will ignored by default(string separated by comma)", + ), + ] = "" class Config: env_prefix: str = "spellcheck_"