浏览代码

feat: removed waffle link + added git author config

NGPixel 8 年之前
父节点
当前提交
86eb7a427d
共有 4 个文件被更改,包括 11 次插入12 次删除
  1. 0 1
      README.md
  2. 2 3
      app/data.yml
  3. 6 3
      config.sample.yml
  4. 3 5
      libs/git.js

+ 0 - 1
README.md

@@ -19,7 +19,6 @@
 - [Requirements](#requirements)
 - [Change Log](https://github.com/Requarks/wiki/blob/master/CHANGELOG.md)
 - [Feature Requests](https://wikijs.canny.io/features)
-- [Project Planning](https://waffle.io/Requarks/wiki)
 - [Milestones](#milestones)
 - [Chat with us](#gitter)
 - [Special Thanks](#special-thanks)

+ 2 - 3
app/data.yml

@@ -50,9 +50,8 @@ defaults:
         password: null
         privateKey: null
         sslVerify: true
-      signature:
-        name: Wiki
-        email: wiki@example.com
+      serverEmail: wiki@example.com
+      showUserEmail: true
     features:
       mathjax: true
     externalLogging:

+ 6 - 3
config.sample.yml

@@ -127,9 +127,12 @@ git:
     privateKey: /etc/wiki/keys/git.pem
 
     sslVerify: true
-  signature:
-    name: Marty
-    email: marty@example.com
+
+  # Default email to use as commit author
+  serverEmail: marty@example.com
+
+  # Whether to use user email as author in commits
+  showUserEmail: true
 
 # ---------------------------------------------------------------------
 # Features

+ 3 - 5
libs/git.js

@@ -20,8 +20,7 @@ module.exports = {
     exists: false
   },
   _signature: {
-    name: 'Wiki',
-    email: 'user@example.com'
+    email: 'wiki@example.com'
   },
   _opts: {
     clone: {},
@@ -52,8 +51,7 @@ module.exports = {
     // Define signature
 
     if (appconfig.git) {
-      self._signature.name = appconfig.git.signature.name || 'Wiki'
-      self._signature.email = appconfig.git.signature.email || 'user@example.com'
+      self._signature.email = appconfig.git.serverEmail || 'wiki@example.com'
     }
 
     return self
@@ -102,7 +100,7 @@ module.exports = {
       self._url = URL.format(urlObj)
 
       let gitConfigs = [
-        () => { return self._git.exec('config', ['--local', 'user.name', self._signature.name]) },
+        () => { return self._git.exec('config', ['--local', 'user.name', 'Wiki']) },
         () => { return self._git.exec('config', ['--local', 'user.email', self._signature.email]) },
         () => { return self._git.exec('config', ['--local', '--bool', 'http.sslVerify', _.toString(appconfig.git.auth.sslVerify)]) }
       ]