cwf
is a small tool to quickly share content (e.g. logfiles, commands, ...) with your friends and colleagues. It can be run local or on a server, so nobody needs to set things up like port forwarding on their local machine.
As of now we do not recommend sending sensitive data! Although the transport can be handled via HTTPS, the files on the server are just base64
encoded and can be accessed via the given endpoints from any IP.
We provide a homebrew package to install cwf
as a binary.
It's totally possible to run the server with the binary.
However if you are planning to run cwf
on a server (e.g. VPS) we recommend using our docker image.
brew install noobcollective/tap/cwf
[mothership]
ip = '127.0.0.1'
port = '8787'
ssl = true
[client]
user_name = 'MyLittleUsername'
user_id = '<id_from_server>'
user_id
will be automatically generated when registering user the first time.
Have a look at the registration command.
echo "Hello Clipboard!" | cwf testfile
Saved to: testfile
cwf testfile
Hello Clipboard!
echo "Hello Clipboard from subdirectory!" | cwf testdir/testfile
Saved to: testdir/testfile
cwf testdir/testerfile
Hello Clipboard from subdirectory!
cwf -d testerfile
Deleted file: testerfile
cwf -d testdir/testfile
Deleted file: testfile
cwf -d testdir/
Deleted directory: testdir
cwf -l
Type Name Modified
Dir testdir 2006-01-02 15:04:05
File testfile.cwf 2006-01-02 15:04:05
cwf -l testdir
Type Name Modified
File testfile.cwf 2006-01-02 15:04:05
For a more secure environment, we decided to implement user accounts server side. Therefore you'll need to register
your user when using cwf
the first time. Be sure there is a user_name
set in your config file and it's the same on the server.
cwf -r
Successfully registered! Have fun using CWF!
The path to your configuration file can be set via the -config
flag -> defaults to /etc/cwf/config.toml
.
[general]
port = '8787'
ssl = true
files_dir = '/tmp/cwf/'
certs_dir = '/etc/crypts'
cert_file = 'cert.crt'
key_file = 'cert.key'
[[accounts]]
user_name = 'MyLittleUser'
id = '<autogenerated_uuid>'
registered = true
[[accounts]]
user_name = 'AnotherUser'
id = '<autogenerated_uuid>'
registered = false
- Get the image with:
docker pull noobcollective/cwf-server
- Start
cwf
with docker in HTTP Mode:docker run \ --name cwf-server \ -p <host_port>:<container_port> \ -v <volume_name>:<container_filesDir> \ -d noobcollective/cwf-server -serve
- Start
cwf
with docker in HTTPS Mode:docker run \ --name cwf-server \ -p <host_port>:<container_port> \ -v <host_config_path>:<container_config_path> \ -v <volume_name>:<container_filesDir> \ -v <host_ssl_certs_dir>:<container_ssl_certs_dir> \ -d noobcollective/cwf-server -serve
<container_port>
: Configurable via-port
argument in cwf -> defaults to 8787.<container_config_path>
: Configurable via-config
argument in cwf.<volume_name>
: Name of the docker volume for persisting data.<container_filesDir>
: Configurable viafiles_dir
in config file -> defaults to/tmp/cwf/
.
When ssl
is set to true
in your config, you need to mount the directory where the SSL certificates are located on your host machine
and set the paths of your ssl directory, certificate and key in your config.
<host_ssl_certs_dir>
: Directory where the SSL certificates are located on your host machine.<container_ssl_certs_dir>
: Configurable in your config.
- get size of files
- diffs over snapshots
- chown directories to specific users
- only stdout a range (e.g cwf test1 -r 25,30)
- Added Zap as logging library go.uber.org/zap
- Added yaml to parse our config file gopkg.in/yaml.v3
- prefix paths with cwf home (preferable in a config file) - defaults to
/tmp/cwf/
- more secure content (because base64 - wtf)
- safe error handling (e.g. handle error responses in client)
- fix path for config file in resulting binary (for now it uses
pwd
, which is not a good idea, becausecwf
should lay in<somewhere>/bin
)
- copy into cwf
- stdout of cwf
- clean file
- check if file exists
- create dir if path passed as name
- list all files after date (more options for sorting?)
- Currently only listing files in directory in modified order. NO additional sorting is supported
- adding flag to setup port additionaly reading from config file setting dir/dirDepth/port
- Implemented with yaml (I thought yaml is toml and toml is yaml) so currently its working with a yaml file but i actually want a toml file
- copy into cwf
- stdout of cwf
- clean file
- [ ] check if file exists- not needed (cwf <filename>
returns if file exists anyway) - hashing/enryption
- list all files after date (more options for sorting?)
- create dir if path passed as name