Commit b90884fd authored by NGPixel's avatar NGPixel

fix: Updated setup wizard to use new git author options

parent ed0253cd
...@@ -61,8 +61,8 @@ jQuery(document).ready(function ($) { ...@@ -61,8 +61,8 @@ jQuery(document).ready(function ($) {
gitAuthUser: '', gitAuthUser: '',
gitAuthPass: '', gitAuthPass: '',
gitAuthSSL: true, gitAuthSSL: true,
gitSignatureName: '', gitShowUserEmail: true,
gitSignatureEmail: '', gitServerEmail: '',
adminEmail: '', adminEmail: '',
adminPassword: '', adminPassword: '',
adminPasswordConfirm: '' adminPasswordConfirm: ''
...@@ -119,6 +119,8 @@ jQuery(document).ready(function ($) { ...@@ -119,6 +119,8 @@ jQuery(document).ready(function ($) {
if (appconfig.git !== false && _.isPlainObject(appconfig.git)) { if (appconfig.git !== false && _.isPlainObject(appconfig.git)) {
this.conf.gitUrl = appconfig.git.url || '' this.conf.gitUrl = appconfig.git.url || ''
this.conf.gitBranch = appconfig.git.branch || 'master' this.conf.gitBranch = appconfig.git.branch || 'master'
this.conf.gitShowUserEmail = (appconfig.git.showUserEmail !== false)
this.conf.gitServerEmail = appconfig.git.serverEmail || ''
if (_.isPlainObject(appconfig.git.auth)) { if (_.isPlainObject(appconfig.git.auth)) {
this.conf.gitAuthType = appconfig.git.auth.type || 'ssh' this.conf.gitAuthType = appconfig.git.auth.type || 'ssh'
this.conf.gitAuthSSHKey = appconfig.git.auth.privateKey || '' this.conf.gitAuthSSHKey = appconfig.git.auth.privateKey || ''
...@@ -126,10 +128,6 @@ jQuery(document).ready(function ($) { ...@@ -126,10 +128,6 @@ jQuery(document).ready(function ($) {
this.conf.gitAuthPass = appconfig.git.auth.password || '' this.conf.gitAuthPass = appconfig.git.auth.password || ''
this.conf.gitAuthSSL = (appconfig.git.auth.sslVerify !== false) this.conf.gitAuthSSL = (appconfig.git.auth.sslVerify !== false)
} }
if (_.isPlainObject(appconfig.git.signature)) {
this.conf.gitSignatureName = appconfig.git.signature.name || ''
this.conf.gitSignatureEmail = appconfig.git.signature.email || ''
}
} }
}, },
methods: { methods: {
......
...@@ -193,13 +193,13 @@ module.exports = (port, spinner) => { ...@@ -193,13 +193,13 @@ module.exports = (port, spinner) => {
}, },
() => { () => {
if (req.body.gitUseRemote === false) { return false } if (req.body.gitUseRemote === false) { return false }
return exec.stdout('git', ['config', '--local', 'user.name', req.body.gitSignatureName], { cwd: gitDir }).then(result => { return exec.stdout('git', ['config', '--local', 'user.name', 'Wiki'], { cwd: gitDir }).then(result => {
return 'Git Signature Name has been set successfully.' return 'Git Signature Name has been set successfully.'
}) })
}, },
() => { () => {
if (req.body.gitUseRemote === false) { return false } if (req.body.gitUseRemote === false) { return false }
return exec.stdout('git', ['config', '--local', 'user.email', req.body.gitSignatureEmail], { cwd: gitDir }).then(result => { return exec.stdout('git', ['config', '--local', 'user.email', req.body.gitServerEmail], { cwd: gitDir }).then(result => {
return 'Git Signature Name has been set successfully.' return 'Git Signature Name has been set successfully.'
}) })
}, },
...@@ -340,10 +340,8 @@ module.exports = (port, spinner) => { ...@@ -340,10 +340,8 @@ module.exports = (port, spinner) => {
privateKey: req.body.gitAuthSSHKey, privateKey: req.body.gitAuthSSHKey,
sslVerify: (req.body.gitAuthSSL === true) sslVerify: (req.body.gitAuthSSL === true)
}, },
signature: { showUserEmail: (req.body.gitShowUserEmail === true),
name: req.body.gitSignatureName, serverEmail: req.body.gitServerEmail
email: req.body.gitSignatureEmail
}
} }
} }
return crypto.randomBytesAsync(32).then(buf => { return crypto.randomBytesAsync(32).then(buf => {
......
...@@ -264,16 +264,16 @@ html(data-logic='configure') ...@@ -264,16 +264,16 @@ html(data-logic='configure')
input(type='text', placeholder='e.g. /etc/wiki/keys/git.pem', v-model='conf.gitAuthSSHKey') input(type='text', placeholder='e.g. /etc/wiki/keys/git.pem', v-model='conf.gitAuthSSHKey')
span.desc The full path to the private key on disk. span.desc The full path to the private key on disk.
section.columns section.columns
.column .column.is-one-third
p.control.is-fullwidth p.control.is-fullwidth
label.label Sync User Name input#ipt-git-show-user-email(type='checkbox', v-model='conf.gitShowUserEmail')
input(type='text', placeholder='e.g. John Smith', v-model.number='conf.gitSignatureName', data-vv-scope='git', name='ipt-gitsigname', v-validate='{ required: true }') label.label(for='ipt-git-show-user-email') Commit using User Email
span.desc The name to use when pushing commits to the git repository. span.desc When enabled, commits are made as the current user name and email. If unchecked, the current user name will still be used but the default commit author email will be used instead.
.column .column
p.control.is-fullwidth p.control.is-fullwidth
label.label Sync User Email label.label Default Commit Author Email
input(type='text', placeholder='e.g. user@example.com', v-model.number='conf.gitSignatureEmail', data-vv-scope='git', name='ipt-gitsigemail', v-validate='{ required: true, email: true }') input(type='text', placeholder='e.g. user@example.com', v-model.number='conf.gitServerEmail', data-vv-scope='git', name='ipt-gitsrvemail', v-validate='{ required: true, email: true }')
span.desc The email to use when pushing commits to the git repository. span.desc The default/fallback email to use when creating commits to the git repository.
.panel-footer .panel-footer
.progress-bar: div(v-bind:style='{width: currentProgress}') .progress-bar: div(v-bind:style='{width: currentProgress}')
button.button.is-light-blue.is-outlined(v-on:click='proceedToPaths', v-bind:disabled='loading') Back button.button.is-light-blue.is-outlined(v-on:click='proceedToPaths', v-bind:disabled='loading') Back
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment