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.
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.
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
אם פיצלת פלאגין, אז אתה צריך להסיר את הפלאגין הכלול ולשכפל את הגרסה שלך.
אני חושב שכבר סיפרתי לך על זה בנושא אחר. אתה בהחלט רוצה לפצל רק את הפלאגין ולא את כל האפליקציה ואת כל שאר הפלאגינים.
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
זו הדרך לפתור את הבעיה שלך. אם יש לך שגיאה, ואתה רוצה עזרה, אתה צריך לומר בדיוק מהי השגיאה, ולכלול את קטע התוספים של קובץ ה-yml שלך וקישור לתוסף המזלג שלך.
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.
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
עשה כפי שהציע @pfaffman.
אני עושה זאת עם לקוחות וזו הדרך הטובה ביותר.
במיוחד כמפתח פחות מנוסה, תיכנס לצרות אם תפצל את המאגר הראשי.
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 ![]()
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
לא שיתפת מה השתבש כשניסית את התוסף המפוצל בלבד.
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 תייגתי נושא זה כ-unsupported-install ואסגור אותו. אנא עקוב אחר הוראות ההתקנה הרשמיות אם ברצונך לקבל עזרה כאן בעתיד. בהצלחה!
ישנם כמה דברי חוכמה למעלה מ@pfaffman ו@merefield שאני מקווה שתשתמש בהם כדי לעזור לך להכיר כיצד לעבוד עם Discourse.