From 598c7dab4363a38fddcdcf71603ebff7223b1cfb Mon Sep 17 00:00:00 2001 From: 0xD0M1M0 <76812428+0xD0M1M0@users.noreply.github.com> Date: Sat, 7 Dec 2024 15:30:46 +0100 Subject: [PATCH] fix: --no-mariadb-socket & --mariadb-root-password is DEPRECATED --- docs/development.md | 8 ++++---- docs/migrate-from-multi-image-setup.md | 4 ++-- docs/setup_for_linux_mac.md | 2 +- docs/single-server-example.md | 8 ++++---- docs/site-operations.md | 4 ++-- tests/conftest.py | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/development.md b/docs/development.md index 89b20ec2..1d862231 100644 --- a/docs/development.md +++ b/docs/development.md @@ -144,7 +144,7 @@ sed -i '/redis/d' ./Procfile You can create a new site with the following command: ```shell -bench new-site --no-mariadb-socket sitename +bench new-site --mariadb-user-host-login-scope=% sitename ``` sitename MUST end with .localhost for trying deployments locally. @@ -152,18 +152,18 @@ sitename MUST end with .localhost for trying deployments locally. for example: ```shell -bench new-site --no-mariadb-socket development.localhost +bench new-site --mariadb-user-host-login-scope=% development.localhost ``` The same command can be run non-interactively as well: ```shell -bench new-site --mariadb-root-password 123 --admin-password admin --no-mariadb-socket development.localhost +bench new-site --db-root-password 123 --admin-password admin --mariadb-user-host-login-scope=% development.localhost ``` The command will ask the MariaDB root password. The default root password is `123`. This will create a new site and a `development.localhost` directory under `frappe-bench/sites`. -The option `--no-mariadb-socket` will configure site's database credentials to work with docker. +The option `--mariadb-user-host-login-scope=%` will configure site's database credentials to work with docker. You may need to configure your system /etc/hosts if you're on Linux, Mac, or its Windows equivalent. To setup site with PostgreSQL as database use option `--db-type postgres` and `--db-host postgresql`. (Available only v12 onwards, currently NOT available for ERPNext). diff --git a/docs/migrate-from-multi-image-setup.md b/docs/migrate-from-multi-image-setup.md index 79072b0d..0e3c640c 100644 --- a/docs/migrate-from-multi-image-setup.md +++ b/docs/migrate-from-multi-image-setup.md @@ -74,7 +74,7 @@ configurator: ### Site Creation -For `create-site` service to act as run once site creation job, you need to pass `["bash", "-c"]` as container `entrypoint` and bash script inline to yaml. Make sure to use `--no-mariadb-socket` as upstream bench is installed in container. +For `create-site` service to act as run once site creation job, you need to pass `["bash", "-c"]` as container `entrypoint` and bash script inline to yaml. Make sure to use `--mariadb-user-host-login-scope=%` as upstream bench is installed in container. The `WORKDIR` has changed to `/home/frappe/frappe-bench` like `bench` setup we are used to. So the path to find `common_site_config.json` has changed to `sites/common_site_config.json`. @@ -106,7 +106,7 @@ create-site: fi done; echo "sites/common_site_config.json found"; - bench new-site --no-mariadb-socket --admin-password=admin --db-root-password=admin --install-app erpnext --set-default frontend; + bench new-site --mariadb-user-host-login-scope=% --admin-password=admin --db-root-password=admin --install-app erpnext --set-default frontend; # ... removed for brevity ``` diff --git a/docs/setup_for_linux_mac.md b/docs/setup_for_linux_mac.md index b26cef48..ba720fbb 100644 --- a/docs/setup_for_linux_mac.md +++ b/docs/setup_for_linux_mac.md @@ -83,7 +83,7 @@ services: fi done; echo "sites/common_site_config.json found"; - bench new-site --no-mariadb-socket --admin-password=admin --db-root-password=admin --install-app erpnext --set-default frontend; + bench new-site --mariadb-user-host-login-scope=% --admin-password=admin --db-root-password=admin --install-app erpnext --set-default frontend; db: image: mariadb:10.6 diff --git a/docs/single-server-example.md b/docs/single-server-example.md index 1bc2c2b1..ca61cda1 100644 --- a/docs/single-server-example.md +++ b/docs/single-server-example.md @@ -177,7 +177,7 @@ Create sites `one.example.com` and `two.example.com`: ```shell # one.example.com docker compose --project-name erpnext-one exec backend \ - bench new-site --no-mariadb-socket --mariadb-root-password changeit --install-app erpnext --admin-password changeit one.example.com + bench new-site --mariadb-user-host-login-scope=% --db-root-password changeit --install-app erpnext --admin-password changeit one.example.com ``` You can stop here and have a single bench single site setup complete. Continue to add one more site to the current bench. @@ -185,7 +185,7 @@ You can stop here and have a single bench single site setup complete. Continue t ```shell # two.example.com docker compose --project-name erpnext-one exec backend \ - bench new-site --no-mariadb-socket --mariadb-root-password changeit --install-app erpnext --admin-password changeit two.example.com + bench new-site --mariadb-user-host-login-scope=% --db-root-password changeit --install-app erpnext --admin-password changeit two.example.com ``` #### Create second bench @@ -236,10 +236,10 @@ Create sites `three.example.com` and `four.example.com`: ```shell # three.example.com docker compose --project-name erpnext-two exec backend \ - bench new-site --no-mariadb-socket --mariadb-root-password changeit --install-app erpnext --admin-password changeit three.example.com + bench new-site --mariadb-user-host-login-scope=% --db-root-password changeit --install-app erpnext --admin-password changeit three.example.com # four.example.com docker compose --project-name erpnext-two exec backend \ - bench new-site --no-mariadb-socket --mariadb-root-password changeit --install-app erpnext --admin-password changeit four.example.com + bench new-site --mariadb-user-host-login-scope=% --db-root-password changeit --install-app erpnext --admin-password changeit four.example.com ``` #### Create custom domain to existing site diff --git a/docs/site-operations.md b/docs/site-operations.md index 793dfef5..08f1f159 100644 --- a/docs/site-operations.md +++ b/docs/site-operations.md @@ -9,7 +9,7 @@ Note: - Wait for the `db` service to start and `configurator` to exit before trying to create a new site. Usually this takes up to 10 seconds. ```sh -docker-compose exec backend bench new-site --no-mariadb-socket --mariadb-root-password --admin-password +docker-compose exec backend bench new-site --mariadb-user-host-login-scope=% --db-root-password --admin-password ``` If you need to install some app, specify `--install-app`. To see all options, just run `bench new-site --help`. @@ -24,7 +24,7 @@ docker-compose exec backend bench set-config -g root_password Also command is slightly different: ```sh -docker-compose exec backend bench new-site --no-mariadb-socket --db-type postgres --admin-password +docker-compose exec backend bench new-site --mariadb-user-host-login-scope=% --db-type postgres --admin-password ``` ## Push backup to S3 storage diff --git a/tests/conftest.py b/tests/conftest.py index 99470aa4..f2659f16 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -71,8 +71,8 @@ def frappe_site(compose: Compose): site_name = "tests.localhost" compose.bench( "new-site", - "--no-mariadb-socket", - "--mariadb-root-password", + "--mariadb-user-host-login-scope=%", + "--db-root-password", "123", "--admin-password", "admin", @@ -96,8 +96,8 @@ def erpnext_site(compose: Compose): site_name = "test-erpnext-site.localhost" args = [ "new-site", - "--no-mariadb-socket", - "--mariadb-root-password", + "--mariadb-user-host-login-scope=%", + "--db-root-password", "123", "--admin-password", "admin",