Use SMTPS port to send email for Go programs

This commit is contained in:
Girish Ramakrishnan 2018-01-18 11:01:41 -08:00
parent 99379fdbb3
commit d3553de1a6
2 changed files with 19 additions and 1 deletions

View File

@ -87,7 +87,7 @@ crudini --set "/run/gitea/app.ini" server SSH_PORT "${SSH_PORT}"
crudini --set "/run/gitea/app.ini" server APP_DATA_PATH "/app/data/appdata" crudini --set "/run/gitea/app.ini" server APP_DATA_PATH "/app/data/appdata"
crudini --set "/run/gitea/app.ini" repository ROOT "/app/data/repository" crudini --set "/run/gitea/app.ini" repository ROOT "/app/data/repository"
crudini --set "/run/gitea/app.ini" repository.upload TEMP_PATH "/run/gitea/tmp/uploads" crudini --set "/run/gitea/app.ini" repository.upload TEMP_PATH "/run/gitea/tmp/uploads"
crudini --set "/run/gitea/app.ini" mailer HOST "${MAIL_SMTP_SERVER}:${MAIL_SMTP_PORT}" crudini --set "/run/gitea/app.ini" mailer HOST "${MAIL_SMTP_SERVER}:${MAIL_SMTPS_PORT}"
crudini --set "/run/gitea/app.ini" mailer USER "${MAIL_SMTP_USERNAME}" crudini --set "/run/gitea/app.ini" mailer USER "${MAIL_SMTP_USERNAME}"
crudini --set "/run/gitea/app.ini" mailer PASSWD "${MAIL_SMTP_PASSWORD}" crudini --set "/run/gitea/app.ini" mailer PASSWD "${MAIL_SMTP_PASSWORD}"
crudini --set "/run/gitea/app.ini" mailer FROM "${MAIL_FROM}" crudini --set "/run/gitea/app.ini" mailer FROM "${MAIL_FROM}"

View File

@ -220,6 +220,21 @@ return done();
expect(fs.existsSync(repodir + '/newfile')).to.be(true); expect(fs.existsSync(repodir + '/newfile')).to.be(true);
} }
function sendMail(done) {
browser.get('https://' + app.fqdn + '/admin/config').then(function () {
var button = browser.findElement(by.xpath('//button[@id="test-mail-btn"]'));
return browser.executeScript('arguments[0].scrollIntoView(true)', button);
}).then(function () {
return browser.findElement(by.xpath('//input[@name="email"]')).sendKeys('test@cloudron.io');
}).then(function () {
return browser.findElement(by.xpath('//button[@id="test-mail-btn"]')).click();
}).then(function () {
return browser.wait(until.elementLocated(by.xpath('//p[contains(text(),"Test email has been sent to \'test@cloudron.io\'")]')), TIMEOUT);
}).then(function () {
done();
});
}
xit('build app', function () { xit('build app', function () {
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
}); });
@ -262,6 +277,7 @@ return done();
}); });
it('can login', login); it('can login', login);
it('can send mail', sendMail);
it('can set avatar', setAvatar); it('can set avatar', setAvatar);
it('can get avatar', checkAvatar); it('can get avatar', checkAvatar);
@ -350,6 +366,8 @@ return done();
execSync('cloudron install --wait --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); execSync('cloudron install --wait --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
}); });
it('can login', login);
it('can send mail', sendMail);
it('can get avatar', checkAvatar); it('can get avatar', checkAvatar);
it('can clone the url', cloneRepo); it('can clone the url', cloneRepo);
it('file exists in cloned repo', fileExists); it('file exists in cloned repo', fileExists);