commit
3ffdbd863b
|
@ -1,6 +1,6 @@
|
||||||
# Firefox Fileshare
|
# Firefox Send
|
||||||
|
|
||||||
[![CircleCI](https://circleci.com/gh/mozilla/something-awesome.svg?style=svg)](https://circleci.com/gh/mozilla/something-awesome)
|
[![CircleCI](https://circleci.com/gh/mozilla/send.svg?style=svg)](https://circleci.com/gh/mozilla/send)
|
||||||
|
|
||||||
## What it does
|
## What it does
|
||||||
|
|
||||||
|
@ -29,11 +29,11 @@ $ redis-server /usr/local/etc/redis.conf
|
||||||
|
|
||||||
## Localization
|
## Localization
|
||||||
|
|
||||||
_Coming soon_ (see [#57](https://github.com/mozilla/something-awesome/issues/57))
|
_Coming soon_ (see [#57](https://github.com/mozilla/send/issues/57))
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Pull requests are always welcome! Feel free to check out the list of ["good first bugs"](https://github.com/mozilla/something-awesome/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+bug%22).
|
Pull requests are always welcome! Feel free to check out the list of ["good first bugs"](https://github.com/mozilla/send/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+bug%22).
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,5 @@
|
||||||
## Example:
|
## Example:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ docker run --net=host -e 'NODE_ENV=production' -e 'P2P_S3_BUCKET=testpilot-p2p-dev' -e 'P2P_REDIS_HOST=dyf9s2r4vo3.bolxr4.0001.usw2.cache.amazonaws.com' mozilla/portal:latest
|
$ docker run --net=host -e 'NODE_ENV=production' -e 'P2P_S3_BUCKET=testpilot-p2p-dev' -e 'P2P_REDIS_HOST=dyf9s2r4vo3.bolxr4.0001.usw2.cache.amazonaws.com' mozilla/send:latest
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "portal-alpha",
|
"name": "firefox-send",
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
10
package.json
10
package.json
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "portal-alpha",
|
"name": "firefox-send",
|
||||||
"description": "File Sharing Experiment",
|
"description": "File Sharing Experiment",
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
"author": "Mozilla (https://mozilla.org)",
|
"author": "Mozilla (https://mozilla.org)",
|
||||||
|
@ -40,17 +40,17 @@
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.0.0"
|
"node": ">=8.0.0"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/mozilla/something-awesome/",
|
"homepage": "https://github.com/mozilla/send/",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"repository": "mozilla/something-awesome",
|
"repository": "mozilla/send",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"predocker": "browserify frontend/src/main.js | uglifyjs > public/bundle.js && npm run version",
|
"predocker": "browserify frontend/src/main.js | uglifyjs > public/bundle.js && npm run version",
|
||||||
"dev": "npm run version && watchify frontend/src/main.js -o public/bundle.js -d | node server/portal_server",
|
"dev": "npm run version && watchify frontend/src/main.js -o public/bundle.js -d | node server/server",
|
||||||
"format": "prettier '{frontend/src/,scripts/,server/,test/}*.js' 'public/*.css' --single-quote --write",
|
"format": "prettier '{frontend/src/,scripts/,server/,test/}*.js' 'public/*.css' --single-quote --write",
|
||||||
"lint": "npm-run-all lint:*",
|
"lint": "npm-run-all lint:*",
|
||||||
"lint:css": "stylelint 'public/*.css'",
|
"lint:css": "stylelint 'public/*.css'",
|
||||||
"lint:js": "eslint .",
|
"lint:js": "eslint .",
|
||||||
"start": "node server/portal_server",
|
"start": "node server/server",
|
||||||
"test": "mocha test/unit && mocha test/server",
|
"test": "mocha test/unit && mocha test/server",
|
||||||
"version": "node scripts/version"
|
"version": "node scripts/version"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,16 +2,16 @@
|
||||||
"name": "firefox-send",
|
"name": "firefox-send",
|
||||||
"description": "File Sharing Experiment",
|
"description": "File Sharing Experiment",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "https://github.com/mozilla/something-awesome/",
|
"url": "https://github.com/mozilla/send/",
|
||||||
"license": "MPL-2.0"
|
"license": "MPL-2.0"
|
||||||
},
|
},
|
||||||
"participate": {
|
"participate": {
|
||||||
"home": "https://github.com/mozilla/something-awesome/blob/master/README.md",
|
"home": "https://github.com/mozilla/send/blob/master/README.md",
|
||||||
"docs": "https://github.com/mozilla/something-awesome/blob/master/README.md"
|
"docs": "https://github.com/mozilla/send/blob/master/README.md"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"list": "https://github.com/mozilla/something-awesome/issues",
|
"list": "https://github.com/mozilla/send/issues",
|
||||||
"report": "https://github.com/mozilla/something-awesome/issues/new"
|
"report": "https://github.com/mozilla/send/issues/new"
|
||||||
},
|
},
|
||||||
"urls": {
|
"urls": {
|
||||||
"prod": "https://send.firefox.com/",
|
"prod": "https://send.firefox.com/",
|
||||||
|
|
|
@ -3,7 +3,7 @@ const conf = require('./config.js');
|
||||||
const isProduction = conf.env === 'production';
|
const isProduction = conf.env === 'production';
|
||||||
|
|
||||||
const mozlog = require('mozlog')({
|
const mozlog = require('mozlog')({
|
||||||
app: 'FirefoxFileshare',
|
app: 'FirefoxSend',
|
||||||
level: isProduction ? 'INFO' : 'verbose',
|
level: isProduction ? 'INFO' : 'verbose',
|
||||||
fmt: isProduction ? 'heka' : 'pretty',
|
fmt: isProduction ? 'heka' : 'pretty',
|
||||||
debug: !isProduction
|
debug: !isProduction
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (conf.sentry_dsn) {
|
||||||
|
|
||||||
const mozlog = require('./log.js');
|
const mozlog = require('./log.js');
|
||||||
|
|
||||||
const log = mozlog('portal.server');
|
const log = mozlog('send.server');
|
||||||
|
|
||||||
const STATIC_PATH = path.join(__dirname, '../public');
|
const STATIC_PATH = path.join(__dirname, '../public');
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ app.post('/delete/:id', (req, res) => {
|
||||||
app.post('/upload', (req, res, next) => {
|
app.post('/upload', (req, res, next) => {
|
||||||
const newId = crypto.randomBytes(5).toString('hex');
|
const newId = crypto.randomBytes(5).toString('hex');
|
||||||
let meta;
|
let meta;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
meta = JSON.parse(req.header('X-File-Metadata'));
|
meta = JSON.parse(req.header('X-File-Metadata'));
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
|
@ -202,7 +202,7 @@ app.get('/__version__', (req, res) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const server = app.listen(conf.listen_port, () => {
|
const server = app.listen(conf.listen_port, () => {
|
||||||
log.info('startServer:', `Portal app listening on port ${conf.listen_port}!`);
|
log.info('startServer:', `Send app listening on port ${conf.listen_port}!`);
|
||||||
});
|
});
|
||||||
|
|
||||||
const validateID = route_id => {
|
const validateID = route_id => {
|
||||||
|
@ -216,4 +216,4 @@ const validateIV = route_id => {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
server: server,
|
server: server,
|
||||||
storage: storage
|
storage: storage
|
||||||
}
|
}
|
|
@ -7,7 +7,7 @@ const path = require('path');
|
||||||
|
|
||||||
const mozlog = require('./log.js');
|
const mozlog = require('./log.js');
|
||||||
|
|
||||||
const log = mozlog('portal.storage');
|
const log = mozlog('send.storage');
|
||||||
|
|
||||||
const redis = require('redis');
|
const redis = require('redis');
|
||||||
const redis_client = redis.createClient({
|
const redis_client = redis.createClient({
|
||||||
|
|
|
@ -24,11 +24,11 @@ describe('Server integration tests', function() {
|
||||||
let fileId;
|
let fileId;
|
||||||
|
|
||||||
before(function() {
|
before(function() {
|
||||||
const app = proxyquire('../../server/portal_server', {
|
const app = proxyquire('../../server/server', {
|
||||||
'./log.js': function() {
|
'./log.js': function() {
|
||||||
return logStub;
|
return logStub;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
server = app.server;
|
server = app.server;
|
||||||
storage = app.storage;
|
storage = app.storage;
|
||||||
|
@ -167,4 +167,4 @@ describe('Server integration tests', function() {
|
||||||
.then(() => assert.fail())
|
.then(() => assert.fail())
|
||||||
.catch(err => assert(1))
|
.catch(err => assert(1))
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Firefox Fileshare</title>
|
<title>Firefox Send</title>
|
||||||
{{#if dsn}}
|
{{#if dsn}}
|
||||||
{{> sentry dsn=dsn}}
|
{{> sentry dsn=dsn}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
Loading…
Reference in New Issue