💾 Archived View for jb55.com › ward.asia.wiki.org › federated-wiki-on-digital-ocean captured on 2021-12-05 at 23:47:19. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-04)

-=-=-=-=-=-=-

Federated Wiki on Digital Ocean

At some point you may want to run your own Federated Wiki site, or perhaps set one up for friends or a class. We've had good luck installing on Digital Ocean, which currently offers very cheap hosting and a much simpler setup than services such as Amazon Web Services.

Before You Start

Before you start there are some things to consider. You will very probably want a name to access your Federated Wiki, you will need to get yourself a domain, ask a friend or colleague for a domain name registrar that they use and like/trust.

Digital Ocean provides some tutorials to walk you though the various steps, we will be referring to them as we step through initial server setup, and installing the Federated Wiki server.

Creating a Server

First, sign up for Digital Ocean. html

html

Once the sign up is complete you will have the option to create a new `droplet`.

The following will help you when following the tutorial. * A name for the droplet, e.g. `fedwiki`, * Choose a size, for a personal site or a small group site, we've found the $5/month option works perfectly fine. * A datacenter, choose one that is in the same area as you. * Choose an image, we will choose `Ubuntu 14.04.3 x32` which is the current 'Long Term Support' version of Ubuntu *supported until during 2019*. With less than 3GB of memory, it is recommended to use a 32-bit operating system. * It is recommended to use a SSH key to connect to the server, if you don't already have one click on `New SSH Key` to create one. tutorial

tutorial

tutorial

You should now have created a droplet, and be connected to it.

Server Setup

We are going to follow the steps in the `New Ubuntu 14.04 Server Checklist`

tutorial

tutorial

tutorial

tutorial

In the second tutorial replace `demo` with `wiki`. We will use this `wiki` account to run our Federated Wiki server later.

We will also setup the server to install patches automatically.

The recommended method for performing unattended upgrades is to use the `unattended-upgrades` package. Configuration is covered in in a tutorial and guide.

tutorial

guide

Some upgrades can require a server reboot, it is best to configure unattended upgrades to do this automatically.

In `/etc/apt/apt.conf.d/50unattended-upgrades` check that `Unattended-Upgrade::Automatic-Reboot` is `true`. **Also** ensure the `update-notifier-common` package is installed.

Also in `/etc/apt/apt.conf.d/50unattended-upgrades` you can uncomment the line

to apply updates as well as security patches. This will be needed if you choose to update Node.js automatically.

Node.js Install

We will install Node.js using the package manager. guide.

guide

Some of the Federated Wiki components include native code, so also install the optional build tools.

You will want to monitor for Node.js Security Updates, forum, or blog.

forum

blog

To install a security update, manually run the following commands:

This will also apply any other available updates at the same time.

Alternatively you could configure the unattended upgrade process to also apply Node.js updates.

There are a number of options for using a reverse proxy in front of the Federated Wiki server. Previously we have used Nginx, but currently prefer Caddy for its On-Demand TLS.

Caddy

Federated Wiki Install, and Configuration

We will now install the Federated Wiki software, configure it to restart automatically when the server is restarted.

We will be configuring a reverse proxy to forward request to the wiki server. We currently prefer Caddy, see Federated Wiki with Caddy, but there are also some older notes on Federated Wiki with Nginx.

Federated Wiki with Caddy

Federated Wiki with Nginx

Federated Wiki is installed, and updated, by typing:

Any independent plugins can be added to the wiki where it has been globally installed. For example:

The tutorial uses the `pm2` process manager. Below are instructions for using `init` as a simpler alternative.

tutorial

We can set up a Federated Wiki farm, that will automatically start when then the machine is restarted and we can start, and stop, using `sudo start wiki` and `sudo stop wiki`, by running the following commands, replacing `<user>` with the user you want to run wiki as:

This will use `/home/<user>/config.json` as the configuration file for the wiki. An initial simple initial config file would contain:

If we start the Federated Wiki, `sudo start wiki`, we can check that it is running by typing `curl http://127.0.0.1:3000/` which should return the text `Found. Redirecting to welcome-vistors.html`.

At this point we need to configure the wiki server to use our preferred identity provider, the default providers are either the Passport.js plugin that supports GitHub, Google and/or Twitter github, or the Friends plugin github.

github

github

You will also want to have your reverse proxy (Caddy, or Nginx) configured, so you can test to ensure that the configuration has been successfully done.

Of course DNS would need to be setup to point the names we wish to use to our droplet, see tutorial and tutorial.

tutorial

tutorial

You should now be able to access our new Federated Wiki site.

Next access your new Federated Wiki sites, sign in and claim them.

You will want to periodically: * Backup your wiki pages, * Check for updates to Node.js and wiki