Farm Mode

-f or --farm triggers farm mode.

By default this is "promiscuous", meaning that a wiki will be built for any domain name that is used to access the server.

So we need the wikiDomains or allowed arguments.

wikiDomains is apparently a complex JSON object that can only be specified in a config file.

To study the source on how arguments are used, we need these files: GitHub farm.coffee GitHub cli.coffee

allowed is either * or a comma-separated list of host domains. * allows any site for which a directory exists.

This guy blogged about setting up a farm for educational purposes. hapgood.us

Farm scripts from Ward https://github.com/WardCunningham/farm-scripts

Host a Site discusses site farms.

When `allowed` is set to `"*"`, Wiki acts as if the host domain was explicitly provided. It fills in the missing files if the directory is empty. This works even if the server had previously had a request for that host domain before the directory was created.

If the directory is deleted, it's not exactly clear what the behavior is—the server seems to return the page or otherwise act falsely successful, but the directory doesn't get re-created. Once the server restarts the "site doesn't exist" message is returned as expected. So it seems best to restart the server upon deleting a directory to avoid ambiguity.