Giter VIP home page Giter VIP logo

wiki's Introduction

wiki

Very personal wiki

Prerequisite

  1. Docker
  2. Docker Compose

Installation

  1. Download or clone this repository.
  2. Run sudo ./bootstrap.sh in termial.
  3. Set up .env, .config file. Details below.
  4. Run docker-compose up -d in terminal.
  5. Open http://localhost/mw-config on web brower and follow the instructions.

CAUTION: Do not overwrite LocalSettings.php as given in the last instruction. Do it if you understand what are you doing. This step initializes database.

  1. Run docker-compose exec wiki php maintenance/update.php --quick
  2. Voila!

Set up .env, .config file

This file sets system environment variable of running containers. Write a plain text file named .env inside compose directory.

.env

HOST=localhost
[email protected]
WG_PATH=/wiki
WG_SCRIPTPATH=/w
Variable (Required*) Example Description
HOST* localhost Domain name that hosts mediawiki. Or IP address.
EMAIL* [email protected] An email address for issuing letsencrypt certificate.
WG_PATH* /wiki URI path for wiki articles.
WG_SCRIPTPATH* /w URI path for wiki resources(scripts, images, etc).

.config

MYSQL_USER=user
MYSQL_PASSWORD=P@55W0RD
WG_SITENAME=
WG_METANAMESPACE=Project
WG_LANGUAGECODE=en
[email protected]
[email protected]
WG_SECRETKEY=
WG_UPGRADEKEY=4yy8yq1d4v1sxdpz
WG_SMTP_HOST=ssl://smtp.mail.com
WG_SMTP_IDHOST=mail.com
WG_SMTP_LOCALHOST=this.wiki
WG_SMTP_PORT=465
[email protected]
WG_SMTP_PASSWORD=P@55W0RD
WG_SMTP_AUTH=true
Variable (Required*) Example Description
MYSQL_USER* wiki User of mariadb database.
MYSQL_PASSWORD* P@55W0RD Do not leak. Password of corresponding user
WG_SITENAME* Wikipedia Name of wiki.
WG_METANAMESPACE* Project Name for project namespace
WG_LANGUAGECODE* en Language code for wiki
WG_EMERGENCYCONTACT* [email protected] Emergency email address. Also used for letsencrypt certificate issuing.
WG_PASSWORDSENDER [email protected] Adress that may send email reset, security alers, etc.
WG_SECRETKEY* (64 length string) Do not leak. Random 64-character alphanumeric string. You can generate one with keygen.py. Refer Manual:$wgSecretKey.
WG_UPGRADEKEY* 1omwk5pxsphkk6cl Do not leak. Random 16-character alphanumeric string. You can generate one with keygen.py. Refer Manual:$wgUpgradeKey
WG_SMTP_HOST Refer Manual:$wgSMTP
WG_SMTP_IDHOST Refer Manual:$wgSMTP
WG_SMTP_LOCALHOST Refer Manual:$wgSMTP
WG_SMTP_PORT 465 Refer Manual:$wgSMTP
WG_SMTP_USERNAME Refer Manual:$wgSMTP
WG_SMTP_PASSWORD Refer Manual:$wgSMTP
WG_SMTP_AUTH 1 or empty Refer Manual:$wgSMTP

keygen.py

You need these unique keys to run secure wiki. Type python keygen.py or shortly ./keygen.py to generate one.

> ./keygen.py # either python 2 or 3 is fine.
$wgSecretKey=   8nghg15hmibsqqzzdqpeue9on9k5ezumyis6d1rrfmx8lpjsj3xchohwhx5gb4jo
$wgUpgradeKey=  1omwk5pxsphkk6cl

Configure traefik.yml

Almost everything is already set up. You only need to configure entrypoints.websecure.http.tls.domains.main and certificatesResolvers.letsencrypt.acme.email.

The first value is domain name, and the second one is email address. Replace 2js.dev and [email protected] with your ones.

"I don't need HTTPS"

These values are used to get letsencrypt certificate, which is necessary for HTTPS secure connection. For those of you who don't want HTTPS or have no domain, just leave them blank, and delete lines containing

  • traefik.http.routers.wiki-local.
  • traefik.http.routers.wiki-global.
  • traefik.http.routers.wiki.tls.
  • traefik.http.middlewares.redirector.

in docker-compose.yml.

Usage

Start

docker-compose up -d --build

Stop

docker-compose down

CAUTION: Do not use option -v or --volumes when stopping services. It will irreversibly delete wiki data(including files and articles, users, etc) entirely.

Backup and Restore

To backup, run backup script. It'll archive database contents and uploaded files into backups directory.

./backup.sh

Restore script is not ready yet.

Refer to Manual:Backing up a wiki for more detail.

wiki's People

Contributors

2js avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

kaistusc

wiki's Issues

KSSO authentication

KSSO authentication is essential for expanding wiki to be public wiki of KAIST.

Article edit preservation during switch from Wikitext to VisualEditor mode

Is your feature request related to a problem? Please describe.
As editing an article, it's troublesome that switching from Wikitext mode to VisualEditor mode loses edit.

Describe the solution you'd like
A clear and concise description of what you want to happen.
Restbase integration would be a solution.

Describe alternatives you've considered

Additional context

Change path /wiki to domain

Suggestion
ArticlePath
2js.dev/wiki/$1 -> wiki.2js.dev/$1
ScriptPath
2js.dev/w/ -> wikicontent.2js.dev/$1

Security concerns

Google and internal Database credentials are exposed.
Google app password is invalidated.

Multistage Dockerfile

Since most of components are shared across wiki based on this project,
How about to separate COPY LocalSettings.php . step to another stage so that decrase build time and incrase sharability?

\$wgSMTP bug

$wgSMTP setup by environment variables is buggy.

Add RevisionSlider

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Replace Kartographer with Maps

Since Kartographer extension is broken by too many requests error, replacing it with Maps extension would be a good solution.

bootstrap.sh

bootstrap script initializes installation and reduce hassles

[Feature] File uploads up to 2 GiB

Is your feature request related to a problem? Please describe.
Currently Max file upload is 2MB, which makes almost nothing uploadable.

Describe the solution you'd like
Handle apache server configuration and localsettings to unleash this limit.

Traefik config

Letsencrypt cert acme domain and email is hardcoded. This can be separated into /.env

Add LoginNotify

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Add SlackNotifications Extension

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Language fixed

$wgLanguageCode is fixed to be ko.
It's better to be optional and default to be en.

Add TemplateWizard

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Migration to AWS or GCP

Is your feature request related to a problem? Please describe.
Currently service is running on my own desktop, which causes the desktop can't be stopped.

Describe the solution you'd like
Migration to AWS Fargate or GCP Run would offer a continuous service operation with not much cost.

Describe alternatives you've considered
Migration to other services of AWS such as EC2 will be easier but will be more costly.

Additional context

Database template file

Database template file that can be loaded to db right after installation
may help improve productivity of development.
.sql file loaded into database, so that let developer skip database initialzing.

Purge submodules

Submodules are completely removed from this project, however some configs are remaining.
We need to purge them

Add dedicated mail server

Dedicated mail server defined in docker-compose would enable the wiki to send emergency/password reset emails independent to $wgSMTP setup

Extension installtion for kaiwiki

Integration of 2JS/wiki and kaistusc/kaiwiki.
As cost of development and operation is doubled for operating two separate wikis,
kaistusc/kaiwiki will transit to kaistusc/wiki, which is fork of 2JS/wiki.

Because of using fork repo, all the codes are exposed publicly,
so be careful not to push any sensitive data such as passwords or credentials.

Docker network linking issue

Since reverse proxy server is outside of this project, connection between proxy and wiki container breaks everytime docker-compose up.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.