CopyParty for WebServer

I am probably one of the Few users that’s not using the Nethserver Webserver tool for hosting websites and Files, and tbh i don’t like it. The main and probably only reason i don’t like it, is because the current implementation of File Explorer and view is not that robust, missing alot of Features and functionalities, and tbh significantly underpowered for proper webhosting needs, compared to what solutions like cpanel, and controlwepanel(i helped implement) ships.

I came across this Nice tool, that i am sure would significantly be a nice addition for the Nethserver 8 Webserver, and many other use cases as well.

9001/copyparty: Portable file server with accelerated resumable uploads, dedup, WebDAV, FTP, TFTP, zeroconf, media indexer, thumbnails++ all in one file, no deps

with this, i will finally have proper zip and unzip, among other nice features, like on the fly editiing of source code files,

Here is a Video on Details about it.

here is another video

IF we can get this working, for the Webserver first, then figure out other UseCases, i think it would be Amazing. @stephdl @mrmarkuz @davidep

3 Likes

I would have to agree that CopyParty looks nice, not to mention all the features it has. It’s small and fast.

I would rather the possibility of using CopyParty for sure.

I was already thinking of setting up a weekend to spin up a test server of Copyparty as well as some other OpenSource items I have been eyeing.

Any thoughts on CopyParty guys?

@oneitonitram Did you already test it?
I think it’s just about installation, publishing the ports in the service file and open the firewall ports…

in relation to NS8 webserver, there is actually alot more actions and considerations that need to be made, on configurations wise.

To use copyparty in webserver:

Open port in firewall:

firewall-cmd --permanent --add-port=3923/tcp
firewall-cmd --reload

Enter webserver env:

runagent -m webserver1

Run copyparty:

podman run --rm -it -p 3923:3923 -v "websites:/w:z" docker.io/copyparty/ac:1.19.1 -a user:secret -v /w::rw,user --usernames

The first -v "websites:/w:z" podman option mounts the websites volume to the containers /w directory.
The -a user:secret sets a user account with password in copyparty.
The -v /w::rw,user configures the /w directory to be accessible by user which has rw permissions.

Browse to https://webserverurl:3923 and login with user user and password secret.
You should be able to upload files to the webserver vhost dirs, for example 9001.

3 Likes

will it be persisitent, on restarts or reboots?

No, it’s just to provide a starting point for testing copyparty as It has a lot of options.

To make it persistent, a systemd service file would be needed.

1 Like

Copyparty should be included in every container with a web server to make it easier to manage assets. The first things that come to mind are Dokuwiki and Wordpress.

2 Likes

anaother solution could be https://www.files.gallery/

You don’t need Python for that.

2 Likes

yes wordpress could benefit alot, however we need a standardized config first, before we can start including it in containers, to prevent security issues, Also there should be a possibility to turn it off or on, or exposing it or not, otherwise we might have security issues where someoe forgets copypart exists

3 Likes

A stronger use case (considerations/pros/cons/benefits/drawbacks/maintain- sustain ability) would be required I guess…

How did you come up with the idea of classifying my use case as unimportant?

Who did?

Read your answer with my eyes

Too cryptic for me. No further interest in this topic.

It’s also possible to use copyparty via traefik, this way we avoid opening the firewall port.
So it’s possible to run copyparty in any app and connect it to any volume and access it via HTTPS (including letsencrypt if wanted)

Create the HTTP route:

Get the right volume to use with copyparty:

[root@node ~]# runagent -m webserver1 podman volume ls
DRIVER      VOLUME NAME
local       websites
local       sftpgo_backups
local       sftpgo_config

Run copyparty in any app environment for example webserver and mount the volume websites:

runagent -m webserver1 podman run --rm -it -p 30000:3923 -v "websites:/w:z" docker.io/copyparty/ac:1.19.1 -a markus:secret -v /w::rw,markus --usernames

Now you can upload files and check the terminal for errors.

@capote I don’t think that @LayLow classified your use case as unimportant but there are some valid questions.

If you like to provide it together with the apps, we need to care about security and options to enable.

Which copyparty services should be accessible from WAN?
Which user(s) to allow? LDAP is a wanted feature, see External user onboarding / linking: LDAP · Issue #194 · 9001/copyparty · GitHub
Should it be enabled by default or maybe manageable in the app settings?

For now I’d prefer the way to just run copyparty manually as long as needed to upload files. This way there’s no security issue and no maintenance needed and it’s just a one-liner in the terminal.

Another way could be a script, so you can just run

copyparty <USER> <PASSWORD> <VOLUME>

in an app environment.

tell me more in this regards…

i am thinking, considering our needs and use cases for NS8, we should work with a single script that we can wget into a podman container, ru necesary scripts for attaching the copyparty etc.

then this script could be used a sa baseline for apps like webser, that would need a constant fileserver available for them to be added as normal services, while still allowig standard utilization in other apps

1 Like

Maybe something like this?

Create a file ../bin/copyparty with following content:

#!/bin/bash
die(){
      	local volume="$1"  
        local port=$2    
        local username="$3"
        local password="$4"
        local e=$5
        echo $volume $port $username $password
        exit $e
}

# if not enough args displayed, display an error and die
[ $# -eq 0 ] && die "Usage: $0 volume port username password" 1

podman run --rm -it -p $2:3923 -v $1:/w:z docker.io/copyparty/ac:1.19.1 -a $3:$4 -v /w::rw,$3 --usernames

Set it executable:

chmod +x ../bin/copyparty

Now it’s possible to run:

copyparty websites 30000 user password

Still I’m thinking about how to make copyparty persistent so it’s still available after restart or update to also fulfill the use case of @capote
We could add another service file for copyparty and edit the Requires of the webserver.service file…

2 Likes