OpenCloning / OpenCloning/OpenCloning_frontend

Use relative paths for config.json and examples fetches to support sub-path proxy deployments

Open
#691 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
4
Forks
10
Avg merge
11d 9h
Merged PRs (30d)
3

Description

Hi Manu,

OpenCloning fetches at least two resources using absolute URL paths that break when the application is served behind a sub-path proxy:

  • axios.get("/config.json"): always resolves against the browser origin, not the OC base path
  • `/examples/${name}` (two occurrences): same issue for example cloning strategies

When OC is deployed behind JupyterHub, institutional reverse proxies, or our Reproducible Research Platform (RRP), the browser origin is the gateway (e.g. https://host:7443) rather than the OC backend port. A request to /config.json returns whatever the gateway serves at its root. In our case it is the RRP platform config, which has no backendUrl instead of OC's own config. The examples fetch similarly returns a platform HTML page instead of the JSON cloning strategy.

Proposed fix

Change both to relative paths in the source:

  • axios.get("/config.json") to axios.get("./config.json")
  • `/examples/${name}` to `examples/${name}` (remove leading slash)

Relative paths resolve from the page's base URL, which is the OC application root regardless of the proxy prefix. This is a two-line change in the source and requires no configuration.

Context

I encountered this while deploying OC with an openBIS adapter on RRP (see issue #667 for the broader generic backend discussion) to use openBIS instead of eLabFTW as the the research data management system / ELN-LIMS. The current workaround requires patching the built JavaScript at deploy time, which is fragile and build-version-specific. A source-level fix would benefit any non-localhost deployment.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the frontend source for the axios.get("/config.json") call and the two /examples/${name} fetches. Replace the leading-root paths with the proposed relative paths, then verify that config and example requests resolve correctly when the application is served below a proxy sub-path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.