Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
f8161f2e
Commit
f8161f2e
authored
Jan 09, 2017
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added appdata support
parent
ec6f32d2
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
73 additions
and
28 deletions
+73
-28
agent.js
agent.js
+7
-5
data.yml
app/data.yml
+49
-0
entries.js
libs/entries.js
+1
-2
git.js
libs/git.js
+1
-2
local.js
libs/local.js
+1
-4
uploads-agent.js
libs/uploads-agent.js
+2
-5
uploads.js
libs/uploads.js
+1
-2
server.js
server.js
+9
-7
login.pug
views/auth/login.pug
+2
-1
No files found.
agent.js
View file @
f8161f2e
...
@@ -25,11 +25,13 @@ global.winston = require(CORE_PATH + 'core-libs/winston')(IS_DEBUG);
...
@@ -25,11 +25,13 @@ global.winston = require(CORE_PATH + 'core-libs/winston')(IS_DEBUG);
winston
.
info
(
'[AGENT] Background Agent is initializing...'
);
winston
.
info
(
'[AGENT] Background Agent is initializing...'
);
var
appconfig
=
require
(
CORE_PATH
+
'core-libs/config'
)(
'./config.yml'
);
let
appconf
=
require
(
CORE_PATH
+
'core-libs/config'
)();
global
.
db
=
require
(
CORE_PATH
+
'core-libs/mongodb'
).
init
(
appconfig
);
global
.
appconfig
=
appconf
.
config
;
global
.
upl
=
require
(
'./libs/uploads-agent'
).
init
(
appconfig
);
global
.
appdata
=
appconf
.
data
;
global
.
git
=
require
(
'./libs/git'
).
init
(
appconfig
);
global
.
db
=
require
(
CORE_PATH
+
'core-libs/mongodb'
).
init
();
global
.
entries
=
require
(
'./libs/entries'
).
init
(
appconfig
);
global
.
upl
=
require
(
'./libs/uploads-agent'
).
init
();
global
.
git
=
require
(
'./libs/git'
).
init
();
global
.
entries
=
require
(
'./libs/entries'
).
init
();
global
.
mark
=
require
(
'./libs/markdown'
);
global
.
mark
=
require
(
'./libs/markdown'
);
// ----------------------------------------
// ----------------------------------------
...
...
app/data.yml
0 → 100644
View file @
f8161f2e
# ---------------------------------
# DO NOT EDIT THIS FILE!
# This is reserved for system use!
# ---------------------------------
name
:
Wiki.js
capabilities
:
guest
:
true
rights
:
true
manyAuthProviders
:
true
defaults
:
config
:
title
:
Wiki
host
:
http://localhost
port
:
80
paths
:
repo
:
./repo
data
:
./data
uploads
:
maxImageFileSize
:
3,
maxOtherFileSize
:
100
lang
:
en
public
:
false
auth
:
local
:
enabled
:
true
microsoft
:
enabled
:
false
google
:
enabled
:
false
facebook
:
enabled
:
false
db
:
mongodb://localhost/wiki
sessionSecret
:
null
admin
:
null
git
:
url
:
null
branch
:
master
auth
:
type
:
basic
username
:
null
password
:
null
publicKey
:
null
privateKey
:
null
sslVerify
:
true
signature
:
name
:
Wiki
email
:
wiki@example.com
# ---------------------------------
\ No newline at end of file
libs/entries.js
View file @
f8161f2e
...
@@ -18,10 +18,9 @@ module.exports = {
...
@@ -18,10 +18,9 @@ module.exports = {
/**
/**
* Initialize Entries model
* Initialize Entries model
*
*
* @param {Object} appconfig The application config
* @return {Object} Entries model instance
* @return {Object} Entries model instance
*/
*/
init
(
appconfig
)
{
init
()
{
let
self
=
this
;
let
self
=
this
;
...
...
libs/git.js
View file @
f8161f2e
...
@@ -34,10 +34,9 @@ module.exports = {
...
@@ -34,10 +34,9 @@ module.exports = {
/**
/**
* Initialize Git model
* Initialize Git model
*
*
* @param {Object} appconfig The application config
* @return {Object} Git model instance
* @return {Object} Git model instance
*/
*/
init
(
appconfig
)
{
init
()
{
let
self
=
this
;
let
self
=
this
;
...
...
libs/local.js
View file @
f8161f2e
...
@@ -9,8 +9,6 @@ var path = require('path'),
...
@@ -9,8 +9,6 @@ var path = require('path'),
/**
/**
* Local Data Storage
* Local Data Storage
*
* @param {Object} appconfig The application configuration
*/
*/
module
.
exports
=
{
module
.
exports
=
{
...
@@ -22,10 +20,9 @@ module.exports = {
...
@@ -22,10 +20,9 @@ module.exports = {
/**
/**
* Initialize Local Data Storage model
* Initialize Local Data Storage model
*
*
* @param {Object} appconfig The application config
* @return {Object} Local Data Storage model instance
* @return {Object} Local Data Storage model instance
*/
*/
init
(
appconfig
)
{
init
()
{
this
.
_uploadsPath
=
path
.
resolve
(
ROOTPATH
,
appconfig
.
paths
.
repo
,
'uploads'
);
this
.
_uploadsPath
=
path
.
resolve
(
ROOTPATH
,
appconfig
.
paths
.
repo
,
'uploads'
);
this
.
_uploadsThumbsPath
=
path
.
resolve
(
ROOTPATH
,
appconfig
.
paths
.
data
,
'thumbs'
);
this
.
_uploadsThumbsPath
=
path
.
resolve
(
ROOTPATH
,
appconfig
.
paths
.
data
,
'thumbs'
);
...
...
libs/uploads-agent.js
View file @
f8161f2e
...
@@ -13,9 +13,7 @@ var path = require('path'),
...
@@ -13,9 +13,7 @@ var path = require('path'),
_
=
require
(
'lodash'
);
_
=
require
(
'lodash'
);
/**
/**
* Uploads
* Uploads - Agent
*
* @param {Object} appconfig The application configuration
*/
*/
module
.
exports
=
{
module
.
exports
=
{
...
@@ -27,10 +25,9 @@ module.exports = {
...
@@ -27,10 +25,9 @@ module.exports = {
/**
/**
* Initialize Uploads model
* Initialize Uploads model
*
*
* @param {Object} appconfig The application config
* @return {Object} Uploads model instance
* @return {Object} Uploads model instance
*/
*/
init
(
appconfig
)
{
init
()
{
let
self
=
this
;
let
self
=
this
;
...
...
libs/uploads.js
View file @
f8161f2e
...
@@ -23,10 +23,9 @@ module.exports = {
...
@@ -23,10 +23,9 @@ module.exports = {
/**
/**
* Initialize Local Data Storage model
* Initialize Local Data Storage model
*
*
* @param {Object} appconfig The application config
* @return {Object} Uploads model instance
* @return {Object} Uploads model instance
*/
*/
init
(
appconfig
)
{
init
()
{
this
.
_uploadsPath
=
path
.
resolve
(
ROOTPATH
,
appconfig
.
paths
.
repo
,
'uploads'
);
this
.
_uploadsPath
=
path
.
resolve
(
ROOTPATH
,
appconfig
.
paths
.
repo
,
'uploads'
);
this
.
_uploadsThumbsPath
=
path
.
resolve
(
ROOTPATH
,
appconfig
.
paths
.
data
,
'thumbs'
);
this
.
_uploadsThumbsPath
=
path
.
resolve
(
ROOTPATH
,
appconfig
.
paths
.
data
,
'thumbs'
);
...
...
server.js
View file @
f8161f2e
...
@@ -25,14 +25,16 @@ winston.info('[SERVER] Wiki.js is initializing...');
...
@@ -25,14 +25,16 @@ winston.info('[SERVER] Wiki.js is initializing...');
// Load global modules
// Load global modules
// ----------------------------------------
// ----------------------------------------
var
appconfig
=
require
(
CORE_PATH
+
'core-libs/config'
)(
'./config.yml'
);
let
appconf
=
require
(
CORE_PATH
+
'core-libs/config'
)();
global
.
lcdata
=
require
(
'./libs/local'
).
init
(
appconfig
);
global
.
appconfig
=
appconf
.
config
;
global
.
db
=
require
(
CORE_PATH
+
'core-libs/mongodb'
).
init
(
appconfig
);
global
.
appdata
=
appconf
.
data
;
global
.
entries
=
require
(
'./libs/entries'
).
init
(
appconfig
);
global
.
lcdata
=
require
(
'./libs/local'
).
init
();
global
.
git
=
require
(
'./libs/git'
).
init
(
appconfig
,
false
);
global
.
db
=
require
(
CORE_PATH
+
'core-libs/mongodb'
).
init
();
global
.
entries
=
require
(
'./libs/entries'
).
init
();
global
.
git
=
require
(
'./libs/git'
).
init
(
false
);
global
.
lang
=
require
(
'i18next'
);
global
.
lang
=
require
(
'i18next'
);
global
.
mark
=
require
(
'./libs/markdown'
);
global
.
mark
=
require
(
'./libs/markdown'
);
global
.
upl
=
require
(
'./libs/uploads'
).
init
(
appconfig
);
global
.
upl
=
require
(
'./libs/uploads'
).
init
();
// ----------------------------------------
// ----------------------------------------
// Load modules
// Load modules
...
@@ -87,7 +89,7 @@ app.use(express.static(path.join(ROOTPATH, 'assets')));
...
@@ -87,7 +89,7 @@ app.use(express.static(path.join(ROOTPATH, 'assets')));
// Passport Authentication
// Passport Authentication
// ----------------------------------------
// ----------------------------------------
var
strategy
=
require
(
CORE_PATH
+
'core-libs/auth'
)(
passport
,
appconfig
);
var
strategy
=
require
(
CORE_PATH
+
'core-libs/auth'
)(
passport
);
global
.
rights
=
require
(
CORE_PATH
+
'core-libs/rights'
);
global
.
rights
=
require
(
CORE_PATH
+
'core-libs/rights'
);
rights
.
init
();
rights
.
init
();
...
...
views/auth/login.pug
View file @
f8161f2e
...
@@ -63,5 +63,5 @@ html
...
@@ -63,5 +63,5 @@ html
#copyright
#copyright
= t('footer.poweredby') + ' '
= t('footer.poweredby') + ' '
a.icon(href='https://github.com/Requarks/wiki')
a.icon(href='https://github.com/Requarks/wiki')
i.
fa.fa
-github
i.
icon
-github
a(href='https://github.com/Requarks/wiki') Requarks Wiki
a(href='https://github.com/Requarks/wiki') Requarks Wiki
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment