Updating Plugins
-
Hello. I want to update the discourse-translator plugin due to coming core changes in Discourse. With v3.4 a banner appeared:
[Admin Notice] One of your themes or plugins needs updating for compatibility with upcoming Discourse core changes. (id:discourse.post-menu-widget-overrides) Identified plugin: 'discourse-translator'
When looking at the plugins (commit hash) in the Discourse admin settings menu, it seems like the plugins do not update automatically.
Is updating plugins identical to installing them ?
-
Thanks for the reply. Sounds good. I wonder if I have to repeat the installation procedure just with a pull instead of clone like this :
cd /app/code/plugins/<plugin-repo> # installed plugin directory git config --global --add safe.directory /app/data/plugins/<plugin-repo> # make git work git pull <plugin-repo> # pull instead of clone cd .. # continue with install procedure chown -R cloudron:cloudron <plugin-dir> cd /app/code gosu cloudron:cloudron bundle exec rake plugin:install_all_gems gosu cloudron:cloudron bundle exec rake db:migrate gosu cloudron:cloudron bundle exec rake assets:precompile
or only the pull ?
-
Thanks for the reply. Sounds good. I wonder if I have to repeat the installation procedure just with a pull instead of clone like this :
cd /app/code/plugins/<plugin-repo> # installed plugin directory git config --global --add safe.directory /app/data/plugins/<plugin-repo> # make git work git pull <plugin-repo> # pull instead of clone cd .. # continue with install procedure chown -R cloudron:cloudron <plugin-dir> cd /app/code gosu cloudron:cloudron bundle exec rake plugin:install_all_gems gosu cloudron:cloudron bundle exec rake db:migrate gosu cloudron:cloudron bundle exec rake assets:precompile
or only the pull ?
@mononym said in Updating Plugins:
gosu cloudron:cloudron bundle exec rake db:migrate
gosu cloudron:cloudron bundle exec rake assets:precompileThese two can be skipped, I think. The package does this already on a app restart (you should restart the app after you git update).
-
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
-
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
-
@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 -
Strange. Are you running this in
/app/data/plugins/<plugin-repo>
? Which should be a git repo (check for .git subfolder) ?@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
-
Strange. Are you running this in
/app/data/plugins/<plugin-repo>
? Which should be a git repo (check for .git subfolder) ? -
Simple git commands (
stauts
&log
, tested with and withoutsudo -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 withoutsudo -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.
-
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. -
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.
-
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.
-
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
orapp/code/plugins/discourse-translator
, and try togit pull
the latest version of the plugin. That's where it's stuck right now.