mirror of
https://github.com/9001/copyparty.git
synced 2026-10-05 22:04:38 +01:00
packaging: *.gif + pre-gzip js/css;
* web/*.gif was ignored by pyproject.toml * pre-gzip js/css in dist source tarball * systemd/archlinux: safer default-config * readme: "config file example" labeling
This commit is contained in:
@@ -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
|
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)
|
* 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
|
* 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)
|
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)
|
* you can also `PRTY_CONFIG=foobar.conf python copyparty-sfx.py` (convenient in docker etc)
|
||||||
|
|
||||||
|
config file example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
[accounts]
|
[accounts]
|
||||||
u1: p1 # create account "u1" with password "p1"
|
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`
|
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
|
```yaml
|
||||||
[global]
|
[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`
|
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
|
```yaml
|
||||||
[global]
|
[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
|
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
|
```yaml
|
||||||
[global]
|
[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)
|
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
|
```yaml
|
||||||
[global]
|
[global]
|
||||||
|
|||||||
@@ -27,9 +27,6 @@ backup=("etc/${pkgname}/copyparty.conf" )
|
|||||||
sha256sums=("654ef47555bb402e27d8905c900c99f54b7f1d6db874a749effdf9ab23cf4223")
|
sha256sums=("654ef47555bb402e27d8905c900c99f54b7f1d6db874a749effdf9ab23cf4223")
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "${srcdir}/${pkgname}-${pkgver}/copyparty/web"
|
|
||||||
make
|
|
||||||
|
|
||||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||||
python -m build --wheel --no-isolation
|
python -m build --wheel --no-isolation
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,9 +24,6 @@ backup=("/etc/${pkgname}.d/init" )
|
|||||||
sha256sums=("654ef47555bb402e27d8905c900c99f54b7f1d6db874a749effdf9ab23cf4223")
|
sha256sums=("654ef47555bb402e27d8905c900c99f54b7f1d6db874a749effdf9ab23cf4223")
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "${srcdir}/${pkgname}-${pkgver}/copyparty/web"
|
|
||||||
make
|
|
||||||
|
|
||||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||||
python -m build --wheel --no-isolation
|
python -m build --wheel --no-isolation
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,9 +26,6 @@ See release at https://github.com/9001/copyparty/releases
|
|||||||
%setup -q
|
%setup -q
|
||||||
|
|
||||||
%build
|
%build
|
||||||
cd "copyparty/web"
|
|
||||||
make
|
|
||||||
cd -
|
|
||||||
%pyproject_wheel
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
[global]
|
|
||||||
i: 127.0.0.1
|
|
||||||
|
|
||||||
[accounts]
|
|
||||||
user: password
|
|
||||||
|
|
||||||
[/]
|
[/]
|
||||||
/var/lib/copyparty-jail
|
/var/lib/copyparty-jail
|
||||||
accs:
|
accs:
|
||||||
r: *
|
r: * # everyone can [r]ead (browse/download)
|
||||||
rwdma: user
|
|
||||||
flags:
|
|
||||||
grid
|
# 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/
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
# vim: ft=yaml:
|
# vim: ft=yaml:
|
||||||
|
|
||||||
|
|
||||||
# put this file in /etc/
|
|
||||||
|
|
||||||
|
|
||||||
[global]
|
[global]
|
||||||
e2dsa # enable file indexing and filesystem scanning
|
e2dsa # enable file indexing and filesystem scanning
|
||||||
e2ts # and enable multimedia indexing
|
e2ts # and enable multimedia indexing
|
||||||
|
|||||||
@@ -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)
|
please edit `/etc/copyparty/copyparty.conf` (if running as a system service)
|
||||||
or `$HOME/.config/copyparty/copyparty.conf` if running as a user 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 basic example config: 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
|
* 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`
|
or by running `copyparty --help`
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ pk: $(addsuffix .gz, $(wildcard tl/*.js *.js *.css) \
|
|||||||
un: $(addsuffix .un, $(wildcard tl/*.gz *.gz a/*.gz))
|
un: $(addsuffix .un, $(wildcard tl/*.gz *.gz a/*.gz))
|
||||||
|
|
||||||
tl/%.js.gz: tl/%.js
|
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 $< $@
|
touch -r $< $@
|
||||||
rm $<
|
rm $<
|
||||||
|
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ copyparty = [
|
|||||||
"web/*.css",
|
"web/*.css",
|
||||||
"web/*.html",
|
"web/*.html",
|
||||||
"web/*.xml",
|
"web/*.xml",
|
||||||
|
"web/*.gif",
|
||||||
"web/tl/*.js",
|
"web/tl/*.js",
|
||||||
"web/tl/*.gz",
|
"web/tl/*.gz",
|
||||||
"web/a/*.txt",
|
"web/a/*.txt",
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ scripts/genlic.py "$rls_dir/copyparty/res/COPYING.txt"
|
|||||||
|
|
||||||
cd "$rls_dir"
|
cd "$rls_dir"
|
||||||
find -type d -exec chmod 755 '{}' \+
|
find -type d -exec chmod 755 '{}' \+
|
||||||
find -type f -exec chmod 644 '{}' \+
|
find -type f -exec chmod u+rw,go+r '{}' \+
|
||||||
|
|
||||||
commaver="$(
|
commaver="$(
|
||||||
printf '%s\n' "$ver" |
|
printf '%s\n' "$ver" |
|
||||||
@@ -99,6 +99,12 @@ rm -f \
|
|||||||
cp -pv LICENSE LICENSE.txt
|
cp -pv LICENSE LICENSE.txt
|
||||||
mv setup.py{,.disabled}
|
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
|
# the regular cleanup memes
|
||||||
find -name '*.pyc' -delete
|
find -name '*.pyc' -delete
|
||||||
find -name __pycache__ -delete
|
find -name __pycache__ -delete
|
||||||
|
|||||||
Reference in New Issue
Block a user