Merge remote-tracking branch 'upstream/master' into DepauMD

This commit is contained in:
Davide Depau 2019-04-11 22:25:13 +02:00
commit 283938b35c
12 changed files with 23 additions and 19 deletions

View file

@ -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

View file

@ -20,7 +20,7 @@
"loglevel": "info",
"hsts": {
"enable": true,
"maxAgeSeconds": "31536000",
"maxAgeSeconds": 31536000,
"includeSubdomains": true,
"preload": true
},

View file

@ -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)
},

View file

@ -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)
},

View file

@ -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)

View file

@ -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) {

View file

@ -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) {

View file

@ -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"
}

View file

@ -110,7 +110,7 @@
"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"

View file

@ -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
}
)

View file

@ -150,7 +150,7 @@
<option value="id">Bahasa Indonesia</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>') %>

View file

@ -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>