]> git.p6c8.net - jirafeau.git/commitdiff
Merge branch 'next-release' master 4.6.2
authorPatrick Canterino <patrick@patrick-canterino.de>
Tue, 4 Mar 2025 14:34:07 +0000 (15:34 +0100)
committerPatrick Canterino <patrick@patrick-canterino.de>
Tue, 4 Mar 2025 14:34:07 +0000 (15:34 +0100)
CHANGELOG.md
Dockerfile
docker-compose.yaml
docker/README.md
docker/docker_config.php
lib/settings.php

index 13564df88c7346570bb950f52528ccd9d1659f52..944d8355f3c762ad01f87237c4d266db17755588 100644 (file)
 5. Follow the installation wizard, it should propose you the same data folder or even update automatically
 6. Check your `/lib/config.local.php` and compare it with the `/lib/config.original.php` to see if new configuration items are available. If a new item is missing in your `config.local.php`, this may trigger some errors as Jirafeau may expect to have them.
 
+## Version 4.6.2
+
+- Allow to configure the language and the availabilities for files for a Docker container (issue [#20](https://gitlab.com/jirafeau/Jirafeau/-/issues/20))
+- Added an example `docker-compose.yaml` file for configuring the Docker container
+- Fixed an error occuring on some systems while building the Docker image (issue [#24](https://gitlab.com/jirafeau/Jirafeau/-/issues/24))
+- Script upload was broken due to a missing `return` statement (issue [#23](https://gitlab.com/jirafeau/Jirafeau/-/issues/23))
+- Upgrade from 4.6.1: in-place upgrade
+
 ## Version 4.6.1
 
 - Removed the download button and the corresponding link for encrypted files from the admin interface
 - Fixed an issue with sending the wrong filesize after decrypting an encrypted file
-- Fixed the possibility to bypass the check for CVE-2022-30110 (prevent preview of SVG images) by sending a manipulated HTTP request with a MIME type like "image/svg+XML".
+- Fixed the possibility to bypass the check for [CVE-2022-30110](https://www.cve.org/CVERecord?id=CVE-2022-30110) (prevent preview of SVG images) by sending a manipulated HTTP request with a MIME type like "image/svg+XML". This issue has subsequently been reported as [CVE-2024-12326](https://www.cve.org/CVERecord?id=CVE-2024-12326).
 - We now provide Docker images for AMD64 and ARM64 systems
 - Lots of code refactoring and cleanup
 - Few more little fixes
index 823c1dd37c4d8a7f2ea60e4b0905225751af4d15..6bf9788ffeeb7d996fb49da713544d9a51fc6b91 100644 (file)
@@ -1,5 +1,6 @@
 FROM php:8.1-fpm-alpine
 LABEL org.opencontainers.image.authors="jerome@jutteau.fr"
+ARG INI="php"
 
 # base install
 RUN apk update && \
@@ -11,7 +12,7 @@ RUN apk update && \
 COPY --chmod=550 docker/cleanup.sh docker/run.sh  /
 COPY --chmod=640 docker/docker_config.php /docker_config.php
 
-COPY docker/php.ini /usr/local/etc/php/php.ini
+COPY docker/${INI}.ini /usr/local/etc/php/php.ini
 COPY docker/lighttpd.conf /etc/lighttpd/lighttpd.conf
 
 # Install Jirafeau
index 6b9c57b7249746a0e060e93c4d608a00b2d83e75..2de68f8e19f9e1aa5bb6338a8e860c053cb8e9ad 100644 (file)
@@ -1,12 +1,31 @@
 services:
   web:
     build:
+      no_cache: true
+      #args:
+        # INI: php_debug #change the ini
       context: . # or ../Dockerfile if we put it in the ./docker folder
     volumes:
       - ./jirafeau_data:/data
     environment:
-      - ADMIN_PASSWORD='p4ssw0rd'
-    
+      ADMIN_PASSWORD: p4ssw0rd
+      #LANG: en
+      #WEB_ROOT: 'my.domain.de'
+      #STYLE: 'my_jirafeau_theme'
+      #DARK_STYLE: 'my_jirafeau_theme'
+      AVAILABILITIES: |
+        {
+          "minute": true,
+          "hour": true,
+          "day": true,
+          "week": true,
+          "fortnight": true,
+          "month": true,
+          "quarter": false,
+          "year": false,
+          "none": false
+        }
     ports:
       - 8080:80
 
+
index 10ee3224e986b53c79bc7930754b38f78ac1426c..d170d70747b1867216f5087519df248445ca9a05 100644 (file)
@@ -20,6 +20,47 @@ cd Jirafeau
 docker build -t your/jirafeau:latest .
 ```
 
+## Docker Compose
+
+You can use the `docker-compose.yaml` from [here](../docker-compose.yaml)
+
+### Run Container
+
+```sh
+docker compose up -d
+```
+
+### Custom Theme
+
+1. copy the theme data from the running container
+
+    ```sh
+    docker compose cp web:/www/media jirafeau_media
+    ```
+
+2. mount the theme data
+
+    ```yaml
+    #....
+    volumes:
+        - ./jirafeau_media/your_theme:/www/media/your_theme
+    ```
+
+3. set the environment variable
+
+    ```yaml
+    # ....
+    environment:
+    STYLE: 'your_theme'
+    DARK_STYLE: 'your_theme'
+    ```
+
+4. run the compose file
+
+    ```sh
+    docker compose up -d
+    ```
+
 ## Security
 
 You may be interested in running Jirafeau on port 80:
@@ -36,8 +77,11 @@ Jirafeau's docker image accepts some options through environment variables to ea
 More details about options in `lib/config.original.php`.
 
 Available options:
+
 - `ADMIN_PASSWORD`: setup a specific admin password. If not set, a random password will be generated.
 - `ADMIN_IP`: set one or more ip allowed to access admin interface (separated by comma).
+- `LANG`: choose the language for jirafeau (default auto).
+- `AVAILABILITIES`: change the array for availablibilities that the user can select (see `docker-compose.yaml` for an example how to do that). Availability is the time the file should be available before it can be deleted.
 - `WEB_ROOT`: setup a specific domain to point at when generating links (e.g. 'jirafeau.mydomain.com/').
 - `VAR_ROOT`: setup a specific path where to place files. default: '/data'.
 - `FILE_HASH`: can be set to `md5`, `partial_md5` or `random` (default).
index 75c6fb8cca3c58fefe62e53f2ab89d7e1646c3ba..6037ec6434c17337d19c033b205d69f904e191c2 100644 (file)
@@ -91,6 +91,26 @@ function env_2_cfg_string_array(&$cfg, $config_name)
     return true;
 }
 
+function env_2_cfg_array_from_json(&$cfg, $config_name)
+{
+    $env_name = strtoupper($config_name);
+    $env_string = getenv($env_name);
+    if ($env_string === false) {
+        return;
+    }
+    $result = json_decode($env_string, true);
+    if (json_last_error() === JSON_ERROR_NONE) {
+        // JSON is valid
+        $c = count($result);
+        echo("setting $config_name array with $c value(s)n\n");
+    } else {
+        echo("ERROR - invalid json for environment key $config_name \n");
+    }
+
+    $cfg[$config_name] = $result;
+    return true;
+}
+
 function setup_admin_password(&$cfg)
 {
     if (strlen($cfg['admin_password']) > 0) {
@@ -165,6 +185,7 @@ function run_setup(&$cfg)
     env_2_cfg_bool($cfg, 'preview');
     env_2_cfg_string($cfg, 'title', false);
     env_2_cfg_string($cfg, 'organisation');
+    env_2_cfg_string($cfg, 'lang');
     env_2_cfg_string($cfg, 'contactperson');
     env_2_cfg_string($cfg, 'style');
     env_2_cfg_string($cfg, 'availability_default');
@@ -179,6 +200,8 @@ function run_setup(&$cfg)
     env_2_cfg_string_array($cfg, 'admin_ip');
     env_2_cfg_string_array($cfg, 'upload_ip_nopassword');
     env_2_cfg_string_array($cfg, 'proxy_ip');
+    // this is a key value based value
+    env_2_cfg_array_from_json($cfg, 'availabilities');
     env_2_cfg_bool($cfg, 'store_uploader_ip');
     env_2_cfg_string($cfg, 'download_password_requirement');
     env_2_cfg_int($cfg, 'download_password_gen_len');
index f0f193e29bc00080bef3ebf013b96189506c69a3..791404ecbddc25ef74ad388c5f60a4edcf79d607 100644 (file)
@@ -43,7 +43,7 @@ if ($cfg['debug'] === true) {
 
 /* Jirafeau package */
 define('JIRAFEAU_PACKAGE', 'Jirafeau');
-define('JIRAFEAU_VERSION', '4.6.1');
+define('JIRAFEAU_VERSION', '4.6.2');
 
 define('JIRAFEAU_WEBSITE', 'https://gitlab.com/jirafeau/Jirafeau');
 

patrick-canterino.de