diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..5f97f08f37 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.git +/vendor +/docs diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index ac272915bc..bc5831b87c 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -30,20 +30,26 @@ jobs: run: | docker build -t jeedom:bullseye --build-arg DEBIAN=bullseye --build-arg DATABASE=1 . - name: run jeedom:bullseye and check - # build current image for bullseye and check it + # run current image for bullseye and check it run: | docker run -p 80:80 -d --rm --name jeedom_bullseye jeedom:bullseye - sleep 45 + until [ "`docker inspect -f {{.State.Health.Status}} jeedom_bullseye`" == "healthy" ]; do + echo "waiting container to be healthy..." + sleep 5; + done; docker exec jeedom_bullseye php sick.php - name: Build jeedom:bookworm # build current image for bookworm run: | docker build -t jeedom:bookworm --build-arg DEBIAN=bookworm --build-arg DATABASE=1 . - name: run jeedom:bookworm and check - # build current image for bookworm and check it + # run current image for bookworm and check it run: | docker run -p 81:80 -d --rm --name jeedom_bookworm jeedom:bookworm - sleep 45 + until [ "`docker inspect -f {{.State.Health.Status}} jeedom_bookworm`" == "healthy" ]; do + echo "waiting container to be healthy..." + sleep 5; + done; docker exec jeedom_bookworm php sick.php - name: Clean docker image diff --git a/Dockerfile b/Dockerfile index 37a75bffed..5d8260ab2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,30 +35,53 @@ VOLUME /var/lib/mysql #speed up build using docker cache RUN apt update -y -RUN apt -o Dpkg::Options::="--force-confdef" -y install software-properties-common \ +RUN apt -o Dpkg::Options::="--force-confdef" -y -q install software-properties-common \ ntp ca-certificates unzip curl sudo cron locate tar telnet wget logrotate dos2unix ntpdate htop \ iotop vim iftop smbclient git python3 python3-pip libexpat1 ssl-cert \ apt-transport-https xvfb cutycapt xauth at mariadb-client espeak net-tools nmap ffmpeg usbutils \ gettext libcurl3-gnutls chromium librsync-dev ssl-cert iputils-ping \ apache2 apache2-utils libexpat1 ssl-cert \ php libapache2-mod-php php-json php-mysql php-curl php-gd php-imap php-xml php-opcache php-soap php-xmlrpc \ - php-common php-dev php-zip php-ssh2 php-mbstring php-ldap php-yaml php-snmp && apt -y remove brltty + php-common php-dev php-zip php-ssh2 php-mbstring php-ldap php-yaml php-snmp \ + npm && \ + # install npm, and node with fixed version + npm install n -g && n 20.18.1 && \ + #clean + apt -y remove brltty -COPY install/install.sh /tmp/ -RUN sh /tmp/install.sh -s 1 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -RUN sh /tmp/install.sh -s 2 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -RUN sh /tmp/install.sh -s 3 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -RUN sh /tmp/install.sh -s 4 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -RUN sh /tmp/install.sh -s 5 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker +COPY --chown=root:root --chmod=550 install/install.sh /root/ +# install step by step : step_1_upgrade ... useless, using the LATEST debian +# RUN sh /root/install.sh -s 1 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker +# step_2_mainpackage ... useless, already installed before +# RUN sh /root/install.sh -s 2 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker +# step_3_database ... only if $DATABASE +RUN sh /root/install.sh -s 3 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker +# step_4_apache +RUN sh /root/install.sh -s 4 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker +# step_5_php : install php with extensions +RUN sh /root/install.sh -s 5 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker +# step 6 : copy jeedom source files from local COPY . ${WEBSERVER_HOME} -RUN sh /tmp/install.sh -s 7 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -RUN sh /tmp/install.sh -s 8 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -RUN sh /tmp/install.sh -s 9 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -RUN sh /tmp/install.sh -s 10 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker -RUN sh /tmp/install.sh -s 11 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker +# step_7_jeedom_customization_mariadb +RUN sh /root/install.sh -s 7 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker +# step_8_jeedom_customization +RUN sh /root/install.sh -s 8 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker +# step_9_jeedom_configuration +RUN sh /root/install.sh -s 9 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker +# step_10_jeedom_installation : install composer +COPY --from=composer/composer:latest-bin /composer /usr/bin/composer +RUN composer install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-scripts --optimize-autoloader +# RUN sh /root/install.sh -s 10 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker +# step_11_jeedom_post +RUN sh /root/install.sh -s 11 -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} -i docker + RUN apt-get clean && rm -rf /var/lib/apt/lists/* RUN echo >${WEBSERVER_HOME}/initialisation +# check if apache is running +HEALTHCHECK --interval=1m --timeout=3s --retries=5 --start-period=10s --start-interval=5s \ + CMD curl -f http://localhost/ || exit 1 + WORKDIR ${WEBSERVER_HOME} EXPOSE 80 EXPOSE 443 diff --git a/composer.lock b/composer.lock index b78c8572c4..93a47dbb71 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6d3817ee337cc5ed162b1e9463030e8a", + "content-hash": "4344ceaeab5759906dcf9b486f5a7cef", "packages": [ { "name": "bacon/bacon-qr-code", @@ -59,72 +59,7 @@ "source": "https://github.com/Bacon/BaconQrCode/tree/2.0.8" }, "time": "2022-12-07T17:46:57+00:00" - }, - { - "name": "clue/stream-filter", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/clue/stream-filter.git", - "reference": "049509fef80032cb3f051595029ab75b49a3c2f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/clue/stream-filter/zipball/049509fef80032cb3f051595029ab75b49a3c2f7", - "reference": "049509fef80032cb3f051595029ab75b49a3c2f7", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "Clue\\StreamFilter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering" - } - ], - "description": "A simple and modern approach to stream filtering in PHP", - "homepage": "https://github.com/clue/stream-filter", - "keywords": [ - "bucket brigade", - "callback", - "filter", - "php_user_filter", - "stream", - "stream_filter_append", - "stream_filter_register" - ], - "support": { - "issues": "https://github.com/clue/stream-filter/issues", - "source": "https://github.com/clue/stream-filter/tree/v1.7.0" - }, - "funding": [ - { - "url": "https://clue.engineering/support", - "type": "custom" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2023-12-20T15:40:13+00:00" + "time": "2022-12-07T17:46:57+00:00" }, { "name": "dasprid/enum", @@ -210,7 +145,7 @@ }, "autoload": { "psr-4": { - "Cron\\": "src/Cron/" + "Clue\\StreamFilter\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -226,8 +161,13 @@ ], "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", "keywords": [ - "cron", - "schedule" + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", @@ -241,56 +181,6 @@ ], "time": "2024-10-09T13:47:03+00:00" }, - { - "name": "influxdata/influxdb-client-php", - "version": "3.6.0", - "source": { - "type": "git", - "url": "https://github.com/influxdata/influxdb-client-php.git", - "reference": "3606b12214508f22126b7ed0565d53380674312a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/influxdata/influxdb-client-php/zipball/3606b12214508f22126b7ed0565d53380674312a", - "reference": "3606b12214508f22126b7ed0565d53380674312a", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "php": ">=7.2", - "php-http/client-common": "^2.2.1", - "php-http/discovery": "^1.9.1", - "psr/http-client": "^1.0.1" - }, - "require-dev": { - "guzzlehttp/guzzle": "^7.0.1", - "guzzlehttp/psr7": "^2.0.0", - "phpunit/phpunit": "^8.5.27", - "squizlabs/php_codesniffer": "~3.7" - }, - "type": "library", - "autoload": { - "psr-4": { - "InfluxDB2\\": "src/InfluxDB2" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "InfluxDB (v2+) Client Library for PHP", - "homepage": "https://www.github.com/influxdata/influxdb-client-php", - "keywords": [ - "influxdb" - ], - "support": { - "issues": "https://github.com/influxdata/influxdb-client-php/issues", - "source": "https://github.com/influxdata/influxdb-client-php/tree/3.6.0" - }, - "time": "2024-06-24T10:01:53+00:00" - }, { "name": "paragonie/constant_time_encoding", "version": "v2.7.0", @@ -305,347 +195,6 @@ "reference": "52a0d99e69f56b9ec27ace92ba56897fe6993105", "shasum": "" }, - "require": { - "php": "^7|^8" - }, - "require-dev": { - "phpunit/phpunit": "^6|^7|^8|^9", - "vimeo/psalm": "^1|^2|^3|^4" - }, - "type": "library", - "autoload": { - "psr-4": { - "ParagonIE\\ConstantTime\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com", - "role": "Maintainer" - }, - { - "name": "Steve 'Sc00bz' Thomas", - "email": "steve@tobtu.com", - "homepage": "https://www.tobtu.com", - "role": "Original Developer" - } - ], - "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", - "keywords": [ - "base16", - "base32", - "base32_decode", - "base32_encode", - "base64", - "base64_decode", - "base64_encode", - "bin2hex", - "encoding", - "hex", - "hex2bin", - "rfc4648" - ], - "support": { - "email": "info@paragonie.com", - "issues": "https://github.com/paragonie/constant_time_encoding/issues", - "source": "https://github.com/paragonie/constant_time_encoding" - }, - "time": "2024-05-08T12:18:48+00:00" - }, - { - "name": "php-http/client-common", - "version": "2.7.2", - "source": { - "type": "git", - "url": "https://github.com/php-http/client-common.git", - "reference": "0cfe9858ab9d3b213041b947c881d5b19ceeca46" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/0cfe9858ab9d3b213041b947c881d5b19ceeca46", - "reference": "0cfe9858ab9d3b213041b947c881d5b19ceeca46", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/httplug": "^2.0", - "php-http/message": "^1.6", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0 || ^2.0", - "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0 || ^7.0", - "symfony/polyfill-php80": "^1.17" - }, - "require-dev": { - "doctrine/instantiator": "^1.1", - "guzzlehttp/psr7": "^1.4", - "nyholm/psr7": "^1.2", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "phpspec/prophecy": "^1.10.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7" - }, - "suggest": { - "ext-json": "To detect JSON responses with the ContentTypePlugin", - "ext-libxml": "To detect XML responses with the ContentTypePlugin", - "php-http/cache-plugin": "PSR-6 Cache plugin", - "php-http/logger-plugin": "PSR-3 Logger plugin", - "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" - }, - "type": "library", - "autoload": { - "psr-4": { - "Http\\Client\\Common\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Common HTTP Client implementations and tools for HTTPlug", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "common", - "http", - "httplug" - ], - "support": { - "issues": "https://github.com/php-http/client-common/issues", - "source": "https://github.com/php-http/client-common/tree/2.7.2" - }, - "time": "2024-09-24T06:21:48+00:00" - }, - { - "name": "php-http/discovery", - "version": "1.20.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/discovery.git", - "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d", - "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0|^2.0", - "php": "^7.1 || ^8.0" - }, - "conflict": { - "nyholm/psr7": "<1.0", - "zendframework/zend-diactoros": "*" - }, - "provide": { - "php-http/async-client-implementation": "*", - "php-http/client-implementation": "*", - "psr/http-client-implementation": "*", - "psr/http-factory-implementation": "*", - "psr/http-message-implementation": "*" - }, - "require-dev": { - "composer/composer": "^1.0.2|^2.0", - "graham-campbell/phpspec-skip-example-extension": "^5.0", - "php-http/httplug": "^1.0 || ^2.0", - "php-http/message-factory": "^1.0", - "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", - "sebastian/comparator": "^3.0.5 || ^4.0.8", - "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1" - }, - "type": "composer-plugin", - "extra": { - "class": "Http\\Discovery\\Composer\\Plugin", - "plugin-optional": true - }, - "autoload": { - "psr-4": { - "Http\\Discovery\\": "src/" - }, - "exclude-from-classmap": [ - "src/Composer/Plugin.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", - "homepage": "http://php-http.org", - "keywords": [ - "adapter", - "client", - "discovery", - "factory", - "http", - "message", - "psr17", - "psr7" - ], - "support": { - "issues": "https://github.com/php-http/discovery/issues", - "source": "https://github.com/php-http/discovery/tree/1.20.0" - }, - "time": "2024-10-02T11:20:13+00:00" - }, - { - "name": "php-http/httplug", - "version": "2.4.1", - "source": { - "type": "git", - "url": "https://github.com/php-http/httplug.git", - "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4", - "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/promise": "^1.1", - "psr/http-client": "^1.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", - "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eric GELOEN", - "email": "geloen.eric@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "HTTPlug, the HTTP client abstraction for PHP", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "http" - ], - "support": { - "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.4.1" - }, - "time": "2024-09-23T11:39:58+00:00" - }, - { - "name": "php-http/message", - "version": "1.16.2", - "source": { - "type": "git", - "url": "https://github.com/php-http/message.git", - "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/06dd5e8562f84e641bf929bfe699ee0f5ce8080a", - "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a", - "shasum": "" - }, - "require": { - "clue/stream-filter": "^1.5", - "php": "^7.2 || ^8.0", - "psr/http-message": "^1.1 || ^2.0" - }, - "provide": { - "php-http/message-factory-implementation": "1.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.6", - "ext-zlib": "*", - "guzzlehttp/psr7": "^1.0 || ^2.0", - "laminas/laminas-diactoros": "^2.0 || ^3.0", - "php-http/message-factory": "^1.0.2", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "slim/slim": "^3.0" - }, - "suggest": { - "ext-zlib": "Used with compressor/decompressor streams", - "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", - "laminas/laminas-diactoros": "Used with Diactoros Factories", - "slim/slim": "Used with Slim Framework PSR-7 implementation" - }, - "type": "library", - "autoload": { - "files": [ - "src/filters.php" - ], - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "HTTP Message related tools", - "homepage": "http://php-http.org", - "keywords": [ - "http", - "message", - "psr-7" - ], - "support": { - "issues": "https://github.com/php-http/message/issues", - "source": "https://github.com/php-http/message/tree/1.16.2" - }, - "time": "2024-10-02T11:34:13+00:00" - }, - { - "name": "php-http/promise", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/php-http/promise.git", - "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83", - "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83", - "shasum": "" - }, "require": { "php": "^7.1 || ^8.0" }, @@ -679,10 +228,11 @@ "promise" ], "support": { - "issues": "https://github.com/php-http/promise/issues", - "source": "https://github.com/php-http/promise/tree/1.3.1" + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" }, - "time": "2024-03-15T13:55:21+00:00" + "time": "2024-05-08T12:18:48+00:00" }, { "name": "pragmarx/google2fa", @@ -952,164 +502,6 @@ }, "time": "2023-09-23T14:17:50+00:00" }, - { - "name": "psr/http-factory", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", - "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "psr/http-message": "^1.0 || ^2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-factory" - }, - "time": "2024-04-15T12:06:14+00:00" - }, - { - "name": "psr/http-message", - "version": "2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", - "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/2.0" - }, - "time": "2023-04-04T09:54:51+00:00" - }, - { - "name": "psr/log", - "version": "1.1.4", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" - }, - "time": "2021-05-03T11:20:27+00:00" - }, { "name": "symfony/cache", "version": "v5.4.46", @@ -1161,11 +553,8 @@ }, "type": "library", "autoload": { - "psr-4": { - "Symfony\\Component\\Cache\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "function.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1184,10 +573,6 @@ ], "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", "homepage": "https://symfony.com", - "keywords": [ - "caching", - "psr6" - ], "support": { "source": "https://github.com/symfony/cache/tree/v5.4.46" }, @@ -1230,12 +615,12 @@ }, "type": "library", "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, "branch-alias": { "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -1305,12 +690,12 @@ }, "type": "library", "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, "branch-alias": { "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -1416,75 +801,6 @@ ], "time": "2024-10-04T14:55:40+00:00" }, - { - "name": "symfony/options-resolver", - "version": "v5.4.45", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", - "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.45" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-25T14:11:13+00:00" - }, { "name": "symfony/polyfill-php73", "version": "v1.31.0", @@ -1591,6 +907,7 @@ ], "psr-4": { "Symfony\\Polyfill\\Php80\\": "" + "Symfony\\Polyfill\\Php80\\": "" }, "classmap": [ "Resources/stubs" @@ -1601,6 +918,10 @@ "MIT" ], "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, { "name": "Ion Bazan", "email": "ion.bazan@gmail.com" @@ -1668,12 +989,12 @@ }, "type": "library", "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, "branch-alias": { "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -1860,14 +1181,10 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": {}, + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, - "platform": { - "php": ">=7.4" - }, + "platform": {}, "platform-dev": {}, - "platform-overrides": { - "php": "7.4" - }, "plugin-api-version": "2.6.0" } diff --git a/install/OS_specific/Docker/init.sh b/install/OS_specific/Docker/init.sh index 1bb9c50f77..aa24029749 100644 --- a/install/OS_specific/Docker/init.sh +++ b/install/OS_specific/Docker/init.sh @@ -25,15 +25,22 @@ docker_stop() { echo "${JAUNE}Stopping Jeedom container${NORMAL}" echo "${VERT}Stopping Apache gracefully${NORMAL}" service apache2 stop - if [[ 1 -eq ${ISMARIABDBINSTALLED} ]]; then + # check if mariadb is installed + dpkg --list mariadb-server > /dev/null 2>&1 + status=$? + ISMARIADBSERVER=$(( 1 - ${status} )) + if [[ 1 -eq ${ISMARIADBSERVER} ]]; then echo "${VERT}Stopping Database gracefully${NORMAL}" service mariadb stop + else + echo "${VERT}no mariadb server${NORMAL}" fi + echo "${VERT}Stopping ATD gracefully${NORMAL}" service atd stop + echo "${VERT}Stoping CRON${NORMAL}" + service cron stop echo "${ROUGE}Requesting stop on init.sh${NORMAL}" - echo "${VERT}Killing CRON${NORMAL}" - killall cron exit 0 } @@ -81,10 +88,15 @@ if [ -f ${WEBSERVER_HOME}/core/config/common.config.php ]; then else echo 'Start jeedom installation' JEEDOM_INSTALL=0 - rm -rf /root/install.sh - wget https://raw.githubusercontent.com/jeedom/core/${VERSION}/install/install.sh -O /root/install.sh - chmod +x /root/install.sh - /root/install.sh -s 6 -v ${VERSION} -w ${WEBSERVER_HOME} + + # do not re-install jeedom + if [ ! -f ${WEBSERVER_HOME}/core/config/common.config.sample.php ]; then + echo 'download again Jeedom' + /root/install.sh -s 6 -v ${VERSION} -w ${WEBSERVER_HOME} + # jeedom installation : install composer + /root/install.sh -s 10 -v ${VERSION} -w ${WEBSERVER_HOME} -i docker + fi + if [ $(which mysqld | wc -l) -ne 0 ]; then chown -R mysql:mysql /var/lib/mysql mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/ @@ -101,8 +113,14 @@ else sed -i "s/#USERNAME#/jeedom/g" ${WEBSERVER_HOME}/core/config/common.config.php sed -i "s/#PORT#/3306/g" ${WEBSERVER_HOME}/core/config/common.config.php sed -i "s/#HOST#/localhost/g" ${WEBSERVER_HOME}/core/config/common.config.php - /root/install.sh -s 10 -v ${VERSION} -w ${WEBSERVER_HOME} - /root/install.sh -s 11 -v ${VERSION} -w ${WEBSERVER_HOME} + # init database + php ${WEBSERVER_HOME}/install/install.php mode=force + if [ $? -ne 0 ]; then + echo "${RED}Cannot install Jeedom - Cancelling${NORMAL}" + exit 1 + fi + # jeedom post-install + /root/install.sh -s 11 -v ${VERSION} -w ${WEBSERVER_HOME} -i docker fi fi @@ -148,4 +166,9 @@ service apache2 start echo "Add trap docker_stop" trap "docker_stop $$ ;" 15 -cron -f \ No newline at end of file +# launch cron daemon in background +cron -f & +# hold the cron daemon PID +child=$! +# wait for cron stopping +wait "$child" \ No newline at end of file diff --git a/install/install.sh b/install/install.sh index bb55dafea1..fd14673508 100644 --- a/install/install.sh +++ b/install/install.sh @@ -145,7 +145,7 @@ step_5_php() { step_6_jeedom_download() { echo "---------------------------------------------------------------------" echo "${YELLOW}Starting step 6 - download Jeedom${NORMAL}" - wget https://codeload.github.com/jeedom/core/zip/refs/heads/${VERSION} -O /tmp/jeedom.zip + wget https://codeload.github.com/jeedom/core/zip/refs/heads/${VERSION} -O /tmp/jeedom.zip --no-verbose if [ $? -ne 0 ]; then echo "${YELLOW}Cannot download Jeedom from Github. Use deployment version if exist.${NORMAL}" @@ -184,7 +184,7 @@ step_7_jeedom_customization_mariadb() { echo 'Restart=always' >> /lib/systemd/system/mariadb.service.d/override.conf echo 'RestartSec=10' >> /lib/systemd/system/mariadb.service.d/override.conf - # do not start oany new service during docker build sequence + # do not start any new service during docker build sequence if [ "${INSTALLATION_TYPE}" != "docker" ];then systemctl daemon-reload @@ -331,9 +331,6 @@ step_10_jeedom_installation() { export COMPOSER_ALLOW_SUPERUSER=1 cd ${WEBSERVER_HOME} composer install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-scripts --optimize-autoloader - mkdir -p /tmp/jeedom - chmod 777 -R /tmp/jeedom - chown www-data:www-data -R /tmp/jeedom if [ "${INSTALLATION_TYPE}" != "docker" ];then php ${WEBSERVER_HOME}/install/install.php mode=force @@ -349,6 +346,9 @@ step_10_jeedom_installation() { step_11_jeedom_post() { echo "---------------------------------------------------------------------" echo "${YELLOW}Starting step 11 - Jeedom post-install${NORMAL}" + mkdir -p /tmp/jeedom + chmod 777 -R /tmp/jeedom + chown www-data:www-data -R /tmp/jeedom if [ $(crontab -l | grep jeedom | wc -l) -ne 0 ];then (echo crontab -l | grep -v "jeedom") | crontab - @@ -380,8 +380,10 @@ step_11_jeedom_post() { echo 'tmpfs /tmp/jeedom tmpfs defaults,size=256M 0 0' >> /etc/fstab fi fi - chmod +x ${WEBSERVER_HOME}/resources/install_nodejs.sh - ${WEBSERVER_HOME}/resources/install_nodejs.sh + if [ "${INSTALLATION_TYPE}" != "docker" ];then + chmod +x ${WEBSERVER_HOME}/resources/install_nodejs.sh + ${WEBSERVER_HOME}/resources/install_nodejs.sh + fi echo "${GREEN}Step 11 - Jeedom post-install done${NORMAL}" }