Skip to content

Commit 8153fa3

Browse files
authored
Merge pull request #292 from FlorianRhiem/bugfix-anonymous-typo
Fixed typo: anonmyous
2 parents 11d6b24 + fdea226 commit 8153fa3

6 files changed

Lines changed: 13 additions & 13 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Environment variables (will overwrite other server configs)
118118
| HMD_PROTOCOL_USESSL | `true` or `false` | set to use ssl protocol for resources path (only applied when domain is set) |
119119
| HMD_URL_ADDPORT | `true` or `false` | set to add port on callback url (port 80 or 443 won't applied) (only applied when domain is set) |
120120
| HMD_USECDN | `true` or `false` | set to use CDN resources or not (default is `true`) |
121-
| HMD_ALLOW_ANONMYOUS | `true` or `false` | set to allow anonmyous usage (default is `true`) |
121+
| HMD_ALLOW_ANONYMOUS | `true` or `false` | set to allow anonymous usage (default is `true`) |
122122
| HMD_ALLOW_FREEURL | `true` or `false` | set to allow new note by accessing not exist note url |
123123
| HMD_FACEBOOK_CLIENTID | no example | Facebook API client id |
124124
| HMD_FACEBOOK_CLIENTSECRET | no example | Facebook API client secret |
@@ -155,7 +155,7 @@ Server settings `config.json`
155155
| protocolusessl | `true` or `false` | set to use ssl protocol for resources path (only applied when domain is set) |
156156
| urladdport | `true` or `false` | set to add port on callback url (port 80 or 443 won't applied) (only applied when domain is set) |
157157
| usecdn | `true` or `false` | set to use CDN resources or not (default is `true`) |
158-
| allowanonmyous | `true` or `false` | set to allow anonmyous usage (default is `true`) |
158+
| allowanonymous | `true` or `false` | set to allow anonymous usage (default is `true`) |
159159
| allowfreeurl | `true` or `false` | set to allow new note by accessing not exist note url |
160160
| db | `{ "dialect": "sqlite", "storage": "./db.hackmd.sqlite" }` | set the db configs, [see more here](http://sequelize.readthedocs.org/en/latest/api/sequelize/) |
161161
| sslkeypath | `./cert/client.key` | ssl key path (only need when you set usessl) |

lib/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var urladdport = process.env.HMD_URL_ADDPORT ? (process.env.HMD_URL_ADDPORT ===
1919

2020
var usecdn = process.env.HMD_USECDN ? (process.env.HMD_USECDN === 'true') : ((typeof config.usecdn === 'boolean') ? config.usecdn : true);
2121

22-
var allowanonmyous = process.env.HMD_ALLOW_ANONMYOUS ? (process.env.HMD_ALLOW_ANONMYOUS === 'true') : ((typeof config.allowanonmyous === 'boolean') ? config.allowanonmyous : true);
22+
var allowanonymous = process.env.HMD_ALLOW_ANONYMOUS ? (process.env.HMD_ALLOW_ANONYMOUS === 'true') : ((typeof config.allowanonymous === 'boolean') ? config.allowanonymous : true);
2323

2424
var allowfreeurl = process.env.HMD_ALLOW_FREEURL ? (process.env.HMD_ALLOW_FREEURL === 'true') : !!config.allowfreeurl;
2525

@@ -129,7 +129,7 @@ module.exports = {
129129
usessl: usessl,
130130
serverurl: getserverurl(),
131131
usecdn: usecdn,
132-
allowanonmyous: allowanonmyous,
132+
allowanonymous: allowanonymous,
133133
allowfreeurl: allowfreeurl,
134134
db: db,
135135
sslkeypath: path.join(cwd, sslkeypath),

lib/realtime.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ function connection(socket) {
767767
var note = notes[noteId];
768768
//Only owner can change permission
769769
if (note.owner && note.owner == socket.request.user.id) {
770-
if (permission == 'freely' && !config.allowanonmyous) return;
770+
if (permission == 'freely' && !config.allowanonymous) return;
771771
note.permission = permission;
772772
models.Note.update({
773773
permission: permission
@@ -915,4 +915,4 @@ function connection(socket) {
915915
});
916916
}
917917

918-
module.exports = realtime;
918+
module.exports = realtime;

lib/response.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function showIndex(req, res, next) {
6060
res.render(config.indexpath, {
6161
url: config.serverurl,
6262
useCDN: config.usecdn,
63-
allowAnonmyous: config.allowanonmyous,
63+
allowAnonymous: config.allowanonymous,
6464
facebook: config.facebook,
6565
twitter: config.twitter,
6666
github: config.github,
@@ -93,7 +93,7 @@ function responseHackMD(res, note) {
9393
url: config.serverurl,
9494
title: title,
9595
useCDN: config.usecdn,
96-
allowAnonmyous: config.allowanonmyous,
96+
allowAnonymous: config.allowanonymous,
9797
facebook: config.facebook,
9898
twitter: config.twitter,
9999
github: config.github,
@@ -108,7 +108,7 @@ function newNote(req, res, next) {
108108
var owner = null;
109109
if (req.isAuthenticated()) {
110110
owner = req.user.id;
111-
} else if (!config.allowanonmyous) {
111+
} else if (!config.allowanonymous) {
112112
return response.errorForbidden(res);
113113
}
114114
models.Note.create({

public/views/body.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<a id="permissionLabel" class="ui-permission-label text-uppercase" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
1616
</a>
1717
<ul class="dropdown-menu" aria-labelledby="permissionLabel">
18-
<li class="ui-permission-freely"<% if(!allowAnonmyous) { %> style="display: none;"<% } %>><a><i class="fa fa-leaf fa-fw"></i> Freely - Anyone can edit</a></li>
18+
<li class="ui-permission-freely"<% if(!allowAnonymous) { %> style="display: none;"<% } %>><a><i class="fa fa-leaf fa-fw"></i> Freely - Anyone can edit</a></li>
1919
<li class="ui-permission-editable"><a><i class="fa fa-shield fa-fw"></i> Editable - Signed people can edit</a></li>
2020
<li class="ui-permission-locked"><a><i class="fa fa-lock fa-fw"></i> Locked - Only owner can edit</a></li>
2121
<li class="ui-permission-private"><a><i class="fa fa-hand-stop-o fa-fw"></i> Private - Only owner can view &amp; edit</a></li>
@@ -245,4 +245,4 @@
245245
<%- include refresh-modal %>
246246
<%- include signin-modal %>
247247
<%- include help-modal %>
248-
<%- include revision-modal %>
248+
<%- include revision-modal %>

public/views/index.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@
6363
<a type="button" class="btn btn-lg btn-success ui-signin" data-toggle="modal" data-target=".signin-modal" style="min-width: 170px;"><%= __('Sign In') %></a>
6464
</span>
6565
<% }%>
66-
<% if((facebook || twitter || github || gitlab || dropbox || google || email) && allowAnonmyous) { %>
66+
<% if((facebook || twitter || github || gitlab || dropbox || google || email) && allowAnonymous) { %>
6767
<span class="ui-or"><%= __('or') %></span>
6868
<% }%>
69-
<% if(allowAnonmyous) { %>
69+
<% if(allowAnonymous) { %>
7070
<span class="ui-signin">
7171
<a href="<%- url %>/new" class="btn btn-lg btn-default" style="min-width: 170px;"><%= __('New guest note') %></a>
7272
<br>

0 commit comments

Comments
 (0)