Commit Graph
18 Commits
Author SHA1 Message Date
Maxim Shulga c15763d9f8 Stop server-provided values from reaching a shell or escaping /dsc/seafile
Commands were joined into a string and passed to "su -c", so a login shell
parsed every interpolated value. A library name is chosen on the server, and
"sync -d /dsc/seafile/<name>" put it straight into that string: a library
named 'Docs; touch /tmp/pwned; #' ran as an arbitrary command. Confirmed
against the built image before and after this change.

Every command is now an argument list executed by "runuser --", which execs
directly with no shell. runuser -u sets the same HOME and a PATH that still
finds the seaf-cli wrapper, so the daemon environment is unchanged.

The password no longer needs its surrounding quotes, which also fixes
passwords containing quotes, dollar signs, and backticks.

Library names are untrusted, so dsc/paths.py reduces each one to a single
path component and proves the result stays under the libraries directory
with symlinks resolved. Empty, ".", "..", and names containing a separator
are skipped with a warning; names that would collide are suffixed with their
library ID rather than sharing a directory.

Tests cover quotes, command substitutions, separators, newlines, absolute
paths, parent traversal, Unicode, and colliding names. They run in a separate
CI job so application failures stay distinguishable from packaging failures.
2026-08-02 16:53:19 -07:00
Maxim Shulga e3c6f28182 Pin Compose example to 0.0.13, the current release 2026-08-02 15:00:48 -07:00
Maxim Shulga d500ddc7ab Fix and validate Compose quick start
The list-form environment syntax in the README passed quote characters
through as part of the value, so LIBRARY_ID was read as '"<id>"' and no
matching library was found. Switch to mapping syntax, where YAML strips
the quotes.

- Pin the example to a versioned image instead of implicit latest
- Add a checked-in compose.example.yaml
- Validate it with `docker compose config` in CI
- Link the Docker Hub image from the README
2026-08-02 14:53:08 -07:00
snegov 452c29ac95 Add DELETE_CONFIRM_THRESHOLD option 2023-10-20 17:32:34 -07:00
snegov 7f39e0f271 Initialize seafile client during container start 2023-09-16 01:27:46 -07:00
snegov 724166b4a4 Support library names in configuration 2022-01-30 18:27:37 +03:00
snegov 681b11bbc1 Update README 2021-02-28 23:27:51 +03:00
snegov 310eb9028c Save seafile-data info in volume 2021-02-28 23:27:26 +03:00
snegov 4dcac70520 Removed DATA_DIR environment variable 2021-02-28 23:26:04 +03:00
snegov 8a0b1abfe7 Fix typo in README 2021-01-30 22:35:48 +03:00
snegov e35cf0efa5 Fix incorrect schema issue 2020-08-25 21:17:34 +03:00
snegov 79f15e5f09 Update image in docker-compose examples 2019-12-10 22:44:33 +03:00
snegov 9d5d015cc0 Remove obsolete code 2019-12-09 21:24:31 +03:00
snegov 4b7de4a5ca update docker-compose info in README 2019-04-14 13:18:09 +03:00
snegov 6e7177ebc2 update README 2019-04-14 13:08:29 +03:00
Robin Grönberg 6fe86a5292 Added help img. 2018-04-18 18:45:14 +02:00
Robin Grönberg 4e3b86f9f4 Updated README. 2018-04-18 18:38:25 +02:00
Robin Grönberg 7e166688ff Initial commit 2018-04-18 18:28:15 +02:00