diff --git a/README.md b/README.md index f73d7c65d..e4a156599 100644 --- a/README.md +++ b/README.md @@ -526,6 +526,7 @@ upgrade notes per-folder, per-user permissions - if your setup is getting complex, consider making a [config file](./docs/example.conf) instead of using arguments * much easier to manage, and you can modify the config at runtime with `systemctl reload copyparty` or more conveniently using the `[reload cfg]` button in the control-panel (if the user has `a`/admin in any volume) * changes to the `[global]` config section requires a restart to take effect +* when using config-files, ignore all the `-a` and `-v` stuff below, and CTRL-F `config file example` on this page instead a quick summary can be seen using [`--help-accounts`](https://copyparty.eu/cli/#accounts-help-page) @@ -575,6 +576,8 @@ and if you want to use config files instead of commandline args (good!) then her * you can also `PRTY_CONFIG=foobar.conf python copyparty-sfx.py` (convenient in docker etc) +config file example: + ```yaml [accounts] u1: p1 # create account "u1" with password "p1" @@ -2195,7 +2198,7 @@ as for client-side stuff, there is [plugins for modifying UI/UX](./contrib/plugi autologin based on IP range (CIDR) , using the global-option `--ipu` -for example, if everyone with an IP that starts with `192.168.123` should automatically log in as the user `spartacus`, then you can either specify `--ipu=192.168.123.0/24=spartacus` as a commandline option, or put this in a config file: +for example, if everyone with an IP that starts with `192.168.123` should automatically log in as the user `spartacus`, then you can either specify `--ipu=192.168.123.0/24=spartacus` as a commandline option, same as this config file example: ```yaml [global] @@ -2211,7 +2214,7 @@ repeat the option to map additional subnets limit a user to certain IP ranges (CIDR) , using the global-option `--ipr` -for example, if the user `spartacus` should get rejected if they're not connecting from an IP that starts with `192.168.123` or `172.16`, then you can either specify `--ipr=192.168.123.0/24,172.16.0.0/16=spartacus` as a commandline option, or put this in a config file: +for example, if the user `spartacus` should get rejected if they're not connecting from an IP that starts with `192.168.123` or `172.16`, then you can either specify `--ipr=192.168.123.0/24,172.16.0.0/16=spartacus` as a commandline option, same as this config file example: ```yaml [global] @@ -2248,7 +2251,7 @@ but if you just want to let users change their own passwords, then you probably other ways to auth by header -if you have a middleware which adds a header with a user identifier, for example tailscale's `Tailscale-User-Login: alice.m@forest.net` then you can automatically auth as `alice` by defining that mapping with `--idp-hm-usr '^Tailscale-User-Login^alice.m@forest.net^alice'` or the following config file: +if you have a middleware which adds a header with a user identifier, for example tailscale's `Tailscale-User-Login: alice.m@forest.net` then you can automatically auth as `alice` by defining that mapping with `--idp-hm-usr '^Tailscale-User-Login^alice.m@forest.net^alice'` or the following config file example: ```yaml [global] @@ -2569,7 +2572,7 @@ change the association of a file extension using commandline args, you can do something like `--mime gif=image/jif` and `--mime ts=text/x.typescript` (can be specified multiple times) -in a config file, this is the same as: +that's the same as this config file example: ```yaml [global] diff --git a/contrib/package/arch/PKGBUILD b/contrib/package/arch/PKGBUILD index c79ee2f38..917036088 100644 --- a/contrib/package/arch/PKGBUILD +++ b/contrib/package/arch/PKGBUILD @@ -27,9 +27,6 @@ backup=("etc/${pkgname}/copyparty.conf" ) sha256sums=("654ef47555bb402e27d8905c900c99f54b7f1d6db874a749effdf9ab23cf4223") build() { - cd "${srcdir}/${pkgname}-${pkgver}/copyparty/web" - make - cd "${srcdir}/${pkgname}-${pkgver}" python -m build --wheel --no-isolation } diff --git a/contrib/package/makedeb-mpr/PKGBUILD b/contrib/package/makedeb-mpr/PKGBUILD index cb8e4f85d..1b5e3d71e 100644 --- a/contrib/package/makedeb-mpr/PKGBUILD +++ b/contrib/package/makedeb-mpr/PKGBUILD @@ -24,9 +24,6 @@ backup=("/etc/${pkgname}.d/init" ) sha256sums=("654ef47555bb402e27d8905c900c99f54b7f1d6db874a749effdf9ab23cf4223") build() { - cd "${srcdir}/${pkgname}-${pkgver}/copyparty/web" - make - cd "${srcdir}/${pkgname}-${pkgver}" python -m build --wheel --no-isolation } diff --git a/contrib/package/rpm/copyparty.spec b/contrib/package/rpm/copyparty.spec index 69ac26ee4..f32912c6e 100644 --- a/contrib/package/rpm/copyparty.spec +++ b/contrib/package/rpm/copyparty.spec @@ -26,9 +26,6 @@ See release at https://github.com/9001/copyparty/releases %setup -q %build -cd "copyparty/web" -make -cd - %pyproject_wheel %install diff --git a/contrib/systemd/copyparty.conf b/contrib/systemd/copyparty.conf index 5d9bdbe3a..6161cccbb 100644 --- a/contrib/systemd/copyparty.conf +++ b/contrib/systemd/copyparty.conf @@ -1,13 +1,15 @@ -[global] - i: 127.0.0.1 - -[accounts] - user: password - [/] /var/lib/copyparty-jail accs: - r: * - rwdma: user - flags: - grid \ No newline at end of file + r: * # everyone can [r]ead (browse/download) + + +# above is a very simple config; +# the webroot is /var/lib/copyparty-jail +# readable by everyone, no login required +# +# you'll want to replace this file; some inspiration: +# a basic example: https://github.com/9001/copyparty/blob/hovudstraum/contrib/systemd/copyparty.example.conf +# another example: https://github.com/9001/copyparty/blob/hovudstraum/docs/example.conf +# CTRL-F "config file example" here: https://github.com/9001/copyparty +# full list of options: https://copyparty.eu/cli/ diff --git a/contrib/systemd/copyparty.example.conf b/contrib/systemd/copyparty.example.conf index b85ec7707..836499d2e 100644 --- a/contrib/systemd/copyparty.example.conf +++ b/contrib/systemd/copyparty.example.conf @@ -3,9 +3,6 @@ # vim: ft=yaml: -# put this file in /etc/ - - [global] e2dsa # enable file indexing and filesystem scanning e2ts # and enable multimedia indexing diff --git a/contrib/systemd/index.md b/contrib/systemd/index.md index cfd1b7157..2e132cf98 100644 --- a/contrib/systemd/index.md +++ b/contrib/systemd/index.md @@ -3,8 +3,9 @@ this is `/var/lib/copyparty-jail`, the fallback webroot when copyparty has not y please edit `/etc/copyparty/copyparty.conf` (if running as a system service) or `$HOME/.config/copyparty/copyparty.conf` if running as a user service -a basic configuration example is available at https://github.com/9001/copyparty/blob/hovudstraum/contrib/systemd/copyparty.example.conf -a configuration example that explains most flags is available at https://github.com/9001/copyparty/blob/hovudstraum/docs/chungus.conf +* a basic example config: https://github.com/9001/copyparty/blob/hovudstraum/contrib/systemd/copyparty.example.conf +* another example with focus on syntax: https://github.com/9001/copyparty/blob/hovudstraum/docs/example.conf +* and CTRL-F "config file example" here: https://github.com/9001/copyparty -the full list of configuration options can be seen at https://ocv.me/copyparty/helptext.html +the full list of configuration options can be seen at https://copyparty.eu/cli/ or by running `copyparty --help` diff --git a/copyparty/web/Makefile b/copyparty/web/Makefile index 2f9670c55..a048a64e3 100644 --- a/copyparty/web/Makefile +++ b/copyparty/web/Makefile @@ -7,7 +7,8 @@ pk: $(addsuffix .gz, $(wildcard tl/*.js *.js *.css) \ un: $(addsuffix .un, $(wildcard tl/*.gz *.gz a/*.gz)) tl/%.js.gz: tl/%.js - ./Makefile.s1 <$< | pigz -c11 -J 34 -I 573 >$@ + sh Makefile.s1 <$< | pigz -c11 -J 34 -I 573 >$@ + pigz -dc <$@ | grep -q ^Ls touch -r $< $@ rm $< diff --git a/pyproject.toml b/pyproject.toml index a9966b58e..a63c86c14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,6 +97,7 @@ copyparty = [ "web/*.css", "web/*.html", "web/*.xml", + "web/*.gif", "web/tl/*.js", "web/tl/*.gz", "web/a/*.txt", diff --git a/scripts/make-tgz-release.sh b/scripts/make-tgz-release.sh index f7cf25ca0..0bdaae45b 100755 --- a/scripts/make-tgz-release.sh +++ b/scripts/make-tgz-release.sh @@ -68,7 +68,7 @@ scripts/genlic.py "$rls_dir/copyparty/res/COPYING.txt" cd "$rls_dir" find -type d -exec chmod 755 '{}' \+ -find -type f -exec chmod 644 '{}' \+ +find -type f -exec chmod u+rw,go+r '{}' \+ commaver="$( printf '%s\n' "$ver" | @@ -99,6 +99,12 @@ rm -f \ cp -pv LICENSE LICENSE.txt mv setup.py{,.disabled} +( cd copyparty/web +make -j$(nproc) +rm Makefile* +printf 'all:\n\t@echo "NOTE: no longer necessary to run copyparty/web/Makefile when building from source tarball"\n' >Makefile +) + # the regular cleanup memes find -name '*.pyc' -delete find -name __pycache__ -delete