mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-03 06:13:02 +02:00
Converting to gunicorn, which is the recommended production server for Flask apps, means app main() function is no longer called at startup, so we have to factor out the mDNS CNAME functionality for infix.local and network.local to a separate app. We take this opportunity to collapse the structure, move non-class methods to __init.py__, and rename the AvahiAlias class. A prototype for replacing the overhead of mdns-alias with a C daemon is in its early stages. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
mDNS Network Browser
This program is a Python Flask app that provides an mDNS browser for, e.g., Nginx. It is intended to answer calls to https://network.local
A UNIX socket, for fastcgi, is created in /tmp/netbrowse.sock with
permissions 0660 as the user and group the program is started as.
When using Finit this can be achieved with
service @www-data:www-data netbrowse network.local
In your Nginx server configuration, add:
location /browse {
include fastcgi_params;
fastcgi_pass unix:/tmp/netbrowse.sock;
}
For more a elaborate setup, you can have another server block:
server {
listen 80;
listen [::]:80;
server_name network.local;
location / {
include fastcgi_params;
fastcgi_pass unix:/tmp/netbrowse.sock;
}
}