diff --git a/.env.dist b/.env.dist index d0726fc..8156deb 100644 --- a/.env.dist +++ b/.env.dist @@ -1,7 +1,12 @@ -# must be the same that SITE_VERSION define in php-fpm/.env +# compose project name. A docker compose project has as its name +# the name of the folder where it is executed (default). +# This setting overrides the default +COMPOSE_PROJECT_NAME=gmo-loki +# must be the same that SITE_VERSION +# define in php-fpm/.env DOCKER_IMAGE_VERSION="3.25" # docker image tag = DOCKER_IMAGE_VERSION DOCKER_IMAGE=gmouchet/wwwgmo-php-fpm NGINX_PORT=8085 PMA_PORT_WEB=8084 -ELASTIC_VERSION=7.17.19 \ No newline at end of file +ELASTIC_VERSION=8.18.2 \ No newline at end of file diff --git a/README.md b/README.md index 7901cc4..fbd430c 100644 --- a/README.md +++ b/README.md @@ -216,3 +216,393 @@ https://www.elastic.co/guide/en/elasticsearch/reference/8.18/docker.html ### 1.0 (2024-03-01) * Created from scratch + + + +Ignorer et passer au contenu +Vous avez dit : +J'ai l'erreur suivante lorsque j'exécute mon ficher docker-compose.yml: +[2025-06-19T16:58:29.674+00:00][ERROR][elasticsearch-service] Unable to retrieve version information from Elasticsearch nodes. security_exception + Root causes: + security_exception: missing authentication credentials for REST request [/_nodes?filter_path=nodes.*.version%2Cnodes.*.http.publish_address%2Cnodes.*.ip] + +Mon fichier docker-compose.yml + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:8.18.2 + container_name: elasticsearch + environment: + - node.name=es01 + - cluster.name=es-docker-cluster + - discovery.type=single-node + - bootstrap.memory_lock=true + - xpack.security.enabled=true + - ELASTIC_PASSWORD=changeme + - xpack.security.http.ssl.enabled=false + - ES_JAVA_OPTS=-Xms1g -Xmx1g + ulimits: + memlock: + soft: -1 + hard: -1 + ports: + - "9200:9200" + - "9300:9300" + volumes: + # - esdata:/usr/share/elasticsearch/data + - wwwgmo-elasticsearch:/usr/share/elasticsearch/data + + kibana: + image: docker.elastic.co/kibana/kibana:8.18.2 + container_name: kibana + depends_on: + - elasticsearch + environment: + - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 + - xpack.security.enabled=false + ports: + - "5601:5601" +ChatGPT a dit : +L’erreur que vous rencontrez est causée par l’activation de la sécurité dans Elasticsearch (xpack.security.enabled=true) sans fournir d’identifiants d’authentification lors de la tentative d’accès à l'API REST. + +🔍 Détail de l'erreur : +security_exception: missing authentication credentials for REST request [/_nodes?...] +Cela signifie que Kibana ou un autre service tente de communiquer avec Elasticsearch sans credentials, alors que ce dernier requiert une authentification. + +✅ Solution 1 : Aligner la sécurité entre Kibana et Elasticsearch + +Actuellement : + +Elasticsearch a xpack.security.enabled=true +Kibana a xpack.security.enabled=false +Ce n’est pas compatible. Kibana doit être configuré pour utiliser les identifiants quand Elasticsearch a la sécurité activée. + +🛠 Modifier la section kibana comme suit : + kibana: + image: docker.elastic.co/kibana/kibana:8.18.2 + container_name: kibana + depends_on: + - elasticsearch + environment: + - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 + - ELASTICSEARCH_USERNAME=elastic + - ELASTICSEARCH_PASSWORD=changeme + ports: + - "5601:5601" +⚠️ Important : On utilise ici ELASTICSEARCH_USERNAME=elastic et ELASTICSEARCH_PASSWORD=changeme, car vous avez défini ce mot de passe dans la variable d'environnement ELASTIC_PASSWORD côté Elasticsearch. +✅ Solution 2 : Désactiver complètement la sécurité (pour développement uniquement) + +Si vous êtes en environnement de test ou de développement local, vous pouvez désactiver la sécurité côté Elasticsearch. + + environment: + - xpack.security.enabled=false +Dans ce cas, gardez aussi Kibana sans sécurité : + + - xpack.security.enabled=false +⚠️ Pas recommandé en production : cette approche désactive les protections d’accès aux données. +🧪 Astuce : Tester si tout fonctionne +Une fois les containers relancés, testez l’accès à Elasticsearch : + +curl -u elastic:changeme http://localhost:9200 +Et pour Kibana : ouvrez http://localhost:5601 dans un navigateur. + +Souhaitez-vous : + +Garder la sécurité activée et intégrer les credentials dans tous les services ? +Ou désactiver la sécurité pour un usage local plus simple ? +Vous avez dit : +Garder la sécurité activée et intégrer les credentials dans tous les services +ChatGPT a dit : +Parfait ! Si vous souhaitez garder la sécurité activée, alors il faut que tous les services clients (comme Kibana) s’authentifient auprès d’Elasticsearch. + +Voici comment ajuster correctement votre docker-compose.yml pour intégrer les identifiants. + +✅ Fichier docker-compose.yml corrigé + +version: "3.8" + +services: + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:8.18.2 + container_name: elasticsearch + environment: + - node.name=es01 + - cluster.name=es-docker-cluster + - discovery.type=single-node + - bootstrap.memory_lock=true + - xpack.security.enabled=true + - xpack.security.http.ssl.enabled=false + - ELASTIC_PASSWORD=changeme + - ES_JAVA_OPTS=-Xms1g -Xmx1g + ulimits: + memlock: + soft: -1 + hard: -1 + ports: + - "9200:9200" + - "9300:9300" + volumes: + - wwwgmo-elasticsearch:/usr/share/elasticsearch/data + + kibana: + image: docker.elastic.co/kibana/kibana:8.18.2 + container_name: kibana + depends_on: + - elasticsearch + environment: + - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 + - ELASTICSEARCH_USERNAME=elastic + - ELASTICSEARCH_PASSWORD=changeme + ports: + - "5601:5601" + +volumes: + wwwgmo-elasticsearch: +🔐 Authentification à l'API Elasticsearch (test via curl) + +Une fois vos conteneurs démarrés, testez si l'accès avec mot de passe fonctionne : + +curl -u elastic:changeme http://localhost:9200 +Réponse attendue : + +{ + "name": "es01", + "cluster_name": "es-docker-cluster", + "cluster_uuid": "...", + "version": { + "number": "8.18.2", + ... + }, + "tagline": "You Know, for Search" +} +✅ Accès à Kibana + +Ouvrez http://localhost:5601 dans votre navigateur. Kibana devrait démarrer sans vous afficher d'erreur liée à la connexion Elasticsearch. + +✅ Recommandation de sécurité (optionnelle) + +Pour un environnement plus sûr : + +Créez un nouvel utilisateur avec des permissions spécifiques pour Kibana, via l’API ou l’interface d’admin de Kibana. +Évitez d'utiliser elastic en production, car c’est un super admin. +Souhaitez-vous un exemple de script pour créer un utilisateur avec rôle personnalisé ? + +Vous avez dit : +Error: [config validation of [elasticsearch].username]: value of "elastic" is forbidden. This is a superuser account that cannot write to system indices that Kibana needs to function. Use a service account token instead. Learn more: https://www.elastic.co/guide/en/elasticsearch/reference/8.0/service-accounts.html + at ensureValidConfiguration (/usr/share/kibana/node_modules/@kbn/core-config-server-internal/src/ensure_valid_configuration.js:44:11) + at Server.preboot (/usr/share/kibana/node_modules/@kbn/core-root-server-internal/src/server.js:181:7) + at Root.preboot (/usr/share/kibana/node_modules/@kbn/core-root-server-internal/src/root/index.js:48:14) + at bootstrap (/usr/share/kibana/node_modules/@kbn/core-root-server-internal/src/bootstrap.js:96:29) + at Command. (/usr/share/kibana/src/cli/serve/serve.js:235:5) +ChatGPT a dit : +Merci pour ce message d’erreur très clair — Kibana refuse catégoriquement d'utiliser l'utilisateur elastic à partir d'Elasticsearch 8, car : + +❌ elastic est un super-utilisateur. Il ne peut pas être utilisé pour que Kibana écrive dans les indices système, ce qui est nécessaire pour qu'il fonctionne correctement. +✅ Solution recommandée : utiliser un service account token + +🔐 Étapes pour créer un Service Account Token pour Kibana : +Lancer Elasticsearch avec sécurité activée +Gardez xpack.security.enabled=true +Assurez-vous que le conteneur Elasticsearch fonctionne +Créer un Service Account Token pour Kibana +Ouvrez un terminal et exécutez : +docker exec -it elasticsearch \ + bin/elasticsearch-service-tokens create kibana kibana-token +Cela génère un token dans ce format : +AAEAAWVsYXN0aWMvY2liYW5hL2tpYmFuYS10b2tlbjoxR3VOSVZzUjZsb3pk... +Mettre à jour votre docker-compose.yml pour Kibana +Supprimez ELASTICSEARCH_USERNAME et ELASTICSEARCH_PASSWORD, et utilisez ELASTICSEARCH_SERVICEACCOUNTTOKEN à la place : + +kibana: + image: docker.elastic.co/kibana/kibana:8.18.2 + container_name: kibana + depends_on: + - elasticsearch + environment: + - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 + - ELASTICSEARCH_SERVICEACCOUNTTOKEN=AAEAAWVsYXN0aWMvY2liYW5hL2tpYmFuYS10b2tlbjoxR3VOSVZzUjZsb3pk... + ports: + - "5601:5601" +(remplace le token par celui généré précédemment) +🔄 Ensuite : + +Redémarre les services : +docker-compose down +docker-compose up -d +Va sur http://localhost:5601 pour voir Kibana se connecter correctement. +🔎 Besoin d'aller plus loin ? + +Si tu préfères créer un utilisateur dédié à Kibana au lieu d’un token de service, je peux aussi te guider pas à pas avec elasticsearch-users ou via l'API REST. + +Souhaites-tu cette alternative ? + +Vous avez dit : +oui +ChatGPT a dit : +Parfait ! Voici comment créer un utilisateur dédié à Kibana, via l'API REST d'Elasticsearch, avec des rôles appropriés pour permettre à Kibana de fonctionner sans utiliser le super-utilisateur elastic. + +🎯 Objectif + +Créer un utilisateur, par exemple kibana_system_user, qui a le rôle kibana_system (prérequis minimum pour que Kibana fonctionne). + +✅ Étapes détaillées + +1. 🔐 Authentifiez-vous avec le super-utilisateur elastic +Exécute cette commande pour vérifier que tu peux parler à Elasticsearch : + +curl -u elastic:changeme http://localhost:9200 +2. 👤 Créer un nouvel utilisateur kibana_system_user +curl -X POST http://localhost:9200/_security/user/kibana_system_user \ + -u elastic:changeme \ + -H "Content-Type: application/json" \ + -d '{ + "password" : "kibanapassword", + "roles" : [ "kibana_system" ], + "full_name" : "Kibana System User", + "email" : "kibana@example.com" + }' +⚠️ Le mot de passe ici est kibanapassword. Tu peux le changer selon tes préférences. + +3. 🔧 Modifier docker-compose.yml pour Kibana +Mets à jour la section Kibana avec ces variables d’environnement : + + kibana: + image: docker.elastic.co/kibana/kibana:8.18.2 + container_name: kibana + depends_on: + - elasticsearch + environment: + - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 + - ELASTICSEARCH_USERNAME=kibana_system_user + - ELASTICSEARCH_PASSWORD=kibanapassword + ports: + - "5601:5601" +4. 🔄 Redémarre les services +docker-compose down +docker-compose up -d +5. ✅ Accès à Kibana +Rends-toi sur http://localhost:5601. Kibana devrait démarrer sans erreur de permission, car il utilise désormais un utilisateur restreint, mais autorisé à accéder aux indices système nécessaires. + +✅ Résumé + +Élément Valeur +Utilisateur Elasticsearch kibana_system_user +Rôle attribué kibana_system +Mot de passe kibanapassword (ou autre) +Avantage Bonne pratique, sécurisé +Souhaites-tu aussi créer un utilisateur pour ingester des données dans Elasticsearch via une application ? + +Vous avez dit : +et tout ca dans un fichier docker-compose +ChatGPT a dit : +Parfait, je vais t’aider à tout intégrer dans un seul docker-compose.yml, avec : + +Elasticsearch sécurisé +Création automatique de l’utilisateur kibana_system_user avec le rôle kibana_system +Kibana configuré pour utiliser cet utilisateur +⚠️ Important : +Elasticsearch ne permet pas nativement la création d'utilisateurs via le docker-compose.yml, donc on doit ajouter un script d'initialisation personnalisé monté dans le conteneur, qui s'exécute au démarrage. + +✅ Structure du projet recommandée : + +project/ +├── docker-compose.yml +├── elasticsearch/ +│ └── create_kibana_user.sh +🔧 elasticsearch/create_kibana_user.sh (script d'init) + +#!/bin/bash + +# Attendre qu'Elasticsearch soit démarré +echo "⏳ Attente du démarrage d'Elasticsearch..." +until curl -u elastic:changeme -s http://localhost:9200 >/dev/null; do + sleep 2 +done + +echo "✅ Elasticsearch est prêt. Création de l'utilisateur Kibana..." + +# Créer un utilisateur pour Kibana +curl -X POST http://localhost:9200/_security/user/kibana_system_user \ + -u elastic:changeme \ + -H "Content-Type: application/json" \ + -d '{ + "password" : "kibanapassword", + "roles" : [ "kibana_system" ], + "full_name" : "Kibana System User" + }' + +echo "✅ Utilisateur Kibana créé avec succès." +Donne les permissions au script : +chmod +x elasticsearch/create_kibana_user.sh +📦 docker-compose.yml complet + +version: "3.8" + +services: + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:8.18.2 + container_name: elasticsearch + environment: + - node.name=es01 + - cluster.name=es-docker-cluster + - discovery.type=single-node + - bootstrap.memory_lock=true + - xpack.security.enabled=true + - xpack.security.http.ssl.enabled=false + - ELASTIC_PASSWORD=changeme + - ES_JAVA_OPTS=-Xms1g -Xmx1g + ulimits: + memlock: + soft: -1 + hard: -1 + ports: + - "9200:9200" + - "9300:9300" + volumes: + - wwwgmo-elasticsearch:/usr/share/elasticsearch/data + - ./elasticsearch/create_kibana_user.sh:/usr/local/bin/create_kibana_user.sh + command: > + bash -c " + /bin/tini -g -- /usr/local/bin/docker-entrypoint.sh & + pid=$!; + sleep 20; + bash /usr/local/bin/create_kibana_user.sh; + wait $pid + " + + kibana: + image: docker.elastic.co/kibana/kibana:8.18.2 + container_name: kibana + depends_on: + - elasticsearch + environment: + - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 + - ELASTICSEARCH_USERNAME=kibana_system_user + - ELASTICSEARCH_PASSWORD=kibanapassword + ports: + - "5601:5601" + +volumes: + wwwgmo-elasticsearch: +✅ Lancer le tout + +Dans ton terminal : + +docker-compose down -v +docker-compose up --build +✅ Résultat attendu + +Elasticsearch démarre avec la sécurité activée +Un script crée automatiquement un utilisateur kibana_system_user +Kibana l'utilise pour se connecter +Tout est prêt et fonctionnel sans intervention manuelle +Souhaites-tu que je t’aide à ajouter aussi un utilisateur applicatif (ex: my_app_user) avec accès en lecture/écriture ? + + + + +Joindre + +Rechercher + +Voix + +ChatGPT peut faire des erreurs. Envisagez de vérifier les informations importantes. diff --git a/docker-compose.yml b/docker-compose.yml index 3820b36..4d8c603 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,74 +1,64 @@ -# GMo Lab -#version: '2.3' services: - -## Linux nginx mysql php -# wwwgmo-nginx: +# Linux nginx mysql php +# server http nginx + nginx: # container_name: wwwgmo-nginx # hostname: wwwgmo-nginx -# image: nginxinc/nginx-unprivileged:1.23-alpine -# volumes: -# - './docker/nginx/default.conf:/etc/nginx/conf.d/default.conf' -# - './certs:/etc/nginx/certs/' -# - './src:/var/www/html:rw,cached' -# ports: -# - '${NGINX_PORT}:8080' #local:docker + image: nginxinc/nginx-unprivileged:1.23-alpine + volumes: + - './docker/nginx/default.conf:/etc/nginx/conf.d/default.conf' + - './certs:/etc/nginx/certs/' + - './src:/var/www/html:rw,cached' + ports: + - '${NGINX_PORT}:8080' #local:docker # depends_on: # - wwwgmo-php-fpm ## -# wwwgmo-php-fpm: + php-fpm: # container_name: wwwgmo-php-fpm # hostname: wwwgmo-php-fpm # #image: wwwgmo -# image: ${DOCKER_IMAGE}:${DOCKER_IMAGE_VERSION} -# env_file: -# - ./docker/php-fpm/.env -# volumes: -# - './src/:/var/www/html:rw,cached' -# build: -# context: . -# dockerfile: ./docker/php-fpm/Dockerfile -# ports: -# - '9000:9000' #local:docker -# depends_on: -# - wwwgmo-mariadb -# -# wwwgmo-mariadb: + image: ${DOCKER_IMAGE}:${DOCKER_IMAGE_VERSION} + env_file: + - ./docker/php-fpm/.env + volumes: + - './src/:/var/www/html:rw,cached' + build: + context: . + dockerfile: ./docker/php-fpm/Dockerfile + ports: + - '9000:9000' #local:docker + depends_on: + - mariadb + + mariadb: # container_name: wwwgmo-mariadb # hostname: wwwgmo-mariadb -# #image: mysql:8.0-debian -# #image: mysql/mysql-server:8.0.27-aarch64 -# image: mariadb:10.11.7 -# volumes: -# - 'wwwgmo-mariadb:/var/lib/mysql:z' -# env_file: -# - ./docker/mariadb/.env # ports: -# -# wwwgmo-phpmyadmin: + #image: mysql:8.0-debian + #image: mysql/mysql-server:8.0.27-aarch64 + image: mariadb:10.11.7 + volumes: + - 'wwwgmo-mariadb:/var/lib/mysql:z' + env_file: + - ./docker/mariadb/.env # ports: + + phpmyadmin: # container_name: wwwgmo-pma -# image: phpmyadmin -# links: -# - wwwgmo-mariadb -# env_file: -# - ./docker/mariadb/.env -# restart: always -# ports: -# - ${PMA_PORT_WEB}:80 + image: phpmyadmin + links: + - mariadb + env_file: + - ./docker/mariadb/.env + restart: always + ports: + - ${PMA_PORT_WEB}:80 # -## EK - +# elasticsearch elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch:8.18.2 - container_name: elasticsearch - environment: - - node.name=es01 - - cluster.name=es-docker-cluster - - discovery.type=single-node - - bootstrap.memory_lock=true - - xpack.security.enabled=true - - ELASTIC_PASSWORD=changeme - - xpack.security.http.ssl.enabled=false - - ES_JAVA_OPTS=-Xms1g -Xmx1g + image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION} + #container_name: elasticsearch + env_file: + - ./docker/elasticsearch/.env ulimits: memlock: soft: -1 @@ -77,58 +67,29 @@ services: - "9200:9200" - "9300:9300" volumes: - - esdata:/usr/share/elasticsearch/data - # - 'wwwgmo-elasticsearch:/usr/share/elasticsearch/data' + - wwwgmo-elasticsearch:/usr/share/elasticsearch/data + - ./docker/elasticsearch/create_kibana_user.sh:/usr/local/bin/create_kibana_user.sh + command: > + bash -c " + /bin/tini -g -- /usr/local/bin/docker-entrypoint.sh & + pid=$!; + sleep 20; + bash /usr/local/bin/create_kibana_user.sh; + wait $pid + " +# kibana kibana: - image: docker.elastic.co/kibana/kibana:8.18.2 - container_name: kibana + image: docker.elastic.co/kibana/kibana:${ELASTIC_VERSION} + #container_name: kibana + env_file: + - ./docker/kibana/.env depends_on: - elasticsearch - environment: - - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 - - xpack.security.enabled=false ports: - "5601:5601" - -# wwwgmo-elasticsearch: -# container_name: wwwgmo-elasticsearch -# hostname: wwwgmo-elasticsearch -# image: 'docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}' -# #image: 'docker.elastic.co/elasticsearch/elasticsearch:8.8.1' -# volumes: -# - 'wwwgmo-elasticsearch:/usr/share/elasticsearch/data' -# restart: unless-stopped -# env_file: -# - ./docker/elasticsearch/.env -# ulimits: -# memlock: -# soft: -1 -# hard: -1 -# nofile: -# soft: 65536 -# hard: 65536 -# cap_add: -# - IPC_LOCK -# ports: -# - '9200:9200' -# - '9300:9300' -# -## kibana -# wwwgmo_kibana: -# container_name: wwwgmo-kibana -# hostname: wwwgmo-kibana -# image: docker.elastic.co/kibana/kibana:${ELASTIC_VERSION} -# #image: docker.elastic.co/kibana/kibana:8.8.1 -# restart: unless-stopped -# env_file: -# - ./docker/kibana/.env -# ports: -# - 5601:5601 -# #depends_on: -# # - wwwgmo-elasticsearch -# volumes: -# wwwgmo-mariadb: -# wwwgmo-elasticsearch: - esdata: + wwwgmo-elasticsearch: + name: elasticsearch + wwwgmo-mariadb: + name: mariadb \ No newline at end of file diff --git a/docker-compose.yml.orig b/docker-compose.yml.orig new file mode 100644 index 0000000..5da031b --- /dev/null +++ b/docker-compose.yml.orig @@ -0,0 +1,138 @@ +# GMo Lab +#version: '2.3' +services: + +## Linux nginx mysql php +# wwwgmo-nginx: +# container_name: wwwgmo-nginx +# hostname: wwwgmo-nginx +# image: nginxinc/nginx-unprivileged:1.23-alpine +# volumes: +# - './docker/nginx/default.conf:/etc/nginx/conf.d/default.conf' +# - './certs:/etc/nginx/certs/' +# - './src:/var/www/html:rw,cached' +# ports: +# - '${NGINX_PORT}:8080' #local:docker +# depends_on: +# - wwwgmo-php-fpm +## +# wwwgmo-php-fpm: +# container_name: wwwgmo-php-fpm +# hostname: wwwgmo-php-fpm +# #image: wwwgmo +# image: ${DOCKER_IMAGE}:${DOCKER_IMAGE_VERSION} +# env_file: +# - ./docker/php-fpm/.env +# volumes: +# - './src/:/var/www/html:rw,cached' +# build: +# context: . +# dockerfile: ./docker/php-fpm/Dockerfile +# ports: +# - '9000:9000' #local:docker +# depends_on: +# - wwwgmo-mariadb +# +# wwwgmo-mariadb: +# container_name: wwwgmo-mariadb +# hostname: wwwgmo-mariadb +# #image: mysql:8.0-debian +# #image: mysql/mysql-server:8.0.27-aarch64 +# image: mariadb:10.11.7 +# volumes: +# - 'wwwgmo-mariadb:/var/lib/mysql:z' +# env_file: +# - ./docker/mariadb/.env # ports: +# +# wwwgmo-phpmyadmin: +# container_name: wwwgmo-pma +# image: phpmyadmin +# links: +# - wwwgmo-mariadb +# env_file: +# - ./docker/mariadb/.env +# restart: always +# ports: +# - ${PMA_PORT_WEB}:80 +# +## EK + + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:8.18.2 + container_name: elasticsearch + environment: + - node.name=es01 + - cluster.name=es-docker-cluster + - discovery.type=single-node + - bootstrap.memory_lock=true + - xpack.security.enabled=true + - ELASTIC_PASSWORD=changeme + - xpack.security.http.ssl.enabled=false + - ES_JAVA_OPTS=-Xms1g -Xmx1g + ulimits: + memlock: + soft: -1 + hard: -1 + ports: + - "9200:9200" + - "9300:9300" + volumes: + # - esdata:/usr/share/elasticsearch/data + - wwwgmo-elasticsearch:/usr/share/elasticsearch/data + + kibana: + image: docker.elastic.co/kibana/kibana:8.18.2 + container_name: kibana + depends_on: + - elasticsearch + environment: + - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 + - ELASTICSEARCH_USERNAME=elastic + - ELASTICSEARCH_PASSWORD=changeme + #- xpack.security.enabled=true + + ports: + - "5601:5601" + + +# wwwgmo-elasticsearch: +# container_name: wwwgmo-elasticsearch +# hostname: wwwgmo-elasticsearch +# image: 'docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}' +# #image: 'docker.elastic.co/elasticsearch/elasticsearch:8.8.1' +# volumes: +# - 'wwwgmo-elasticsearch:/usr/share/elasticsearch/data' +# restart: unless-stopped +# env_file: +# - ./docker/elasticsearch/.env +# ulimits: +# memlock: +# soft: -1 +# hard: -1 +# nofile: +# soft: 65536 +# hard: 65536 +# cap_add: +# - IPC_LOCK +# ports: +# - '9200:9200' +# - '9300:9300' +# +## kibana +# wwwgmo_kibana: +# container_name: wwwgmo-kibana +# hostname: wwwgmo-kibana +# image: docker.elastic.co/kibana/kibana:${ELASTIC_VERSION} +# #image: docker.elastic.co/kibana/kibana:8.8.1 +# restart: unless-stopped +# env_file: +# - ./docker/kibana/.env +# ports: +# - 5601:5601 +# #depends_on: +# # - wwwgmo-elasticsearch +# +volumes: +# wwwgmo-mariadb: + wwwgmo-elasticsearch: +# esdata: diff --git a/docker.sh b/docker.sh index 3241ddc..544e490 100755 --- a/docker.sh +++ b/docker.sh @@ -15,14 +15,15 @@ while test $# -gt 0 do case "$1" in install) - env UID=${_UID} GID=${_GID} docker compose up -d wwwgmo-php-fpm + env UID=${_UID} GID=${_GID} docker compose up -d php-fpm #docker exec --user root wwwgmo-php-fpm "/bin/sh -c 'cd /var/www/html/; composer require elasticsearch/elasticsearch'" - docker exec --user root wwwgmo-php-fpm /bin/sh -c "cd /var/www/html; composer require elasticsearch/elasticsearch:^7.17.2" - env UID=${_UID} GID=${_GID} docker compose stop + #docker exec --user root ${COMPOSE_PROJECT_NAME}-php-fpm-1 /bin/sh -c "cd /var/www/html; composer require elasticsearch/elasticsearch:^7.17.2" + docker exec --user root ${COMPOSE_PROJECT_NAME}-php-fpm-1 /bin/sh -c "cd /var/www/html; composer require elasticsearch/elasticsearch:^8.0" + env UID=${_UID} GID=${_GID} docker compose stop ;; start) env UID=${_UID} GID=${_GID} docker compose up -d; - docker exec --user root wwwgmo-php-fpm composer install --no-interaction + docker exec --user root ${COMPOSE_PROJECT_NAME}-php-fpm-1 composer install --no-interaction ;; start-nginx) env UID=${_UID} GID=${_GID} docker compose up -d wwwgmo-nginx diff --git a/docker/elasticsearch/.env.dist b/docker/elasticsearch/.env.dist index cb4fec2..46ca5b6 100644 --- a/docker/elasticsearch/.env.dist +++ b/docker/elasticsearch/.env.dist @@ -1,6 +1,10 @@ -xpack.security.transport.ssl.enabled=true -xpack.security.enabled=true +# config es +node.name=es01 +cluster.name=es-docker-cluster discovery.type=single-node -cluster.name=gmo_es_cluster -ELASTIC_USERNAME=elastic -ELASTIC_PASSWORD=pa55w0rd \ No newline at end of file +bootstrap.memory_lock=true +xpack.security.enabled=true +xpack.security.http.ssl.enabled=false +ES_JAVA_OPTS=-Xms1g -Xmx1g +# password for elasric use +ELASTIC_PASSWORD=pa55w0rd diff --git a/docker/elasticsearch/create_kibana_user.sh b/docker/elasticsearch/create_kibana_user.sh new file mode 100644 index 0000000..a5590c1 --- /dev/null +++ b/docker/elasticsearch/create_kibana_user.sh @@ -0,0 +1,21 @@ +!/bin/bash + +# Wait for elasticsearch to start +echo "--- waiting for elasticsearch to start..." +until curl -u elastic:${ELASTIC_PASSWORD} -s http://localhost:9200 >/dev/null; do + sleep 2 +done + +echo "--- elasticsearch is ready. Creating the Kibana user..." + +# create a user for Kibana +curl -X POST http://localhost:9200/_security/user/kibana_system_user \ + -u elastic:${ELASTIC_PASSWORD} \ + -H "Content-Type: application/json" \ + -d '{ + "password" : "kibanapassword", + "roles" : [ "kibana_system" ], + "full_name" : "Kibana System User" + }' + +echo "--- kibana user successfully created." \ No newline at end of file diff --git a/docker/kibana/.env.dist b/docker/kibana/.env.dist index 621ba8b..bbf5fd8 100644 --- a/docker/kibana/.env.dist +++ b/docker/kibana/.env.dist @@ -1,4 +1,6 @@ -ELASTICSEARCH_HOSTS=http://wwwgmo-elasticsearch:9200 -ELASTICSEARCH_USERNAME=elastic -ELASTICSEARCH_PASSWORD=pa55w0rd -xpack.security.enabled=true \ No newline at end of file +# es url +ELASTICSEARCH_HOSTS=http://elasticsearch:9200 +# username (technical) with which kibana connects to elasticsearch +ELASTICSEARCH_USERNAME=kibana_system_user +# password for username +ELASTICSEARCH_PASSWORD=kibanapassword diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf index 112a123..1dd6fe8 100644 --- a/docker/nginx/default.conf +++ b/docker/nginx/default.conf @@ -49,7 +49,7 @@ location ~* \.php$ { #fastcgi_pass 127.0.0.1:9000; - fastcgi_pass wwwgmo-php-fpm:9000; + fastcgi_pass php-fpm:9000; #fastcgi_pass archivescacm-php-fpm:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; diff --git a/src/composer.json b/src/composer.json index 5cc09b4..115fb8c 100644 --- a/src/composer.json +++ b/src/composer.json @@ -1,10 +1,5 @@ { - "config": { - "allow-plugins": { - "php-http/discovery": true - } - }, "require": { - "elasticsearch/elasticsearch": "^7.17.2" + "elasticsearch/elasticsearch": "^8.0" } } diff --git a/src/composer.lock b/src/composer.lock index 3d109c4..2ae1da6 100644 --- a/src/composer.lock +++ b/src/composer.lock @@ -4,104 +4,174 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cd1eb78118167a9346c9821e10644b8c", + "content-hash": "896ff89adf34fedde1ecec1943b40744", "packages": [ { - "name": "elasticsearch/elasticsearch", - "version": "v7.17.2", + "name": "elastic/transport", + "version": "v8.11.0", "source": { "type": "git", - "url": "https://github.com/elastic/elasticsearch-php.git", - "reference": "2d302233f2bb0926812d82823bb820d405e130fc" + "url": "https://github.com/elastic/elastic-transport-php.git", + "reference": "1d476af5dc0b74530d59b67d5dd96ee39768d5a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/2d302233f2bb0926812d82823bb820d405e130fc", - "reference": "2d302233f2bb0926812d82823bb820d405e130fc", + "url": "https://api.github.com/repos/elastic/elastic-transport-php/zipball/1d476af5dc0b74530d59b67d5dd96ee39768d5a4", + "reference": "1d476af5dc0b74530d59b67d5dd96ee39768d5a4", "shasum": "" }, "require": { - "ext-json": ">=1.3.7", - "ezimuel/ringphp": "^1.1.2", - "php": "^7.3 || ^8.0", + "composer-runtime-api": "^2.0", + "open-telemetry/api": "^1.0", + "php": "^7.4 || ^8.0", + "php-http/discovery": "^1.14", + "php-http/httplug": "^2.3", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0 || ^2.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "nyholm/psr7": "^1.5", + "open-telemetry/sdk": "^1.0", + "php-http/mock-client": "^1.5", + "phpstan/phpstan": "^2.1", + "phpunit/phpunit": "^9.5", + "symfony/http-client": "^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Elastic\\Transport\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "HTTP transport PHP library for Elastic products", + "keywords": [ + "PSR_17", + "elastic", + "http", + "psr-18", + "psr-7", + "transport" + ], + "support": { + "issues": "https://github.com/elastic/elastic-transport-php/issues", + "source": "https://github.com/elastic/elastic-transport-php/tree/v8.11.0" + }, + "time": "2025-04-02T08:20:33+00:00" + }, + { + "name": "elasticsearch/elasticsearch", + "version": "v8.18.0", + "source": { + "type": "git", + "url": "https://github.com/elastic/elasticsearch-php.git", + "reference": "df8ee73046c688ee9ce2d69cb5c54a03ca38cc5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/df8ee73046c688ee9ce2d69cb5c54a03ca38cc5c", + "reference": "df8ee73046c688ee9ce2d69cb5c54a03ca38cc5c", + "shasum": "" + }, + "require": { + "elastic/transport": "^8.10", + "guzzlehttp/guzzle": "^7.0", + "php": "^7.4 || ^8.0", + "psr/http-client": "^1.0", + "psr/http-message": "^1.1 || ^2.0", "psr/log": "^1|^2|^3" }, "require-dev": { "ext-yaml": "*", "ext-zip": "*", - "mockery/mockery": "^1.2", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.3", - "squizlabs/php_codesniffer": "^3.4", - "symfony/finder": "~4.0" - }, - "suggest": { - "ext-curl": "*", - "monolog/monolog": "Allows for client-level logging and tracing" + "mockery/mockery": "^1.5", + "nyholm/psr7": "^1.5", + "php-http/mock-client": "^1.5", + "phpstan/phpstan": "^2.1", + "phpunit/phpunit": "^9.5", + "psr/http-factory": "^1.0", + "symfony/finder": "~4.0", + "symfony/http-client": "^5.0|^6.0|^7.0" }, "type": "library", "autoload": { - "files": [ - "src/autoload.php" - ], "psr-4": { - "Elasticsearch\\": "src/Elasticsearch/" + "Elastic\\Elasticsearch\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0", - "LGPL-2.1-only" - ], - "authors": [ - { - "name": "Zachary Tong" - }, - { - "name": "Enrico Zimuel" - } + "MIT" ], "description": "PHP Client for Elasticsearch", "keywords": [ "client", + "elastic", "elasticsearch", "search" ], "support": { "issues": "https://github.com/elastic/elasticsearch-php/issues", - "source": "https://github.com/elastic/elasticsearch-php/tree/v7.17.2" + "source": "https://github.com/elastic/elasticsearch-php/tree/v8.18.0" }, - "time": "2023-04-21T15:31:12+00:00" + "time": "2025-05-02T10:38:56+00:00" }, { - "name": "ezimuel/guzzlestreams", - "version": "3.1.0", + "name": "guzzlehttp/guzzle", + "version": "7.9.3", "source": { "type": "git", - "url": "https://github.com/ezimuel/guzzlestreams.git", - "reference": "b4b5a025dfee70d6cd34c780e07330eb93d5b997" + "url": "https://github.com/guzzle/guzzle.git", + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezimuel/guzzlestreams/zipball/b4b5a025dfee70d6cd34c780e07330eb93d5b997", - "reference": "b4b5a025dfee70d6cd34c780e07330eb93d5b997", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", "shasum": "" }, "require": { - "php": ">=5.4.0" + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~9.0" + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "3.0-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "GuzzleHttp\\Stream\\": "src/" + "GuzzleHttp\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -109,61 +179,509 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], - "description": "Fork of guzzle/streams (abandoned) to be used with elasticsearch-php", - "homepage": "http://guzzlephp.org/", + "description": "Guzzle is a PHP HTTP client library", "keywords": [ - "Guzzle", - "stream" + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" ], "support": { - "source": "https://github.com/ezimuel/guzzlestreams/tree/3.1.0" + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.9.3" }, - "time": "2022-10-24T12:58:50+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2025-03-27T13:37:11+00:00" }, { - "name": "ezimuel/ringphp", + "name": "guzzlehttp/promises", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.2.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2025-03-27T13:27:01+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.7.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16", + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.7.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2025-03-27T12:30:47+00:00" + }, + { + "name": "open-telemetry/api", "version": "1.3.0", "source": { "type": "git", - "url": "https://github.com/ezimuel/ringphp.git", - "reference": "5e4ee1dfc7a323b87873b83f17c69c76ba047793" + "url": "https://github.com/opentelemetry-php/api.git", + "reference": "4e3bb38e069876fb73c2ce85c89583bf2b28cd86" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezimuel/ringphp/zipball/5e4ee1dfc7a323b87873b83f17c69c76ba047793", - "reference": "5e4ee1dfc7a323b87873b83f17c69c76ba047793", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/4e3bb38e069876fb73c2ce85c89583bf2b28cd86", + "reference": "4e3bb38e069876fb73c2ce85c89583bf2b28cd86", "shasum": "" }, "require": { - "ezimuel/guzzlestreams": "^3.0.1", - "php": ">=5.4.0", - "react/promise": "^2.0 || ^3.0" + "open-telemetry/context": "^1.0", + "php": "^8.1", + "psr/log": "^1.1|^2.0|^3.0", + "symfony/polyfill-php82": "^1.26" }, - "replace": { - "guzzlehttp/ringphp": "self.version" + "conflict": { + "open-telemetry/sdk": "<=1.0.8" }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "~9.0" + "type": "library", + "extra": { + "spi": { + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" + ] + }, + "branch-alias": { + "dev-main": "1.1.x-dev" + } + }, + "autoload": { + "files": [ + "Trace/functions.php" + ], + "psr-4": { + "OpenTelemetry\\API\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "API for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "api", + "apm", + "logging", + "opentelemetry", + "otel", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2025-05-07T12:32:21+00:00" + }, + { + "name": "open-telemetry/context", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/context.git", + "reference": "1eb2b837ee9362db064a6b65d5ecce15a9f9f020" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/1eb2b837ee9362db064a6b65d5ecce15a9f9f020", + "reference": "1eb2b837ee9362db064a6b65d5ecce15a9f9f020", + "shasum": "" + }, + "require": { + "php": "^8.1", + "symfony/polyfill-php82": "^1.26" }, "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" + "ext-ffi": "To allow context switching in Fibers" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-main": "1.0.x-dev" } }, "autoload": { + "files": [ + "fiber/initialize_fiber_handler.php" + ], "psr-4": { - "GuzzleHttp\\Ring\\": "src/" + "OpenTelemetry\\Context\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "Context implementation for OpenTelemetry PHP.", + "keywords": [ + "Context", + "opentelemetry", + "otel" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2025-05-07T23:36:50+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/", @@ -172,29 +690,251 @@ ], "authors": [ { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" + "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": "Fork of guzzle/RingPHP (abandoned) to be used with elasticsearch-php", + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], "support": { - "source": "https://github.com/ezimuel/ringphp/tree/1.3.0" + "issues": "https://github.com/php-http/httplug/issues", + "source": "https://github.com/php-http/httplug/tree/2.4.1" }, - "time": "2025-02-24T10:29:27+00:00" + "time": "2024-09-23T11:39:58+00:00" }, { - "name": "psr/log", - "version": "3.0.0", + "name": "php-http/promise", + "version": "1.3.1", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "url": "https://github.com/php-http/promise.git", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.3.2 || ^6.3", + "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/php-http/promise/issues", + "source": "https://github.com/php-http/promise/tree/1.3.1" + }, + "time": "2024-03-15T13:55:21+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "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": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { @@ -229,39 +969,36 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2021-07-14T16:46:02+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { - "name": "react/promise", - "version": "v3.2.0", + "name": "ralouphie/getallheaders", + "version": "3.0.3", "source": { "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63" + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", - "reference": "8a164643313c71354582dc850b42b33fa12a4b63", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", "shasum": "" }, "require": { - "php": ">=7.1.0" + "php": ">=5.6" }, "require-dev": { - "phpstan/phpstan": "1.10.39 || 1.4.10", - "phpunit/phpunit": "^9.6 || ^7.5" + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" }, "type": "library", "autoload": { "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" - } + "src/getallheaders.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -269,42 +1006,159 @@ ], "authors": [ { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" } ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ], + "description": "A polyfill for getallheaders.", "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v3.2.0" + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" }, "funding": [ { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" + "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-05-24T10:39:05+00:00" + "time": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/polyfill-php82", + "version": "v1.32.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php82.git", + "reference": "5d2ed36f7734637dacc025f179698031951b1692" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php82/zipball/5d2ed36f7734637dacc025f179698031951b1692", + "reference": "5d2ed36f7734637dacc025f179698031951b1692", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php82\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php82/tree/v1.32.0" + }, + "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-09T11:45:10+00:00" } ], "packages-dev": [], diff --git a/src/connect-es.php b/src/connect-es.php index b037f6f..abf0641 100644 --- a/src/connect-es.php +++ b/src/connect-es.php @@ -1,6 +1,6 @@