Local Fedwiki Farm

Serving a local Fedwiki Farm on OSX involves the following steps:

  • Create Wiki Network
  • Start local wiki farm
  • Configure Bonjour to serve local domains

There seem to be roughly three ways to configure / hack the DNS on the LAN in order that different "local domains" point to the same IP address on the LAN - therefore allowing wiki-in-farm-mode to serve different sites:

# Detecting servers on the network

For convenience in the studio we need to be able to detect running servers that are made available on the local network. For that we are advised to use zeroconf.

We have a number of options in terms of implementations:

1. Use Livecode's mergeBonjour 1. Use dns-sd cli 1. Manipulate a DNS Server you control 1. Run your own DHCP / DNS Server locally

For testing and to serve our initial needs we only need to deal with Mac based laptops and mobile devices. Ultimately we will need solutions for Linux, Android and Window - going down the zeroconf line will suite us well in the longer term.

# Use dns-sd

The following command registers a locally running Fedwiki site (being served on the default 3000 port):

dns-sd -P Fedwiki _http._tcp local 3000 fedwiki.local david.local path=/

in a way in which it can be reached using a local browser by:

http://fedwiki.local.:3000/view/welcome-visitors

You can use dns-sd to point a local domain to a url togetehr with a path, and this path can be used by Fedwiki to lay out a long Lineup of pages when the network user goes to their local home domain.

dns-sd -P Viral _http._tcp local 3000 viral.local david.local path=/view/welcome-visitors/david.bovill.me/david-bovill/google.local:3000/google/plonker.local:3000/plonkers/view/local-hosting Registering Service Viral._http._tcp.local host viral.local port 3000 TXT path=/view/welcome-visitors/david.bovill.me/david-bovill/google.local:3000/google/plonker.local:3000/plonkers/view/local-hosting

The issue here is then how to automatically create a lot of Bonjour records using dnd-sd, given that the tool is supposed to be used mainly in interactive mode.

Manipulate a DNS Server you control

Dynadot or DigitalOcean name servers can be controlled via an REST API. It is therefore possible to dynamically control DNS settings, and this is the basis for altering the services revealed by Zeroconf.

The technique essentially involves setting 3-5 records on your DNS Server and then telling the computers on the LAN to use your DNS Server rather than the ISP's DNS Server. You can find details of how to do this here - dns-sd.org

Run your own DHCP / DNS Server locally

The sofware you can use to run your own local DHCP / DNS server is dnsmasq. It can be installed using brew, looks pretty powerful, but a tad hard to get your head around / configure. I'm not completely clear it plays properly with Yosemite and above - thekelleys.org.uk

There is a useful description of how to use dnsmasq on OSX over at - passingcuriosity.com

DNSmasq provides two services, either of which can be used independently - ubuntu.com

  • DNS service
  • DHCP service (including features relating to network boot)

A local DNS cache can speed up internet browsing because the user's browser will not need to access a domain name server when it looks up a domain name the computer has visited before. DHCP allows the user's computer to allocate network addresses to other computers on the wired or wireless network. A computer needs a unique network address in order to do access the internet. DNSmasq is not designed for so-called "Internet Connection Sharing," however, it does provide a lot of the services needed in the background. With DNSmasq set up, only two additional commands can set up internet connection sharing.