Browse Source

Add option for gravatar url

pull/6/head
Menci 6 years ago
parent
commit
0dc5cf0f62
  1. 1
      config-example.json
  2. 2
      utility.js

1
config-example.json

@ -113,6 +113,7 @@
"rabbitMQ": "amqp://localhost/", "rabbitMQ": "amqp://localhost/",
"email_jwt_secret": "@EMAIL_JWT_SECRET@", "email_jwt_secret": "@EMAIL_JWT_SECRET@",
"google_analytics": "UA-XXXXXXXX-X", "google_analytics": "UA-XXXXXXXX-X",
"gravatar_url": "https://gravatar.loli.net/avatar",
"cdnjs_url": "https://cdnjs.loli.net/ajax/libs", "cdnjs_url": "https://cdnjs.loli.net/ajax/libs",
"self_cdn_url": "", "self_cdn_url": "",
"google_fonts": { "google_fonts": {

2
utility.js

@ -142,7 +142,7 @@ module.exports = {
}); });
}, },
gravatar(email, size) { gravatar(email, size) {
return gravatar.url(email, { s: size, d: 'mm' }).replace('www.gravatar.com', 'gravatar.loli.net'); return gravatar.url(email, { s: size, d: 'mm' }).replace('//www.gravatar.com/avatar', syzoj.config.gravatar_url);
}, },
async parseTestdata(dir, submitAnswer) { async parseTestdata(dir, submitAnswer) {
if (!await syzoj.utils.isDir(dir)) return null; if (!await syzoj.utils.isDir(dir)) return null;

Loading…
Cancel
Save