Google integration error - http vs https

I’ve got the Google Social Key Login integration working. However, it’s presently supplying an http redirect URI. I want to keep this https. I have both versions enabled within the google OAuth config. If I disable the http URI, though, I get a redirect_uri_mismatch and it show that it’s still using the http URI.

I suspect that this is because the connection between my load-balancer and the erpnext service is http-only. erpnext effectively only knows http. Is there a workaround for this?

I saw a note somewhere about forcing host_name in site_config.json and that might work but I’m unclear how to get erpnext to pick up that change (this is a helm-based deployment so no ‘bench restart’).

Yes, you need https url of site in site_config.json. It doesn’t need restart. Try it.

In any case you need to restart the “bench”, kubectl rollout deploy. It keeps the site available during the process.

How can I change the site_config.json in the docker enviroment?

I found a description here, but I dont quite get it:

docker run
-it
-v _sites-vol:/sites
alpine vi /sites/site_config.json

What is the “project-name” if I just start the container with a plain “docker-compose up -d”?
And for what stands the “alpine”?

It is the directory name, if you cloned repo into frappe_docker it will be frappe_docker.

alpine is image name. vi is editor.

1 Like

Thanks for the immediate response :smiley:
So I ran →

docker run
-it
-v frappe_docker_sites-vol:/sites
alpine vi /sites/site_config.json

And I could edit the file :

{
        "host_name":"https://erp.<mydomain>",
}

(Above is the whole content of the site_config.json)

I restarted docker just in case with docker down and up
But Google still has the redirect_uri_mismatch
Because it should be:
redirect_uri: http://erp.<mydomain>?cmd=frappe.integrations.doctype.google_drive.google_drive.google_callback

Example site_config.json

{
 "db_name": "_3d266cf3efd7e1b5",
 "db_password": "Z7KKnLr5RWkwpC3L",
 "user_type_doctype_limit": {
  "employee_self_service": 10
 },
 "host_name": "https://erp.example.com"
}

From your answer I would guess, that the site_config.json should not have been empty in the first place.

Could you explain, what docker run -it -v frappe_docker_sites-vol:/sites alpine vi /sites/site_config.json should do in the first place?
I could not extract that from the given Documentation.

The things I noticed, when I ran the command, have been, that it created an image named “alpine” and startet it as a container.

Should I have targeted a specific image for it to work?

it should start the alpine container, open the file /sites/site_config.json in vi editor for you to edit.

/sites comes from sites-vol