diff options
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | config.json.example | 2 | ||||
-rw-r--r-- | lib/config/environment.js | 2 | ||||
-rw-r--r-- | lib/config/hackmdEnvironment.js | 2 | ||||
-rw-r--r-- | lib/config/index.js | 2 | ||||
-rw-r--r-- | lib/response.js | 2 | ||||
-rw-r--r-- | lib/web/auth/google/index.js | 3 | ||||
-rw-r--r-- | locales/en.json | 4 | ||||
-rw-r--r-- | locales/fr.json | 4 | ||||
-rw-r--r-- | public/js/extra.js | 2 | ||||
-rw-r--r-- | public/views/index/body.ejs | 2 | ||||
-rw-r--r-- | public/views/shared/signin-modal.ejs | 16 |
12 files changed, 23 insertions, 19 deletions
@@ -68,6 +68,7 @@ Just to more confusion: We are still friends with HackMD :heart: - Node.js 6.x or up (test up to 7.5.0) and <10.x - Database (PostgreSQL, MySQL, MariaDB, SQLite, MSSQL) use charset `utf8` - npm (and its dependencies, especially [uWebSockets](https://github.com/uWebSockets/uWebSockets#nodejs-developers), [node-gyp](https://github.com/nodejs/node-gyp#installation)) +- `libssl-dev` for building scrypt (see [here](https://github.com/ml1nk/node-scrypt/blob/master/README.md#installation-instructions) for further information) - For **building** CodiMD we recommend to use a machine with at least **2GB** RAM ### Instructions diff --git a/config.json.example b/config.json.example index fe8c810c..cb2bf3a5 100644 --- a/config.json.example +++ b/config.json.example @@ -20,7 +20,7 @@ "loglevel": "info", "hsts": { "enable": true, - "maxAgeSeconds": "31536000", + "maxAgeSeconds": 31536000, "includeSubdomains": true, "preload": true }, diff --git a/lib/config/environment.js b/lib/config/environment.js index a57fe0db..fc757cf1 100644 --- a/lib/config/environment.js +++ b/lib/config/environment.js @@ -14,7 +14,7 @@ module.exports = { useSSL: toBooleanConfig(process.env.CMD_USESSL), hsts: { enable: toBooleanConfig(process.env.CMD_HSTS_ENABLE), - maxAgeSeconds: process.env.CMD_HSTS_MAX_AGE, + maxAgeSeconds: toIntegerConfig(process.env.CMD_HSTS_MAX_AGE), includeSubdomains: toBooleanConfig(process.env.CMD_HSTS_INCLUDE_SUBDOMAINS), preload: toBooleanConfig(process.env.CMD_HSTS_PRELOAD) }, diff --git a/lib/config/hackmdEnvironment.js b/lib/config/hackmdEnvironment.js index e1c11569..bc20e58a 100644 --- a/lib/config/hackmdEnvironment.js +++ b/lib/config/hackmdEnvironment.js @@ -10,7 +10,7 @@ module.exports = { useSSL: toBooleanConfig(process.env.HMD_USESSL), hsts: { enable: toBooleanConfig(process.env.HMD_HSTS_ENABLE), - maxAgeSeconds: process.env.HMD_HSTS_MAX_AGE, + maxAgeSeconds: toIntegerConfig(process.env.HMD_HSTS_MAX_AGE), includeSubdomains: toBooleanConfig(process.env.HMD_HSTS_INCLUDE_SUBDOMAINS), preload: toBooleanConfig(process.env.HMD_HSTS_PRELOAD) }, diff --git a/lib/config/index.js b/lib/config/index.js index cbe6c39c..e5d02dc1 100644 --- a/lib/config/index.js +++ b/lib/config/index.js @@ -128,7 +128,7 @@ if (config.gitlab && config.gitlab.version !== 'v4' && config.gitlab.version !== config.gitlab.version = 'v4' } // If gitlab scope is api, enable snippets Export/import -config.isGitlabSnippetsEnable = (!config.gitlab.scope || config.gitlab.scope === 'api') +config.isGitlabSnippetsEnable = (!config.gitlab.scope || config.gitlab.scope === 'api') && config.isGitLabEnable // Only update i18n files in development setups config.updateI18nFiles = (env === Environment.development) diff --git a/lib/response.js b/lib/response.js index 8191e74f..76793a46 100644 --- a/lib/response.js +++ b/lib/response.js @@ -23,7 +23,7 @@ var response = { responseError(res, '403', 'Forbidden', 'oh no.') } else { req.flash('error', 'You are not allowed to access this page. Maybe try logging in?') - res.redirect(config.serverURL) + res.redirect(config.serverURL + '/') } }, errorNotFound: function (res) { diff --git a/lib/web/auth/google/index.js b/lib/web/auth/google/index.js index 60282cf5..0a4fd55e 100644 --- a/lib/web/auth/google/index.js +++ b/lib/web/auth/google/index.js @@ -11,7 +11,8 @@ let googleAuth = module.exports = Router() passport.use(new GoogleStrategy({ clientID: config.google.clientID, clientSecret: config.google.clientSecret, - callbackURL: config.serverURL + '/auth/google/callback' + callbackURL: config.serverURL + '/auth/google/callback', + userProfileURL: "https://www.googleapis.com/oauth2/v3/userinfo" }, passportGeneralCallback)) googleAuth.get('/auth/google', function (req, res, next) { diff --git a/locales/en.json b/locales/en.json index ead7ce2f..15ed6e4e 100644 --- a/locales/en.json +++ b/locales/en.json @@ -113,5 +113,7 @@ "Delete user": "Delete user", "Export user data": "Export user data", "Help us translating on %s": "Help us translating on %s", - "Source Code": "Source Code" + "Source Code": "Source Code", + "Powered by %s": "Powered by %s", + "Register": "Register" } diff --git a/locales/fr.json b/locales/fr.json index e4555027..cf8787e6 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -110,8 +110,8 @@ "Terms of Use": "Conditions d'utilisation", "Do you really want to delete your user account?": "Voulez-vous vraiment supprimer votre compte utilisateur", "This will delete your account, all notes that are owned by you and remove all references to your account from other notes.": "Cela supprimera votre compte, toutes les notes dont vous êtes propriétaire et supprimera toute référence à votre compte dans les autres notes.", - "Delete user": "Suprrimez l'utilisteur", + "Delete user": "Supprimer l'utilisteur", "Export user data": "Exportez les données utilisateur", "Help us translating on %s": "Aidez nous à traduire sur %s", "Source Code": "Code source" -}
\ No newline at end of file +} diff --git a/public/js/extra.js b/public/js/extra.js index f8e0eb22..b80290d1 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -1134,7 +1134,7 @@ const emojijsPlugin = new Plugin( (match, utils) => { const emoji = match[1].toLowerCase() - const div = $(`<img class="emoji" src="${serverurl}/build/emojify.js/dist/images/basic/${emoji}.png"></img>`) + const div = $(`<img class="emoji" alt=":${emoji}:" src="${serverurl}/build/emojify.js/dist/images/basic/${emoji}.png"></img>`) return div[0].outerHTML } ) diff --git a/public/views/index/body.ejs b/public/views/index/body.ejs index 97b4280b..3b8ef621 100644 --- a/public/views/index/body.ejs +++ b/public/views/index/body.ejs @@ -151,7 +151,7 @@ <option value="sr">српски</option> </select> <p> - Powered by <a href="https://codimd.org">CodiMD</a> | <a href="<%- serverURL %>/s/release-notes" target="_blank" rel="noopener"><%= __('Releases') %></a>| <a href="<%- sourceURL %>" target="_blank" rel="noopener"><%= __('Source Code') %></a><% if(privacyStatement) { %> | <a href="<%- serverURL %>/s/privacy" target="_blank" rel="noopener"><%= __('Privacy') %></a><% } %><% if(termsOfUse) { %> | <a href="<%- serverURL %>/s/terms-of-use" target="_blank" rel="noopener"><%= __('Terms of Use') %></a><% } %> + <%- __('Powered by %s', '<a href="https://codimd.org">CodiMD</a>') %> | <a href="<%- serverURL %>/s/release-notes" target="_blank" rel="noopener"><%= __('Releases') %></a>| <a href="<%- sourceURL %>" target="_blank" rel="noopener"><%= __('Source Code') %></a><% if(privacyStatement) { %> | <a href="<%- serverURL %>/s/privacy" target="_blank" rel="noopener"><%= __('Privacy') %></a><% } %><% if(termsOfUse) { %> | <a href="<%- serverURL %>/s/terms-of-use" target="_blank" rel="noopener"><%= __('Terms of Use') %></a><% } %> </p> <h6 class="social-foot"> <%- __('Follow us on %s and %s.', '<a href="https://github.com/hackmdio/CodiMD" target="_blank" rel="noopener"><i class="fa fa-github"></i> GitHub</a>, <a href="https://riot.im/app/#/room/#codimd:matrix.org" target="_blank" rel="noopener"><i class="fa fa-comments"></i> Riot</a>', '<a href="https://translate.codimd.org" target="_blank" rel="noopener"><i class="fa fa-globe"></i> POEditor</a>') %> diff --git a/public/views/shared/signin-modal.ejs b/public/views/shared/signin-modal.ejs index d46b8d54..40f01b57 100644 --- a/public/views/shared/signin-modal.ejs +++ b/public/views/shared/signin-modal.ejs @@ -57,7 +57,7 @@ <hr> <% }%> <% if (authProviders.ldap) { %> - <h4>Via <% if (authProviders.ldapProviderName) { %> <%= authProviders.ldapProviderName %> (LDAP) <% } else { %> LDAP <% } %></h4> + <h4><%= __('Sign in via %s', authProviders.ldapProviderName ? authProviders.ldapProviderName + ' (LDAP)' : 'LDAP') %></h4> <form data-toggle="validator" role="form" class="form-horizontal" method="post" enctype="application/x-www-form-urlencoded"> <div class="form-group"> <div class="col-sm-12"> @@ -73,7 +73,7 @@ </div> <div class="form-group"> <div class="col-sm-12"> - <button type="submit" class="btn btn-primary" formaction="<%- serverURL %>/auth/ldap">Sign in</button> + <button type="submit" class="btn btn-primary" formaction="<%- serverURL %>/auth/ldap"><%= __('Sign In') %></button> </div> </div> </form> @@ -82,7 +82,7 @@ <hr> <% }%> <% if (authProviders.openID) { %> - <h4>OpenID</h4> + <h4><%= __('Sign in via %s', 'OpenID') %></h4> <form data-toggle="validator" role="form" class="form-horizontal" method="post" enctype="application/x-www-form-urlencoded"> <div class="form-group"> <div class="col-sm-12"> @@ -92,7 +92,7 @@ </div> <div class="form-group"> <div class="col-sm-12"> - <button type="submit" class="btn btn-primary" formaction="<%- serverURL %>/auth/openid">Sign in</button> + <button type="submit" class="btn btn-primary" formaction="<%- serverURL %>/auth/openid"><%= __('Sign In') %></button> </div> </div> </form> @@ -101,11 +101,11 @@ <hr> <% }%> <% if (authProviders.email) { %> - <h4>Via Email</h4> + <h4><%= __('Sign in via %s', 'E-Mail') %></h4> <form data-toggle="validator" role="form" class="form-horizontal" method="post" enctype="application/x-www-form-urlencoded"> <div class="form-group"> <div class="col-sm-12"> - <input type="email" class="form-control" name="email" placeholder="Email" required> + <input type="email" class="form-control" name="email" placeholder="E-Mail" required> <span class="help-block control-label with-errors" style="display: inline;"></span> </div> </div> @@ -117,8 +117,8 @@ </div> <div class="form-group"> <div class="col-sm-12"> - <button type="submit" class="btn btn-primary" formaction="<%- serverURL %>/login">Sign in</button> - <% if (authProviders.allowEmailRegister) { %><button type="submit" class="btn btn-default" formaction="<%- serverURL %>/register">Register</button><% }%> + <button type="submit" class="btn btn-primary" formaction="<%- serverURL %>/login"><%= __('Sign In') %></button> + <% if (authProviders.allowEmailRegister) { %><button type="submit" class="btn btn-default" formaction="<%- serverURL %>/register"><%= __('Register') %></button><% }%> </div> </div> </form> |