[PATCH] aurweb.spawn: Integrate FastAPI and nginx
fmang at mg0.fr
Sun May 31 21:20:45 UTC 2020
Lukas Fleischer [2020-05-31 10:16:43 -0400]
> > diff --git a/conf/config.defaults b/conf/config.defaults
> > index 86fe765c..ed495168 100644
> > --- a/conf/config.defaults
> > +++ b/conf/config.defaults
> > @@ -41,9 +41,16 @@ cache = none
> > cache_pkginfo_ttl = 86400
> > memcache_servers = 127.0.0.1:11211
> > +[php]
> > +; Address PHP should bind when spawned in development mode by aurweb.spawn.
> > +bind_address = 127.0.0.1:8081
> > ; Directory containing aurweb's PHP code, required by aurweb.spawn.
> > ;htmldir = /path/to/web/html
> > +[fastapi]
> > +; Address uvicorn should bind when spawned in development mode by aurweb.spawn.
> > +bind_address = 127.0.0.1:8082
> > +
> Even if the dev-only options are indicated by comments, I am not sure
> whether it's a good idea to mix production and development configuration
> like this. Can we put them in a separate file or at least a separate
> section without too much effort?
aurweb.config is quite trivial so we could easily add mechanisms for
handling environments or things like that. However, since these values
are just ignored by production, I don’t think it’s a big deal.
How about creating conf/config.dev with dev-specific options, and
options most developers need to change (disable_http_login, etc.). In
TESTING, we would change 3) to “Copy conf/config.dev to conf/config”.
The downside is that when we add new required options to config.dev,
developers need to update their conf/config manually.
A more powerful option would be to have conf.d/00-defaults.ini,
conf.d/60-dev.ini, and conf.d/90-user.ini. I think most developers are
familiar with conf.d configurations already. Such a switch would break
everyone’s setup though, including production, but the fix is easy.
What do you think?
More information about the aur-dev