Hosting own Git for Discourse


#1

Hi,

We’re using Discourse as a back-end for our front-end Node.js app.

We’d like to write our customised code to our own Git, however when I do this, I lose the styling of the Discourse pages and the commits from the original Discourse are also written to our personal Github org.

Is there any way we can host our own Discourse codebase while also referencing the main Discourse codebase for system updates?

Thanks,
amoncadot


(James Kiesel) #2

:fearful:

I think there’s a fundamental misunderstanding here. What kind of customizations are you trying to apply? Are you modifying code from within a docker container, or are you on an unsupported install?
There almost certainly must be a way to what you want to do using plugins or theme components, rather than the method that you’re describing.


#3

Okay so in short our setup is:

  • Running x2 discourse containers on one docker host load balanced between two unix sockets
  • Each unix socket is under a different dir i.e. 1st UNIX - /var/discourse & 2nd UNIX - /var/discourse_TWO

I want to write the files/subfolders under /var/discourse & /var/discourse_TWO to our personal Git so we can run CI/CD. There are custom configurations within these directories such as the app.yml files and modifying the web.template.yml file to launch a specific version of Discourse.

When I write these two directories to our own personal Git by running a git init etc, we see the original commits that are from the original Discourse codebase and when I rebuild containers, they styling of Discourse breaks.

If we want to add functionality to Discourse i.e. another setting under /admin, we will use plugins in order to achieve this. However we are not adding functionality. The .yaml files have just been modified.

Is there any way we can write these custom configurations to our personal Git without losing the styling of Discourse and not seeing original commits?


(Zack Siri) #4

I think the better solution would be to run discourse as a separate service and have your node js app call the discourse api, to mix things up with your node app.


#5

Hi Zack.

That is what it already does.

Node.js sits on a separate EC2 instance and calls the Discourse API which runs on a Docker host under two containers. The two containers talk to the docker host via UNIX.

I am just trying to write my /var/discourse and /var/discourse_TWO files to Git which is the problem.


#6

Hey guys,

Any ideas? Just want to write our .yaml files for Discourse to our own Git without any commits from the original Discourse codebase (GitHub - discourse/discourse_docker: A Docker image for Discourse)

Thanks


#7

Forgive me, I’ve not tried this configuration but it’s an interesting idea (if a lot of work?).

You are trying to create your own UI and use Discourse as an application server?

Couple of questions:

  • Are you saying that despite separating the UI from the back-end you are still having issues with formatting of the UI because discourse is including UI elements in its feed to your custom app and over time this is changing?
  • I assume you’ve forked the codebase, can’t you manage merges from the official instances to help prevent issues from occuring?

Out of interest, why didn’t you go the Theme/Plugin route to achieve this?


#8

Nope. We have a front-end Node.js app that talks to our backend Discourse docker containers. Users only interact with our Node.js app, so they never see Discourse.

Nope. I’m saying that I want to write our Discourse .yaml files that are used to build a container to our own personal Git. But when I create a dev environment and run a git init on the “/var/discourse” folder which contains /bin, /shared, /containers etc, it breaks the styling of Discourse and I’m not sure why.

When I run a rebuild, I always see this when the launcher bash script runs

From https://github.com/SamSaffron/pups
   7bde3d3..d1cdc3f  master     -> origin/master
 * [new tag]         v1.0.2     -> v1.0.2

So it’s like the discourse .yaml files are already preconfigured to pull from that personal Git.

We have forked the main discourse codebase. We are managing our main Discourse application files through the main discourse codebase. If we want to add functionality, we’ll use plugins.

Not sure what that is. We just want to use CI/CD to deploy our Discourse docker .yaml files.

Hope this helps.


#9

I think you’d better look up the definitions of UI and application server :wink:


#10

Lol.

Is anyone able to shed some light on why SamSaffron’s github is contacted when the launcher is ran? Couldn’t see any references to that repo within the launcher script.