אפשרויות קונפיגורציה כקוד ל-Discourse?

אז לא מדברים על פריסת המופע עם מסד נתונים וכו’.

האם יש דפוס קיים לתחזוקת מופע באמצעות פורמט הצהרתי כלשהו? קטגוריות, תגיות, מדיניות וכו’. חשבתי שיהיה נחמד למשתמשים הטכניים שלנו להמליץ על שינויים באמצעות PR לעומת שרשורי נושאים וביצוע ידני, אבל לא ראיתי תוסף או כלי אחר של “as code” שמתמקד בתצורת הארגון של Discourse.

4 לייקים

I think the expectation is that sites will use the pre-seeded site feedback category for this. Its description is: “Discussion about this site, its organization, how it works, and how we can improve it.”

That’s an interesting idea. What benefit would it have over just having users suggest changes in regular topics? Is the goal to have a way of keeping track of changes that have been made to the site’s configuration over time?

Site settings, categories, tags, policies etc, can be configured with the Discourse API. It might be possible to have a script that managed your site’s configuration via the API in a git repo. The script could be run when a PR on the repo is accepted. From my point of view this would be more difficult than manually making changes to the site’s config via the UI though.

2 לייקים

10-4 on the Category. For now I was crowdsourcing a bit on an existing pattern. For me its getting that gitops style community engagement so landed with this one, but can punt it over to the other if it helps.

And yeah we use a bit of config as code for a lot of things so you get the clean revision control, deterministic roll back, clear change review, etc. GUI based changes are not bad (and what we do today via community feedback loops) but its a manual operation and the decision context can be lost to time. And the org constructs exist in the middle between the infra and the actual dialog so its not a deployment or rehydration thing.

And yeah PR based triggers (or even an Issue) can fire off a runbook that figures out the proposed change and does the operation. Doing the diff analysis and linting can be difficult which is why i was poking around to see if anyone had tried it yet. The ask is definitely square in the nice to have camp and only might resonate with a certain demographic.

2 לייקים

אני (ובטוחני שקהילת שפת התכנות שלנו) נשמח מאוד ליכולת הזו. בפרט, אשמח להיות מסוגל לנהל ערכות נושא, רכיבים וטקסטים של אתר במאגר GitHub שבו אנשים יכולים להגיש בקשות משיכה (pull requests) בקלות. גם הגדרות כלליות של האתר יהיו נחמדות, אבל אלו שלושת הדברים שהכי כואב לתחזק בממשק משתמש אינטרנטי.

אם זה לא אפשרי היום — ואני לא חושב שזה כן, לפחות לא עבור מופע בתשלום/מתארח — האם ניתן לשייך זאת מחדש לבקשת תכונה?

לייק 1

Immediately after writing that, I thought to double check the UI. It seems this is possible — at least to create/import a theme from a git repo! How does this work for updates? Is it able to pull new commits? I found Installing a theme from a private Git repository, but that doesn’t discuss update.

Is it possible to convert an existing theme or component to track a git repository?

You can export a theme, upload it to a repository, and install that.

All remote themes have a section at the top where you can decide if you want it to update automatically when Discourse is updated. Furthermore, there is a background job that checks if a more recent version is available, and you can check for new updates manually too. When a new version is available, the button offers to update the component.

You can also find that information in the guide about Installing a theme or theme component.

In case you haven’t already found it, there is also a tutorial about theme development

3 לייקים

זה נהדר, תודה @מועין! זה מכסה שני מקורות עיקריים להתאמה אישית של האתר שלנו.

עדיין הייתי רוצה מאוד להשתמש ב-git כדי לנהל את טקסטים של האתר מכיוון שרבים מהם (כמו ההנחיות וה-FAQ וכדומה) הם ארוכים, לא טריוויאליים, ויכולים להיות בקוד פתוח לקלט וסקירה של הקהילה.

הגדרות האתר האחרות יהיה נחמד שיהיו, אבל בהחלט לא קריטיות כמו אלו.

Those are usually base on a topic in the staff category. I think you can move them to a different category and make the post a wiki. Then your members can edit them.

You can also use the FAQ URL, Privacy policy URL and ToS URL site settings and host these somewhere else

לייק 1

Yeah, but the FAQ URL setting unfortunately has other behaviors that makes its use very much self-defeating for this purpose.

Just to point out that it is clear that it is already possible to manage content in source control, take a look at this topic, it’s maintained on GitHub:

at the bottom:

though I’m not sure if this functionality has yet been released or announced (or if that’s intended)

לייק 1

I’ve started fiddling around a GitHub action that submits updates to the site_texts section of the admin panel via API. It’s pretty rudimentary at the moment (and is failing for big values with a 422 for some reason), but it’s promising.

Definitely needs more work.

לייק 1

We don’t currently have any plans to release it as a re-usable tool. But you can check the code for our sync here. It leans on all the normal Discourse REST APIs, including a data-explorer query (details here).

2 לייקים