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. Directus
  3. Installing Directus Extensions

Installing Directus Extensions

Scheduled Pinned Locked Moved Solved Directus
13 Posts 2 Posters 3.0k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic was forked from How to update/change a package.json in /app/code girish
This topic has been deleted. Only users with topic management privileges can see it.
  • girishG girish

    Documented here - https://docs.cloudron.io/apps/directus/#custom-modules

    andreasduerenA Offline
    andreasduerenA Offline
    andreasdueren
    wrote on last edited by
    #1

    @girish said in How to update/change a package.json in /app/code:

    Documented here - https://docs.cloudron.io/apps/directus/#custom-modules

    I'd like to propose a change in the documentation here:

    Add export EXTENSIONS_PATH="/app/data/node_modules" to the .env
    then

    # cd /app/data
    # HOME=/app/data/ npm i directus-extension-here
    

    then reboot directus

    This seems to work fairly reliably. Only one extension I was not able to get to run this way.

    girishG 1 Reply Last reply
    2
    • andreasduerenA andreasdueren

      @girish said in How to update/change a package.json in /app/code:

      Documented here - https://docs.cloudron.io/apps/directus/#custom-modules

      I'd like to propose a change in the documentation here:

      Add export EXTENSIONS_PATH="/app/data/node_modules" to the .env
      then

      # cd /app/data
      # HOME=/app/data/ npm i directus-extension-here
      

      then reboot directus

      This seems to work fairly reliably. Only one extension I was not able to get to run this way.

      girishG Do not disturb
      girishG Do not disturb
      girish
      Staff
      wrote on last edited by
      #2

      @andreasdueren The app already sets EXTENSIONS_PATH=/app/data/extensions . So, this is conflicting with your instructions.

      andreasduerenA 2 Replies Last reply
      0
      • girishG girish

        @andreasdueren The app already sets EXTENSIONS_PATH=/app/data/extensions . So, this is conflicting with your instructions.

        andreasduerenA Offline
        andreasduerenA Offline
        andreasdueren
        wrote on last edited by
        #3

        @girish Hmm that's actually suboptimal I think. What is the reason not to put all environmental variables in the .env file for the user to modify?

        girishG 1 Reply Last reply
        0
        • andreasduerenA andreasdueren

          @girish Hmm that's actually suboptimal I think. What is the reason not to put all environmental variables in the .env file for the user to modify?

          girishG Do not disturb
          girishG Do not disturb
          girish
          Staff
          wrote on last edited by
          #4

          @andreasdueren the EXTENSIONS_PATH in your case is only working by accident. I am guessing the reason why one of the extensions doesn't work for you is because it has a scoped name ? Like @foo/directus-extension-bar ?

          girishG 1 Reply Last reply
          0
          • girishG Do not disturb
            girishG Do not disturb
            girish
            Staff
            wrote on last edited by
            #5

            Investigating this on how to make it work properly .

            There are two methods it seems - https://docs.directus.io/extensions/installing-extensions.html :

            • via npm - this involves building a custom docker image. the code then just reads up package.json and looks for packages starting with directus-extension- .
            • via Extensions Folder - the code is looking for subdirectories recursively named directus-extension- and then reading the package.json inside that folder.

            Ideally, we can use the Extensions folder to install packages via npm. However, npm is making this really difficult. Investigating...

            1 Reply Last reply
            0
            • girishG girish

              @andreasdueren the EXTENSIONS_PATH in your case is only working by accident. I am guessing the reason why one of the extensions doesn't work for you is because it has a scoped name ? Like @foo/directus-extension-bar ?

              girishG Do not disturb
              girishG Do not disturb
              girish
              Staff
              wrote on last edited by
              #6

              @girish said in Installing Directus Extensions:

              @andreasdueren the EXTENSIONS_PATH in your case is only working by accident. I am guessing the reason why one of the extensions doesn't work for you is because it has a scoped name ? Like @foo/directus-extension-bar ?

              I was wrong about this. The reason an extension is not working for you is maybe because it is not named directus-extension-xxx ? Does it have that prefix?

              andreasduerenA 1 Reply Last reply
              0
              • girishG girish

                @girish said in Installing Directus Extensions:

                @andreasdueren the EXTENSIONS_PATH in your case is only working by accident. I am guessing the reason why one of the extensions doesn't work for you is because it has a scoped name ? Like @foo/directus-extension-bar ?

                I was wrong about this. The reason an extension is not working for you is maybe because it is not named directus-extension-xxx ? Does it have that prefix?

                andreasduerenA Offline
                andreasduerenA Offline
                andreasdueren
                wrote on last edited by
                #7

                @girish said in Installing Directus Extensions:

                @girish said in Installing Directus Extensions:

                @andreasdueren the EXTENSIONS_PATH in your case is only working by accident. I am guessing the reason why one of the extensions doesn't work for you is because it has a scoped name ? Like @foo/directus-extension-bar ?

                I was wrong about this. The reason an extension is not working for you is maybe because it is not named directus-extension-xxx ? Does it have that prefix?

                Nope that's not the problem. For example I have directus-extension-api-docs vie npm in the node_moduels folder installed but not working. The package.json lists the following dependencies:

                "devDependencies": {
                        "@directus/extensions-sdk": "^10.3.0",
                        "@directus/shared": "^9.24.0",
                        "@types/express": "^4.17.21",
                        "@types/jest": "^29.5.11",
                        "@types/node": "^18.19.8",
                        "@typescript-eslint/eslint-plugin": "^5.62.0",
                        "@typescript-eslint/parser": "^5.62.0",
                        "eslint": "^8.56.0",
                        "eslint-config-prettier": "^8.10.0",
                        "eslint-plugin-import": "^2.29.1",
                        "eslint-plugin-prettier": "^4.2.1",
                        "express": "^4.18.2",
                        "jest": "^29.7.0",
                        "jest-extended": "^3.2.4",
                        "openapi-schema-validator": "^12.1.3",
                        "pino": "^8.17.2",
                        "prettier": "^2.8.8",
                        "ts-jest": "^29.1.1",
                        "ts-node": "^10.9.2",
                        "typescript": "^4.9.5"
                    }
                

                These are the ones that did not install for some reason:

                        "@directus/extensions-sdk": "^10.3.0",
                        "@directus/shared": "^9.24.0",
                        "eslint-config-prettier": "^8.10.0",
                        "eslint-plugin-import": "^2.29.1",
                        "eslint-plugin-prettier": "^4.2.1",
                        "jest": "^29.7.0",
                        "jest-extended": "^3.2.4",
                        "openapi-schema-validator": "^12.1.3",
                        "pino": "^8.17.2",
                        "prettier": "^2.8.8",
                        "ts-jest": "^29.1.1",
                        "ts-node": "^10.9.2",
                
                girishG 1 Reply Last reply
                0
                • girishG girish

                  @andreasdueren The app already sets EXTENSIONS_PATH=/app/data/extensions . So, this is conflicting with your instructions.

                  andreasduerenA Offline
                  andreasduerenA Offline
                  andreasdueren
                  wrote on last edited by andreasdueren
                  #8

                  @girish said in Installing Directus Extensions:

                  @andreasdueren The app already sets EXTENSIONS_PATH=/app/data/extensions . So, this is conflicting with your instructions.

                  Going through the repository I also noticed that I am trying to change various other environmental variables:

                  export STORAGE_LOCATIONS="local,s3"
                  export AUTH_OKTA_DRIVER="openid" 
                  # as a side-note: It would be nice to have openID set up directly without having to do it manually
                  export AUTH_DISABLE_DEFAULT="true"
                  

                  They also seem to work (even though I do have some glitches sometimes with the storage locations)

                  1 Reply Last reply
                  0
                  • andreasduerenA andreasdueren

                    @girish said in Installing Directus Extensions:

                    @girish said in Installing Directus Extensions:

                    @andreasdueren the EXTENSIONS_PATH in your case is only working by accident. I am guessing the reason why one of the extensions doesn't work for you is because it has a scoped name ? Like @foo/directus-extension-bar ?

                    I was wrong about this. The reason an extension is not working for you is maybe because it is not named directus-extension-xxx ? Does it have that prefix?

                    Nope that's not the problem. For example I have directus-extension-api-docs vie npm in the node_moduels folder installed but not working. The package.json lists the following dependencies:

                    "devDependencies": {
                            "@directus/extensions-sdk": "^10.3.0",
                            "@directus/shared": "^9.24.0",
                            "@types/express": "^4.17.21",
                            "@types/jest": "^29.5.11",
                            "@types/node": "^18.19.8",
                            "@typescript-eslint/eslint-plugin": "^5.62.0",
                            "@typescript-eslint/parser": "^5.62.0",
                            "eslint": "^8.56.0",
                            "eslint-config-prettier": "^8.10.0",
                            "eslint-plugin-import": "^2.29.1",
                            "eslint-plugin-prettier": "^4.2.1",
                            "express": "^4.18.2",
                            "jest": "^29.7.0",
                            "jest-extended": "^3.2.4",
                            "openapi-schema-validator": "^12.1.3",
                            "pino": "^8.17.2",
                            "prettier": "^2.8.8",
                            "ts-jest": "^29.1.1",
                            "ts-node": "^10.9.2",
                            "typescript": "^4.9.5"
                        }
                    

                    These are the ones that did not install for some reason:

                            "@directus/extensions-sdk": "^10.3.0",
                            "@directus/shared": "^9.24.0",
                            "eslint-config-prettier": "^8.10.0",
                            "eslint-plugin-import": "^2.29.1",
                            "eslint-plugin-prettier": "^4.2.1",
                            "jest": "^29.7.0",
                            "jest-extended": "^3.2.4",
                            "openapi-schema-validator": "^12.1.3",
                            "pino": "^8.17.2",
                            "prettier": "^2.8.8",
                            "ts-jest": "^29.1.1",
                            "ts-node": "^10.9.2",
                    
                    girishG Do not disturb
                    girishG Do not disturb
                    girish
                    Staff
                    wrote on last edited by
                    #9

                    @andreasdueren did you see a "Killed" message when you ran npm install? I saw this when I was testing one other extension. The installed was killed mid way possibly due to lack of memory, I didn't investigate.

                    andreasduerenA 1 Reply Last reply
                    0
                    • girishG girish

                      @andreasdueren did you see a "Killed" message when you ran npm install? I saw this when I was testing one other extension. The installed was killed mid way possibly due to lack of memory, I didn't investigate.

                      andreasduerenA Offline
                      andreasduerenA Offline
                      andreasdueren
                      wrote on last edited by
                      #10

                      @girish said in Installing Directus Extensions:

                      @andreasdueren did you see a "Killed" message when you ran npm install? I saw this when I was testing one other extension. The installed was killed mid way possibly due to lack of memory, I didn't investigate.

                      I don't remember seeing one, no. I will try to replicate that.

                      1 Reply Last reply
                      0
                      • girishG Do not disturb
                        girishG Do not disturb
                        girish
                        Staff
                        wrote on last edited by girish
                        #11

                        I have added a script now in the latest package to install extensions. Seems to work with the extensions I have tried . See https://docs.cloudron.io/apps/directus/#extensions . I tested directus-extension-api-docs as well.

                        andreasduerenA 1 Reply Last reply
                        2
                        • girishG girish

                          I have added a script now in the latest package to install extensions. Seems to work with the extensions I have tried . See https://docs.cloudron.io/apps/directus/#extensions . I tested directus-extension-api-docs as well.

                          andreasduerenA Offline
                          andreasduerenA Offline
                          andreasdueren
                          wrote on last edited by
                          #12

                          @girish said in Installing Directus Extensions:

                          I have added a script now in the latest package to install extensions. Seems to work with the extensions I have tried . See https://docs.cloudron.io/apps/directus/#extensions . I tested directus-extension-api-docs as well.

                          Awesome thank you!

                          1 Reply Last reply
                          0
                          • andreasduerenA Offline
                            andreasduerenA Offline
                            andreasdueren
                            wrote on last edited by
                            #13

                            Seems to work like a charm!

                            1 Reply Last reply
                            1
                            • nebulonN nebulon marked this topic as a question on
                            • nebulonN nebulon has marked this topic as solved on
                            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