The code editor runs software from your servers, so it should not share a hostname with the console.
Before you start
- Run server 2.51.0 or later and proxy server 1.5.2 or later. Earlier releases don’t support a separate editor hostname.
- Count the site’s active workspaces, excluding the system workspace (
public). The editor hostname supports exactly one active workspace. If you have more than one, leaveALPACON_EDITOR_HOSTempty and turn off the editor on servers you don’t trust. - Choose a hostname reserved for the editor, such as
alpacon-editor.example.com. The console, API, and other services must each use a different hostname from the editor. Use the same registrable domain as the console, such asexample.com, so the browser can send the editor’s login cookie. Create a DNS record and install a TLS certificate that covers the editor hostname. - Serve the console over HTTPS. If you set
ALPACON_FRONT_DOMAIN_ROOT, setALPACON_HTTP_TYPE=https. Otherwise, setALPACON_URLto the HTTPS console origin with no path. Use ASCII for the console and API hostnames, including thexn--form of internationalized names.
Set up the hostname
- Route the new hostname to the proxy and enable WebSocket upgrades. You can forward all requests on that hostname or forward only requests under
/proxy/editor/. Check that the route forwards the editor hostname and allows WebSocket upgrades. - Set
ALPACON_EDITOR_HOST=alpacon-editor.example.comin the environment file shared by the server and proxy. Check that you entered only the hostname, with no scheme, port, or path. - Recreate the server and proxy together. Check that both services start.
- Open an editor from the console. Users with editors already open need to open them again. Check that the editor address uses the new hostname.
- On the console hostname, request
/proxy/editor/test-session/test-channel/test-token/using these dummy values. Check that it returns HTTP 404. - If administrators saw a warning about the shared editor hostname before the change, open the console as an administrator. Check that the warning is gone.
After the change
Have users clear the browser’s site data for the console hostname. Then have each user sign back in and end their previous sign-ins one at a time from Sign-in sessions to revoke those login tokens.
Troubleshooting
| Symptom | Fix |
|---|---|
| The proxy doesn’t start | Configure a valid HTTPS console origin. Set ALPACON_FRONT_DOMAIN_ROOT with ALPACON_HTTP_TYPE=https, or use an HTTPS ALPACON_URL with no path when ALPACON_FRONT_DOMAIN_ROOT is empty. |
| The server doesn’t start | Read the startup message for the setting to fix. Set ALPACON_EDITOR_HOST to a bare DNS hostname distinct from the console and API hostnames. Use ASCII for both the console and API hostnames. Remove CSRF or CORS entries that trust the editor hostname, including matching wildcards or patterns in your site’s local_settings.py. Turn off any CORS setting that allows all origins. |
| The editor returns HTTP 404 | Open the editor from the console and verify the address uses the configured editor hostname. Confirm that the site has exactly one active workspace, excluding public. |
Go back
- Empty
ALPACON_EDITOR_HOSTin the shared environment file. Check that the setting is empty. - Recreate both services together. Check that both start.
- Restore the previous routing. Check that the previous editor route forwards requests to the proxy again.
- Open the editors again from the console. Check that the editors load using the previous hostname.