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

Fauxton only works went mounted to url "/",. #944

Closed
KpjComp opened this issue Jul 29, 2017 · 20 comments
Closed

Fauxton only works went mounted to url "/",. #944

KpjComp opened this issue Jul 29, 2017 · 20 comments

Comments

@KpjComp
Copy link

KpjComp commented Jul 29, 2017

I'm using Fauxton with Express, and when mounted say at url "/db".. everything fails..

Expected Behavior

When mounted at say '/db', request should be '/db/_session',..

Current Behavior

Instead of say requests like -> '/db/_session', the console is showing requests like -> '/_session'

Possible Solution

Make the fauxton route path configurable.

code like ->

    return window.location.origin + '/' + app.utils.safeURLName(database);

This is assuming we have everything running at '/'..

Steps to Reproduce (for bugs)

Run Fauxton from a route like "/db"

Context

I'm trying to make an express app, that can host website, and fauxton etc. Assuming everything is @ "/" is not ideal. So a request say for session would be '/db/_session'

Your Environment

Node
Windows

@VladimirCores
Copy link

VladimirCores commented Apr 25, 2018

Any guide how to properly solve this problem?

@popojargo
Copy link
Member

I'll look into this this weekend

@popojargo
Copy link
Member

@garrensmith or @Antonio-Maranhao, some urls are registered as apiurl and other as server (we call this one to access couch). We use the apiurl for the raw json query.

As I am in the process to review the routes, I would like to replace apiurl with server url. Do you have any objections?

This way, we could simply control the base url in the settings.json 🎉

@wohali
Copy link
Member

wohali commented Apr 29, 2018

It would be great if Fauxton can determine where it's hosted automatically. Imagine hosting CouchDB behind a reverse proxy that places all URLs under /db/ or something. You won't be able to edit settings.json in this situation as CouchDB might be deployed from packages or in a docker container.

@popojargo
Copy link
Member

By default, it would use relative path. For example, if you access Fauxton from /db/_utils, the resolved host would be /db

@garrensmith
Copy link
Member

Making Fauxton use a relative path would be awesome but don't replace apiurl. The apiurl is used for the little json button on the top right so that a user can see the api endpoint.

@wohali
Copy link
Member

wohali commented Apr 30, 2018

@garrensmith But does that have to be hard-coded at compile time, or can it be dynamically calculated based on runtime information? If the latter I'm all thumbs up :)

@garrensmith
Copy link
Member

garrensmith commented Apr 30, 2018 via email

@popojargo
Copy link
Member

Yeah, basically, I calculate the absolute urls with the window.location.href and the relative url. PR should be landing today or tomorrow.

@VladimirCores
Copy link

VladimirCores commented May 1, 2018

Great! Will this change be included in a snapshot installed from apt-get?

@wohali
Copy link
Member

wohali commented May 1, 2018

It will be included in the next point release of CouchDB (2.2.0) in the official packages.

@h0jeZvgoxFepBQ2C
Copy link

Is the old Futon GUI still available in CouchDB2 somehow? We can't upgrade due to this bug unfortunately.

@wohali
Copy link
Member

wohali commented Jun 26, 2018

@lichtamberg No, Futon is no longer supported. Recommend you wait until 2.2.0.

@h0jeZvgoxFepBQ2C
Copy link

Thanks for your feedback, is there an ETA when the 2.2.0 will be finished? There are still some bugs open, so I don't know whow long it will take for it to get released?

@popojargo
Copy link
Member

Closing this since it has been fixed with #1078.

@popojargo
Copy link
Member

@lichtamberg @DQvsRA Any chance you can test the RC for CouchDB 2.2 and see if it works as expected?

@h0jeZvgoxFepBQ2C
Copy link

h0jeZvgoxFepBQ2C commented Jul 25, 2018

I would love to, but I'm not sure how to install it? I'm just using the normal debian package?

@popojargo
Copy link
Member

popojargo commented Jul 25, 2018

@lichtamberg you'll need to build from source

@ceremcem
Copy link

ceremcem commented Aug 2, 2018

When will it be available for downloading via package managers?

@popojargo
Copy link
Member

@ceremcem When CouchDB 2.2.0 RC3 will be accepted. Test of this release candidate would be appreciated !

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

No branches or pull requests

7 participants