diff --git a/README.md b/README.md index 6abe930..fc428fa 100644 --- a/README.md +++ b/README.md @@ -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 fe8c810..cb2bf3a 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 a57fe0d..fc757cf 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 e1c1156..bc20e58 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 cbe6c39..e5d02dc 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 8191e74..76793a4 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 60282cf..0a4fd55 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 ead7ce2..15ed6e4 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 e455502..cf8787e 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 f8e0eb2..b80290d 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 = $(``) + const div = $(`:${emoji}:`) return div[0].outerHTML } ) diff --git a/public/views/index/body.ejs b/public/views/index/body.ejs index a5e591e..40ff9db 100644 --- a/public/views/index/body.ejs +++ b/public/views/index/body.ejs @@ -150,7 +150,7 @@

- Powered by CodiMD | <%= __('Releases') %>| <%= __('Source Code') %><% if(privacyStatement) { %> | <%= __('Privacy') %><% } %><% if(termsOfUse) { %> | <%= __('Terms of Use') %><% } %> + <%- __('Powered by %s', 'CodiMD') %> | <%= __('Releases') %>| <%= __('Source Code') %><% if(privacyStatement) { %> | <%= __('Privacy') %><% } %><% if(termsOfUse) { %> | <%= __('Terms of Use') %><% } %>

<%- __('Follow us on %s and %s.', ' GitHub, Riot', ' POEditor') %> diff --git a/public/views/shared/signin-modal.ejs b/public/views/shared/signin-modal.ejs index d46b8d5..40f01b5 100644 --- a/public/views/shared/signin-modal.ejs +++ b/public/views/shared/signin-modal.ejs @@ -57,7 +57,7 @@
<% }%> <% if (authProviders.ldap) { %> -

Via <% if (authProviders.ldapProviderName) { %> <%= authProviders.ldapProviderName %> (LDAP) <% } else { %> LDAP <% } %>

+

<%= __('Sign in via %s', authProviders.ldapProviderName ? authProviders.ldapProviderName + ' (LDAP)' : 'LDAP') %>

@@ -73,7 +73,7 @@
- +
@@ -82,7 +82,7 @@
<% }%> <% if (authProviders.openID) { %> -

OpenID

+

<%= __('Sign in via %s', 'OpenID') %>

@@ -92,7 +92,7 @@
- +
@@ -101,11 +101,11 @@
<% }%> <% if (authProviders.email) { %> -

Via Email

+

<%= __('Sign in via %s', 'E-Mail') %>

- +
@@ -117,8 +117,8 @@
- - <% if (authProviders.allowEmailRegister) { %><% }%> + + <% if (authProviders.allowEmailRegister) { %><% }%>