Skip to content

Commit

Permalink
[NV-8287] CR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Kozlovtsev authored and Nikita Kozlovtsev committed Jul 10, 2024
1 parent 7f04954 commit cc9f5bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion whole_app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_"
Expand Down

0 comments on commit cc9f5bb

Please sign in to comment.