Welcome Visitors

Pages where we do and share.

You can edit your copy of these pages. Press [+] to add more writing spaces. Read How to Wiki for more ideas. Follow Recent Changes here and nearby.

### Setup This guide uses Vultr but will be almost the same with Digital Ocean, Linode, or others.

### Server Deployment 1. Go to https://vultr.com and make an account 2. Deploy a new Instance 3. Select Cloud Compute 4. Select a CPU. The Regular Performance Intel is the cheapest and likely works just fine 5. Select a close Server Location 6. Select an operating system. We are using Ubuntu 23.04 7. Select a Server Size. The smallest (25gb for Ubuntu machine) is fine for now 8. Auto backups if you want 9. You probably don't need the Additional Features besides maybe IPv6 10. Add an SSH key if you want and (https://www.howtogeek.com/424510/how-to-create-and-install-ssh-keys-from-the-linux-shell/)[know how]. If not you will still be able to SSH through a web 11. Enter whatever you want for host name / label 12. Deploy Now

### Server Setup 1. Either use the web console (three dots -> web console) or ssh from your own machine (ssh user@ip-address) 2. Make and configure a wiki user - You can pretty much follow [this](https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-22-04) guide but replace 'sammy' with 'wiki'. You may do the UFW steps but either do them or use the firewall feature in Vultr.com, not both. Follow the [guide for setting up ssh](https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys-on-ubuntu-22-04) for your new user

### Install NVM and Node 1. We want to use Node Version Manager in case we need to update Node for future wiki updates 2. Go to the fedwiki github, main wiki repo, go to the package.json, and see what version of node they are running under "engines". Use nvm to install the latest stable LTS version that meets these requirements. Example: `nvm install v18.18.1`

### Install NGINX 1. Follow [this guide](https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-22-04)

### Install wiki 1. `npm install -g wiki`

### Connect domain to IP 1. If you purchased a domain, go to your registrar and follow instructions to forward

### Install and configure passport plugin 1. This is so people can log in with oauth 2. type `which wiki` to see the location of your wiki executable. It will be something like `/home/wiki/.nvm/versions/node/v18.18.1/bin/wiki`. If you go to here (`bin`), you will see it points to somewhere in node_modules. probably `../lib/node_modules/wiki`. `cd` there to get into your wiki install 3. Install the plugin by typing `npm install wiki-security-passportjs` 4. Configure it using [this guide](https://github.com/fedwiki/wiki-security-passportjs/blob/ec5359de488665253f6968b581c2a493e1935d67/docs/configuration.md)

### Setup systemd service to automatically run wiki on boot

Create a config file in /home/{user}/config.json. user is `wiki` if you've been following this guide. put the following in it for farm mode: { "farm": true, "debug": false }

`sudo vim /etc/systemd/system/wiki.service` then paste the following in: (remember, in vim you press `i` to enter insert mode. then paste as usual. then press `escape` then `:x` then enter to save and exit)

[Unit] Description=Wiki Service Wants=network-online.target After=network-online.target [Service] Type=simple User=wiki ExecStart=/usr/bin/sudo -H -u wiki /home/wiki/.nvm/versions/node/v18.18.1/bin/node /home/wiki/.nvm/versions/node/v18.18.1/bin/wiki --conf /home/wiki/config.json Restart=always [Install] WantedBy=multi-user.target ~

### Configure NGINX or Caddy

Caddy has a number of attractions, but for the owner of a Federated Wiki farm one of the main attractions is On-Demand TLS, where Caddy will obtain a certificate for a new wiki during the first TLS handshake for a wiki that does not yet have a certificate. Automatic HTTPS (On-Demand TLS)