Hosting // Copyparty
A couple weeks ago I was working on something at work and decided to "watch" some YouTube while I was working. I happened to see a video about something that was crossing my mind recently, a simple file server. Having been using Rust and specifically Ratatui to make terminal applications the project Ratzilla made me want to try to make a "terminal themed" file browser for the web for myself. Thankfully I did come across this as it does everything I wanted and more. The video was about Copyparty.
Copyparty is actually a very handy application. I have been wanting to have a cloud storage solution that aligned more with how I use the cloud. Yes, this isn't really the cloud and just another computer in your home, but with RAID setup and a good backup system you can have as much cloud data storage you could want. With Copyparty I am able to extend my current host as a cloud fileserver, allowing me to do things like mounting another samba server to it and using that network mount as a shared folder! This allows me to continue using my existing intranet NAS without having to reconfigure it, move data, or rebuild any machines. Thank god!
Hosting Copyparty is actually very easy, and so is the configuration.
networks:
net:
external: false
services:
copyparty:
image: copyparty/ac
container_name: copyparty
user: "1000:1000" # should match the user/group of your fileshare volumes
volumes:
- /DATA/AppData/copyparty:/cfg:z # the copyparty config folder
- /DATA/PublicShare:/PublicShare:z # this is where we declare that "/srv/pub" is the filesystem-path on the server that shall be shared online
- /DATA/PrivateShare:/PrivateShare:z
- /DATA/Media:/Media:z
networks:
- net
expose:
- "3923"
ports:
- "3923:3923"
stop_grace_period: 15s # thumbnailer is allowed to continue finishing up for 10s after the shutdown signal
environment:
LD_PRELOAD: /usr/lib/libmimalloc-secure.so.NOPE
# enable mimalloc by replacing "NOPE" with "2" for a nice speed-boost (will use twice as much ram)
Its that simple, once you deploy your Copyparty instance you will need to do some configuration in your copyparty.conf file. Below is an example configuration
[accounts]
admin: admin
user: password
[/]
/PublicShare
accs:
A: admin
r: *
[/music]
/Media/Music
accs:
A: admin
rwm: user
g: *
[/movies]
/Media/Movies
accs:
A: simplicy
rwm: cassiesr
g: *
[/p]
/PrivateShare
accs:
A: admin
rwm: user
g: * # everyone can access files if they know the URL
flags:
fk: 4 # each file URL will have a 4-character password
[global]
spinner: ,padding:0;border-radius:9em;border:.2em solid #444;border-top:.2em solid #fc0
e2dsa # enable file indexing and filesystem scanning
e2ts # enable multimedia indexing
ansi # enable colors in log messages
name: your-domain.com
Once Copyparty is configured you can start using it to store your files in the cloud. It is very useful for sharing large files with friend quickly without having to upload to google drive and deal with your space restrictions! The full depth of things you can do with Copyparty are notated in their github if you want to do more than simple file sharing/storing.
With some tweaking to the docker-compose.yaml and some configuring of your machine, you can mount your NAS as a mounted drive to your host, and share that with Copyparty to have direct access to your storage setup.