File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ rec {
137137 GH_ISSUES_REPO = "sectracker-testing" ;
138138 GH_SECURITY_TEAM = "setracker-testing-security" ;
139139 GH_COMMITTERS_TEAM = "sectracker-testing-committers" ;
140+ STATIC_ROOT = "${ toString ./src/website/static } " ;
140141 } ;
141142 } ;
142143
Original file line number Diff line number Diff line change 108108 type = types . nullOr types . str ;
109109 default = null ;
110110 } ;
111- env = mkOption {
111+ env = mkOption rec {
112+ description = ''
113+ Django configuration via environment variables, see `settings.py` for options.
114+ '' ;
112115 type = types . attrsOf types . anything ;
113- default = { } ;
116+ default = {
117+ STATIC_ROOT = "/var/lib/web-security-tracker/static" ;
118+ } ;
119+ # only override defaults with explicit values
120+ apply = lib . recursiveUpdate default ;
114121 } ;
115122 settings = mkOption {
116123 type = types . attrsOf types . anything ;
174181 {
175182 locations = {
176183 "/" . proxyPass = "http://localhost:${ toString cfg . wsgi-port } " ;
177- "/static/" . alias = "/var/lib/web-security-tracker/static/" ;
184+ "/static/" . alias = cfg . env . STATIC_ROOT ;
178185 } ;
179186 }
180187 // lib . optionalAttrs cfg . production {
Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ class Settings(BaseSettings):
3838 class DjangoSettings (BaseModel ):
3939 # SECURITY WARNING: don't run with debug turned on in production!
4040 DEBUG : bool = False
41+ STATIC_ROOT : Path = Field (
42+ description = """
43+ Writeable directory for compilimg static files, such as stylesheets, when running `manage collectstatic`.
44+ """
45+ )
4146 SYNC_GITHUB_STATE_AT_STARTUP : bool = Field (
4247 description = """
4348 Connect to GitHub when the service is started and update
You can’t perform that action at this time.
0 commit comments