From 76fe93348b4eeee1df0fe48db8a18f37f660f944 Mon Sep 17 00:00:00 2001 From: SFDKHISSI Date: Tue, 19 Mar 2024 13:01:35 +0100 Subject: [PATCH 1/2] added the script and volume link in the container --- create-power-bi-ronlyuser.sql | 3 +++ docker-compose.yml | 2 ++ env_create.sh | 7 +++++++ 3 files changed, 12 insertions(+) create mode 100644 create-power-bi-ronlyuser.sql diff --git a/create-power-bi-ronlyuser.sql b/create-power-bi-ronlyuser.sql new file mode 100644 index 0000000..b1b5b3a --- /dev/null +++ b/create-power-bi-ronlyuser.sql @@ -0,0 +1,3 @@ +CREATE USER 'powerbi'@'%' IDENTIFIED BY 'powerbi'; +GRANT SELECT ON efncdb.* TO 'powerbi'@'%'; +FLUSH PRIVILEGES; diff --git a/docker-compose.yml b/docker-compose.yml index ba0e99b..c3cbb4b 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: MYSQL_PASSWORD: ${MYSQL_PASSWORD} volumes: - ./database_data:/var/lib/mysql + - ./create-readonly-user.sql:/docker-entrypoint-initdb.d/create-readonly-user.sql ports: - "3307:3306" networks: @@ -20,6 +21,7 @@ services: # - "traefik.http.routers.database-efnc.rule=PathPrefix(`/database-efnc`)" # - "traefik.http.routers.database-efnc.entrypoints=mariadb" # - "traefik.tcp.routers.tcp-database-efnc.entrypoints=mariadb" + command: ['--init-file', '/docker-entrypoint-initdb.d/create-readonly-user.sql'] phpmyadmin: image: phpmyadmin/phpmyadmin diff --git a/env_create.sh b/env_create.sh index 6d9644a..eb047a4 100755 --- a/env_create.sh +++ b/env_create.sh @@ -99,6 +99,13 @@ class Kernel extends BaseKernel } EOL +# Create the create-power-bi-ronlyuser.sql file +cat > create-power-bi-ronlyuser.sql < .env < Date: Tue, 19 Mar 2024 13:17:39 +0100 Subject: [PATCH 2/2] added a sql script to create readonly powerbi user, added a cat to env_create and env_update shell script and finally added the volume to docker compose yml script --- composer.lock | 27 +- create-power-bi-ronlyuser.sql | 0 docker-compose.yml | 2 +- env_update.sh | 8 +- yarn.lock | 907 +++++++++++++++++----------------- 5 files changed, 468 insertions(+), 476 deletions(-) mode change 100644 => 100755 create-power-bi-ronlyuser.sql diff --git a/composer.lock b/composer.lock index c129136..5c88ea2 100755 --- a/composer.lock +++ b/composer.lock @@ -438,16 +438,16 @@ }, { "name": "doctrine/doctrine-bundle", - "version": "2.11.3", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineBundle.git", - "reference": "492725310ae9a1b5b20d6ae09fb5ae6404616e68" + "reference": "5418e811a14724068e95e0ba43353b903ada530f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/492725310ae9a1b5b20d6ae09fb5ae6404616e68", - "reference": "492725310ae9a1b5b20d6ae09fb5ae6404616e68", + "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/5418e811a14724068e95e0ba43353b903ada530f", + "reference": "5418e811a14724068e95e0ba43353b903ada530f", "shasum": "" }, "require": { @@ -485,6 +485,7 @@ "symfony/property-info": "^5.4 || ^6.0 || ^7.0", "symfony/proxy-manager-bridge": "^5.4 || ^6.0 || ^7.0", "symfony/security-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0", "symfony/string": "^5.4 || ^6.0 || ^7.0", "symfony/twig-bridge": "^5.4 || ^6.0 || ^7.0", "symfony/validator": "^5.4 || ^6.0 || ^7.0", @@ -502,7 +503,7 @@ "type": "symfony-bundle", "autoload": { "psr-4": { - "Doctrine\\Bundle\\DoctrineBundle\\": "" + "Doctrine\\Bundle\\DoctrineBundle\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -537,7 +538,7 @@ ], "support": { "issues": "https://github.com/doctrine/DoctrineBundle/issues", - "source": "https://github.com/doctrine/DoctrineBundle/tree/2.11.3" + "source": "https://github.com/doctrine/DoctrineBundle/tree/2.12.0" }, "funding": [ { @@ -553,7 +554,7 @@ "type": "tidelift" } ], - "time": "2024-02-10T20:56:20+00:00" + "time": "2024-03-19T07:20:37+00:00" }, { "name": "doctrine/doctrine-migrations-bundle", @@ -1079,16 +1080,16 @@ }, { "name": "doctrine/orm", - "version": "2.19.0", + "version": "2.19.2", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "a809a71aa6a233a6c82e68ebaaf8954adc4998dc" + "reference": "40a0964f06e142e173b783c45688e5f5efaed6aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/a809a71aa6a233a6c82e68ebaaf8954adc4998dc", - "reference": "a809a71aa6a233a6c82e68ebaaf8954adc4998dc", + "url": "https://api.github.com/repos/doctrine/orm/zipball/40a0964f06e142e173b783c45688e5f5efaed6aa", + "reference": "40a0964f06e142e173b783c45688e5f5efaed6aa", "shasum": "" }, "require": { @@ -1174,9 +1175,9 @@ ], "support": { "issues": "https://github.com/doctrine/orm/issues", - "source": "https://github.com/doctrine/orm/tree/2.19.0" + "source": "https://github.com/doctrine/orm/tree/2.19.2" }, - "time": "2024-03-03T17:43:41+00:00" + "time": "2024-03-18T19:12:56+00:00" }, { "name": "doctrine/persistence", diff --git a/create-power-bi-ronlyuser.sql b/create-power-bi-ronlyuser.sql old mode 100644 new mode 100755 diff --git a/docker-compose.yml b/docker-compose.yml index c3cbb4b..bcca161 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ services: MYSQL_PASSWORD: ${MYSQL_PASSWORD} volumes: - ./database_data:/var/lib/mysql - - ./create-readonly-user.sql:/docker-entrypoint-initdb.d/create-readonly-user.sql + - ./create-power-bi-ronlyuser.sql:/docker-entrypoint-initdb.d/create-readonly-user.sql ports: - "3307:3306" networks: diff --git a/env_update.sh b/env_update.sh index c4a8e65..3bbc533 100755 --- a/env_update.sh +++ b/env_update.sh @@ -1,8 +1,10 @@ #!/bin/bash -cat > ~/.ssh/config < create-power-bi-ronlyuser.sql <=0.6.2 <2.0.0", source-map-js@^1.0.1, source-map-js@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" - integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== +"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.1, source-map-js@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.1.0.tgz#9e7d5cb46f0689fb6691b30f226937558d0fa94b" + integrity sha512-9vC2SfsJzlej6MAaMPLu8HiBSHGdRAJ9hVFYN1ibZoNkeanmDmLUcIrj6G9DGL7XMJ54AKg/G75akXl1/izTOw== source-map-support@~0.5.20: version "0.5.21"