Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change the name of site-name frappe once it has been run #1432

Open
hieuNV0871 opened this issue Jul 8, 2024 · 9 comments
Open

change the name of site-name frappe once it has been run #1432

hieuNV0871 opened this issue Jul 8, 2024 · 9 comments
Labels

Comments

@hieuNV0871
Copy link

i have docker images for custom frappe
and i pull and run it by docker compose
so i want rename site name of frappe from example.com to abc.com

what do i need for all actions (about frappe, nginx, ...)

@hieuNV0871
Copy link
Author

i try:
backup old site
bench new-site
restore data to new site
bench setup nginx

but i got internal server error

@letajmal
Copy link

Share more details about your setup

@hieuNV0871
Copy link
Author

Share more details about your setup

https://discuss.frappe.io/t/overview-frappe-docker-self-hosting/110132

i follow this and i want update custom code but when i stop container and run again with new image (with change and new tag) (i do not change any thing in compose file). all data lost

@bangonkali
Copy link

Hi @letajmal , I am in a similar bind. The current site name is just frontend. I want it to be my domain name ie https://mydomain.com instead. The side-effect today seems to be that emails received by users redirect to a broken url http://frontend/app/item/{id} instead of https://mydomain.com/app/item/{id}.
image

At the current situation the setup already has a lot of production data and I want to change just this. Is there a possible reconfiguration of maybe just a text file, a minimum reconfig such that all references to site name becomes https://mydomain.com instead of http://frontend/app/item/{id}? Do I really need to rename the folder/directory under sites or can it just be a file that needs to be edited?

@bangonkali
Copy link

bangonkali commented Aug 14, 2024

Okay as it turns out the information from here #1264 (comment) works to fix the issue regarding email. I now have site_config.json host_name: https://mydomain.com and email support seems to work very well now. I did not add 443 port on the end of the host_name because I assumed the default for https is 443.

My next problem now is socket.io which is discussed https://github.com/frappe/frappe_docker/wiki/Frequently-Asked-Questions#socketio-does-not-work-with-pwdyml.

Is it at all possible to change the subdomain of socket.io server and propagate the change to the client? I am unable to change the socket_host_name just for the socket.io itself. After checking socketio_port on docker compose --project-name erpnext-prod exec backend bench --site all show-config -f json the socketio_port is 9000. Our configuration is behind cloudflare tunnel with websockets enabled on Cloudflare Network Configuration and we can only expose one port at a time per domain. It would be interesting to know if say , I can tunnel port 9000 as configured for the site for socketio to https://websocket.mydomain.com. Or is it the case that wss://mydomain.com is also already hosting the socket.io server despite being configured as port 9000 on the site_config.json?

At the moment I am getting this error behind cloudflare:

image

@letajmal
Copy link

@bangonkali change your frappe site name to mydomain.com as discussed here

In case of production setup make following changes to pwd.yml:
Set environment variable FRAPPE_SITE_NAME_HEADER under frontend service to $$host.
Change site name from frontend to erp.example.com under create-site service command. Any domain name that resolves to the server IP can be used here.

If you cloudflare domain name matches your frappe site name, it should work

@bangonkali
Copy link

Hi @letajmal , if i set FRAPPE_SITE_NAME_HEADER=$$host my site would be unreachable. If I set it to frontend, which is the default, it works. Do i have to change the site name currently frontend under sites folder to be the same as the value on FRAPPE_SITE_NAME_HEADER for this to work?

@letajmal
Copy link

@bangonkali create a new site with mydomain.com , set FRAPPE_SITE_NAME_HEADER=$$host

@revant
Copy link
Collaborator

revant commented Oct 1, 2024

Simple rename of site directory renames the site for frappe framework code.

The site_config.json will maintain original credentials to db. host_name key will need change.

Beyond that you'll need to make changes at load balancer, ingress, proxy level as per you infrastructure.

In case of pwd.yml site named frontend is created. Internally all other services from same ctr network can access it by frontend:8080. It is set to default site so it's served over any host or ip on :8080 port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants