summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app.json72
-rwxr-xr-xbin/heroku10
-rw-r--r--lib/letter-avatars.js2
-rw-r--r--package.json2
-rw-r--r--public/views/index/body.ejs12
-rw-r--r--test/letter-avatars.js4
6 files changed, 42 insertions, 60 deletions
diff --git a/app.json b/app.json
index 0b5a5152..dcfe67cc 100644
--- a/app.json
+++ b/app.json
@@ -11,10 +11,6 @@
"logo": "https://github.com/codimd/server/raw/master/public/codimd-icon-1024.png",
"success_url": "/",
"env": {
- "BUILD_ASSETS": {
- "description": "Our build script variable",
- "value": "true"
- },
"NPM_CONFIG_PRODUCTION": {
"description": "Let npm also install development build tool",
"value": "false"
@@ -23,137 +19,129 @@
"description": "Specify database type. See sequelize available databases. Default using postgres",
"value": "postgres"
},
- "HMD_SESSION_SECRET": {
+ "CMD_SESSION_SECRET": {
"description": "Secret used to secure session cookies.",
"required": false
},
- "HMD_HSTS_ENABLE": {
+ "CMD_HSTS_ENABLE": {
"description": "whether to also use HSTS if HTTPS is enabled",
"required": false
},
- "HMD_HSTS_MAX_AGE": {
+ "CMD_HSTS_MAX_AGE": {
"description": "max duration, in seconds, to tell clients to keep HSTS status",
"required": false
},
- "HMD_HSTS_INCLUDE_SUBDOMAINS": {
+ "CMD_HSTS_INCLUDE_SUBDOMAINS": {
"description": "whether to tell clients to also regard subdomains as HSTS hosts",
"required": false
},
- "HMD_HSTS_PRELOAD": {
+ "CMD_HSTS_PRELOAD": {
"description": "whether to allow at all adding of the site to HSTS preloads (e.g. in browsers)",
"required": false
},
- "HMD_DOMAIN": {
+ "CMD_DOMAIN": {
"description": "domain name",
"required": false
},
- "HMD_URL_PATH": {
+ "CMD_URL_PATH": {
"description": "sub url path, like `www.example.com/<URL_PATH>`",
"required": false
},
- "HMD_ALLOW_ORIGIN": {
+ "CMD_ALLOW_ORIGIN": {
"description": "domain name whitelist (use comma to separate)",
"required": false,
"value": "localhost"
},
- "HMD_PROTOCOL_USESSL": {
+ "CMD_PROTOCOL_USESSL": {
"description": "set to use ssl protocol for resources path (only applied when domain is set)",
"required": false
},
- "HMD_URL_ADDPORT": {
+ "CMD_URL_ADDPORT": {
"description": "set to add port on callback url (port 80 or 443 won't applied) (only applied when domain is set)",
"required": false
},
- "HMD_FACEBOOK_CLIENTID": {
+ "CMD_FACEBOOK_CLIENTID": {
"description": "Facebook API client id",
"required": false
},
- "HMD_FACEBOOK_CLIENTSECRET": {
+ "CMD_FACEBOOK_CLIENTSECRET": {
"description": "Facebook API client secret",
"required": false
},
- "HMD_TWITTER_CONSUMERKEY": {
+ "CMD_TWITTER_CONSUMERKEY": {
"description": "Twitter API consumer key",
"required": false
},
- "HMD_TWITTER_CONSUMERSECRET": {
+ "CMD_TWITTER_CONSUMERSECRET": {
"description": "Twitter API consumer secret",
"required": false
},
- "HMD_GITHUB_CLIENTID": {
+ "CMD_GITHUB_CLIENTID": {
"description": "GitHub API client id",
"required": false
},
- "HMD_GITHUB_CLIENTSECRET": {
+ "CMD_GITHUB_CLIENTSECRET": {
"description": "GitHub API client secret",
"required": false
},
- "HMD_GITLAB_BASEURL": {
+ "CMD_GITLAB_BASEURL": {
"description": "GitLab authentication endpoint, set to use other endpoint than GitLab.com (optional)",
"required": false
},
- "HMD_GITLAB_CLIENTID": {
+ "CMD_GITLAB_CLIENTID": {
"description": "GitLab API client id",
"required": false
},
- "HMD_GITLAB_CLIENTSECRET": {
+ "CMD_GITLAB_CLIENTSECRET": {
"description": "GitLab API client secret",
"required": false
},
- "HMD_GITLAB_SCOPE": {
+ "CMD_GITLAB_SCOPE": {
"description": "GitLab API client scope (optional)",
"required": false
},
- "HMD_MATTERMOST_BASEURL": {
+ "CMD_MATTERMOST_BASEURL": {
"description": "Mattermost authentication endpoint",
"required": false
},
- "HMD_MATTERMOST_CLIENTID": {
+ "CMD_MATTERMOST_CLIENTID": {
"description": "Mattermost API client id",
"required": false
},
- "HMD_MATTERMOST_CLIENTSECRET": {
+ "CMD_MATTERMOST_CLIENTSECRET": {
"description": "Mattermost API client secret",
"required": false
},
- "HMD_DROPBOX_CLIENTID": {
+ "CMD_DROPBOX_CLIENTID": {
"description": "Dropbox API client id",
"required": false
},
- "HMD_DROPBOX_CLIENTSECRET": {
+ "CMD_DROPBOX_CLIENTSECRET": {
"description": "Dropbox API client secret",
"required": false
},
- "HMD_DROPBOX_APP_KEY": {
+ "CMD_DROPBOX_APP_KEY": {
"description": "Dropbox app key (for import/export)",
"required": false
},
- "HMD_GOOGLE_CLIENTID": {
+ "CMD_GOOGLE_CLIENTID": {
"description": "Google API client id",
"required": false
},
- "HMD_GOOGLE_CLIENTSECRET": {
+ "CMD_GOOGLE_CLIENTSECRET": {
"description": "Google API client secret",
"required": false
},
- "HMD_IMGUR_CLIENTID": {
+ "CMD_IMGUR_CLIENTID": {
"description": "Imgur API client id",
"required": false
},
- "HMD_ALLOW_PDF_EXPORT": {
+ "CMD_ALLOW_PDF_EXPORT": {
"description": "Enable or disable PDF exports",
"required": false
}
},
"addons": [
"heroku-postgresql"
- ],
- "buildpacks": [
- {
- "url": "https://github.com/alex88/heroku-buildpack-vips"
- },
- {
- "url": "https://github.com/heroku/heroku-buildpack-nodejs"
- }
]
}
diff --git a/bin/heroku b/bin/heroku
index 24727347..c9642c20 100755
--- a/bin/heroku
+++ b/bin/heroku
@@ -2,9 +2,7 @@
set -e
-if [ "$BUILD_ASSETS" = true ]; then
- # setup config files
- cat << EOF > .sequelizerc
+cat << EOF > .sequelizerc
var path = require('path');
module.exports = {
@@ -17,7 +15,7 @@ module.exports = {
EOF
- cat << EOF > config.json
+cat << EOF > config.json
{
"production": {
@@ -25,7 +23,3 @@ EOF
}
EOF
-
- # build app
- npm run build
-fi
diff --git a/lib/letter-avatars.js b/lib/letter-avatars.js
index a5dd8207..935cc1bb 100644
--- a/lib/letter-avatars.js
+++ b/lib/letter-avatars.js
@@ -37,7 +37,7 @@ exports.generateAvatarURL = function (name, email = '', big = true) {
let hexDigest = hash.digest('hex')
if (email !== '' && config.allowGravatar) {
- photo = 'https://www.gravatar.com/avatar/' + hexDigest;
+ photo = 'https://cdn.libravatar.org/avatar/' + hexDigest;
if (big) {
photo += '?s=400'
} else {
diff --git a/package.json b/package.json
index 538a320f..c17c0dba 100644
--- a/package.json
+++ b/package.json
@@ -10,8 +10,8 @@
"jsonlint": "find . -not -path './node_modules/*' -type f -name '*.json' -o -type f -name '*.json.example' | while read json; do echo $json ; jq . $json; done",
"standard": "echo 'standard is no longer being used, use `npm run eslint` instead!' && exit 1",
"dev": "webpack --config webpack.dev.js --progress --colors --watch",
+ "heroku-prebuild": "bin/heroku",
"build": "webpack --config webpack.prod.js --progress --colors --bail",
- "postinstall": "bin/heroku",
"start": "sequelize db:migrate && node app.js",
"doctoc": "doctoc --title='# Table of Contents' README.md"
},
diff --git a/public/views/index/body.ejs b/public/views/index/body.ejs
index c8e86b94..db22f2e3 100644
--- a/public/views/index/body.ejs
+++ b/public/views/index/body.ejs
@@ -135,20 +135,20 @@
<option value="ca">Català</option>
<option value="el">Ελληνικά</option>
<option value="pt">Português</option>
- <option value="it">italiano</option>
+ <option value="it">Italiano</option>
<option value="tr">Türkçe</option>
<option value="ru">Русский</option>
<option value="nl">Nederlands</option>
- <option value="hr">hrvatski jezik</option>
- <option value="pl">język polski</option>
+ <option value="hr">Hrvatski</option>
+ <option value="pl">Polski</option>
<option value="uk">Українська</option>
<option value="hi">हिन्दी</option>
- <option value="sv">svenska</option>
+ <option value="sv">Svenska</option>
<option value="eo">Esperanto</option>
- <option value="da">dansk</option>
+ <option value="da">Dansk</option>
<option value="ko">한국어</option>
<option value="id">Bahasa Indonesia</option>
- <option value="sr">српски</option>
+ <option value="sr">Cрпски</option>
</select>
<p>
<%- __('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><% } %>
diff --git a/test/letter-avatars.js b/test/letter-avatars.js
index c0e967ef..8cc32d8b 100644
--- a/test/letter-avatars.js
+++ b/test/letter-avatars.js
@@ -19,8 +19,8 @@ describe('generateAvatarURL() gravatar enabled', function () {
})
it('should return correct urls', function () {
- assert.strictEqual(avatars.generateAvatarURL('Daan Sprenkels', 'hello@dsprenkels.com', true), 'https://www.gravatar.com/avatar/d41b5f3508cc3f31865566a47dd0336b?s=400')
- assert.strictEqual(avatars.generateAvatarURL('Daan Sprenkels', 'hello@dsprenkels.com', false), 'https://www.gravatar.com/avatar/d41b5f3508cc3f31865566a47dd0336b?s=96')
+ assert.strictEqual(avatars.generateAvatarURL('Daan Sprenkels', 'hello@dsprenkels.com', true), 'https://cdn.libravatar.org/avatar/d41b5f3508cc3f31865566a47dd0336b?s=400')
+ assert.strictEqual(avatars.generateAvatarURL('Daan Sprenkels', 'hello@dsprenkels.com', false), 'https://cdn.libravatar.org/avatar/d41b5f3508cc3f31865566a47dd0336b?s=96')
})
it('should return correct urls for names with spaces', function () {