Compare commits

...

5 Commits

Author SHA1 Message Date
JJ Kasper
37a469a419 Update Next.js 2019-06-26 01:50:39 -07:00
JJ Kasper
8c4bb5e8ba Update Next.js 2019-06-06 23:05:56 -07:00
JJ Kasper
8eba73a29b updated npm-run-all to get rid of event-stream 2018-11-27 14:08:08 -06:00
JJ Kasper
873734b1e0 updated docker_startup to fix git permission error 2018-11-24 17:40:02 -06:00
JJ Kasper
f634ec7bba updated docs.patch git handling 2018-11-24 16:37:26 -06:00
5 changed files with 1224 additions and 956 deletions

View File

@@ -22,8 +22,14 @@ if [ -d "/config" ];then
CONFDIR="/config"
fi
# create home directory with full access that git can access
mkdir -p /home/mykb
chmod 0777 -R /home/mykb
cd /opt/mykb
export NODE_ENV=production
export HOME=/home/mykb
if [ -z "$PUID" ];then
echo 'no PUID set running as default user'

View File

@@ -58,7 +58,7 @@
"isomorphic-unfetch": "^3.0.0",
"jsonwebtoken": "^8.3.0",
"keymirror": "^0.1.1",
"next": "^7.0.2",
"next": "^8.1.1-canary.52",
"passport": "^0.4.0",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
@@ -79,7 +79,7 @@
"eslint-plugin-react": "^7.11.1",
"husky": "^1.1.3",
"lint-staged": "^8.0.4",
"npm-run-all": "^4.1.3",
"npm-run-all": "^4.1.5",
"prettier": "^1.15.1",
"rimraf": "^2.6.2",
"server-destroy": "^1.0.1",

View File

@@ -32,6 +32,9 @@ export default async function checkLogin(req) {
verified: true,
jwt,
}
} else if (res.status === 400) {
user = {}
delete localStorage.jwt
}
})
.catch(() => {})

View File

@@ -106,8 +106,7 @@ module.exports = function docs(app) {
if (!doc) return notFound(res)
if (!isOkDoc({ name: name || doc.name, dir, md }, kb, res)) return
let newDir = typeof dir === 'string' ? dir : doc.dir
const oldDir = path.join(docsDir, doc.dir)
const oldPath = path.join(oldDir, doc.name)
const oldPath = path.join(docsDir, doc.dir, doc.name)
const docPath = path.join(docsDir, newDir, name || doc.name)
const oldRelPath = oldPath.split(docsDir + '/')[1]
const curRelPath = docPath.split(docsDir + '/')[1]
@@ -125,13 +124,14 @@ module.exports = function docs(app) {
}
await tryRmdir(docsDir, oldRelPath)
if (useGit && isNewPath) {
await git.rm(oldPath)
if (useGit) {
let commitMsg = `updated doc ${curRelPath}`
if (isNewPath) {
git.rm(oldPath)
commitMsg = `renamed doc ${oldRelPath} to ${curRelPath}`
}
await git.add(docPath)
await git.commit(`renamed doc ${oldRelPath} to ${curRelPath}`)
} else if (useGit) {
await git.add(docPath)
await git.commit(`updated doc ${curRelPath}`)
await git.commit(commitMsg)
}
} catch (err) {
return serverError(res, err)

2151
yarn.lock

File diff suppressed because it is too large Load Diff