Storing Multisite Configuration in Database

(Joe Shidel) #1

This may me more relevant here then in the extensibility category. The mods can feel free to remove my old post Dynamic multisite deployment.

I have been exploring the source code to see if what I would like to do is possible, and I have come to the conclusion that it probably is with some modifications.

I would like to be able to create a discourse deployment where new forums can be created dynamically. I need a separate forum for each group that gets created on my main site.

The multisite gem uses multisite.yml to setup/manage all of the database connections. This means that this file needs to be modified in order to add a new forum (correct?).

What I would like to do is have a table, or store the data in redis. I would just need to modify the multisite gem to read from a database rather then the multisite.yml (correct?).

I would appreciate any tips on other approaches I could take, or steps I am missing in making this happen.

Also I would be happy to contribute my work back to the project If it is something that is desired, or already on the road map.

(Sam Saffron) #2

I am open to extracting multisite into a gem and adding support for more backing stores, however this is key infrastructure that now works perfectly for us and I can not risk any regressions in either performance or functionality

There is no work on multisite planned.

(Joe Shidel) #3

@sam is there currently any method of automating the creation of new sites?

The other option would be to create new containers dynamically, but that would end up being expensive if I need to dynamically generate many forums.

(Sam Saffron) #4

we rebuild multisite.yml and restart, but this is getting into the hosting business