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. Discourse
  3. Updating Plugins

Updating Plugins

Scheduled Pinned Locked Moved Solved Discourse
20 Posts 2 Posters 1.3k 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.
  • M mononym

    Thanks. Unfortunately, I'm already stuck at the git command. I've tried the following:

    cd /app/code/plugins/discourse-translator
    sudo -u www-data git pull
    # fatal: detected dubious ownership in repository at '/app/data/plugins/discourse-translator'
    # To add an exception for this directory, call:
    # git config --global --add safe.directory /app/data/plugins/discourse-translator
    sudo -u www-data git config --global --add safe.directory /app/data/plugins/discourse-translator
    # error: could not lock config file /var/www/.gitconfig: Read-only file system
    sudo -u www-data git config --add safe.directory /app/data/plugins/discourse-translator  # without the global flag
    # fatal: not in a git directory
    
    J Offline
    J Offline
    joseph
    Staff
    wrote on last edited by
    #6

    @mononym said in Updating Plugins:

    git config --global --add safe.directory /app/data/plugins/discourse-translator

    remove the --global . It will then create the .git/config in the same diretory

    M 1 Reply Last reply
    0
    • J joseph

      @mononym said in Updating Plugins:

      git config --global --add safe.directory /app/data/plugins/discourse-translator

      remove the --global . It will then create the .git/config in the same diretory

      M Offline
      M Offline
      mononym
      wrote on last edited by
      #7

      I tried to as well but I get a fatal: not in a git directory error when removing the --global flag.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        joseph
        Staff
        wrote on last edited by
        #8

        Strange. Are you running this in /app/data/plugins/<plugin-repo> ? Which should be a git repo (check for .git subfolder) ?

        M 2 Replies Last reply
        0
        • J joseph

          Strange. Are you running this in /app/data/plugins/<plugin-repo> ? Which should be a git repo (check for .git subfolder) ?

          M Offline
          M Offline
          mononym
          wrote on last edited by
          #9

          @joseph Yes, I'm wondering about the same thing.

          root@973fc516-e3d4-4f67-b18b-3f55c5bd086f:/app/code/plugins/discourse-translator# ls -a
          .                         .github          .template-lintrc.cjs  assets       lib           spec
          ..                        .gitignore       Gemfile               config       package.json  translator.yml
          .discourse-compatibility  .prettierrc.cjs  Gemfile.lock          db           plugin.rb     yarn.lock
          .eslintrc.cjs             .rubocop.yml     LICENSE               example.gif  services
          .git                      .streerc         README.md             gems         setup.png
          
          1 Reply Last reply
          0
          • J joseph

            Strange. Are you running this in /app/data/plugins/<plugin-repo> ? Which should be a git repo (check for .git subfolder) ?

            M Offline
            M Offline
            mononym
            wrote on last edited by mononym
            #10

            @joseph said in Updating Plugins:

            /data/

            My bad. I was in app/code/.... Did not know the plugin exists in both locations.

            But unfortunately the git command still gives a fatal: not in a git directory even in the data subdirectory.

            1 Reply Last reply
            0
            • J Offline
              J Offline
              joseph
              Staff
              wrote on last edited by
              #11

              are you able to run simple commands like "git log" ?

              M 1 Reply Last reply
              0
              • J joseph

                are you able to run simple commands like "git log" ?

                M Offline
                M Offline
                mononym
                wrote on last edited by
                #12

                Simple git commands (stauts & log, tested with and without sudo -u www-data) give:

                fatal: detected dubious ownership in repository at '/app/data/plugins/discourse-translator'
                To add an exception for this directory, call:
                
                        git config --global --add safe.directory /app/data/plugins/discourse-translator
                

                When trying to solve the ownership with git config --add safe.directory /app/data/plugins/discourse-translator (with and without sudo -u www-data) I get :

                fatal: not in a git directory
                

                In the case of the translator plugin, I could maybe reinstall instead of update. As it is just a connection to a LibreTranslate instance. But that's probably not a solution for other plugins.

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  joseph
                  Staff
                  wrote on last edited by
                  #13

                  mmm, I am stumped. Why would it say not a git directory . Is there no '.git' ? There is a /app/data/plugins/discourse-translator/.git right ?

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    mononym
                    wrote on last edited by mononym
                    #14

                    Yes. This is the content:

                    root@973fc516-e3d4-4f67-b18b-3f55c5bd086f:/app/data/plugins/discourse-translator# ls -asl
                    total 3944
                       4 drwxr-xr-x 11 cloudron cloudron    4096 May  8  2024 .
                       4 drwxr-xr-x  4 cloudron cloudron    4096 Feb 25 05:03 ..
                       4 -rw-r--r--  1 cloudron cloudron     110 May  8  2024 .discourse-compatibility
                       4 -rw-r--r--  1 cloudron cloudron      60 May  8  2024 .eslintrc.cjs
                       4 drwxr-xr-x  8 cloudron cloudron    4096 May  8  2024 .git
                       4 drwxr-xr-x  3 cloudron cloudron    4096 May  8  2024 .github
                       4 -rw-r--r--  1 cloudron cloudron      88 May  8  2024 .gitignore
                       4 -rw-r--r--  1 cloudron cloudron      62 May  8  2024 .prettierrc.cjs
                       4 -rw-r--r--  1 cloudron cloudron      51 May  8  2024 .rubocop.yml
                       4 -rw-r--r--  1 cloudron cloudron      50 May  8  2024 .streerc
                       4 -rw-r--r--  1 cloudron cloudron      67 May  8  2024 .template-lintrc.cjs
                       4 -rw-r--r--  1 cloudron cloudron     134 May  8  2024 Gemfile
                       4 -rw-r--r--  1 cloudron cloudron    1228 May  8  2024 Gemfile.lock
                       4 -rw-r--r--  1 cloudron cloudron    1080 May  8  2024 LICENSE
                       4 -rw-r--r--  1 cloudron cloudron     227 May  8  2024 README.md
                       4 drwxr-xr-x  4 cloudron cloudron    4096 May  8  2024 assets
                       4 drwxr-xr-x  3 cloudron cloudron    4096 May  8  2024 config
                       4 drwxr-xr-x  3 cloudron cloudron    4096 May  8  2024 db
                    3668 -rw-r--r--  1 cloudron cloudron 3755037 May  8  2024 example.gif
                       4 drwxr-xr-x  5 cloudron cloudron    4096 Feb  8 05:04 gems
                       4 drwxr-xr-x  3 cloudron cloudron    4096 May  8  2024 lib
                       4 -rw-r--r--  1 cloudron cloudron     213 May  8  2024 package.json
                       8 -rw-r--r--  1 cloudron cloudron    6541 May  8  2024 plugin.rb
                       4 drwxr-xr-x  3 cloudron cloudron    4096 May  8  2024 services
                      12 -rw-r--r--  1 cloudron cloudron   11777 May  8  2024 setup.png
                       4 drwxr-xr-x  8 cloudron cloudron    4096 May  8  2024 spec
                       4 -rw-r--r--  1 cloudron cloudron     208 May  8  2024 translator.yml
                     160 -rw-r--r--  1 cloudron cloudron  161368 May  8  2024 yarn.lock
                    

                    The issue is exactly the same in the /app/data/plugins/discourse-data-explorer directory.

                    FYI, I recently pulled an update for my GravCMS and there sudo -u www-data git config --add safe.directory <theme/directory> + sudo -u www-data git pull worked as expected.

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mononym
                      wrote on last edited by
                      #15

                      As a test, I tried deleting the folder and installing the plugin anew following the steps in the documentation. The plugin (translator) was displayed correctly but not working for some reason (unable to detect the post language I guess). I finally restored a backup made just before this test.

                      J M 2 Replies Last reply
                      0
                      • M mononym

                        As a test, I tried deleting the folder and installing the plugin anew following the steps in the documentation. The plugin (translator) was displayed correctly but not working for some reason (unable to detect the post language I guess). I finally restored a backup made just before this test.

                        J Offline
                        J Offline
                        joseph
                        Staff
                        wrote on last edited by
                        #16

                        @mononym I can give this a try in a fresh install. What should I be testing after the post is installed?

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          mononym
                          wrote on last edited by
                          #17

                          I guess first one has to somehow install an old version of the discourse plugin. Mine, the discourse-translator plugin, is currently at commit eb55d60. I don't know git well enough to do that instead of a "regular" clone of the latest version. Thus, that differs a little from the Cloudron Discourse docs. Rebuild Discourse with the plugin.

                          Once done, navigate to the plugin folder, either in app/data/plugins/discourse-translator or app/code/plugins/discourse-translator, and try to git pull the latest version of the plugin. That's where it's stuck right now.

                          1 Reply Last reply
                          0
                          • M mononym

                            As a test, I tried deleting the folder and installing the plugin anew following the steps in the documentation. The plugin (translator) was displayed correctly but not working for some reason (unable to detect the post language I guess). I finally restored a backup made just before this test.

                            M Offline
                            M Offline
                            mononym
                            wrote on last edited by mononym
                            #18

                            Still trying to solve this before Discourse rolls out the breaking UI changes... What would be the correct procedure to delete and reinstall a plugin ?

                            1 Reply Last reply
                            0
                            • J Offline
                              J Offline
                              joseph
                              Staff
                              wrote on last edited by
                              #19

                              I think deleting the directory and restarting the app uninstalls the plugin. After that, you can reinstall it with https://docs.cloudron.io/apps/discourse/#installing-plugins

                              M 1 Reply Last reply
                              1
                              • J joseph

                                I think deleting the directory and restarting the app uninstalls the plugin. After that, you can reinstall it with https://docs.cloudron.io/apps/discourse/#installing-plugins

                                M Offline
                                M Offline
                                mononym
                                wrote on last edited by
                                #20

                                @joseph Perfect, thank you ! That did the job. And to my surprise, the settings (LibreTranslate API and URL) were still in place !

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