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
  • 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 | Demo | Docs | Install
  1. Cloudron Forum
  2. App Packaging & Development
  3. FORM.IO : attempting custom package

FORM.IO : attempting custom package

Scheduled Pinned Locked Moved App Packaging & Development
10 Posts 5 Posters 1.7k Views 5 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

      So I decided to have a bash at packaging an app.
      I have previously installed what others have built but not myself packaged from scratch. So standby for some dumb questions, sorry.

      I decided to try to package FORM.IO as i think it would be popular with others, as well as useful to myself. I got it working as a docker-compose installation on another VPS.

      I have blundered through changes to their Dockerfile and package.json, and have got to a point where it installs but hangs in healthcheck because of failed connection to mongodb (specified as an addon in CloudronManifest.json). I believe I fixed this by editing src/db/index.js to say let db = ${CLOUDRON_MONGODB_URL};

      But on install, the logs show what seems to be a race condition.
      Needy to investigate more, but wondering if anyone has seen this?

      Screenshot 2022-01-09 at 20.28.31.png

      girishG timconsidineT 2 Replies Last reply
      3
      • timconsidineT timconsidine

        So I decided to have a bash at packaging an app.
        I have previously installed what others have built but not myself packaged from scratch. So standby for some dumb questions, sorry.

        I decided to try to package FORM.IO as i think it would be popular with others, as well as useful to myself. I got it working as a docker-compose installation on another VPS.

        I have blundered through changes to their Dockerfile and package.json, and have got to a point where it installs but hangs in healthcheck because of failed connection to mongodb (specified as an addon in CloudronManifest.json). I believe I fixed this by editing src/db/index.js to say let db = ${CLOUDRON_MONGODB_URL};

        But on install, the logs show what seems to be a race condition.
        Needy to investigate more, but wondering if anyone has seen this?

        Screenshot 2022-01-09 at 20.28.31.png

        girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #2

        @timconsidine It seems some node module got compromised somewhere. We are seeing this when using surfer CLI as well . See also https://github.com/compodoc/compodoc/issues/1171 and https://github.com/aws/aws-cdk/issues/18323

        1 Reply Last reply
        2
        • girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by
          #3

          It seems https://github.com/Marak/colors.js/issues/285#issuecomment-1008300773 might be the module in question.

          timconsidineT 1 Reply Last reply
          1
          • girishG girish

            It seems https://github.com/Marak/colors.js/issues/285#issuecomment-1008300773 might be the module in question.

            timconsidineT Offline
            timconsidineT Offline
            timconsidine
            App Dev
            wrote on last edited by
            #4

            @girish thank you

            1 Reply Last reply
            0
            • luckowL Offline
              luckowL Offline
              luckow
              translator
              wrote on last edited by
              #5

              some background: https://www.bleepingcomputer.com/news/security/dev-corrupts-npm-libs-colors-and-faker-breaking-thousands-of-apps/

              Pronouns: he/him | Primary language: German

              timconsidineT 1 Reply Last reply
              1
              • luckowL luckow

                some background: https://www.bleepingcomputer.com/news/security/dev-corrupts-npm-libs-colors-and-faker-breaking-thousands-of-apps/

                timconsidineT Offline
                timconsidineT Offline
                timconsidine
                App Dev
                wrote on last edited by
                #6

                @luckow Interesting
                As my build is only in alpha and I don't care about colors at this stage, I just deleted it from package.json.
                Cheating maybe, but other priorities for now.

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

                  Since @girish mentioned our cli and surfer cli also being affected, for anyone following this thread, we have update both packages now to fix the issue. So if you hit this, please update them.

                  1 Reply Last reply
                  2
                  • timconsidineT timconsidine

                    So I decided to have a bash at packaging an app.
                    I have previously installed what others have built but not myself packaged from scratch. So standby for some dumb questions, sorry.

                    I decided to try to package FORM.IO as i think it would be popular with others, as well as useful to myself. I got it working as a docker-compose installation on another VPS.

                    I have blundered through changes to their Dockerfile and package.json, and have got to a point where it installs but hangs in healthcheck because of failed connection to mongodb (specified as an addon in CloudronManifest.json). I believe I fixed this by editing src/db/index.js to say let db = ${CLOUDRON_MONGODB_URL};

                    But on install, the logs show what seems to be a race condition.
                    Needy to investigate more, but wondering if anyone has seen this?

                    Screenshot 2022-01-09 at 20.28.31.png

                    timconsidineT Offline
                    timconsidineT Offline
                    timconsidine
                    App Dev
                    wrote on last edited by timconsidine
                    #8

                    So my build is still failing to make a db connection
                    In the original app config/default.json, they have this :

                    "mongo": "mongodb://localhost:27017/formioapp",

                    I converted this to :
                    "mongo": "mongodb://${CLOUDRON_MONGODB_HOST}:${CLOUDRON_MONGODB_PORT}/${CLOUDRON_MONGODB_DATABASE}",
                    But it doesn't connect and logs say :
                    (node:1) UnhandledPromiseRejectionWarning: Error: Could not connect to the given Database for server updates: mongodb://${CLOUDRON_MONGODB_HOST}:${CLOUDRON_MONGODB_PORT}/${CLOUDRON_MONGODB_DATABASE}.
                    That suggests to me that the variables' values are not being passed through.
                    How should I be referencing the cloudron mongodb variables?
                    The config file is .json so plain text file.

                    M 1 Reply Last reply
                    0
                    • timconsidineT timconsidine

                      So my build is still failing to make a db connection
                      In the original app config/default.json, they have this :

                      "mongo": "mongodb://localhost:27017/formioapp",

                      I converted this to :
                      "mongo": "mongodb://${CLOUDRON_MONGODB_HOST}:${CLOUDRON_MONGODB_PORT}/${CLOUDRON_MONGODB_DATABASE}",
                      But it doesn't connect and logs say :
                      (node:1) UnhandledPromiseRejectionWarning: Error: Could not connect to the given Database for server updates: mongodb://${CLOUDRON_MONGODB_HOST}:${CLOUDRON_MONGODB_PORT}/${CLOUDRON_MONGODB_DATABASE}.
                      That suggests to me that the variables' values are not being passed through.
                      How should I be referencing the cloudron mongodb variables?
                      The config file is .json so plain text file.

                      M Offline
                      M Offline
                      msbt
                      App Dev
                      wrote on last edited by
                      #9

                      @timconsidine JSON does not have any notion of environment variables by default, probably easiest if you sed/replace them via start.sh and just enter the actual values from env | grep MONGO.

                      timconsidineT 1 Reply Last reply
                      1
                      • M msbt

                        @timconsidine JSON does not have any notion of environment variables by default, probably easiest if you sed/replace them via start.sh and just enter the actual values from env | grep MONGO.

                        timconsidineT Offline
                        timconsidineT Offline
                        timconsidine
                        App Dev
                        wrote on last edited by
                        #10

                        @msbt thank you
                        I've decided to 'step over' adjusting them in the config file (because I can't) and adjusted the app code to read the config file
                        e.g. process.env.CLOUDRON_MONGODB_HOST as it is nodejs app
                        Not there yet but making progress

                        1 Reply Last reply
                        1
                        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