Commit bae2fe1d authored by Max Rees's avatar Max Rees

Add FastCGI support using flup

parent 24683c92
......@@ -17,8 +17,44 @@ Dependencies
------------
* Python 3.6+
* `Jinja2 <https://pypi.org/project/Jinja2/>`_ >= 2.10.3 (CGI frontend
* `Jinja2 <https://pypi.org/project/Jinja2/>`_ >= 2.10.3 (web
application dependency)
* `Flup <https://pypi.org/project/flup/>`_ >= 1.0.3 (web application
dependency)
* `APK Kit <https://pypi.org/project/apkkit/>`_ >= 6.0.6.1 (database
builder dependency)
* libapk (database builder dependency)
Running the web application
---------------------------
Thanks to Flup, the web application can be run as either a traditional
CGI program, or using FastCGI. Here's an example Lighttpd configuration
for traditional CGI usage under the URL ``/pkg``::
$HTTP["url"] =~ "^/pkg(/|$)" {
alias.url += (
"/pkg/style.css" => "/path/to/apkvitrine/style.css",
"/pkg" => "/path/to/apkvitrine/cgi.py",
)
cgi.assign = (".py" => "/path/to/apkvitrine/cgi.py")
}
Here's FastCGI::
$HTTP["url"] =~ "^/pkg(/|$)" {
alias.url += (
"/pkg/style.css" => "/path/to/apkvitrine/style.css",
"/pkg" => "/path/to/apkvitrine/cgi.py",
)
fastcgi.server += ( ".py" => ( "apkvitrine" => (
# Replace var.run_dir with wherever lighttpd can make a
# socket.
"socket" => var.run_dir + "apkvitrine.sock",
"bin-path" => "/path/to/apkvitrine/cgi.py",
# Tune to your requirements.
"max-procs" => 5,
) ) )
}
This diff is collapsed.
......@@ -15,6 +15,25 @@ repos = system aarch64 ppc ppc64 pmmx x86_64
; Substitutions: {revision}
gl_rev_url = https://code.foxkit.us/adelie/packages/-/commit/{revision}
; Required: data directory
; This is the directory in which the web application looks for the SQL
; database files.
;
; This option should only be specified in the @default section.
data_dir = /var/db/apkvitrine
; Optional: enable static HTML caching
; Each page that the web application believes to be static (for the
; lifetime of the SQL database) will be cached underneath this
; directory. Combined with FastCGI, this makes loading latencies very
; low. It should be manually emptied after the SQL database is updated.
;
; This directory should already exist, or be creatable by the user under
; which the web application runs.
;
; This option should only be specified in the @default section.
;cache_dir = /var/tmp/apkvitrine
; *********************
; * Bugzilla settings *
; *********************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment