server/password-reset: support having no smtp
This commit is contained in:
parent
32d15a493c
commit
c01214e919
5 changed files with 45 additions and 24 deletions
2
client/css/password-reset.styl
Normal file
2
client/css/password-reset.styl
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#password-reset
|
||||||
|
max-width: 30em
|
|
@ -30,9 +30,7 @@
|
||||||
|
|
||||||
<div class='buttons'>
|
<div class='buttons'>
|
||||||
<input type='submit' value='Log in'/>
|
<input type='submit' value='Log in'/>
|
||||||
<% if (ctx.canSendMails) { %>
|
|
||||||
<a class='append' href='<%- ctx.formatClientLink('password-reset') %>'>Forgot the password?</a>
|
<a class='append' href='<%- ctx.formatClientLink('password-reset') %>'>Forgot the password?</a>
|
||||||
<% } %>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<div class='content-wrapper' id='password-reset'>
|
<div class='content-wrapper' id='password-reset'>
|
||||||
<h1>Password reset</h1>
|
<h1>Password reset</h1>
|
||||||
|
<% if (ctx.canSendMails) { %>
|
||||||
<form autocomplete='off'>
|
<form autocomplete='off'>
|
||||||
<ul class='input'>
|
<ul class='input'>
|
||||||
<li>
|
<li>
|
||||||
|
@ -20,4 +21,10 @@
|
||||||
<input type='submit' value='Proceed'/>
|
<input type='submit' value='Proceed'/>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<% } else { %>
|
||||||
|
<p>We do not support automatic password resetting.</p>
|
||||||
|
<% if (ctx.contactEmail) { %>
|
||||||
|
<p>Please send an e-mail to <a href='mailto:<%- ctx.contactEmail %>'><%- ctx.contactEmail %></a> to go through a manual procedure.</p>
|
||||||
|
<% } %>
|
||||||
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const config = require('../config.js');
|
||||||
const events = require('../events.js');
|
const events = require('../events.js');
|
||||||
const views = require('../util/views.js');
|
const views = require('../util/views.js');
|
||||||
|
|
||||||
|
@ -10,7 +11,10 @@ class PasswordResetView extends events.EventTarget {
|
||||||
super();
|
super();
|
||||||
this._hostNode = document.getElementById('content-holder');
|
this._hostNode = document.getElementById('content-holder');
|
||||||
|
|
||||||
views.replaceContent(this._hostNode, template());
|
views.replaceContent(this._hostNode, template({
|
||||||
|
canSendMails: config.canSendMails,
|
||||||
|
contactEmail: config.contactEmail,
|
||||||
|
}));
|
||||||
views.syncScrollPosition();
|
views.syncScrollPosition();
|
||||||
|
|
||||||
views.decorateValidator(this._formNode);
|
views.decorateValidator(this._formNode);
|
||||||
|
|
|
@ -25,12 +25,18 @@ thumbnails:
|
||||||
post_width: 300
|
post_width: 300
|
||||||
post_height: 300
|
post_height: 300
|
||||||
|
|
||||||
# used to send password reminders
|
|
||||||
|
# used to send password reset e-mails
|
||||||
smtp:
|
smtp:
|
||||||
host: # example: localhost
|
host: # example: localhost
|
||||||
port: # example: 25
|
port: # example: 25
|
||||||
user: # example: bot
|
user: # example: bot
|
||||||
pass: # example: groovy123
|
pass: # example: groovy123
|
||||||
|
# host can be left empty, in which case it is recommended to fill contactEmail.
|
||||||
|
|
||||||
|
|
||||||
|
contactEmail: # example: bob@example.com. Meant for manual password reset procedures
|
||||||
|
|
||||||
|
|
||||||
# used for reverse image search
|
# used for reverse image search
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
|
@ -38,15 +44,16 @@ elasticsearch:
|
||||||
port: 9200
|
port: 9200
|
||||||
index: szurubooru
|
index: szurubooru
|
||||||
|
|
||||||
|
|
||||||
limits:
|
limits:
|
||||||
users_per_page: 20
|
users_per_page: 20
|
||||||
posts_per_page: 40
|
posts_per_page: 40
|
||||||
max_comment_length: 5000
|
max_comment_length: 5000
|
||||||
|
|
||||||
|
|
||||||
tag_name_regex: ^\S+$
|
tag_name_regex: ^\S+$
|
||||||
tag_category_name_regex: ^[^\s%+#/]+$
|
tag_category_name_regex: ^[^\s%+#/]+$
|
||||||
|
|
||||||
default_rank: regular
|
|
||||||
|
|
||||||
# don't change these, unless you want to annoy people. if you do customize
|
# don't change these, unless you want to annoy people. if you do customize
|
||||||
# them though, make sure to update the instructions in the registration form
|
# them though, make sure to update the instructions in the registration form
|
||||||
|
@ -54,6 +61,9 @@ default_rank: regular
|
||||||
password_regex: '^.{5,}$'
|
password_regex: '^.{5,}$'
|
||||||
user_name_regex: '^[a-zA-Z0-9_-]{1,32}$'
|
user_name_regex: '^[a-zA-Z0-9_-]{1,32}$'
|
||||||
|
|
||||||
|
default_rank: regular
|
||||||
|
|
||||||
|
|
||||||
privileges:
|
privileges:
|
||||||
'users:create': anonymous
|
'users:create': anonymous
|
||||||
'users:list': regular
|
'users:list': regular
|
||||||
|
|
Loading…
Reference in a new issue