mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-07 06:30:53 +03:00
Compare commits
55 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b346e3e3ae | ||
|
|
aea428372d | ||
|
|
ea8efb9d93 | ||
|
|
2b7164f589 | ||
|
|
08399059e9 | ||
|
|
aea40fa11b | ||
|
|
e51c753c0d | ||
|
|
6520d71faa | ||
|
|
97b0b10863 | ||
|
|
50e76e0895 | ||
|
|
610e036e26 | ||
|
|
e695a8b481 | ||
|
|
d33ddf643b | ||
|
|
512bd32368 | ||
|
|
3c42de0efd | ||
|
|
b7582230cf | ||
|
|
592ff3fb4a | ||
|
|
927203cb96 | ||
|
|
48237807fa | ||
|
|
38a4552d52 | ||
|
|
9d2d81e063 | ||
|
|
81d6c90c4e | ||
|
|
2bdaa0c4bd | ||
|
|
00d3bebc27 | ||
|
|
ea384ff5d3 | ||
|
|
062c439ec0 | ||
|
|
54e528980b | ||
|
|
b9292abefe | ||
|
|
1520942ac9 | ||
|
|
0e17cd567c | ||
|
|
7b21b199c2 | ||
|
|
6214b07a30 | ||
|
|
941d87976b | ||
|
|
8db3fed6fb | ||
|
|
78ca1f06e0 | ||
|
|
9fdc079878 | ||
|
|
f08d078236 | ||
|
|
46ae4a220b | ||
|
|
d0932c26ea | ||
|
|
798c399a38 | ||
|
|
825e3942a2 | ||
|
|
755459f57e | ||
|
|
42f5ca9701 | ||
|
|
1a923d21b5 | ||
|
|
3bd9f00c25 | ||
|
|
fa1c64369f | ||
|
|
9280f47afc | ||
|
|
3707b90d09 | ||
|
|
21392f1157 | ||
|
|
680d3ed948 | ||
|
|
dee1e84e58 | ||
|
|
214191e743 | ||
|
|
84da34169d | ||
|
|
93e1d2f41a | ||
|
|
43e1845d28 |
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
|
|
||||||
# Build project
|
# Build project
|
||||||
FROM node:current-alpine AS builder
|
FROM node:16.13-alpine3.13 AS builder
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
# Add user
|
# Add user
|
||||||
&& addgroup --gid 10001 app \
|
&& addgroup --gid 10001 app \
|
||||||
@@ -26,7 +26,7 @@ RUN set -x \
|
|||||||
|
|
||||||
|
|
||||||
# Main image
|
# Main image
|
||||||
FROM node:current-alpine
|
FROM node:16.13-alpine3.13
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
# Add user
|
# Add user
|
||||||
&& addgroup --gid 10001 app \
|
&& addgroup --gid 10001 app \
|
||||||
|
|||||||
13
README.md
13
README.md
@@ -1,4 +1,4 @@
|
|||||||
# [](https://gitlab.com/timvisee/send/) Send
|
# [](https://gitlab.com/timvisee/send/) Send
|
||||||
|
|
||||||
[![Build status on GitLab CI][gitlab-ci-master-badge]][gitlab-ci-link]
|
[![Build status on GitLab CI][gitlab-ci-master-badge]][gitlab-ci-link]
|
||||||
[![Latest release][release-badge]][release-link]
|
[![Latest release][release-badge]][release-link]
|
||||||
@@ -81,7 +81,7 @@ A file sharing experiment which allows you to send encrypted files to other user
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- [Node.js 15.x](https://nodejs.org/)
|
- [Node.js 16.x](https://nodejs.org/)
|
||||||
- [Redis server](https://redis.io/) (optional for development)
|
- [Redis server](https://redis.io/) (optional for development)
|
||||||
- [AWS S3](https://aws.amazon.com/s3/) or compatible service (optional)
|
- [AWS S3](https://aws.amazon.com/s3/) or compatible service (optional)
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ The server is configured with environment variables. See [server/config.js](serv
|
|||||||
|
|
||||||
## Localization
|
## Localization
|
||||||
|
|
||||||
see [docs/localization.md](docs/localization.md)
|
See: [docs/localization.md](docs/localization.md)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -139,9 +139,11 @@ Find a list of public instances here: https://github.com/timvisee/send-instances
|
|||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
See also [docs/deployment.md](docs/deployment.md)
|
See: [docs/deployment.md](docs/deployment.md)
|
||||||
|
|
||||||
AWS example using Ubuntu Server `20.04` [docs/AWS.md](docs/AWS.md)
|
Docker quickstart: [docs/docker.md](docs/docker.md)
|
||||||
|
|
||||||
|
AWS example using Ubuntu Server `20.04`: [docs/AWS.md](docs/AWS.md)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -150,6 +152,7 @@ AWS example using Ubuntu Server `20.04` [docs/AWS.md](docs/AWS.md)
|
|||||||
- Web: _this repository_
|
- Web: _this repository_
|
||||||
- Command-line: [`ffsend`](https://github.com/timvisee/ffsend)
|
- Command-line: [`ffsend`](https://github.com/timvisee/ffsend)
|
||||||
- Android: _see [Android](#android) section_
|
- Android: _see [Android](#android) section_
|
||||||
|
- Thunderbird: [FileLink provider for Send](https://addons.thunderbird.net/en-US/thunderbird/addon/filelink-provider-for-send/)
|
||||||
|
|
||||||
#### Android
|
#### Android
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,11 @@ function body(main) {
|
|||||||
state.capabilities = {
|
state.capabilities = {
|
||||||
account: true
|
account: true
|
||||||
}; //TODO
|
}; //TODO
|
||||||
state.archive = new Archive([], DEFAULTS.EXPIRE_SECONDS);
|
state.archive = new Archive(
|
||||||
|
[],
|
||||||
|
DEFAULTS.EXPIRE_SECONDS,
|
||||||
|
DEFAULTS.DOWNLOADS
|
||||||
|
);
|
||||||
state.storage = storage;
|
state.storage = storage;
|
||||||
state.user = new User(storage, LIMITS);
|
state.user = new User(storage, LIMITS);
|
||||||
state.sentry = Sentry;
|
state.sentry = Sentry;
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ function isDupe(newFile, array) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default class Archive {
|
export default class Archive {
|
||||||
constructor(files = [], defaultTimeLimit = 86400) {
|
constructor(files = [], defaultTimeLimit = 86400, defaultDownloadLimit = 1) {
|
||||||
this.files = Array.from(files);
|
this.files = Array.from(files);
|
||||||
this.defaultTimeLimit = defaultTimeLimit;
|
this.defaultTimeLimit = defaultTimeLimit;
|
||||||
this.timeLimit = defaultTimeLimit;
|
this.timeLimit = defaultTimeLimit;
|
||||||
this.dlimit = 1;
|
this.dlimit = defaultDownloadLimit;
|
||||||
this.password = null;
|
this.password = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -224,24 +224,6 @@ async function saveFile(file) {
|
|||||||
if (navigator.msSaveBlob) {
|
if (navigator.msSaveBlob) {
|
||||||
navigator.msSaveBlob(blob, file.name);
|
navigator.msSaveBlob(blob, file.name);
|
||||||
return resolve();
|
return resolve();
|
||||||
} else if (/iPhone|fxios/i.test(navigator.userAgent)) {
|
|
||||||
// This method is much slower but createObjectURL
|
|
||||||
// is buggy on iOS
|
|
||||||
const reader = new FileReader();
|
|
||||||
reader.addEventListener('loadend', function() {
|
|
||||||
if (reader.error) {
|
|
||||||
return reject(reader.error);
|
|
||||||
}
|
|
||||||
if (reader.result) {
|
|
||||||
const a = document.createElement('a');
|
|
||||||
a.href = reader.result;
|
|
||||||
a.download = file.name;
|
|
||||||
document.body.appendChild(a);
|
|
||||||
a.click();
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
reader.readAsDataURL(blob);
|
|
||||||
} else {
|
} else {
|
||||||
const downloadUrl = URL.createObjectURL(blob);
|
const downloadUrl = URL.createObjectURL(blob);
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
|
|||||||
@@ -175,7 +175,6 @@ footer li a:hover {
|
|||||||
position: relative;
|
position: relative;
|
||||||
max-width: 64rem;
|
max-width: 64rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.main > section {
|
.main > section {
|
||||||
@@ -271,7 +270,6 @@ select {
|
|||||||
@apply m-auto;
|
@apply m-auto;
|
||||||
@apply py-8;
|
@apply py-8;
|
||||||
|
|
||||||
min-height: 42rem;
|
|
||||||
max-height: 42rem;
|
max-height: 42rem;
|
||||||
width: calc(100% - 3rem);
|
width: calc(100% - 3rem);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ if (process.env.NODE_ENV === 'production') {
|
|||||||
DEFAULTS,
|
DEFAULTS,
|
||||||
WEB_UI,
|
WEB_UI,
|
||||||
PREFS,
|
PREFS,
|
||||||
archive: new Archive([], DEFAULTS.EXPIRE_SECONDS),
|
archive: new Archive([], DEFAULTS.EXPIRE_SECONDS, DEFAULTS.DOWNLOADS),
|
||||||
capabilities,
|
capabilities,
|
||||||
translate,
|
translate,
|
||||||
storage,
|
storage,
|
||||||
|
|||||||
1281
app/qrcode.js
1281
app/qrcode.js
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,6 @@ module.exports = function(app = choo({ hash: true })) {
|
|||||||
app.route('/unsupported/:reason', body(require('./ui/unsupported')));
|
app.route('/unsupported/:reason', body(require('./ui/unsupported')));
|
||||||
app.route('/error', body(require('./ui/error')));
|
app.route('/error', body(require('./ui/error')));
|
||||||
app.route('/blank', body(require('./ui/blank')));
|
app.route('/blank', body(require('./ui/blank')));
|
||||||
app.route('/robots.txt', function() {return 'User-agent: * Disallow: /'});
|
|
||||||
app.route('/oauth', function(state, emit) {
|
app.route('/oauth', function(state, emit) {
|
||||||
emit('authenticate', state.query.code, state.query.state);
|
emit('authenticate', state.query.code, state.query.state);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const raw = require('choo/html/raw');
|
|||||||
const qrcode = require('../qrcode');
|
const qrcode = require('../qrcode');
|
||||||
|
|
||||||
module.exports = function(url) {
|
module.exports = function(url) {
|
||||||
const gen = qrcode(5, 'L');
|
const gen = qrcode(0, 'L');
|
||||||
gen.addData(url);
|
gen.addData(url);
|
||||||
gen.make();
|
gen.make();
|
||||||
const qr = gen.createSvgTag({ scalable: true });
|
const qr = gen.createSvgTag({ scalable: true });
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module.exports = function(state, emit) {
|
|||||||
why = html`
|
why = html`
|
||||||
<a
|
<a
|
||||||
class="text-blue"
|
class="text-blue"
|
||||||
href="https://github.com/mozilla/send/blob/master/docs/faq.md#why-is-my-browser-not-supported"
|
href="https://github.com/timvisee/send/blob/master/docs/faq.md#why-is-my-browser-not-supported"
|
||||||
>
|
>
|
||||||
${state.translate('notSupportedLink')}
|
${state.translate('notSupportedLink')}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
BIN
assets/icon-64x64.png
Normal file
BIN
assets/icon-64x64.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -195,7 +195,7 @@ Lower files and folders permissions to user and group `www-data`:
|
|||||||
```
|
```
|
||||||
sudo find /var/www/send -type d -exec chmod 750 {} \;
|
sudo find /var/www/send -type d -exec chmod 750 {} \;
|
||||||
sudo find /var/www/send -type f -exec chmod 640 {} \;
|
sudo find /var/www/send -type f -exec chmod 640 {} \;
|
||||||
sudo chmod 750 /var/www/send/node_modules/.bin/*
|
sudo find -L /var/www/send/node_modules/.bin/ -exec chmod 750 {} \;
|
||||||
```
|
```
|
||||||
|
|
||||||
### Systemd
|
### Systemd
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ Config options expecting array values (e.g. `EXPIRE_TIMES_SECONDS`, `DOWNLOAD_CO
|
|||||||
| Name | Description |
|
| Name | Description |
|
||||||
|------------------|-------------|
|
|------------------|-------------|
|
||||||
| `BASE_URL` | The HTTPS URL where traffic will be served (e.g. `https://send.firefox.com`)
|
| `BASE_URL` | The HTTPS URL where traffic will be served (e.g. `https://send.firefox.com`)
|
||||||
| `DETECT_BASE_URL` | Autodetect the base URL using browser if `BASE_URL` is unset (defaults to `false`)
|
| `DETECT_BASE_URL` | Autodetect the base URL using browser if `BASE_URL` is unset (defaults to `false`)
|
||||||
| `PORT` | Port the server will listen on (defaults to `1443`)
|
| `PORT` | Port the server will listen on (defaults to `1443`)
|
||||||
| `NODE_ENV` | Run in `development` mode (unsafe) or `production` mode (the default)
|
| `NODE_ENV` | Run in `development` mode (unsafe) or `production` mode (the default)
|
||||||
| `SEND_FOOTER_DMCA_URL` | A URL to a contact page for DMCA requests (empty / not shown by default)
|
| `SEND_FOOTER_DMCA_URL` | A URL to a contact page for DMCA requests (empty / not shown by default)
|
||||||
@@ -49,6 +49,8 @@ Configure the limits for uploads and downloads. Long expiration times are risky
|
|||||||
| `MAX_DOWNLOADS` | Maximum number of downloads (defaults to `100`)
|
| `MAX_DOWNLOADS` | Maximum number of downloads (defaults to `100`)
|
||||||
| `DOWNLOAD_COUNTS` | Download limit options to show in UI dropdown, e.g. `10,1,2,5,10,15,25,50,100,1000`
|
| `DOWNLOAD_COUNTS` | Download limit options to show in UI dropdown, e.g. `10,1,2,5,10,15,25,50,100,1000`
|
||||||
| `EXPIRE_TIMES_SECONDS` | Expire time options to show in UI dropdown, e.g. `3600,86400,604800,2592000,31536000`
|
| `EXPIRE_TIMES_SECONDS` | Expire time options to show in UI dropdown, e.g. `3600,86400,604800,2592000,31536000`
|
||||||
|
| `DEFAULT_DOWNLOADS` | Default download limit in UI (defaults to `1`)
|
||||||
|
| `DEFAULT_EXPIRE_SECONDS` | Default expire time in UI (defaults to `86400`)
|
||||||
|
|
||||||
*Note: more options can be found here: https://github.com/timvisee/send/blob/master/server/config.js*
|
*Note: more options can be found here: https://github.com/timvisee/send/blob/master/server/config.js*
|
||||||
|
|
||||||
@@ -89,7 +91,7 @@ $ docker run -p 1443:1443 \
|
|||||||
registry.gitlab.com/timvisee/send:latest
|
registry.gitlab.com/timvisee/send:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
*Note: make sure to replace the example values above with your real values before running.*
|
*Note: make sure to replace the example values above with your real values before running.*
|
||||||
|
|
||||||
|
|
||||||
**Run totally self-hosted using the current filesystem directry (`$PWD`) to store the Redis data and file uploads, with a `5GB` upload limit, 1 month expiry, and contact URL set.**
|
**Run totally self-hosted using the current filesystem directry (`$PWD`) to store the Redis data and file uploads, with a `5GB` upload limit, 1 month expiry, and contact URL set.**
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ Send uses JavaScript to:
|
|||||||
|
|
||||||
- Encrypt and decrypt files locally on the client instead of the server.
|
- Encrypt and decrypt files locally on the client instead of the server.
|
||||||
- Render the user interface.
|
- Render the user interface.
|
||||||
- Manage translations on the website into [various different languages](https://github.com/mozilla/send#localization).
|
- Manage translations on the website into [various different languages](https://github.com/timvisee/send#localization).
|
||||||
- Collect data to help us improve Send in accordance with our [Terms & Privacy](https://send.firefox.com/legal).
|
- Collect data to help us improve Send in accordance with our [Terms & Privacy](https://send.firefox.com/legal).
|
||||||
|
|
||||||
Since Send is an open source project, you can see all of the cool ways we use JavaScript by [examining our code](https://github.com/mozilla/send/).
|
Since Send is an open source project, you can see all of the cool ways we use JavaScript by [examining our code](https://github.com/timvisee/send/).
|
||||||
|
|
||||||
## How long are files available for?
|
## How long are files available for?
|
||||||
|
|
||||||
|
|||||||
3492
package-lock.json
generated
3492
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
43
package.json
43
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "send",
|
"name": "send",
|
||||||
"description": "File Sharing Experiment",
|
"description": "File Sharing Experiment",
|
||||||
"version": "3.4.11",
|
"version": "3.4.16",
|
||||||
"author": "Mozilla (https://mozilla.org)",
|
"author": "Mozilla (https://mozilla.org)",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"Tim Visee <3a4fb3964f@sinenomine.email> (https://timvisee.com)"
|
"Tim Visee <3a4fb3964f@sinenomine.email> (https://timvisee.com)"
|
||||||
@@ -37,9 +37,7 @@
|
|||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"pre-commit": "lint-staged",
|
"pre-commit": "lint-staged",
|
||||||
"pre-push": "npm test",
|
"pre-push": "npm test"
|
||||||
"post-merge": "npm install",
|
|
||||||
"post-checkout": "scripts/sync-npm-dependencies.sh"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
@@ -61,24 +59,24 @@
|
|||||||
"cache": true
|
"cache": true
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^15.5.1"
|
"node": "^16.13.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.14.3",
|
"@babel/core": "^7.16.7",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
||||||
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
|
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
|
||||||
"@babel/preset-env": "^7.14.2",
|
"@babel/preset-env": "^7.16.8",
|
||||||
"@dannycoates/webcrypto-liner": "^0.1.37",
|
"@dannycoates/webcrypto-liner": "^0.1.37",
|
||||||
"@fullhuman/postcss-purgecss": "^1.3.0",
|
"@fullhuman/postcss-purgecss": "^1.3.0",
|
||||||
"@mattiasbuelens/web-streams-polyfill": "0.2.1",
|
"@mattiasbuelens/web-streams-polyfill": "0.2.1",
|
||||||
"@sentry/browser": "^5.30.0",
|
"@sentry/browser": "^5.30.0",
|
||||||
"asmcrypto.js": "^0.22.0",
|
"asmcrypto.js": "^0.22.0",
|
||||||
"babel-loader": "^8.2.2",
|
"babel-loader": "^8.2.3",
|
||||||
"babel-plugin-istanbul": "^5.2.0",
|
"babel-plugin-istanbul": "^5.2.0",
|
||||||
"base64-js": "^1.5.1",
|
"base64-js": "^1.5.1",
|
||||||
"content-disposition": "^0.5.3",
|
"content-disposition": "^0.5.4",
|
||||||
"copy-webpack-plugin": "^5.1.2",
|
"copy-webpack-plugin": "^5.1.2",
|
||||||
"core-js": "^3.12.1",
|
"core-js": "^3.20.3",
|
||||||
"crc": "^3.8.0",
|
"crc": "^3.8.0",
|
||||||
"cross-env": "^6.0.3",
|
"cross-env": "^6.0.3",
|
||||||
"css-loader": "^3.6.0",
|
"css-loader": "^3.6.0",
|
||||||
@@ -98,7 +96,7 @@
|
|||||||
"html-loader": "^0.5.5",
|
"html-loader": "^0.5.5",
|
||||||
"http_ece": "^1.1.0",
|
"http_ece": "^1.1.0",
|
||||||
"husky": "^3.0.9",
|
"husky": "^3.0.9",
|
||||||
"intl-pluralrules": "^1.2.2",
|
"intl-pluralrules": "^1.3.1",
|
||||||
"lint-staged": "^9.4.2",
|
"lint-staged": "^9.4.2",
|
||||||
"mocha": "^6.2.2",
|
"mocha": "^6.2.2",
|
||||||
"morgan": "^1.9.1",
|
"morgan": "^1.9.1",
|
||||||
@@ -127,7 +125,7 @@
|
|||||||
"webpack": "4.38.0",
|
"webpack": "4.38.0",
|
||||||
"webpack-cli": "^3.3.12",
|
"webpack-cli": "^3.3.12",
|
||||||
"webpack-dev-middleware": "^3.7.3",
|
"webpack-dev-middleware": "^3.7.3",
|
||||||
"webpack-dev-server": "^3.11.2",
|
"webpack-dev-server": "^3.11.3",
|
||||||
"webpack-manifest-plugin": "^2.2.0",
|
"webpack-manifest-plugin": "^2.2.0",
|
||||||
"webpack-unassert-loader": "^1.2.0"
|
"webpack-unassert-loader": "^1.2.0"
|
||||||
},
|
},
|
||||||
@@ -135,23 +133,24 @@
|
|||||||
"@dannycoates/express-ws": "^5.0.3",
|
"@dannycoates/express-ws": "^5.0.3",
|
||||||
"@fluent/bundle": "^0.13.0",
|
"@fluent/bundle": "^0.13.0",
|
||||||
"@fluent/langneg": "^0.3.0",
|
"@fluent/langneg": "^0.3.0",
|
||||||
"@google-cloud/storage": "^5.8.5",
|
"@google-cloud/storage": "^5.17.0",
|
||||||
"@sentry/node": "^5.30.0",
|
"@sentry/node": "^5.30.0",
|
||||||
"aws-sdk": "^2.909.0",
|
"aws-sdk": "^2.1058.0",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.1",
|
||||||
"choo": "^7.0.0",
|
"choo": "^7.0.0",
|
||||||
"cldr-core": "^35.1.0",
|
"cldr-core": "^35.1.0",
|
||||||
"configstore": "github:dannycoates/configstore#master",
|
"configstore": "github:dannycoates/configstore#master",
|
||||||
"convict": "^5.2.0",
|
"convict": "^5.2.1",
|
||||||
"express": "^4.17.1",
|
"double-ended-queue": "^2.1.0-0",
|
||||||
|
"express": "^4.17.2",
|
||||||
"helmet": "^3.23.3",
|
"helmet": "^3.23.3",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"mozlog": "^2.2.0",
|
"mozlog": "^2.2.0",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.7",
|
||||||
"redis": "^2.8.0",
|
"redis": "^3.1.1",
|
||||||
"redis-mock": "^0.47.0",
|
"redis-mock": "^0.47.0",
|
||||||
"selenium-standalone": "^6.23.0",
|
"selenium-standalone": "^6.24.0",
|
||||||
"ua-parser-js": "^0.7.28"
|
"ua-parser-js": "^0.7.31"
|
||||||
},
|
},
|
||||||
"availableLanguages": [
|
"availableLanguages": [
|
||||||
"en-US",
|
"en-US",
|
||||||
|
|||||||
@@ -2,22 +2,17 @@
|
|||||||
"name": "firefox-send",
|
"name": "firefox-send",
|
||||||
"description": "File Sharing Experiment",
|
"description": "File Sharing Experiment",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "https://github.com/mozilla/send/",
|
"url": "https://github.com/send/send/",
|
||||||
"license": "MPL-2.0"
|
"license": "MPL-2.0"
|
||||||
},
|
},
|
||||||
"participate": {
|
"participate": {
|
||||||
"home": "https://github.com/mozilla/send/blob/master/README.md",
|
"home": "https://github.com/send/send/blob/master/README.md",
|
||||||
"docs": "https://github.com/mozilla/send/blob/master/README.md"
|
"docs": "https://github.com/send/send/blob/master/README.md"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"list": "https://github.com/mozilla/send/issues",
|
"list": "https://gitlab.com/send/send/issues",
|
||||||
"report": "https://github.com/mozilla/send/issues/new"
|
"report": "https://gitlab.com/send/send/issues/new"
|
||||||
},
|
},
|
||||||
"urls": {
|
|
||||||
"prod": "https://send.firefox.com/",
|
|
||||||
"stage": "https://stage.send.nonprod.cloudops.mozgcp.net/",
|
|
||||||
"dev": "https://send2.dev.lcip.org/"
|
|
||||||
},
|
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"JavaScript",
|
"JavaScript",
|
||||||
"jQuery",
|
"jQuery",
|
||||||
|
|||||||
2
public/robots.txt
Normal file
2
public/robots.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow: /
|
||||||
@@ -15,6 +15,7 @@ module.exports = {
|
|||||||
FOOTER_SOURCE_URL: config.footer_source_url
|
FOOTER_SOURCE_URL: config.footer_source_url
|
||||||
},
|
},
|
||||||
DEFAULTS: {
|
DEFAULTS: {
|
||||||
|
DOWNLOADS: config.default_downloads,
|
||||||
DOWNLOAD_COUNTS: config.download_counts,
|
DOWNLOAD_COUNTS: config.download_counts,
|
||||||
EXPIRE_TIMES_SECONDS: config.expire_times_seconds,
|
EXPIRE_TIMES_SECONDS: config.expire_times_seconds,
|
||||||
EXPIRE_SECONDS: config.default_expire_seconds
|
EXPIRE_SECONDS: config.default_expire_seconds
|
||||||
|
|||||||
@@ -64,6 +64,11 @@ const conf = convict({
|
|||||||
default: [1, 2, 3, 4, 5, 20, 50, 100],
|
default: [1, 2, 3, 4, 5, 20, 50, 100],
|
||||||
env: 'DOWNLOAD_COUNTS'
|
env: 'DOWNLOAD_COUNTS'
|
||||||
},
|
},
|
||||||
|
default_downloads: {
|
||||||
|
format: Number,
|
||||||
|
default: 1,
|
||||||
|
env: 'DEFAULT_DOWNLOADS'
|
||||||
|
},
|
||||||
max_downloads: {
|
max_downloads: {
|
||||||
format: Number,
|
format: Number,
|
||||||
default: 100,
|
default: 100,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ module.exports = function(ws, req) {
|
|||||||
|
|
||||||
const fileInfo = JSON.parse(message);
|
const fileInfo = JSON.parse(message);
|
||||||
const timeLimit = fileInfo.timeLimit || config.default_expire_seconds;
|
const timeLimit = fileInfo.timeLimit || config.default_expire_seconds;
|
||||||
const dlimit = fileInfo.dlimit || 1;
|
const dlimit = fileInfo.dlimit || config.default_downloads;
|
||||||
const metadata = fileInfo.fileMetadata;
|
const metadata = fileInfo.fileMetadata;
|
||||||
const auth = fileInfo.authorization;
|
const auth = fileInfo.authorization;
|
||||||
const user = await fxa.verify(fileInfo.bearer);
|
const user = await fxa.verify(fileInfo.bearer);
|
||||||
|
|||||||
Reference in New Issue
Block a user