Recommended production setup with a virtualenv, uWSGI, and systemd.
-
Use
webpass.service.exampleas a guide for where the Python virtualenv should live. -
Create a new Python virtualenv in that location (matching the service file) with appropriate permissions. You may want a dedicated user added to the web server group (
www-dataor equivalent). -
Clone this repository somewhere on the host.
-
Activate the virtualenv:
source /path/to/venv/bin/activate- Install the package:
pip install /path/to/cloned/repo-
Create
webpass.inifromwebpass.ini.exampleand place it in the virtualenv root. -
Place
wsgi.pyin the virtualenv root. -
Create a
webpass.servicefromwebpass.service.example. Adjust paths, user/groups, and setAPP_PATHto the URL path prefix for the app on the host. -
Copy the unit file to
/etc/systemd/systemand runsystemctl daemon-reload. -
Start the service once so it creates the instance folder. It will likely crash without a database; stop it afterward.
-
Find the instance folder under the virtualenv (typically under a
varpath for the package). -
Put a
config.pyand yourpasswords.kdbxfile in that instance folder. See Examples. -
Reverse proxy with nginx, for example:
location /password {
include uwsgi_params;
uwsgi_pass unix:/srv/http/webpass-venv/webpass.sock;
}With Apache, unix sockets may not work; configure uWSGI with a TCP listener instead and adjust webpass.ini accordingly. See the uWSGI configuration docs.
-
Create a static directory in the webroot for that virtual host and copy the
jsandcssfolders from thepywebpasspackagestaticdirectory into it. -
Reload/restart nginx (or Apache) and restart
webpass.service.