Commit 7bbf6839 authored by Nick's avatar Nick

fix: HTTPS server (#784) + custom git path (#783)

parent c236cfdf
......@@ -5,11 +5,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [2.0.0-beta.XX] - 2019-XX-XX
### Added
- Added Search Results overlay
- Added Search Engine - PostgreSQL
- Added Search Engine - DB Basic
- Added Search Engine - DB PostgreSQL
- Added Search Engine - Azure Search
- Added Search Engine - AWS CloudSearch
- Added Git changes processing (add/modify/delete)
- Added Storage last sync date in status panel
- Added Dev Flags
- Added HTTPS server option
- Added HTTP to HTTPS redirect server option
### Fixed
......
......@@ -5,6 +5,7 @@ const cookieParser = require('cookie-parser')
const cors = require('cors')
const express = require('express')
const favicon = require('serve-favicon')
const fs = require('fs-extra')
const http = require('http')
const https = require('https')
const path = require('path')
......
......@@ -69,6 +69,11 @@ props:
default: 'John Smith'
hint: 'Used as fallback in case the author of the change is not present.'
order: 21
gitBinaryPath:
type: String
title: Git Binary Path
default: ''
hint: Optional - Absolute path to the Git binary, when not available in PATH. Leave empty to use the default PATH location (recommended).
actions:
- handler: syncUntracked
label: Add Untracked Changes
......
......@@ -5,6 +5,8 @@ const _ = require('lodash')
const localeFolderRegex = /^([a-z]{2}(?:-[a-z]{2})?\/)?(.*)/i
/* global WIKI */
/**
* Get file extension based on content type
*/
......@@ -64,6 +66,11 @@ module.exports = {
await fs.ensureDir(this.repoPath)
this.git = sgit(this.repoPath)
// Set custom binary path
if (!_.isEmpty(this.config.gitBinaryPath)) {
this.git.customBinary(this.config.gitBinaryPath)
}
// Initialize repo (if needed)
WIKI.logger.info('(STORAGE/GIT) Checking repository state...')
const isRepo = await this.git.checkIsRepo()
......@@ -81,7 +88,7 @@ module.exports = {
const remotes = await this.git.getRemotes()
if (remotes.length > 0) {
WIKI.logger.info('(STORAGE/GIT) Purging existing remotes...')
for(let remote of remotes) {
for (let remote of remotes) {
await this.git.removeRemote(remote.name)
}
}
......@@ -147,7 +154,7 @@ module.exports = {
const diff = await this.git.diffSummary(['-M', currentCommitLog.hash, latestCommitLog.hash])
if (_.get(diff, 'files', []).length > 0) {
for(const item of diff.files) {
for (const item of diff.files) {
const contentType = getContenType(item.file)
if (!contentType) {
continue
......@@ -202,7 +209,6 @@ module.exports = {
locale: contentPath.locale,
skipStorage: true
})
} else {
WIKI.logger.warn(`(STORAGE/GIT) Failed to open ${item.file}`)
WIKI.logger.warn(err)
......
This diff was suppressed by a .gitattributes entry.
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