Skip to content
A simple file sharing tool
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
emails/standard
lib
models
public/stylesheets
routes
spec
views
.gitignore
LICENSE
README.md
app.js
environment.js
environment.prod.js
package-lock.json
package.json

README.md

trnsfr

A simple file sharing tool.

Getting Started

It's a Node.js web application which permits the creation of public links with a unique path in the form of /tranfers/unique-id. Each link permits the download of a zip content. The zip content is given by a list of glob patterns applied to the server's local file system. Moreover it is possible to send one or more emails containing the above described link, with the addition of a subject and a message body.

Admin section

The application has an admin section /admin/transfers protected by a basic authentication scheme, which permits the management of records containing the details for each public, unique, published path.

Each record is composed by the following fields:

  • Unique-id, automatically generated unique identifier which is used to build the public link path /transfers/unqiue-id;
  • Glob patterns, a list of glob patterns, which, applied to the server's local file system, identify the content of the zip being downloaded;
  • Emails, a list of email recipients; For each recipient an email will be sent with the specified subject, message body and download link;
  • Subject, subject of the email;
  • Message, message body of the email, except the download link which will be added at the bottom;
  • Enabled, a flag to enable of disable the public link;
  • Enabled until, a timestamp which permits to disable the link after the timestamp exiration;
  • Dwnlds, number of times the content has been downloaded;
  • Last Dwnld, last download timestamp;
  • Actions, possible actions are the creation of a new record, the modification or deletion of an existing record and the download of the zip;

Installation

The installation can follow standard node.js installation guidelines. The file environment.js / environment.prod.js contains all the needed information in order to run the application in development or production modes.

The environment content is listed below:

  • baseUrl, path of the application, i.e. /trnsfr to obtain http://your-server/trnsfr;
  • dataFile, path of the json file used to store the records, this location needs to have read/write permissions for the user who runs the application;
  • users, list of accounts used for basic authentication;
  • realm, basic authentication realm;
  • publicUrl, public url of the server, needed to create links inside email body;
  • from, email sender address;
  • smtpConfig, smtp server configuration;

Find below a basic systemd service configuration:

[Unit]
Description=Transfer Web Application
After=network.target

[Service]
User=trnsfr
Group=trnsfr
WorkingDirectory=/home/trnsfr/trnsfr
Environment=NODE_ENV=production
Environment=PORT=7654
Environment=USERS_ADMIN_PASSWORD=XXXX
Environment=PUBLIC_URL=http://your-public-server-address
Environment="EMAIL_FROM=Email sender <trnsfr@your-domain>"
Environment=SMTP_HOST=smtp-server-address
Environment=SMTP_PORT=465
Environment=SMTP_SECURE=true
Environment=SMTP_AUTH_USER=XXXX
Environment=SMTP_AUTH_PASS=XXXX
ExecStart=/absolute-path-to-node-app/node /absolute-path-to-application/bin/www
SuccessExitStatus=143
Restart=on-failure

[Install]
WantedBy=multi-user.target

Licensing

The code in this project is licensed under GPL-3.0 license.

You can’t perform that action at this time.