Make writing a habit together! This is the fifth day of my participation in the “Gold Digging Day New Plan · April More text Challenge”. Click here for more details.

I don’t know if there are any people like me who think self-built things are “private plots” and private space on the Internet, with a kind of one mu three to follow one’s incline happily.

For example, you can write whatever you want on your own blog without pleasing your readers. For example, a self-built wiki can record knowledge points directly, without worrying about being laughed at. Apart from the joint construction, Wiki is different from blog in that the recorded content pays more attention to knowledge points and classification, which can be used to build their own knowledge network.

If a blog is a “diary”, then a wiki is a “notebook”. It is used to record knowledge points, which can be easily accessed and updated. It has a clear table of contents and one point of knowledge can be related to other points of knowledge, gradually developing into an “encyclopedia”.

Introduce a,

Knowledge lies in accumulation, but also can not forget to comb.

Today, we are going to introduce an open source project called Wiki.js that is specifically designed to build a wiki platform to help you sort out your knowledge

Address: github.com/requarks/wi…

It is a lightweight, powerful open source wiki project with comments, Markdown editor, image uploads, tagging, global search, co-editing, edit history, user management, Google Analytics, and a high degree of customization.

The technology stack is different from the old wiki system, using Node.js, PostgreSQL, vue.js, Docker, etc. One key deployment based on Docker implementation, quite WordPress wind, not too cool!

Its support for Chinese is key, and its simple and aesthetically pleasing interface is enough to make it stand out from other similar projects.

Are your hands itching when you see this? Let’s get it going with me!

Second, the installation

One of the most important elements of a successful open source project is well-documented, and installation instructions are the most important.

The wiki.js official documentation provides multiple deployment methods, including: Linux, macOS, Windows, Docker, K8S, etc. It covers almost all possibilities and is very comprehensive.

I’ll introduce you to one of the fastest and most common, docker-based Docker Compose deployment.

Tips: If you don’t understand Docker, follow this step-by-step guide

I will mainly introduce the installation steps for Linux, but not for other systems with desktop versions.

If you have Docker on your machine, it only takes two steps to install it.

Docker-compose install docker-compose

1, download

The curl -l https://get.daocloud.io/docker/compose/releases/download/v2.4.1/docker-compose- ` ` uname - s - ` uname -m ` > /usr/local/bin/docker-composeCopy the code

2. Add execute permission

$ sudo chmod +x /usr/local/bin/docker-compose
Copy the code

3. Create shortcuts

$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Copy the code

At this point, you can use docker-compose anywhere.

Step 2, run docker-compose:

Docker-comemess. yml: docker-comemess. yml: docker-comemess. yml: docker-comemess. yml

The whole project is divided into two parts: database and project code, corresponding to pg container and Wiki container.

version: "3"
services:

  db:
    container_name: pg
    image: postgres:11-alpine
    environment:
      POSTGRES_DB: wiki
      POSTGRES_PASSWORD: wikijsrocks
      POSTGRES_USER: wikijs
    logging:
      driver: "none"
    restart: unless-stopped
    volumes:
      - db-data:/var/lib/postgresql/data

  wiki:
    container_name: wiki
    image: ghcr.io/requarks/wiki:2
    depends_on:
      - db
    environment:
      DB_TYPE: postgres
      DB_HOST: db
      DB_PORT: 5432
      DB_USER: wikijs
      DB_PASS: wikijsrocks
      DB_NAME: wiki
    restart: unless-stopped
    ports:
      - "8001:3000"

volumes:
  db-data:
Copy the code

2. In the configuration directory, run the following command:

  • Run:docker-compose up -d
  • View containers:docker ps
  • Stop:docker-compose down

Finally, if you want to turn HTTPS on, I recommend Caddy servers. It doesn’t matter if you haven’t. We’ve written about Caddy and it’s very simple.

The configuration of Caddyfile is as follows:

Port 8001 corresponds to the port port mapping of the wiki container above

Domain name {reverse_proxy 127.0.0.1:8001}Copy the code

Run caddy start to start the caddy server, visit the corresponding domain name in the browser, and the website initialization boot interface will appear in front of you.

So that’s how you installed Wiki.js. Are you up and running?

Three, the flaws outweigh the flaws

Wiki.js is by no means perfect, and while I’m just getting started, there are still a few flaws:

  • The loading speed of the first access is slow

  • While Wiki.js is actively updated and submitted frequently, it does not currently support custom themes

  • Not friendly to Chinese search, Chinese search is not supported by default, you need to use ES but it is no longer light weight, or use PG plug-in to support Chinese word segmentation

  • The coverage rate of Chinese translation is not 100% as shown on the official website, and there are still some untranslated places in the management background

But the flaws don’t outweigh the flaws. It basically implements all the features I want for a wiki. And it’s better than building a wiki system from scratch. I’ll make a new website using Wiki.js:

cheatsheet.store/

I will contribute PR to wiki.js as soon as I get my hands on it. Look forward to a stronger wiki.js!

Four, the last

Knowledge needs to be integrated.

Knowledge is desultorily, but it is necessary to establish connections and become orderly through practical experience, so as to be handy and release powerful creativity.

Finally, use Wiki.js to build your knowledge network, comb through the existing knowledge and keep bringing forth new ideas, so that it can help you on the road to higher breakthroughs!

More articles on open source projects can be found at github.com/HelloGitHub…