A simple sharing service built in D language using serverino. It provides a REST API for uploading and deleting files using AWS S3 compatible storage.
- Public URL access to uploaded files
- Secure deletion with SHA256 hash verification
- AWS S3 compatible storage backend
- Install
s3cmdcli. On ubuntu:apt install s3cmd - Copy
config.d.templatetoconfig.dand fill in your AWS credentials and settings - Setup your nginx:
location / {
# Add user authentication here if needed
# For single user auth, simply set API_USER and API_PASSWORD in config.d
# Example of basic auth:
# auth_basic "Restricted Access";
# auth_basic_user_file /etc/nginx/.htpasswd; # htpasswd -c /etc/nginx/.htpasswd username
client_max_body_size 1000M; # Max file size
client_body_temp_path /tmp;
client_body_in_file_only on;
client_body_buffer_size 128k;
proxy_pass_request_body off;
proxy_set_header Content-Length "0";
proxy_set_header X-File-Path $request_body_file;
proxy_set_header Content-Type "text/plain";
proxy_pass http://localhost:8323; # serverino port
limit_except POST DELETE {
deny all;
}
}
- Build & run the project
dub --build=release. You need the latest D compiler from dlang.org - Upload a file with
curl --data-binary @/path/to/file.mp4 https://your_server/name.mp4or from stdoutman ls | col -b | curl --data-binary @- https://your_server/man.txt
If you find FileSharing useful in your workflow, please consider sponsoring this project. Your support helps maintain the service, implement new features, and ensure its long-term sustainability. Even small contributions make a significant difference in keeping open-source projects like this one alive and thriving. Sponsor us today to help build a better file sharing solution for everyone!