README.md 2.65 KB
Newer Older
1 2
# Installation

p4bl0's avatar
typos  
p4bl0 committed
3
## Requirements
4

p4bl0's avatar
typos  
p4bl0 committed
5
Any webserver with PHP and its SQLite3 extension, plus optionnaly its Zip extension.
6 7 8 9 10 11 12

On Debian and derivatives, `sudo apt install nginx php-fpm php-sqlite3 php-zip` is sufficient.

## Single-user mode

1. Drop the `cigala.php`, `cigala.css`, and `cigala.png` files in any web-facing directory that your web server has write-permission for.

13
2. Edit the default credentials in `cigala.php` (you will find them on line 19).
14 15 16 17 18

3. Go to `cigala.php` in your web browser, log in and start editing your website.

4. That's it!

p4bl0's avatar
typos  
p4bl0 committed
19
## Multi-user mode
20 21 22 23 24 25 26 27 28

This guide assume the use of the `example.com` domain name.
Adapt to use your own.

1. Configure your web server to point `example.com` to a directory (we'll call it `root`)

2. Next to the `root` directory (e.g., in the same parent directory), create a `users` and a `deleted` directory and give your web server write-permission to them.
Make sure neither the `users` not the `deleted` are web-facing (i.e., that they're not publicly accessible).

p4bl0's avatar
typos  
p4bl0 committed
29
3. Configure your web server to point `*ANY*.example.com` to `users/*ANY*`.
30 31 32

4. Make sure you have properly configured HTTPS (you can use Let's Encrypt free certificate including for the wildcard subdomain).

p4bl0's avatar
p4bl0 committed
33 34 35 36 37
5. Drop the `cigala.php`, `cigala.css`, `cigala.png`, `config.php`, `register.php`, `account.php` and `manage.php` files in the `root` directory.

    * `register.php` is the registration form,
    * `account.php` is the account management form (forgotten password, updating email),
    * `manage.php` is the admin interface, it shows all account and allow to update their password, change their disk quota, and delete them.
38

p4bl0's avatar
p4bl0 committed
39
6. Edit the `config.php` file to choose your admin credentials.
40

p4bl0's avatar
p4bl0 committed
41
7. Also update `config.php` if necessary: “home” should be the path to our `users` directory, “delete” should be the path to our `deleted` directory, and “users” should be the path to the SQLite database we will create in the next installation step.
42

p4bl0's avatar
p4bl0 committed
43
8. Create the users database (and then make sure the web server has write-permission for it). Here we assume the file is called `users.db`:
44 45 46 47

        $ sqlite3 users.db
        sqlite> create table users (name TEXT PRIMARY KEY, password TEXT, email TEXT, token TEXT);

p4bl0's avatar
p4bl0 committed
48
9. If you want to protect some subdomains from registration (e.g., if you want to redirect `www.example.com` to `example.com`) you can register a fake “www” user:
49

p4bl0's avatar
typos  
p4bl0 committed
50
        sqlite> insert into users values ('www', '', '', random());
51 52 53

    Another possibility is to register the “www” user normally using the `register.php` form and use it to edit the `example.com` landing page.
    You can do that by creating a symlinks from `users/www` to `root`.