From 4af8944add28927dfd0a04b112d74f46e8edbe6e Mon Sep 17 00:00:00 2001 From: Hendy Irawan Date: Thu, 8 Oct 2020 14:05:43 +0700 Subject: [PATCH 1/3] build: Add honcho start to launch.json As recommended in `README.md` when Bench Web is debugged separately. --- development/.vscode/launch.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/development/.vscode/launch.json b/development/.vscode/launch.json index 2ed12780..efdc0903 100644 --- a/development/.vscode/launch.json +++ b/development/.vscode/launch.json @@ -60,5 +60,17 @@ "DEV_SERVER": "1" } }, + { + "name": "Honcho SocketIO Watch Schedule Worker", + "type": "python", + "request": "launch", + "pythonPath": "/usr/bin/python3", + "program": "/home/frappe/.local/bin/honcho", + "cwd": "${workspaceFolder}/frappe-bench", + "console": "internalConsole", + "args": [ + "start", "socketio", "watch", "schedule", "worker_short", "worker_long", "worker_default" + ] + } ] } From 07606e9f8d43fba0595be403f54e9a6393f754b9 Mon Sep 17 00:00:00 2001 From: Hendy Irawan Date: Fri, 9 Oct 2020 22:45:48 +0700 Subject: [PATCH 2/3] docs(development): VSCode launch configuration "Honcho SocketIO Watch Schedule Worker" Requested by @revant https://github.com/frappe/frappe_docker/pull/365#issuecomment-705680972 [skip travis] --- development/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/development/README.md b/development/README.md index 607e53ed..3bc2fa31 100644 --- a/development/README.md +++ b/development/README.md @@ -195,6 +195,8 @@ honcho start \ worker_default ``` +Alternatively you can use the VSCode launch configuration "Honcho SocketIO Watch Schedule Worker" which launches the same command as above. + This command starts all processes with the exception of Redis (which is already running in separate container) and the `web` process. The latter can can finally be started from the debugger tab of VSCode by clicking on the "play" button. You can now login with user `Administrator` and the password you choose when creating the site, if you followed this guide's unattended install that password is going to be `admin`. From 0d6d3680237b2608b8126613739efacf8782db39 Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Wed, 14 Oct 2020 22:35:34 +0530 Subject: [PATCH 3/3] feat(frappe-worker): update user query for mariadb galera mariadb helm chart doesn't allow root@% to ALTER mysql.user --- build/common/commands/new.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/build/common/commands/new.py b/build/common/commands/new.py index 10fce846..d1452320 100644 --- a/build/common/commands/new.py +++ b/build/common/commands/new.py @@ -83,25 +83,17 @@ def main(): mysql_command = ["mysql", f"-h{db_host}", f"-u{db_root_username}", f"-p{mariadb_root_password}", "-e"] # Drop User if exists - command = mysql_command + [f"DROP USER IF EXISTS '{db_name}'@'%'; FLUSH PRIVILEGES;"] + command = mysql_command + [f"DROP USER IF EXISTS '{db_name}'; FLUSH PRIVILEGES;"] run_command(command) - # update User's host to '%' required to connect from any container - command = mysql_command + [f"UPDATE mysql.user SET Host = '%' where User = '{db_name}'; FLUSH PRIVILEGES;"] - run_command(command) - - # Set db password - command = mysql_command + [f"ALTER USER '{db_name}'@'%' IDENTIFIED BY '{db_password}'; FLUSH PRIVILEGES;"] - run_command(command) - - # Grant permission to database + # Grant permission to database and set password grant_privileges = "ALL PRIVILEGES" # for Amazon RDS if config.get(RDS_DB) or site_config.get(RDS_DB): grant_privileges = RDS_PRIVILEGES - command = mysql_command + [f"GRANT {grant_privileges} ON `{db_name}`.* TO '{db_name}'@'%'; FLUSH PRIVILEGES;"] + command = mysql_command + [f"GRANT {grant_privileges} ON `{db_name}`.* TO '{db_name}'@'%' IDENTIFIED BY '{db_password}'; FLUSH PRIVILEGES;"] run_command(command) if frappe.redis_server: