New User Setup

Federated Wiki migrated to a new method of authentication in November 2016. I had some problems in resurrecting the site I created in September 2016, so I decided to create a new site and document the setup here.

== Server Setup ==

These notes are from my experience of setting up Federated Wiki on an Ubuntu 16.04.1 LTS server on Lightsail from Amazon Web Services.

When logging in through the browser-based terminal in Lightsail, the username is "ubuntu". After logging into the server, enter the following to make sure that all packages on the server are up to date:

sudo apt-get update

All of these commands are using the "sudo" command to install the packages as the root user ("root").

Next, use the following commands to install Node.js and Node Package Manager (NPM):

sudo apt-get install nodejs sudo apt-get install npm

The actual installation of the wiki software is better performed when logged in as root. On the Lightsail server, I did this by entering the following command:

sudo su

Following the instructions from the "Running your own server" section from the Federated Wiki Github repo , I entered the following command:

npm install -g wiki

The wiki software is installed in the .wiki folder within the root account. To start the wiki interactively, enter the following command:

wiki

Since this server is available to the Internet and has a domain, I was able to go to http://fedwiki.andysylvester.com:3000 and view the "Welcome Vistors" page. If this wiki was installed locally on a computer not available to the Internet, then the URL http://localhost:3000 would bring up the welcome page.

Update March 2017 - I have moved this wiki to a Digital Ocean Server. When I did the Node.js installation, and tried to run wiki with just the command "wiki". the app would not start. I had to install another package from NPM as follows:

sudo apt-get install nodejs-legacy

nodejs-legacy makes it possible to run apps by saying node app.js instead of having to use nodejs, an oddity of Ubuntu. Since I am running Ubuntu, it turned out I needed this package.

== Claiming your wiki ==

When the Federated Wiki software is installed, a default security module is configured. This makes the wiki read only. To be able to save changes to a Federated Wiki, the Passport security module (based on Passport.js ) needs to be configured. A brief description of this module is available on Github .

For my wiki, I decided to use the Twitter option for authentication using Passport (general instructions can be found on GitHub ). I was able to follow these instructions for setting up the Twitter application, but I had to work through some details on the setting up of the config.json file.

The following is the text for the template config.json file on the Github page mentioned in the last paragraph.

{ "farm": true, "security_type": "passportjs", "twitter_consumerKey": "CLIENT ID", "twitter_consumerSecret": "CLIENT SECRET", "wikiDomains": { "example.wiki": {} } }

I created this file by logging as root (sudo su), then changing directories to the root directory (cd /root), then changed directory to the wiki root directory (cd .wiki). I then used the Nano text editor to create a file (nano config.json). I entered the text above, copying in the ID and secret from my Twitter application. Finally, since I had a domain assigned, I entered that domain in the config.json file. The final result was:

{ "farm": true, "security_type": "passportjs", "twitter_consumerKey": "My_Twitter_Consumer_Key", "twitter_consumerSecret": "My_Twitter_Consumer_Secret", "wikiDomains": { "fedwiki.andysylvester.com": {} } }

I then was able to start my wiki interactively using the following command:

wiki -p 80

I was able to navigate to my wiki at http://fedwiki.andysylvester.com/ and see the Welcome Vistors page. At the bottom left corner of the browser window, there is a padlock. I clicked on the padlock, and a window opened to allow me to authenticate using my Twitter account information. The Welcome Visitors page now had a yellow border around it. This means that the file is only saved locally. To save the page to the wiki server, click on the flag button at the bottom right of the wiki page. The yellow border will then turn to white. The following video demonstrates this process.

YOUTUBE VVuHGCkSHlg Twitter authentication

== Running a wiki server continuously ==

When Federated Wiki is started from the command line as shown above, it will run until the process is stopped, or when the terminal session is closed. To be able to run Federated Wiki after a terminal session is closed, a script should be run with the proper command.

While logged in as root, I created a file (mywiki.sh) in the root directory, entering the text shown below:

#!/bin/bash nohup sudo wiki -config ~/.wiki/config.json -p 80 > allout.txt 2>&1 & # these two lines are all on one line disown %1

After saving the file, I set permissions using the chmod command:

chmod 755 mywiki.sh

I then executed the script with this command:

./mywiki.sh

== Other topics to add ==

How to get wiki to restart after a server restart

See About Flagmatic Plugin - describes how to pick a new flag

== Other resources ==

Paul Rodwell - Description of server setup on Digital Ocean and wiki installation .

This started the wiki on port 80, and sent all output from the application to allout.txt. After running this script, I was able to close the terminal session and the wiki application was still running.

Online Help - Links to several help pages, including the Better Help page.

Dream Big - Notes from Ward Cunningham on neat/innovative ways to use federated wiki. This is a test.

hihihhh