Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. App Packaging & Development
  3. Correct mongodb connection parameters?

Correct mongodb connection parameters?

Scheduled Pinned Locked Moved Solved App Packaging & Development
6 Posts 2 Posters 1.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • timconsidineT Offline
    timconsidineT Offline
    timconsidine
    App Dev
    wrote on last edited by
    #1

    I am trying to package the CodexDocs app, and am struggling to express the required connection string in Cloudron format.

    The 'native' command is an environment variable :
    APP_CONFIG_database_mongodb_uri=mongodb://mongo:fe7cb9063db50ab63c87@codexdocs_codex-db:27017

    I ham trying to express this in Cloudron syntax in start.sh for mongodb addon as :
    export APP_CONFIG_database_mongodb_uri=mongodb://${CLOUDRON_MONGODB_USERNAME}:${CLOUDRON_MONGODB_PASSWORD}@${CLOUDRON_MONGODB_DATABASE}:${CLOUDRON_MONGODB_PORT}

    But I am getting AuthenticationFailed
    And I can't see what is wrong. 😊
    Just checking with y'all if my statement looks ok.

    Then I will try to check if the app is trying to connect with mongo username instead of ${CLOUDRON_MONGODB_USERNAME}

    Indie app dev, scratching my itches, lover of Cloudron PaaS

    1 Reply Last reply
    0
    • nebulonN Offline
      nebulonN Offline
      nebulon
      Staff
      wrote on last edited by
      #2

      This kinda looks fine, there is also CLOUDRON_MONGODB_URL which has the connect URL string already prebuilt.

      1 Reply Last reply
      1
      • timconsidineT Offline
        timconsidineT Offline
        timconsidine
        App Dev
        wrote on last edited by
        #3

        Oh interesting, so it could be just mongodb://${CLOUDRON_MONGODB_URL}, or it would still need user/password ?

        Indie app dev, scratching my itches, lover of Cloudron PaaS

        1 Reply Last reply
        0
        • timconsidineT Offline
          timconsidineT Offline
          timconsidine
          App Dev
          wrote on last edited by timconsidine
          #4

          Blundering about with trial&error, I managed to get it working by appending the database parameter.

          export APP_CONFIG_database_mongodb_uri=mongodb://${CLOUDRON_MONGODB_USERNAME}:${CLOUDRON_MONGODB_PASSWORD}@${CLOUDRON_MONGODB_HOST}:${CLOUDRON_MONGODB_PORT}/${CLOUDRON_MONGODB_DATABASE}

          Sadly there is another problem with the app also experienced when I was using local storage that pages are not actually created. I thought it might be a folders/permissions issue so tried to side-step it with a database.
          Thank you @nebulon for helping resolve that.
          But <sigh> behaviour persists.
          Oh well, I shall continuing investigating.

          Indie app dev, scratching my itches, lover of Cloudron PaaS

          1 Reply Last reply
          0
          • nebulonN Offline
            nebulonN Offline
            nebulon
            Staff
            wrote on last edited by
            #5

            The CLOUDRON_MONGODB_URL variable already has the schema (mongod://) in it as well as the database identifier, so you should be able to just use that directly.

            1 Reply Last reply
            1
            • nebulonN nebulon marked this topic as a question on
            • nebulonN nebulon has marked this topic as solved on
            • timconsidineT Offline
              timconsidineT Offline
              timconsidine
              App Dev
              wrote on last edited by
              #6

              Cool, that makes it more concise and less open to mis-use (by me 😄 )

              Indie app dev, scratching my itches, lover of Cloudron PaaS

              1 Reply Last reply
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Bookmarks
              • Search