File structure

This article is intended for wiki administrators.

Every Mojowiki is stored in one directory. This document explaints the structure of this directory, what files can be there, and what you should do with them.

You can edit all of the files manually, if you want, just do your best to not break anything.

  • config.json is the configuration file. It is described in full in the repository's config.md.

  • wiki.git/ is the Git repository of the wiki, it has all pages in it. You can edit it directly, but do not forget to make Git commits with your changes and reindex your wiki afterwards, with the button in the admin panel. You can also clone it and publish your changes as a proposal.

  • A page's text is a file named after the page with the .mjm extension: the page hello/world is wiki.git/hello/world.mjm. A media page is a file named after the page with the extension of its format, such as .png.

    • Files named with the old .myco extension are not read as pages any more. An administrator can rename them from the Migration section of the admin panel.

  • static holds static data. You can access data there from your wiki with addresses like /static/image.png.

    • static/favicon.ico is your wiki's favicon, accessed at /favicon.ico by browsers.

    • static/base.css replaces the engine's base stylesheet — the layout, the box model and the breakpoints — if it exists. It is the whole design rather than a theme, so replacing it is a large change. You probably don't need to.

    • static/custom.css is loaded after the base and after the theme. If you want to make visual changes to your wiki, this is where you should do that.

    • static/robots.txt redefines default robots.txt file.

  • tags.json is no longer written. Tags live in each page's own data block; categories.json, if your wiki still has one, is read once by the migration in the admin panel and then left alone.

  • users.json stores the accounts. Passwords are kept as hashes, never as the text you typed. Signed-in sessions are tracked in cache/tokens.json.

  • interwiki.json holds the interwiki configuration.

  • cache/ holds cached data. If you back up your wiki, you can omit this directory.

    • cache/tokens.json holds users' tokens. By deleting specific tokens, you can log out users remotely.

  • Mojomarkup migration markers are hidden files prefixed with .mojomarkup-. You should probably not touch them.

  • .mojowiki.lock is held by the running wiki, so that a second mojowiki on the same directory refuses to start instead of competing for the Git index. The operating system releases it when the process exits, however it exits, so a crashed wiki does not leave a stale lock behind. Do not delete it to "unlock" a wiki: if a wiki says another process is serving it, one really is.

  • .mojowiki-csrf-key is the key that signs the tokens in the wiki's forms. It is kept so a form left open in a browser still submits after a restart. Delete it and every open page's next submit is refused; nothing else breaks.

Every file whose name starts with a dot is ignored by the page indexer, which is why these can sit in the wiki directory without becoming pages.