edina / nbexchange

External exchange for nbgrader
Other
6 stars 2 forks source link

Restore configuraiton options of NbExchange #171

Open ykazakov opened 1 month ago

ykazakov commented 1 month ago

It seems that the following documented configuration options are not actually used in the code:

c.NbExchange.base_url = /services/exchange
c.NbExchange.base_storage_location = /var/data/exchange/storage
c.NbExchange.db_url = mysql://username:password@my.msql.server.host:3306/db_name

Instead, the values of the following environment variables are used:

https://github.com/edina/nbexchange/blob/985796a553a56f4ee39f74f46ab8577a9c263728/nbexchange/app.py#L65-L66 https://github.com/edina/nbexchange/blob/985796a553a56f4ee39f74f46ab8577a9c263728/nbexchange/database.py#L18

It would be nice to update documentation regarding these options.

Personally, I would prefer to use the configuration options over environment variables since this approach is more flexible: it is always possible to set the configuration options to the value of the variables, e.g.:

c.NbExchange.base_url = os.environ["JUPYTERHUB_SERVICE_PREFIX"]
ykazakov commented 1 month ago

I think this is also related to #26.