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

    Solved Not able to use Crypto module

    N8N
    4
    5
    248
    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.
    • MooCloud_Matt
      MooCloud_Matt last edited by MooCloud_Matt

      Hello to all,

      I'm trying a bit N8N, to see the performance on various tasks that now we use some bash or python script to do.

      But I wasn't able to use the Node Crypto function, even when I set the ENV to export NODE_FUNCTION_ALLOW_EXTERNAL=* or
      export NODE_FUNCTION_ALLOW_EXTERNAL=crypto

      I even try with the API to add ENV to the container directly but Nada.

      my test crypt in the Function node is this:

      let crypto;
      const items = [{
          json: {
              "is disable": "yes"
          }
      }]
      try {
          crypto = await import('crypto');
      } catch (err) {
          return items
      }
      

      088dd749-ffb4-4fcb-81d3-2e8694f40fd3-image.png

      I'm not a good JS dev, and my understanding is pretty basic (i live tnx to the debuggers) so is highly possible that is my code doesn't work, but maybe is some weird implementation with the docker container.

      Matteo. R.
      Founder and Tech-Support Manager.
      MooCloud MSP
      Swiss Managed Service Provider

      BrutalBirdie girish 2 Replies Last reply Reply Quote 0
      • BrutalBirdie
        BrutalBirdie Staff @MooCloud_Matt last edited by BrutalBirdie

        @MooCloud_Matt said in Not able to use Crypto module:

        But I wasn't able to use the Node Crypto function, even when I set the ENV to export NODE_FUNCTION_ALLOW_EXTERNAL=* or

        Did you restart the app after setting the env?

        Like my work? Consider donating a beer 🍻 Cheers!

        1 Reply Last reply Reply Quote 1
        • girish
          girish Staff @MooCloud_Matt last edited by

          @MooCloud_Matt Since crypto is a node built-in, you have to do:

          export NODE_FUNCTION_ALLOW_BUILTIN=crypto
          

          I fixed up our docs at https://docs.cloudron.io/apps/n8n/#built-in-node-modules

          robi 1 Reply Last reply Reply Quote 3
          • robi
            robi @girish last edited by

            @girish should this any some others be added as default for better out of box functionality?

            Life of Advanced Technology

            girish 1 Reply Last reply Reply Quote 0
            • girish
              girish Staff @robi last edited by

              @robi I guess this is something for upstream. Ideally, we don't have to make such decisions since we are not experts on the app.

              1 Reply Last reply Reply Quote 0
              • Topic has been marked as a question  girish girish 
              • Topic has been marked as solved  girish girish 
              • First post
                Last post
              Powered by NodeBB