Update SMTP setup instructions

Add smtp port and tls options
Use /user/ path for shorthand sharing link
This commit is contained in:
Tankred Hase
2016-06-02 09:24:57 +02:00
parent 111581bb78
commit 1c6696e7a4
7 changed files with 21 additions and 13 deletions

View File

@@ -200,7 +200,7 @@ describe('Koa App (HTTP Server) Integration Tests', function() {
});
});
describe('GET /:email (sharing link)', () => {
describe('GET /user/:email (sharing link)', () => {
beforeEach(done => {
request(app.listen())
.post('/api/v1/key')
@@ -212,7 +212,7 @@ describe('Koa App (HTTP Server) Integration Tests', function() {
describe('Not yet verified', () => {
it('should return 404', done => {
request(app.listen())
.get('/' + primaryEmail)
.get('/user/' + primaryEmail)
.expect(404)
.end(done);
});
@@ -228,28 +228,28 @@ describe('Koa App (HTTP Server) Integration Tests', function() {
it('should return 200 for correct email address', done => {
request(app.listen())
.get('/' + primaryEmail)
.get('/user/' + primaryEmail)
.expect(200, publicKeyArmored)
.end(done);
});
it('should return 400 for invalid email', done => {
request(app.listen())
.get('/a@bco')
.get('/user/a@bco')
.expect(400)
.end(done);
});
it('should return 404 for unkown email', done => {
request(app.listen())
.get('/a@b.co')
.get('/user/a@b.co')
.expect(404)
.end(done);
});
it('should return 404 for missing email', done => {
request(app.listen())
.get('/')
.get('/user/')
.expect(404)
.end(done);
});

View File

@@ -37,6 +37,8 @@ describe('Email Integration Tests', function() {
email = new Email(nodemailer);
email.init({
host: process.env.SMTP_HOST || credentials.smtp.host,
port: process.env.SMTP_PORT || credentials.smtp.port,
secure: (process.env.SMTP_TLS || credentials.smtp.tls) === 'true',
auth: {
user: process.env.SMTP_USER || credentials.smtp.user,
pass: process.env.SMTP_PASS || credentials.smtp.pass