Skip to content
Snippets Groups Projects
Verified Commit 3196f8f1 authored by nd's avatar nd
Browse files

add more warnings against using pip install for production setups

parent 6366a446
Branches
No related tags found
No related merge requests found
# uffd # Uffd
This is the UserFerwaltungsFrontend. This is the UserFerwaltungsFrontend.
A web service to manage LDAP users, groups and permissions. A web service to manage LDAP users, groups and permissions.
Development chat: [#uffd-development](https://rocket.cccv.de/channel/uffd-development) Development chat: [#uffd-development](https://rocket.cccv.de/channel/uffd-development)
## dependencies ## Dependencies
Please note that we refere to debian packages here and **not** pip packages.
- python3 - python3
- python3-ldap3 - python3-ldap3
- python3-flask - python3-flask
...@@ -17,11 +20,9 @@ Development chat: [#uffd-development](https://rocket.cccv.de/channel/uffd-develo ...@@ -17,11 +20,9 @@ Development chat: [#uffd-development](https://rocket.cccv.de/channel/uffd-develo
- python3-flask-babel - python3-flask-babel
Some of the dependencies (especially fido2 and flask-oauthlib) changed their API in recent versions, so make sure to install the versions from Debian Buster. Some of the dependencies (especially fido2 and flask-oauthlib) changed their API in recent versions, so make sure to install the versions from Debian Buster.
You can also use virtualenv with the supplied `requirements.txt`. For development, you can also use virtualenv with the supplied `requirements.txt`.
## development ## Development
Clone this repository with the `--recurse-submodules` flag to retrieve submodule dependencies.
Before running uffd, you need to create the database with `flask db upgrade`. The database is placed in Before running uffd, you need to create the database with `flask db upgrade`. The database is placed in
`instance/uffd.sqlit3`. `instance/uffd.sqlit3`.
...@@ -38,23 +39,30 @@ You can do so by setting `LDAP_SERVICE_MOCK=True` in the config. ...@@ -38,23 +39,30 @@ You can do so by setting `LDAP_SERVICE_MOCK=True` in the config.
Afterwards you can login as a normal user with "testuser" and "userpassword", or as an admin with "testadmin" and "adminpassword". Afterwards you can login as a normal user with "testuser" and "userpassword", or as an admin with "testadmin" and "adminpassword".
Please note that the mocked LDAP functionality is very limited and many uffd features do not work correctly without a real LDAP server. Please note that the mocked LDAP functionality is very limited and many uffd features do not work correctly without a real LDAP server.
## deployment ## Deployment
You should absolutly never use `pip install uffd` to deploy to production. Using a pip deployment for production will result in not updated dependencies is insecure.
Our pip dependencies are not regularly updated and neither tested. They just represent the version Debian based their packages on.
Instead we relay on the packaged Debian python packages and security updates done by Debian.
The pip package mainly exists for testing and as a required step to build the .deb package.
Use uwsgi. Make sure to run `flask db upgrade` after every update! To deploy to production, use our .deb package. It uses uwsgi to run uffd and ships an `uffd-admin` to execute flask commands in the correct context.
If you upgrade, make sure to run `flask db upgrade` after every update! The Debian package takes care of this by itself using uwsgi pre start hooks.
For an example uwsgi config, see our [uswgi.ini](uwsgi.ini). You might find our [nginx include file](nginx.include.conf) helpful to setup a web server in front of uwsgi. For an example uwsgi config, see our [uswgi.ini](uwsgi.ini). You might find our [nginx include file](nginx.include.conf) helpful to setup a web server in front of uwsgi.
## python style conventions ## Python Coding Style Conventions
PEP 8 without double new lines, tabs instead of spaces and a max line length of 160 characters. PEP 8 without double new lines, tabs instead of spaces and a max line length of 160 characters.
We ship a [pylint](https://pylint.org/) config to verify changes with.
## Config ## Configuration
Uffd reads its default config from `uffd/default_config.cfg`. Uffd reads its default config from `uffd/default_config.cfg`.
You can overwrite config variables by creating a config file in the `instance` folder. You can overwrite config variables by creating a config file in the `instance` folder.
The file must be named `conifg.cfg` (Python syntax), `config.json` or `config.yml`/`config.yaml`. The file must be named `conifg.cfg` (Python syntax), `config.json` or `config.yml`/`config.yaml`.
You can also set a custom file name with the environment variable `CONFIG_FILENAME`. You can also set a custom file name with the environment variable `CONFIG_FILENAME`.
## Bind with service account or as user? ## Bind with LDAP service account or as user?
Uffd can use a dedicated service account for LDAP operations by setting `LDAP_SERVICE_BIND_DN`. Uffd can use a dedicated service account for LDAP operations by setting `LDAP_SERVICE_BIND_DN`.
Leave that variable blank to use anonymouse bind. Leave that variable blank to use anonymouse bind.
......
...@@ -3,6 +3,7 @@ import os ...@@ -3,6 +3,7 @@ import os
with open('README.md', 'r', encoding='utf-8') as f: with open('README.md', 'r', encoding='utf-8') as f:
long_description = f.read() long_description = f.read()
long_description = '**DO NOT INSTALL FROM PIP FOR PRODUCTION DEPLOYMENTS**, see [Deployment](#Deployment) for more information.\n\n\n\n' + long_description
setup( setup(
name='uffd', name='uffd',
...@@ -29,7 +30,8 @@ setup( ...@@ -29,7 +30,8 @@ setup(
zip_safe=False, zip_safe=False,
python_requires='>=3.7', python_requires='>=3.7',
install_requires=[ install_requires=[
# Versions from Debian Buster # Versions Debian Buster packages are based on.
# DO NOT USE FOR PRODUCTION, those in the setup.py are not updated regularly
'ldap3==2.4.1', 'ldap3==2.4.1',
'flask==1.0.2', 'flask==1.0.2',
'Flask-SQLAlchemy==2.1', 'Flask-SQLAlchemy==2.1',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment