4 Commits

Author SHA1 Message Date
5588a008b5 Merge 1174cf4861 into 376f687c38 2025-03-11 00:20:27 -04:00
376f687c38 chore: questionable is not a recognized rating 2025-02-11 21:50:27 +01:00
4fd848abf2 doc: use docker compose instead of docker-compose
The minimum version requirements are rough guesses, in practice any decently modern docker installation should work.
2025-02-11 21:25:10 +01:00
1174cf4861 server: make negated string filters include null values 2023-12-16 23:41:24 +11:00
4 changed files with 14 additions and 16 deletions

View File

@ -789,7 +789,7 @@ data.
| `fav-time` | alias of `fav-date` | | `fav-time` | alias of `fav-date` |
| `feature-date` | featured at given date | | `feature-date` | featured at given date |
| `feature-time` | alias of `feature-time` | | `feature-time` | alias of `feature-time` |
| `safety` | having given safety. `<value>` can be either `safe`, `sketchy` (or `questionable`) or `unsafe`. | | `safety` | having given safety. `<value>` can be either `safe`, `sketchy` or `unsafe`. |
| `rating` | alias of `safety` | | `rating` | alias of `safety` |
**Sort style tokens** **Sort style tokens**

View File

@ -1,5 +1,5 @@
This assumes that you have Docker (version 17.05 or greater) This assumes that you have Docker (version 19.03 or greater)
and Docker Compose (version 1.6.0 or greater) already installed. and the Docker Compose CLI (version 1.27.0 or greater) already installed.
### Prepare things ### Prepare things
@ -38,7 +38,7 @@ and Docker Compose (version 1.6.0 or greater) already installed.
This pulls the latest containers from docker.io: This pulls the latest containers from docker.io:
```console ```console
user@host:szuru$ docker-compose pull user@host:szuru$ docker compose pull
``` ```
If you have modified the application's source and would like to manually If you have modified the application's source and would like to manually
@ -49,17 +49,17 @@ and Docker Compose (version 1.6.0 or greater) already installed.
For first run, it is recommended to start the database separately: For first run, it is recommended to start the database separately:
```console ```console
user@host:szuru$ docker-compose up -d sql user@host:szuru$ docker compose up -d sql
``` ```
To start all containers: To start all containers:
```console ```console
user@host:szuru$ docker-compose up -d user@host:szuru$ docker compose up -d
``` ```
To view/monitor the application logs: To view/monitor the application logs:
```console ```console
user@host:szuru$ docker-compose logs -f user@host:szuru$ docker compose logs -f
# (CTRL+C to exit) # (CTRL+C to exit)
``` ```
@ -84,13 +84,13 @@ and Docker Compose (version 1.6.0 or greater) already installed.
2. Build the containers: 2. Build the containers:
```console ```console
user@host:szuru$ docker-compose build user@host:szuru$ docker compose build
``` ```
That will attempt to build both containers, but you can specify `client` That will attempt to build both containers, but you can specify `client`
or `server` to make it build only one. or `server` to make it build only one.
If `docker-compose build` spits out: If `docker compose build` spits out:
``` ```
ERROR: Service 'server' failed to build: failed to parse platform : "" is an invalid component of "": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument ERROR: Service 'server' failed to build: failed to parse platform : "" is an invalid component of "": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument
@ -102,7 +102,7 @@ and Docker Compose (version 1.6.0 or greater) already installed.
user@host:szuru$ export DOCKER_BUILDKIT=1; export COMPOSE_DOCKER_CLI_BUILD=1 user@host:szuru$ export DOCKER_BUILDKIT=1; export COMPOSE_DOCKER_CLI_BUILD=1
``` ```
...and run `docker-compose build` again. ...and run `docker compose build` again.
*Note: If your changes are not taking effect in your builds, consider building *Note: If your changes are not taking effect in your builds, consider building
with `--no-cache`.* with `--no-cache`.*
@ -117,7 +117,7 @@ with `--no-cache`.*
run from docker: run from docker:
```console ```console
user@host:szuru$ docker-compose run server ./szuru-admin --help user@host:szuru$ docker compose run server ./szuru-admin --help
``` ```
will give you a breakdown on all available commands. will give you a breakdown on all available commands.

View File

@ -1,9 +1,7 @@
## Example Docker Compose configuration ## Example Docker Compose configuration
## ##
## Use this as a template to set up docker-compose, or as guide to set up other ## Use this as a template to set up docker compose, or as guide to set up other
## orchestration services ## orchestration services
version: '2'
services: services:
server: server:

View File

@ -124,11 +124,11 @@ def apply_str_criterion_to_column(
transformer: Callable[[str], str] = wildcard_transformer, transformer: Callable[[str], str] = wildcard_transformer,
) -> SaQuery: ) -> SaQuery:
if isinstance(criterion, criteria.PlainCriterion): if isinstance(criterion, criteria.PlainCriterion):
expr = column.ilike(transformer(criterion.value)) expr = sa.and_(column != None, column.ilike(transformer(criterion.value)))
elif isinstance(criterion, criteria.ArrayCriterion): elif isinstance(criterion, criteria.ArrayCriterion):
expr = sa.sql.false() expr = sa.sql.false()
for value in criterion.values: for value in criterion.values:
expr = expr | column.ilike(transformer(value)) expr = expr | sa.and_(column != None, column.ilike(transformer(value)))
elif isinstance(criterion, criteria.RangedCriterion): elif isinstance(criterion, criteria.RangedCriterion):
raise errors.SearchError( raise errors.SearchError(
"Ranged criterion is invalid in this context. " "Ranged criterion is invalid in this context. "