]> git.p6c8.net - jirafeau_project.git/blob - docker/README.md
removed local upload folders localization from this branch
[jirafeau_project.git] / docker / README.md
1 # Jirafeau's Docker image
2
3 ## Run Jirafeau through a pre-made Docker image
4
5 **There are currently no official pre-made Docker images of Jirafeau! The repository mentioned in this section is outdated!**
6
7 Jirafeau is a small PHP application so running it inside a docker container is pretty straightforward.
8
9 ```
10 docker pull mojo42/jirafeau:latest
11 docker run -it --rm -p 8080:80 mojo42/jirafeau:latest
12 ```
13
14 Then connect on [localhost:8080](http://localhost:8080/).
15 The admin console is located on `/admin.php`, check console output to get auto-generated admin password.
16
17 ## Build your own Jirafeau docker image
18
19 ```
20 git clone https://gitlab.com/jirafeau/Jirafeau.git
21 cd Jirafeau
22 docker build -t your/jirafeau:latest .
23 ```
24
25 ## Security
26
27 You may be interested in running Jirafeau on port 80:
28 ```
29 docker run -d -p 80:80 --sysctl net.ipv4.ip_unprivileged_port_start=80 mojo42/jirafeau
30 ```
31
32 Note that Jirafeau image does not provide any SSL/TLS. You may be interested in using [docker compose](https://docs.docker.com/compose/) combined with [Let's Encrypt](https://letsencrypt.org/).
33
34 ## Options
35
36 Jirafeau's docker image accepts some options through environment variables to ease its configuration.
37 More details about options in `lib/config.original.php`.
38
39 Available options:
40 - `ADMIN_PASSWORD`: setup a specific admin password. If not set, a random password will be generated.
41 - `ADMIN_IP`: set one or more ip allowed to access admin interface (separated by comma).
42 - `WEB_ROOT`: setup a specific domain to point at when generating links (e.g. 'jirafeau.mydomain.com/').
43 - `VAR_ROOT`: setup a specific path where to place files. default: '/data'.
44 - `FILE_HASH`: can be set to `md5`, `partial_md5` or `random` (default).
45 - `PREVIEW`: set to 1 or 0 to enable or disable preview.
46 - `TITLE`: set Jirafeau instance title.
47 - `ORGANISATION`: set organisation (in ToS).
48 - `CONTACTPERSON`: set contact person (in ToS).
49 - `STYLE`: apply a specific style from the media folder.
50 - `DARK_STYLE`: apply a specific style for browsers in dark mode.
51 - `AVAILABILITY_DEFAULT`: setup which availability shows by default.
52 - `ONE_TIME_DOWNLOAD`: set to 1 or 0 to enable or disable one time downloads.
53 - `ENABLE_CRYPT`: set to 1 or 0 to enable or disable server side encryption.
54 - `DEBUG`: set to 1 or 0 to enable or disable debug mode.
55 - `MAXIMAL_UPLOAD_SIZE`: maximal file size allowed (expressed in MB).
56 - `UPLOAD_PASSWORD`: set one or more passwords to access Jirafeau (separated by comma).
57 - `UPLOAD_IP`: set one or more ip allowed to upload files (separated by comma).
58 - `UPLOAD_IP_NO_PASSWORD`: set one or more ip allowed to upload files without password (separated by comma).
59 - `PROXY_IP`: set one or more proxy ip (separated by comma).
60 - `STORE_UPLOADER_IP`: set to 1 or 0 to enable or disable keeping sender's IP with the _link_ file.
61 - `DOWNLOAD_PASSWORD_REQUIREMENT`: set to 'optional' (default), 'required' or 'generated' to make a password for downloading optional, required or generated
62 - `DOWNLOAD_PASSWORD_GEN_LEN`: set length of generated download passwords
63 - `DOWNLOAD_PASSWORD_GEN_CHARS`: set characters used for generated download passwords
64 - `DOWNLOAD_PASSWORD_POLICY`: set to 'regex' to use a regular expression to check user provided download passwords for complexity constraints
65 - `DOWNLOAD_PASSWORD_POLICY_REGEX`: regex to check against if password policy is set to regex
66
67 Example:
68 ```
69 docker run -it -p 8080:80 --rm -e ADMIN_PASSWORD='p4ssw0rd' -e WEB_ROOT='jirafeau.mydomain.com/' -e UPLOAD_PASSWORD='foo,bar' -e PREVIEW=0 mojo42/jirafeau:latest
70 ```
71
72 ## Data storage
73
74 Files and links are stored in `/data` by default. Subfolders are automatically created with needed permissions at creation if needed.
75 Note that configuration is not stored in /data.
76
77 Example of using a dedicated volume to store Jirafeau data separately from the container:
78 ```
79 docker volume create jirafeau_data
80 docker run -it --rm -p 8080:80 --mount source=jirafeau_data,target=/data mojo42/jirafeau:latest
81 ```
82
83 ## Few notes
84
85 - `var-...` folder where lives all uploaded data is protected from direct access
86 - Image has been made using [Alpine Linux](https://alpinelinux.org/) with [lighttpd](https://www.lighttpd.net/) which makes the container very light and start very quickly

patrick-canterino.de