OSC / nginx_stage

[MOVED] Stages & controls the per-user NGINX environment
https://github.com/OSC/ondemand/tree/master/nginx_stage
MIT License
0 stars 1 forks source link

Use a merge when parsing the configuration file #28

Closed nickjer closed 6 years ago

nickjer commented 6 years ago

Currently to change the filesystem location of only the sandbox apps for a particular OnDemand portal you need to specify the filesystem paths for system, user-shared, and sandbox apps, e.g.:

app_root:
  dev: '~%{owner}/ondemand/dev/%{name}'
  usr: '/var/www/ood/apps/usr/%{owner}/gateway/%{name}'
  sys: '/var/www/ood/apps/sys/%{name}'

as it will overwrite the default values even if you didn't want to change the usr and sys values.

One enhancement would be to do an equivalent Hash#merge and Hash#compact (I know these don't exist in Ruby core lib, so equivalent code would be used) with the default values, that way the configuration file can then look like:

app_root:
  dev: '~%{owner}/ondemand/dev/%{name}'

to only override the sandbox location.

If for some reason you wanted to disable a specific app-type then you could set:

app_config_path:
  usr: null

the equivalent Hash#compact would then remove the option after the merge.