Discourse auf einem isolierten CentOS 7-Server installieren

Most plugins carry all the code they need and have a simple install. Those two you tried to use need to fetch gems (libraries) from the internet to able to function.

3 „Gefällt mir“

do you know where in the code those ruby gem fetches for plugins happen? I tried looking for it but haven’t found the right place yet.

I’m thinking maybe instead of using cached gems maybe it would be more elegant to run a rubygems mirror on the isolated host, i found a tutorial here and it looks like you can configure extra system-wide gem sources

https://guides.rubygems.org/run-your-own-gem-server/

1 „Gefällt mir“

Our internal Discourse has happily been running the same old version for a good long while now, but we are finally getting rid of IE9 so it’s way overdue for an upgrade.
I can report that this guide is still good with the latest versions of Discourse. Even with RHEL8 instead of 7 :slight_smile:

While experimenting I figured out a way to get those discourse-prometheus and discourse-calendar plugins working offline too even with the extra dependencies, the trick was to fish out the ruby gems from the plugin directory of the build server as well as the ones in /var/www/discourse/vendor/bundle/ruby

docker run -it -v ~/local/rubygems.org:/local-rubygems local_discourse/app /bin/bash -c "cp -rv /var/www/discourse/vendor/bundle/ruby /local-rubygems"
docker run -it -v ~/local/rubygems.org/plugin-gems/discourse-calendar:/local-rubygems local_discourse/app /bin/bash -c "cp -rv /var/www/discourse/plugins/discourse-calendar/gems /local-rubygems"
docker run -it -v ~/local/rubygems.org/plugin-gems/discourse-prometheus:/local-rubygems local_discourse/app /bin/bash -c "cp -rv /var/www/discourse/plugins/discourse-prometheus/gems /local-rubygems"

and then in /templates/web.template.yml :

  - exec:
      cd: $home
      hook: bundle_exec
      cmd:
        # copy local ruby cache
        - cp -rv /local-rubygems.org/ruby/* $home/vendor/bundle/ruby/
        - cp -rv /local-rubygems.org/plugin-gems/* $home/plugins/
        - su discourse -c 'bundle install --local --deployment --retry 3 --jobs 4 --verbose --without test development'

By the way it looks like the topic for Active Directory IIS SSO got lost at some point, but the code is still available at GitHub - laktak/discourse-sso: Single Sign On for Discourse with Active Directory and still works with the now renamed DiscourseConnect SSO

Ich habe ein weiteres Upgrade ausprobiert und es sieht so aus, als ob an einer Stelle ein neuer Abschnitt “yarn install” zu web.template.yml hinzugefügt wurde, der in der isolierten Umgebung fehlschlägt.

- exec:
      cd: $home
      cmd:
        - "[ ! -d 'node_modules' ] || su discourse -c 'yarn install --production && yarn cache list'"

Beim Vergleich der Inhalte des alten und neuen Containers sieht es so aus, als ob im neuen eine Menge gecachte Yarn-Pakete in /usr/local/share/.cache/yarn/v6 vorhanden sind, im alten jedoch nichts. Ich vermute, dass alle benötigten Node.js-Pakete früher im Basis-Image enthalten waren, jetzt aber während eines Rebuilds aktualisiert werden?

Ich werde experimentieren, indem ich den Yarn-Cache genauso auskopiere wie den Ruby-Cache und sehen, ob ich Yarn dazu bringen kann, die gecachten Pakete von der Build-Box zu verwenden.