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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    FORM.IO : attempting custom package

    App Packaging & Development
    5
    10
    346
    Loading More Posts
    • 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.
    • timconsidine
      timconsidine last edited by

      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

      girish timconsidine 2 Replies Last reply Reply Quote 3
      • girish
        girish Staff @timconsidine last edited by

        @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 Reply Quote 2
        • girish
          girish Staff last edited by

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

          timconsidine 1 Reply Last reply Reply Quote 1
          • timconsidine
            timconsidine @girish last edited by

            @girish thank you

            1 Reply Last reply Reply Quote 0
            • luckow
              luckow translator last edited by

              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

              timconsidine 1 Reply Last reply Reply Quote 1
              • timconsidine
                timconsidine @luckow last edited by

                @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 Reply Quote 0
                • nebulon
                  nebulon Staff last edited by

                  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 Reply Quote 2
                  • timconsidine
                    timconsidine @timconsidine last edited by 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 1 Reply Last reply Reply Quote 0
                    • M
                      msbt App Dev @timconsidine last edited by

                      @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.

                      timconsidine 1 Reply Last reply Reply Quote 1
                      • timconsidine
                        timconsidine @msbt last edited by

                        @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 Reply Quote 1
                        • First post
                          Last post
                        Powered by NodeBB