mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-11-04 04:08:15 +00:00 
			
		
		
		
	Bluesky: Patch hardcoded IPCC_URL and proxy /ipcc
- Added Ansible replace task to override IPCC_URL in geolocation.tsx to same-origin '/ipcc' - Extended Nginx extra_locations.conf to proxy /ipcc requests to https://bsky.app/ipcc - Ensures frontend avoids CORS errors when fetching IP geolocation See: https://chatgpt.com/share/68b97be3-0278-800f-9ee0-94389ca3ac0c
This commit is contained in:
		@@ -16,3 +16,12 @@
 | 
				
			|||||||
  notify:
 | 
					  notify:
 | 
				
			||||||
    - docker compose build
 | 
					    - docker compose build
 | 
				
			||||||
    - docker compose up
 | 
					    - docker compose up
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Force IPCC_URL to same-origin /ipcc
 | 
				
			||||||
 | 
					  ansible.builtin.replace:
 | 
				
			||||||
 | 
					    path: "{{ BLUESKY_SOCIAL_APP_DIR }}/src/state/geolocation.tsx"
 | 
				
			||||||
 | 
					    regexp: '^\s*const\s+IPCC_URL\s*=\s*.*$'
 | 
				
			||||||
 | 
					    replace: "const IPCC_URL = '/ipcc'"
 | 
				
			||||||
 | 
					  notify:
 | 
				
			||||||
 | 
					    - docker compose build
 | 
				
			||||||
 | 
					    - docker compose up
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,3 +14,16 @@ location = /config {
 | 
				
			|||||||
    add_header Access-Control-Allow-Origin $scheme://$host always;
 | 
					    add_header Access-Control-Allow-Origin $scheme://$host always;
 | 
				
			||||||
    add_header Vary Origin always;
 | 
					    add_header Vary Origin always;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					location = /ipcc {
 | 
				
			||||||
 | 
					    proxy_pass https://bsky.app/ipcc;
 | 
				
			||||||
 | 
					    set $up_host "bsky.app";
 | 
				
			||||||
 | 
					    proxy_set_header Host $up_host;
 | 
				
			||||||
 | 
					    proxy_http_version 1.1;
 | 
				
			||||||
 | 
					    proxy_set_header Connection "";
 | 
				
			||||||
 | 
					    proxy_ssl_server_name on;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    proxy_hide_header Access-Control-Allow-Origin;
 | 
				
			||||||
 | 
					    add_header Access-Control-Allow-Origin $scheme://$host always;
 | 
				
			||||||
 | 
					    add_header Vary Origin always;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user