Hi
I need to deploy discourse on 3 environments, each pointing to a different SSO Authorization URL.
Is there a way to set the SSO authorization URL without having to login and go via the admin panel?
Regards
Configuring SSO Authorization URL via config
The original poster, shahidmir, needs to deploy Discourse on three environments, each with a different SSO Authorization URL, and is looking for a way to set this without using the admin panel.
swarnava suggests running a script from the server console to update the SiteSetting values. However, shahidmir is looking for a way to automate this process via a property setting in the build files.
shahidmir notes that the SSO URL is stored in the Postgres database, and wonders if a script can be run to update the URL value during deployment.
pfaffman suggests using the API as an alternative, which would require creating a settings uploader and editing a JSON file with the desired settings. However, this would still require obtaining an API key for each Discourse instance.
Ultimately, shahidmir may need to perform the configuration manually as a dev-ops task for now.
Hi
I need to deploy discourse on 3 environments, each pointing to a different SSO Authorization URL.
Is there a way to set the SSO authorization URL without having to login and go via the admin panel?
Regards
Hey there,
It is mentioned in the first post on this topic:
from server console run:
cd /var/discourse
./launcher enter app
rails c
irb > SiteSetting.enable_sso = false
irb > SiteSetting.sso_url = "https://www.example.com/sso"
irb > SiteSetting.sso_secret = "Your_secret_token"
irb > exit
exit
Cheers
Hi thanks for your reply.
Could I ask, would this need to be done manually once discourse is deployed?
I was hoping to do this via some property setting in one the build files, so when the docker image is created the new setting takes effect?
Regards
Just to add further information:
I have checked that the SSO_URL value that I want to configure per environment in saved in the postgres DB.
I wonder if i need to run some postgres script when the application is built/deployed to update the URL value to what I want it?
How else would it be done?
Another way to do it is via the API. I built a settings uploader. You could edit by hand the settings you want to upload in a json file. There are some sample json files in the repo.
You’d still need to get an API key for each Discourse.
thanks for that, may just have to do it manually as a dev-ops task for now.