Administrative Bulk Operations

Considering that this command needs to be run inside the Docker container, and the default pwd inside the container when running ./launcher enter app appears to be /var/www/discourse, the command described here seems a little odd for a few reasons

  • the site_settings includes the secret access keys used for S3 and other API’s, it feels like these should not be stored in a file under /var/www since that is traditionally the location for files that get served to the web
  • since we are inside the container at this default pwd, I would expect the file saved here would be lost the container stops?

From inside the container, I used this command mount | grep ^/dev/ | grep -v /etc/ to determine that the location /shared inside the container appears to map back to /var/discourse/shared/standalone on the host system. So it seems like maybe the command should be something like this?

cd /var/discourse
./launcher enter app
rake site_settings:export | grep -v key | grep -v secret > /shared/site_settings_$(date "+%Y-%m-%d-%H-%M-%S").yml

this would leave the file in a location such as /var/discourse/shared/standalone/site_settings_2024-08-14-15-53-11.yml on the host system

note that the extra grep commands piped here will remove any lines with the word “key” or “secret” in them in order to remove API keys but would also remove lines that included those words for non-sensitive reasons

does this sound about right?