File: design.mdwn

package info (click to toggle)
ikiwiki-hosting 0.20140613
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 788 kB
  • ctags: 283
  • sloc: perl: 5,124; sh: 182; ansic: 168; makefile: 50
file content (52 lines) | stat: -rw-r--r-- 2,022 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Each site has a hostname, which is a subdomain of one of our domains.
For example, foo.branchable.com.

Each site has an owner, which is an openid. Typically the admin 
is set to the same openid as the owner, but a site may have other admins
who do not own it, and it's also possible for its owner not to be an admin
at all.

A site may also have one or more aliases; domain names that CNAME to its
hostname.

The primary url of a site uses either its hostname, or one of its aliases.
Ikiwiki is configured to use this in its url and cgiurl.

From the hostname, a unique [[username]] is derived. Ikiwiki runs as that user,
and data files associated with the site are stored in the user's home
directory.

Outside the home directory, runtime files for the site are managed in
`/var/www/`, `/var/log/ikiwiki-hosting/`, and [[apacheconfig]].

The home directory has these contents:

* `public_html` - the site's html is here
  (but its cgis are created in /var/www so suidexec can be used)
* `source.git` - bare git repo (or similar for other VCS)
* `source` - checkout of the wiki's source
* `ikiwiki.setup` - config file for the site
* `apache` - directory contains optional apache configs
   ssl certs, etc)
* `tmp` - per-user temp directory

The home directory *itself* is a checkout of a different branch of the
VCS repository, the "setup" branch. Into that branch are checked the
`ikiwiki.setup` file and other configuration and state files. (But
not ssh keys, htpassword files, etc.) Remote users
may not directly commit to that branch.

The [[ikisite]] program handles creating, deleting, and other
administration of these sites.

A [[backupformat]] encapsulates the above into a single file for backups
and transfer.

A [[customersite]] holds information about customers.

## locking

ikisite needs to lock sites as it is creating, deleting, or modifying them,
to prevent concurrency issues. This is done using a directory in `/var`, 
the `lockdir`. The lock files in the lockdir correspond to each site's
username.