Phuks-co / throat

Open Source link aggregator and discussion platform powering Phuks
https://phuks.co
MIT License
74 stars 32 forks source link

Add a site configuration page for admins #333

Closed happy-river closed 3 years ago

happy-river commented 3 years ago

Allow admins to change many site settings from a new page which resembles FireFox's about:config. The config settings which are necessary to get the site up in the first place remain in config.yaml or environment variables, and the remainder, which mostly control site behavior, move to the SiteMetadata table. Two exceptions are site.footer and site.expando_sites which remain in config.yaml for now because they are not simple data types. A new Site Configuration page allows the admin to edit all these settings.

This PR contains a new migration to create SiteMetadata entries based on the existing configuration, so admins of existing sites should run the migration with the same config.yaml and environment variables set that they have been using to run the site. After the migration, check the new admin Site Configuration page, and any value listed there may now be removed from the config file and/or environment. For future new installations, the migration will write the defaults from config.py to the database, and then the admin can change those settings using the Site Configuration page.