| @@ -20,9 +20,9 @@ Guide | |||||
| cp config/config.yml.sample config/config.yml | cp config/config.yml.sample config/config.yml | ||||
| vim config/config.yml # follow instructions | vim config/config.yml # follow instructions | ||||
| cat data/schema.sql | sqlite3 data/db.sqlite3 | cat data/schema.sql | sqlite3 data/db.sqlite3 | ||||
| mkdir logs | |||||
| mkdir logs templates/.cache | |||||
| sudo chmod 0600 config/config.yml data/db.sqlite3 | sudo chmod 0600 config/config.yml data/db.sqlite3 | ||||
| sudo chown www-data:www-data config/config.yml data data/db.sqlite3 logs | |||||
| sudo chown www-data:www-data config/config.yml data data/db.sqlite3 logs templates/.cache | |||||
| ... # TODO: convert these into scripts, add SDE instructions, add module instructions | ... # TODO: convert these into scripts, add SDE instructions, add module instructions | ||||
| ### Test | ### Test | ||||
| @@ -3,3 +3,15 @@ | |||||
| from .getters import get_current, get_overview, get_summary, get_unit | from .getters import get_current, get_overview, get_summary, get_unit | ||||
| from .routes import home, navitem | from .routes import home, navitem | ||||
| from .._provided import config | from .._provided import config | ||||
| def _get_scopes(): | |||||
| """Determine the required scopes, depending on enabled operations.""" | |||||
| for cname in config["enabled"]: | |||||
| campaign = config["campaigns"][cname] | |||||
| for opname in campaign["enabled"]: | |||||
| optype = campaign["operations"][opname]["type"] | |||||
| if optype == "collection": | |||||
| return {"esi-assets.read_assets.v1"} | |||||
| return {} | |||||
| SCOPES = _get_scopes() | |||||