Ik heb de Discourse repository op GitHub geforkt. Hoe kan ik deze vervangen door de bestaande Discourse installatie op mijn site?

I forked the Discourse repository on GitHub. How can I replace it with the existing Discourse installation on my site? I have tried everything, but I encountered errors each time. I added my own Discourse repository from GitHub to the app.yml file, but I couldn’t proceed due to errors. Even when I managed to make the changes, it always reinstalled the original Discourse. How can we properly execute this process?

It helps to be specific.

1 like

Upon re-examination, I made a modification to the discourse I was analyzing, and I noticed that this change is visible on the update page within the admin panel. I am now updating it; if the adjustment functions correctly, I will revise this message accordingly.

These are the settings in my app.yml file, which I have rebuilt without encountering any errors. However, upon subsequent review, the modifications I made are not visible, although Discourse continues to operate flawlessly.

run:
  - exec: echo "Beginning of custom commands"
  ## If you want to set the 'From' email address for your first registration, uncomment and change:
  ## After getting the first signup email, re-comment the line. It only needs to run once.
  #- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
  - exec:
     cd: /var/www/discourse
     cmd:
         - sudo -u discourse git remote set-url origin https://github.com/KilicSelcuk/discourse.git
         - sudo -u discourse git fetch origin
         - sudo -u discourse git checkout origin/main
         - sudo -u discourse git remote set-branches --add origin main
         - sudo -u discourse git remote set-branches origin tests-passed
         - sudo -u discourse git reset --hard origin/main
  - exec: echo "End of custom commands"

So when you do view source and look at the 6th line or so, does the commit hash in the version string correspond to the latest commit in your forked repository?

I believed I had completed the task, but it appears to be ineffective. The latest update visible on the admin update page is: https://github.com/KilicSelcuk/discourse/commit/e44347414a8325ec25e5892c35bcd889d39a6668.

However, the actual modifications I made are reflected here: Commits · KilicSelcuk/discourse · GitHub.

In essence, the changes I implemented are not visible on the update page. Additionally, when I perform a rebuild, it does not incorporate my repository’s updates. If the changes had been applied, they would be visible.

My most recent configuration is as follows:

## Any custom commands to run after building
run:
  - exec: echo "Beginning of custom commands"
  ## To set the 'From' email address for your initial registration, uncomment and modify:
  ## After receiving the first signup email, re-comment the line. It only needs to run once.
  #- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
  - exec:
     cd: /var/www/discourse
     cmd:
         - sudo -u discourse git remote set-url origin https://github.com/KilicSelcuk/discourse.git
         - sudo -u discourse git fetch origin
         - sudo -u discourse git checkout origin/main
         - sudo -u discourse git remote set-branches --add origin main
#         - sudo -u discourse git remote set-branches origin tests-passed
#         - sudo -u discourse git branch -u origin/main
         - sudo -u discourse git reset --hard origin/main

Resolving this issue would be beneficial. I couldn’t find a helpful resource on the forum, but it might serve as a guiding reference for those who follow.

That’s usually a bad idea. You should make changes in a plugin.

2 likes

Indeed, I was originally doing this, but once the plugin was integrated into the core, I am no longer able to modify it. Unfortunately, the suggested solutions also proved ineffective: Overriding user_guardian.rb in a plugin (no fork necessary!) - #24 by kuaza

Als je een plugin hebt geforkt, dan moet je de meegeleverde plugin verwijderen en je eigen versie klonen.

Ik denk dat ik je hierover in een ander onderwerp heb verteld. Je wilt zeker alleen de plugin forken en niet de hele app en alle andere plugins.

1 like

I encounter an error whenever I attempt to install the plugin. If I have more time, I will try again: Overriding user_guardian.rb in a plugin (no fork necessary!) - #29 by pfaffman

Dat is de manier om je probleem op te lossen. Als je een foutmelding hebt en hulp wilt, moet je precies zeggen wat de foutmelding is, en de plugins sectie van je yml bestand en een link naar je forked plugin toevoegen.

4 likes

Regrettably, I am diligently striving to resolve the issue; I have shared the fault in this matter as well, yet I have not yet found a solution. Overriding user_guardian.rb in a plugin (no fork necessary!) - #29 by pfaffman

I am making this configuration; do you think I am making a mistake? Discourse updates indicate there is a change, but it shows the one from my local repository instead of the one from Discourse. I am updating, but nothing changes; the update still appears. (I believe it recognizes my modifications, but when I update, it pulls from the main repository):

## Any custom commands to run after building
run:
  - exec: echo "Beginning of custom commands"
  ## If you want to set the 'From' email address for your first registration, uncomment and change:
  ## After getting the first signup email, re-comment the line. It only needs to run once.
  #- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
  - exec:
     cd: /var/www/discourse
     cmd:
         - sudo -u discourse git remote set-url origin https://github.com/KilicSelcuk/discourse.git
         - sudo -u discourse git fetch --tags --prune-tags --prune --force origin
         - sudo -u discourse git checkout origin/main
         - sudo -u discourse git remote set-branches --add origin main
         - sudo -u discourse git remote set-branches origin tests-passed
#         - sudo -u discourse git branch -u origin
         - sudo -u discourse git reset --hard origin/main
  - exec: echo "End of custom commands"

Yes. I told you how to include just your forked plugin and you’re not doing that.

4 likes

Indeed, I have undertaken this task: Overriding user_guardian.rb in a plugin (no fork necessary!) - #29 by pfaffman. As you suggested, I experimented with both methods. The first approach resulted in an error, as documented here: Overriding user_guardian.rb in a plugin (no fork necessary!) - #30 by kuaza.

The second method rendered the site inaccessible. I am exploring alternative solutions in my quest for resolution, but progress has been limited, prompting me to consider other avenues.

Since I prefer not to make extensive modifications, I contemplated forking Discourse. I would simply update my fork with the latest changes from the main repository each time, then reapply only the modifications I have made, accepting this approach.

My primary challenge lies in identifying an effective and correct solution. I am willing to delete and rewrite the code, trying new approaches. However, in the face of uncertain errors, I am unfortunately unable to produce a definitive resolution.

thanks

Doe zoals @pfaffman voorstelt.

Ik doe dit met klanten en het is de beste manier.

Vooral als minder ervaren ontwikkelaar kom je in de problemen met het forken van de hoofd-repo.

1 like

That’s a full time job. People who did this term years ago are still sorry, and things moved much more slowly then.

I am already doing this, yet it still results in an error. I appreciate your attempt to assist, but I have already mentioned this two or three times before :confused:

You are correct, but how can I keep updates made to a core plugin within my own plugin? Should I not copy the core files and upload them to my repository? Or is there a way to automate this process?

thanks

Je hebt niet gedeeld wat er misging toen je alleen de geforkte plugin probeerde.

1 like

I attempted again and included the details of the error I encountered this time (almost all of them). Could you please review it: Overriding user_guardian.rb in a plugin (no fork necessary!) - #30 by kuaza

@kuaza Ik heb dit onderwerp gemarkeerd met unsupported-install en zal het sluiten. Volg de officiële installatie-instructies als je hier in de toekomst hulp wilt krijgen. Succes!

Er staan hierboven enkele juweeltjes van @pfaffman en @merefield die je hopelijk zult gebruiken om te leren hoe je met Discourse moet werken.

2 likes