diff --git a/.dockerignore b/.dockerignore index 9765ae8..e8d4627 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,8 +1,10 @@ .idea data +tmp temp node_modules app/node_modules npm-debug.log scripts docs +_releases diff --git a/.gitignore b/.gitignore index 175190a..8cc17e6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ data temp node_modules npm-debug.log +_releases diff --git a/README.md b/README.md index 0949aeb..adbfa06 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,11 @@ Simple open source self-hosted file sharing solution. * Supports many and very big files (Streams ftw) -* Resumable up- and downloads ([TUS](https://tus.io)) +* Resumable up- and downloads ([tus.io](https://tus.io)) * Set an expire-time for your upload bucket * One-time downloads -* Password protected downloads ([AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard)) -* Requires Node >=7.4 +* Requires Node >=7.4 or use `--harmony-async-await` flag +* Password protected download list ([AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard))  diff --git a/config.dev.js b/config.dev.js index 2c0d181..d28e64b 100644 --- a/config.dev.js +++ b/config.dev.js @@ -1,5 +1,19 @@ 'use strict'; module.exports = { - accessLog: 'dev' + accessLog: 'dev', + retentions: { + "one-time": "one time download", + 10: "10 Seconds", + 60: "1 Minute", + 300: "5 Minutes", + 3600: "1 Hour", + 21600: "6 Hours", + 86400: "1 Day", + 259200: "3 Days", + 604800: "1 Week", + 1209600: "2 Weeks", + 2419200: "4 Weeks", + 4838400: "8 Weeks" + }, }; diff --git a/lib/db.js b/lib/db.js index f11f2fe..b7e3104 100644 --- a/lib/db.js +++ b/lib/db.js @@ -19,7 +19,7 @@ module.exports = class DB { for (sid of Object.keys(this.db)) { for (f of this.db[sid]) { // no removal of one-time downloads - if(!Number.isInteger(f.metadata.retention)) return; + if(!Number.isInteger(+f.metadata.retention)) return; expires = (+f.metadata.createdAt) + (+f.metadata.retention * 1000) - Date.now(); if(expires <= 0) { diff --git a/lib/endpoints.js b/lib/endpoints.js index 66315f9..b39214c 100644 --- a/lib/endpoints.js +++ b/lib/endpoints.js @@ -34,6 +34,10 @@ if(config.accessLog) { app.use('/app', express.static(path.join(__dirname, '../public/app'))); app.use('/assets', express.static(path.join(__dirname, '../public/assets'))); +// robots.txt +app.get('/robots.txt', (req, res) => { + res.sendFile(path.join(__dirname, '../public/robots.txt')); +}); // Upload App app.get('/', (req, res) => { diff --git a/public/html/download.html b/public/html/download.html index 51fe7e0..a6b8321 100644 --- a/public/html/download.html +++ b/public/html/download.html @@ -5,6 +5,7 @@