@@ -4,6 +4,15 @@ PyCaosDB tries to read from the inifile specified in the environment variable `P
...
@@ -4,6 +4,15 @@ PyCaosDB tries to read from the inifile specified in the environment variable `P
alternatively in `~/.pycaosdb.ini` upon import. After that, the ini file `pycaosdb.ini` in the
alternatively in `~/.pycaosdb.ini` upon import. After that, the ini file `pycaosdb.ini` in the
current working directory will be read additionally, if it exists.
current working directory will be read additionally, if it exists.
Here, we will look at the most common configuration options. For a full and comprehensive
description please check out the [example pycaosdb.ini file](https://gitlab.com/caosdb/caosdb-pylib/-/blob/main/examples/pycaosdb.ini). You can download this file and use
it as a starting point.
Typically, you need to change at least the `url` and `username` fields as required. (Ask your
CaosDB administrator or IT crowd if you do not know what to put there, but for the demo instance at
https://demo.indiscale.com, `username=admin` and `password=caosdb` should work).
## Authentication ##
## Authentication ##
The default configuration (that your are asked for your password when ever a connection is created
The default configuration (that your are asked for your password when ever a connection is created
...
@@ -17,6 +26,8 @@ can be changed by setting `password_method`:
...
@@ -17,6 +26,8 @@ can be changed by setting `password_method`:
Windows). The password will be queried on first usage.
Windows). The password will be queried on first usage.
* with `password_method=plain` (**strongly discouraged**)
* with `password_method=plain` (**strongly discouraged**)
The following illustrates the recommended options:
```ini
```ini
[Connection]
[Connection]
username=YOUR_USERNAME
username=YOUR_USERNAME
...
@@ -35,7 +46,10 @@ username=YOUR_USERNAME
...
@@ -35,7 +46,10 @@ username=YOUR_USERNAME
## SSL Certificate ##
## SSL Certificate ##
You can set the pass to the ssl certificate to be used:
In some cases (especially if you are testing CaosDB) you might need to supply an SSL certificate to
allow SSL encryption.
The `cacert` option sets the path to the ssl certificate for the connection: