-
Notifications
You must be signed in to change notification settings - Fork 4
/
DEVELOPMENT
80 lines (63 loc) · 2.86 KB
/
DEVELOPMENT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
TODO: make a real file out of this
Quickstart
==========
- install python3-gunicorn python3-gevent python3-setproctitle python3-pyldap python3-unidecode python3-psycop2\
build-essential python-dev cython libusb-1.0-0-dev libudev-dev python3-lxml libssl-dev\
python3-setuptools python3-cryptography python3-cups python3-crypto python3-lazy-object-proxy python3-pil python3-hidraw\
pylint3 libcurl4-openssl-dev python3-dev python3-hidapi
- Ubuntu: virtualenv --python=python3 --system-site-packages .env
Fedora: virtualenv-3.5 --system-site-packages .env
- Initialize the repository "./run --init"
- Start the service using "./run --devel"
The non-docker way
==================
- install postgres
- install cups server, mosquitto + auth-plugin and configure in gosa config file
- create /var/lib/gosa + /var/lib/gosa/spool dirs
- run gosa.utils.gosa_ldap_monitor as a service on the LDAP server (add webhook in gosa and configure the monitors config)
SSL - selfsigned
================
- openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365
- add "ssl = true", "cert-file = /path/to/cert.pem", "key-file = /path/to/key.pem" to the "http" section
Testing
=======
# run all tests
- ./setup.py test --addopts="--runslow"
# run only fast tests
- ./setup.py test
# stop testing after first failed test
- ./setup.py test --addopts="-x --runslow"
# verbose output
- ./setup.py test --addopts="-v --runslow" or - ./setup.py test --addopts="-vv --runslow"
# run a single test
- ./setup.py test --addopts="--runslow src/tests/backend/components/test_jsonrpc_service.py::JsonRpcHandlerTestCase::test_login"
**Hint**
For debugging tests in PyCharm/Idea coverage must be turned off. Just comment out the `addopts` property on pytest.ini
SQL Alchemy
===========
SQL ausgeben für ein bestimmtes query_result:
from sqlalchemy.dialects import postgresql
print(str(query_result.statement.compile(dialect=postgresql.dialect(), compile_kwargs={"literal_binds": True})))
DBus access
===========
- create /etc/dbus-1/system.d/org.gosa.conf with content below and reload dbus (service dbus reload):
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- Only user root can own the gosa dbus instance -->
<policy user="root">
<allow own="org.gosa"/>
</policy>
<policy group="gonicus">
<allow own="org.gosa"/>
<allow receive_sender="org.gosa"/>
<allow send_destination="org.gosa"
send_interface="org.freedesktop.DBus.Introspectable"/>
<allow send_destination="org.gosa"
send_interface="org.gosa"/>
<allow send_destination="org.freedesktop.login1"/>
<allow send_destination="org.freedesktop.Hal"
send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
</policy>
</busconfig>