Git Product home page Git Product logo

Comments (7)

Anemy avatar Anemy commented on July 19, 2024

Hi @madansu thanks for opening the issue - this isn't something we support - yet. We have a feedback forum we use for tracking feature requests (which allows for upvoting), looks like this is in there already: https://feedback.mongodb.com/forums/924283-compass/suggestions/38666278-i-wish-to-accelerate-connection-to-a-deployment-f If it's alright I'll close this issue for the feedback forum one, feel free to reopen if you'd like it tracked here as well.

A bit of a workaround, Compass does support loading connections from disk. On Linux, connections are pulled from disk with .json files in the directory ~/.config/COMPASS_APP_NAME/Connections where COMPASS_APP_NAME is the name of the user’s installed compass. MongoDB\ Compass for vanilla compass.

from compass.

madansu avatar madansu commented on July 19, 2024

Hi @Anemy,

Can you point me to where this location would be on a Windows computer ?
Also, if the password is missing from the connection file, will Compass prompt me for the password ?

Thanks,

from compass.

madansu avatar madansu commented on July 19, 2024

Also, can you please share the format of the connection stored on the disk

from compass.

slarti-b avatar slarti-b commented on July 19, 2024

@Anemy : Can you specify even which connection to use from the command line?

I found the files in AppData. I took an existing one as a template and created a new one with my script (I want a script that creates a tunnel then opens the connection all in one). I generated new UUID and used it for both filename and _id, and set connection params but left the rest alone. It does not even see the new file! When i open Compass it simply ignores my new connection. Existing connections can be manipulated there, but not new ones created it seems?

from compass.

Anemy avatar Anemy commented on July 19, 2024

@madansu Apologies for missing your message above, somehow the notification must have slipped me. Really sorry.
For anyone stumbling upon this issue here's where they're stored as of now:

Windows: %APPDATA%\Roaming\MongoDB Compass\Connections
Windows: C:\Users[user-name]\AppData\Roaming\MongoDB Compass\Connections
Mac OSX: /Users/[userid]/Library/Application Support/MongoDB Compass/Connections
Linux: ~/.config/MongoDB Compass/Connections
Each saved connection is stored in that directory as a json file currently (with secrets in the system's credential store).

We've recently redone and are currently improving a lot of the connection storing and connecting logic, so these may change in the coming weeks/months.

@slarti-b If I understand correctly you're looking for proxy/ssh tunnel functionality from Compass? You might want to try the new beta with the new connection experience where we're adding proxy support: https://github.com/mongodb-js/compass/releases
This will be published for General Availability (GA) soon but it may be not for another week or two.
If the connection is edited in the file and isn't showing up in Compass there's likely an error loading that configuration, I would check your log (also something that might only be in the recent beta as of writing this).

from compass.

slarti-b avatar slarti-b commented on July 19, 2024

@Anemy : thanks for the paths.

In terms of my approach, no, that's not really what I'm trying to do. I do not want to use a tunnel built in to Compass. We have an external application that creates the tunnels. With that I can either create a tunnel or get an SSH connection, etc. I have a number of helper scripts for specific applications that create the tunnel and launch the relevant client application.

I do not want to use the tunnelling within Compass for two reasons:

  1. Our external system takes care of 2FA, etc. and I have to use this specific system as per our security policy
  2. Our external system also takes care of discovery (I can specify the connection I want by giving the type of system and customer/environment and it will find the correct machine, hosting center, etc.)

So, what I really want is to be able to launch Compass from the command line, giving it a connection string from the command line when I do, and it will connect to that connection (asking me for password first!). Based on this discussion, I understand that this is not possible. So, I thought I could at least create/update a file for the connection (so it specifies the local port for the tunnel, etc.) with my script and launch Compass and then I'd just need to select the connection my script had just defined. However, if I create a new file (I took an existing one as a template and update the values, generated a new hash which I used as both ID and filename) then it does not show up when i open Compass. Is there somewhere else I need to register them?

I have also logged an issue (https://jira.mongodb.org/browse/COMPASS-5612) for the fact that I can't save a connection without a password (every other DB client has the option to ask for the password each time instead of forcing you to save it). I guess that could be connected to it not showing up? (Since I haven't set a password for the new connection.)

from compass.

slarti-b avatar slarti-b commented on July 19, 2024

Also, log file shows nothing relevant

{"t":{"$date":"2022-03-22T08:54:03.473Z"},"s":"I","c":"COMPASS-MAIN","id":1001000001,"ctx":"logging","msg":"Starting logging","attr":{"version":"1.30.1","nodeVersion":"14.16.0","electronVersion":"13.5.1","chromeVersion":"91.0.4472.164","platform":"win32","arch":"x64","osReleaseName":null,"osReleaseVersion":null}}
{"t":{"$date":"2022-03-22T08:54:04.306Z"},"s":"I","c":"COMPASS-TELEMETRY","id":1001000094,"ctx":"Telemetry","msg":"Enabling Telemetry reporting"}
{"t":{"$date":"2022-03-22T08:54:04.307Z"},"s":"I","c":"COMPASS-TELEMETRY","id":1001000093,"ctx":"Telemetry","msg":"Loading telemetry config","attr":{"telemetryCapableEnvironment":true,"hasAnalytics":true,"currentUserId":"","state":"enabled","queuedEvents":0}}
{"t":{"$date":"2022-03-22T08:54:04.311Z"},"s":"I","c":"COMPASS-TELEMETRY","id":1001000093,"ctx":"Telemetry","msg":"Loading telemetry config","attr":{"telemetryCapableEnvironment":true,"hasAnalytics":true,"currentUserId":"ccaa052e-d976-4477-aa89-26a73f45f370","state":"enabled","queuedEvents":0}}
{"t":{"$date":"2022-03-22T08:54:05.335Z"},"s":"I","c":"COMPASS-APP","id":1001000092,"ctx":"Main Window","msg":"Rendering app container"}
{"t":{"$date":"2022-03-22T08:54:24.396Z"},"s":"I","c":"COMPASS-MAIN","id":1001000003,"ctx":"app","msg":"Closing application"}

from compass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.