Started messing around with a multisite instance of discourse and was wondering instead of defining sites in app.yml hooks is there a way to make this an external file (like the multisite.yml only on the host VPS not in the docker container, at least configurable from the host) or have an sh file define discourse forums in a db table.
I would also like to know is there a command line or something I can run to add a new site without rebuilding the whole app?
hooks:
after_postgres:
# this would have to be set for each sitedb somehow instead of b_discourse
- exec: sudo -u postgres createdb b_discourse || exit 0
- exec:
stdin: |
grant all privileges on database b_discourse to discourse;
cmd: sudo -u postgres psql b_discourse
raise_on_fail: false
- exec: /bin/bash -c 'sudo -u postgres psql b_discourse <<< "alter schema public owner to discourse;"'
- exec: /bin/bash -c 'sudo -u postgres psql b_discourse <<< "create extension if not exists hstore;"'
- exec: /bin/bash -c 'sudo -u postgres psql b_discourse <<< "create extension if not exists pg_trgm;"'
after_code:
- exec:
cd: $home/plugins
cmd:
- mkdir -p plugins
- git clone https://github.com/discourse/docker_manager.git
before_bundle_exec:
- file:
path: $home/config/multisite.yml
contents: |
secondsite:
adapter: postgresql
database: b_discourse
pool: 25
timeout: 5000
host_names:
- sub.domain.tld
after_bundle_exec:
- exec: cd /var/www/discourse && sudo -H -E -u discourse bundle exec rake multisite:migrate
Discourse multisites are new for me, but I have setup and am comfortable in MediaWiki multisties.