diff --git a/.babelrc b/.babelrc deleted file mode 100644 index af0f0c3d..00000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["es2015"] -} \ No newline at end of file diff --git a/.build/.deployexclude b/.build/.deployexclude deleted file mode 100644 index 6c4ef406..00000000 --- a/.build/.deployexclude +++ /dev/null @@ -1,17 +0,0 @@ -client -coverage -data -logs -node_modules -npm -repo -test -.* -*.log -*.tar.gz -*.zip -config.yml -docker-compose.yml -Dockerfile -fuse.js -yarn.lock diff --git a/.build/docker_init.sh b/.build/docker_init.sh deleted file mode 100644 index b9727f3a..00000000 --- a/.build/docker_init.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/ash -apk add bash curl git openssh -cd /var/www -node server diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4eaaf4ee..00000000 --- a/.travis.yml +++ /dev/null @@ -1,45 +0,0 @@ -language: node_js -node_js: -- '8' -branches: - except: - - docker -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.8 -env: - global: - - CXX=g++-4.8 - - secure: VCgscCCKhvHu0tW8e3jo6wydckE6jDkEfC2Zd5aSZytYAex05qahU45cmksqMIT1uBCcC4CKRK4caoKac/+818EyKBTV+vAL74cMMc8NeLNVY2m50+ohu8GYu+ByIffttK7cnXN7xIzyuK4csI7qz84jxLW0KYgYQ+6SPbUG3Hy6gr0P0CztNmAFfyhTam4OKSIiXyvQZW0fZoSruOpUYS5pxvCBi4AxpRY8+6IxCL8xYqF49P0l28nn0C/NYUklwag6l4JF32PrcLAU5S+NIXXgJX499cZO4C2m2GljJeolbvGue3ZEtadv5NkmQuFQ1WGb5aURHPkll0hXsWKxT0bH9P1a4Gt1h/J885acWG4U6QZA1Zds/Z4ymNeLA0MzzoAaDK1q8sRglhDJnZYb4Zm5jy7ZA3vFwb+zcGaOT//pCVpcsZINRnd0Qu9LC5NKPrfmyFAAMAXDdo78BEnwryUviWP5976JZmQAfDIWvmGGTs5i1yjiTRi+NVgH0YpfxtI9MTEJo++r5/zNH/jewxj1D8esaamphp6mQvxvpl388veQDw3REUZQ49muzrdK2YYmVRkzLfH2uMsHInN3WqEl3/mTpH76u0nlxMF6HlrVdgB2UNPjlXbSooWXLfdAw98NpCZ7BAFcCcT8Oa9cYw+40rJrdfem5J2EimG5ltw= - - secure: afxMIIz9YeKKBc0WdafTrQorzsIZSEM8wqUB3ffrC41s+FEXl4VGIl8ZxKWZ/k2W+y7qCWSVfS4vMHv6CYy++Xq87NUczWPqFq99QXNHYpXWD0JK3clLY1DADuRDYeVA/kGkjH3MAAVd5s4I8TK7cmLwZDiwT7ybiYGLnAeQPR5IK1p/WwULEE+UTvSXudKfQIpi8K/EjbjLcB+EcDFPngAvX0LW6qXn0E+Z9NG6aru7/QhCTkHTYIc6k6r/bzWKhRAp+XaA184GxsyxNvIWTiBpeVK8XwDORkotobvgvDoz8uQHMjldtNFg5BL386WjNSh0Ljg242GQVTpbh0ju9F4XC7GN11tRDHwOBbSLa+X/sBomyONgBAve6roqtiQgZ3T92SycyjW06vhG7akC+yAKnAKVL+JdWWvg4qPhppKRAa57/5Se9GlAthSXvhfGvkaKtA4IUq9Jr7FksF4f+tCkSfNeJBYnlV+c/oBY7ZZ9gMUslXuDtv8Dbgp2aa4ELeA9R0U+5Ac42JzzbfojwOaLpEvFYs2cdZybOPlUq/EO/rx2Oxi9Xk2oPL4UW9xV5ZlwYmCw/rXpzSWo4dl4i0tEPN+5ZPtgQGz5pIBeI0LGGvEhCya/Tg+Xc9Bd7/0Ox7cLgNk0vrTEVjW+Z/b3XMhVwVlwmTuVM5wylzaZRcc= -cache: yarn -before_script: -- yarn run build -before_deploy: -- tar -chzf wiki-js.tar.gz * -X .build/.deployexclude -- yarn install --production --ignore-scripts --prefer-offline -- tar -chzf node_modules.tar.gz -C node_modules . -deploy: - provider: releases - api_key: - secure: TyasQ2QnWQoBhsiwm88oHoeJ+PWBZnbWEJwu6JdN5HA9cXqIdHqd1msCh84gGtKRfL2EObw4AvDwLSEd5mIM0cmQfTiokYbmb7OSjOq880rbZwtXt9t9KkC5b+TIxkhJzkzi7vIpssTeNkVJBbo/R3m0suaCRqzypkW5mhVcsFhhZ8oVCZnI1uZAXCwFNMcFFUAHxWYE98tW5bfxknRU1NJFcXysN8VXskIZ82wQQBAzZ1aQgVyMl6Uw2hns399hxCx8gVKWOIdbpO1bliHBMdm5z+lR5i723IQnHpYJf4gWvPf3oHnSS1ocrJeWVoBqanC5Iu3QhwOvPLPw/AUcJOqhvS/QiGZ2AuA9GwtBpYNVYYGD9RqcODBKZy0fWluwCuVNNoQHmwMWVP7lRnwP+SNtLzzV5ZC8mrjb4B9KGoBUR8Q7lz8cMtLoPOixk1WdWOpIFzKcw/fy8Ze6cnnFKrzsPVUZy3E3SKit3GuP6Nd7ghO0Kxp4x0eAlqFDYRZ9nG55ctd0i2b5u1r+VArt21dk2aMFxL6i67funIraEndLQFHhRgPVmjemJBRXf8j8OYrGStTsm0S26IXo3iVh/NJakIg6mEFJ3j4BXPEjCUmIW0iD6sKGTeNH6jaON+DV4T+ErGnYzgwO5KIfo9cI00DqjG0tjBQ45lWaLGy6PEo= - file: - - wiki-js.tar.gz - - node_modules.tar.gz - skip_cleanup: true - overwrite: true - on: - branch: master - repo: Requarks/wiki - tags: true - node: '8' -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/56b27cb2ec4692419db9 - on_success: change - on_failure: always - on_start: never diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index f9d50299..00000000 --- a/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM node:8-alpine - -RUN apk update && apk upgrade && \ - apk add --no-cache bash git openssh - -ENV WIKI_JS_DOCKER 1 - -WORKDIR /usr/src/app -COPY assets assets/ -COPY server server/ -COPY npm/configs/config.passive.yml config.yml -COPY package.json package.json -COPY LICENSE LICENSE -RUN npm install --only=production --no-optional - -EXPOSE 3000 -ENTRYPOINT [ "node", "server" ] diff --git a/README.md b/README.md index 94999a28..457bd021 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ ##### A modern, lightweight and powerful wiki app built on NodeJS, Git and Markdown - [Official Website](https://wiki.js.org/) -- [Documentation](#documentation) +- **[Getting Started](https://wiki.js.org/get-started.html)** +- [Documentation](https://docs.requarks.io/wiki/) - [Requirements](#requirements) - [Change Log](https://github.com/Requarks/wiki/blob/master/CHANGELOG.md) - [Feature Requests](https://wikijs.canny.io/features) @@ -23,12 +24,6 @@ - [Translations](#translations) *(We need your help!)* - [Special Thanks](#special-thanks) -## Documentation - -- [Installation Guide](https://wiki.js.org/get-started.html) -- [Admin Guide](https://docs.requarks.io/wiki/#admin-guide) -- [User Guide](https://docs.requarks.io/wiki/#user-guide) - ## Requirements Wiki.js can run on virtually all platforms where Node.js can (Windows, Mac, Linux, etc.). @@ -43,10 +38,17 @@ Wiki.js can run on virtually all platforms where Node.js can (Windows, Mac, Linu ## Cloud Install [![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/requarks/wiki-heroku) -[![Docker Image](https://raw.githubusercontent.com/Requarks/wiki-site/master/assets/images/docker-deploy.png)](https://hub.docker.com/r/requarks/wiki/) *Docker Cloud, Azure, IBM Bluemix and more coming soon!* +## Docker + +A docker Wiki.js image is available on Docker Hub: + +[![Docker Image](https://raw.githubusercontent.com/Requarks/wiki-site/master/assets/images/docker-deploy.png)](https://hub.docker.com/r/requarks/wiki/) + +You can also use a Dockerfile ([see example]()) or Docker Compose ([see example]()) to run Wiki.js. + ## Milestones Current and upcoming milestones *(major features only, see the [changelog](https://github.com/Requarks/wiki/blob/master/CHANGELOG.md) for complete list of features and bug fixes)*: @@ -74,7 +76,7 @@ Current and upcoming milestones *(major features only, see the [changelog](https - [x] Migrate to PostgreSQL + Redis datastore - [ ] History / Revert to previous version - [ ] Optional Two-Steps Authentication (2FA) -- [ ] Docker support + Auto compile/publish to Docker Hub +- [x] Docker support + Auto compile/publish to Docker Hub - [ ] Support sub-directory installations (e.g. example.com/wiki) - [ ] Persist system settings to database instead of file-based - [ ] User Groups + Better permissions management diff --git a/package.json b/package.json index 4adc0aa4..a598f44e 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,9 @@ "start": "node wiki start", "stop": "node wiki stop", "restart": "node wiki restart", - "build": "node fuse", - "dev": "node fuse -d", - "dev-configure": "node fuse -c", + "build": "node tools/fuse", + "dev": "node tools/fuse -d", + "dev-configure": "node tools/fuse -c", "test": "jest" }, "bin": { diff --git a/test/lint.js b/test/lint.js index 87fb89a0..6b66414c 100644 --- a/test/lint.js +++ b/test/lint.js @@ -69,7 +69,7 @@ describe('Code Linting', () => { it('should pass PugLint validation', () => { const PugLint = require('pug-lint') const lint = new PugLint() - const pugConfig = fs.readJsonSync('.pug-lintrc.json') + const pugConfig = fs.readJsonSync('tools/.pug-lintrc.json') lint.configure(pugConfig) let report = lint.checkPath('./server/views') expect(report).toPugLint() diff --git a/tools/Dockerfile b/tools/Dockerfile new file mode 100644 index 00000000..34b22f9c --- /dev/null +++ b/tools/Dockerfile @@ -0,0 +1,12 @@ +FROM requarks/wiki:latest + +# Replace with your email address: +ENV WIKI_ADMIN_EMAIL admin@example.com + +WORKDIR /var/wiki + +# Replace your-config.yml with the path to your config file: +ADD your-config.yml config.yml + +EXPOSE 3000 +ENTRYPOINT [ "node", "server" ] diff --git a/docker-compose.yml b/tools/docker-compose.yml similarity index 51% rename from docker-compose.yml rename to tools/docker-compose.yml index dcb025be..c7f9595a 100644 --- a/docker-compose.yml +++ b/tools/docker-compose.yml @@ -2,14 +2,18 @@ version: '3' services: wikidb: image: mongo - ports: - - '27017:27017' + expose: + - '27017' command: '--smallfiles --logpath=/dev/null' + volumes: + - ./data/mongo:/data/db wikijs: image: 'requarks/wiki:latest' links: - wikidb ports: - - '3000:3000' + - '80:3000' environment: - - PORT=3000 + - WIKI_ADMIN_EMAIL: admin@example.com + volumes: + - ./config.yml:/var/wiki/config.yml diff --git a/fuse.js b/tools/fuse.js similarity index 94% rename from fuse.js rename to tools/fuse.js index 76143cbd..719bf6ef 100644 --- a/fuse.js +++ b/tools/fuse.js @@ -58,15 +58,15 @@ const ALIASES = { } const SHIMS = { jquery: { - source: 'node_modules/jquery/dist/jquery.js', + source: '../node_modules/jquery/dist/jquery.js', exports: '$' }, diff2html: { - source: 'node_modules/diff2html/dist/diff2html.min.js', + source: '../node_modules/diff2html/dist/diff2html.min.js', exports: 'Diff2Html' }, diff2htmlui: { - source: 'node_modules/diff2html/dist/diff2html-ui.min.js', + source: '../node_modules/diff2html/dist/diff2html-ui.min.js', exports: 'Diff2HtmlUI' } } @@ -76,7 +76,7 @@ const SHIMS = { // ====================================================== console.info(colors.white('└── ') + colors.green('Running global tasks...')) -let globalTasks = require('./.build/_tasks') +let globalTasks = require('./fuse_tasks') // ====================================================== // Fuse Tasks @@ -84,10 +84,11 @@ let globalTasks = require('./.build/_tasks') globalTasks.then(() => { let fuse = fsbx.FuseBox.init({ - homeDir: './client', - output: './assets/js/$name.js', + homeDir: '../client', + output: '../assets/js/$name.js', alias: ALIASES, target: 'browser', + tsConfig: './tsconfig.json', plugins: [ fsbx.EnvPlugin({ NODE_ENV: (dev) ? 'development' : 'production' }), fsbx.VuePlugin(), diff --git a/.build/_tasks.js b/tools/fuse_tasks.js similarity index 100% rename from .build/_tasks.js rename to tools/fuse_tasks.js diff --git a/.pug-lintrc.json b/tools/pug-lintrc.json similarity index 100% rename from .pug-lintrc.json rename to tools/pug-lintrc.json diff --git a/.build/semver_next.sh b/tools/semver_next.sh similarity index 100% rename from .build/semver_next.sh rename to tools/semver_next.sh diff --git a/tsconfig.json b/tools/tsconfig.json similarity index 100% rename from tsconfig.json rename to tools/tsconfig.json diff --git a/wiki.cmd b/wiki.cmd deleted file mode 100644 index f61c9d5d..00000000 --- a/wiki.cmd +++ /dev/null @@ -1 +0,0 @@ -@node "%~dp0wiki.js" %*