Join the conversation

Sign in to join this conversation, and others like it, in the communities you care about.

Wekan

Wekan is an open-source kanban board (Trello like) which allows a card-based task and to-do management.

Wekan / General

Mongo access and setup parameters

Mongo access and setup parameters

Wekan / General · January 7, 2020 at 5:09pm (Edited 4 years ago)

If I want to get access to mongodb database I might have to change a few parameters (right now it binds to 127.0.0.1 and port 27019 etc. Will not blow things up but have a few simple questions.

When I start and stop wekan ... does that start and stop mongo (can't find that in the scripts), meaning I stop wekan, make an edit in mongo and then restart wekan and if it works , great, and if not rollback and try again?

I see the process running mongo and see mongo-control scripting and its all referencing env variables in that script and its is in /snap/wekan/714/bin. I see a file called "config" where it appears all those env values are set. Is that where I do minor editing, and when I restart wekan, itsrestarts mongodb and rereads those variables?

All I want to do is to be able to read the mongodb directly on occasion (not change anything) through a local vpc secure server to one IP address while doing api development. I suspect that if I open up port 27019 to a single ip address and add a login. or use the wekan login, which I believe is documented in the installation notes, I probably would not be able to see that mongodb remotely as bound.

Oh another question. I logged into Mongo locally on the terminal (on the wekan server) and it let me in without auth. Is that correct? You run mongo without authentication enabled and leave it away from everything else for security?

If so, if I did want to expose Mongo inside of wekan even with a single ip and only for a short while, I would want to enable auth in mongo. If so where can I edit the wekan config to use/add creds?

If it is already under auth then disregard my question. I wanted to confirm that the binding was why I could not log in remotely which made me want to confirm the creds locally first..... Assumed 0 or no bind vs 127.


January 8, 2020 at 8:43pm

Yes, mongodb is bind to Wekan snap server localhost port 27019 without any auth

    • reply
    • like

    it is not exposed to outside of localhost

      • reply
      • like

      When you use any programming language or GUI tool like nosqlbooster to edit MongoDB database, changes at cards etc affect Wekan immediately visibly for all Wekan users

        • reply
        • like

        Because Meteor web framework Javascript listens for MongoDB changes

          • reply
          • like

          You can not edit any snap configs in files directly, those will be overwritten by next Wekan update version

            • reply
            • like

            All Wekan MongoDB database files and Caddyfile webserver config is at /var/snap/wekan/common

              • reply
              • like

              but you should not edit raw mongodb database files directly, it will very likely corrupt

                • reply
                • like

                You should use REST API

                  • reply
                  • like

                  Or access mongodb with some programming language, but remember that mongodb database structure can change in new Wekan versions, that would most likely break your code

                    • reply
                    • like

                    REST API will stay the same

                      • reply
                      • like

                      or alternatively, you could have check in your code about has database structure changed

                        • reply
                        • like

                        You can search Wekan open and closed issues at https://github.com/wekan/wekan/issues about mongodb auth

                          • reply
                          • like

                          I think it's already possible to change mongo-url if really necessary

                            • reply
                            • like

                            But I don't know why local mongodb would need auth

                              • reply
                              • like

                              only server admins with ssh access can access files at server

                                • reply
                                • like

                                normal users use webbrowser or REST API

                                  • reply
                                  • like

                                  Yes Wekan node+mongodb both start with sudo snap start wekan

                                    • reply
                                    • like

                                    If you only stop wekan, do it with sudo snap stop wekan.wekan

                                      • reply
                                      • like

                                      and later start it again with sudo snap start wekan.wekan

                                        • reply
                                        • like

                                        Likewise with mongodb, sudo snap start wekan.mongodb

                                          • reply
                                          • like

                                          There is different setting for Caddy, sudo snap set wekan caddy-enabled='false'

                                            Edited
                                            • reply
                                            • like

                                            or true

                                              • reply
                                              • like

                                              I don't know why would it be necessary to expose mongodb. You can run that script directly at server that Wekan Snap installed. Or connect with MongoDB GUI like nosqlbooster though ssh and run with GUI. or install SaltStack and use it's remote commands to run some script or code at that Wekan Snap server.

                                                • reply
                                                • like

                                                Well sure, if that feature is required, you could develop it and send pull request

                                                  • reply
                                                  • like
                                                  • reply
                                                  • like