| 182 | | === Dedicated user for schleuder-cli === |
| 183 | | |
| 184 | | Create a separate "schleuder-mgmt" user that is able to talk to the API but doesn't have r/w access to the sqlitedb |
| | 182 | |
| | 183 | === Schleuder configuration === |
| | 184 | |
| | 185 | Lots of useful information in [https://schleuder.nadir.org/docs/| Schleuder3's official documentation]. |
| | 186 | |
| | 187 | The following commands and file edits should be performed under the dedicated schleuder user created by the installer. |
| | 188 | |
| | 189 | {{{ |
| | 190 | 0 root@herman:~# su - schleuder -s /bin/bash |
| | 191 | }}} |
| | 192 | |
| | 193 | Schleuder reads its basic settings from a file that it by default expects at {{{/etc/schleuder/schleuder.yml}}} The only initial change from the default settings that has been made there on herman is to comment out the default keyserver. |
| | 194 | {{{#keyserver: pool.sks-keyservers.net}}} |
| | 195 | |
| | 196 | The Schleuder API is provided by schleuder-api-daemon. Configuration clients (schleuder-web, schleuder-cli) use it to access information about lists, subscriptions, and keys. schleuder-api-daemon uses transport encyrption (TLS) for all connections. The required TLS-certifcates should have been generated during the setup (schleuder install) but can be regenerated if necessary by running the following command as schleuder user: {{{schleuder cert generate}}} |
| | 197 | |
| | 198 | In order to verify the connection, each client needs to know the fingerprint of the API-certificate. Execute the following command to receive the fingerprint of the current cert. |
| | 199 | |
| | 200 | {{{schleuder@herman:~$ schleuder cert fingerprint}}} |
| | 201 | |
| | 202 | The Schleuder API uses API-keys to authenticate clients. To enable a client to connect, their API-key must be added to the section valid_api_keys in Schleuder’s configuration file. You can generate new API-keys by executing the following command: |
| | 203 | |
| | 204 | {{{schleuder@herman:~$ schleuder new_api_key}}} |
| | 205 | |
| | 206 | ''All current schleuder api keys should remain private. Always use secure channels to transport this information.'' |
| | 207 | |
| | 208 | Add the new api key to file {{{/etc/schleuder/schleuder.yml}}} below the directive {{{valid_api_keys:}}} |
| | 209 | |
| | 210 | {{{ |
| | 211 | valid_api_keys: |
| | 212 | - abcdef... |
| | 213 | - zyxwvu... |
| | 214 | }}} |
| | 215 | |
| | 216 | Restart the schleuder api daemon as root to apply changes. |
| | 217 | |
| | 218 | {{{0 root@herman:~# systemctl restart schleuder-api-daemon}}} |
| | 219 | |
| | 220 | ==== Dedicated user for schleuder-cli ==== |
| | 221 | |
| | 222 | Create a separate "schleuder-manager" user that is able to talk to the API but doesn't have r/w access to the sqlitedb |
| | 223 | |
| | 227 | |
| | 228 | Become the new user, create a new configuration file and ensure that only the schleuder-manager user has read and write access to this file. |
| | 229 | |
| | 230 | {{{ |
| | 231 | 0 root@herman:~# su - schleuder-manager -s /bin/bash |
| | 232 | schleuder-manager@herman:~$ touch /home/schleuder-manager/.schleuder-cli/schleuder-cli.yml |
| | 233 | schleuder-manager@herman:~$ chmod 600 /home/schleuder-manager/.schleuder-cli/schleuder-cli.yml |
| | 234 | }}} |
| | 235 | |
| | 236 | Edit this file with details for the connection of the schleuder-cli client to the schleuder-api-daemon including the tls fingerprint and api key retrieved above. |
| | 237 | |
| | 238 | {{{ |
| | 239 | host: localhost |
| | 240 | port: 4443 |
| | 241 | tls_fingerprint: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| | 242 | api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| | 243 | }}} |
| | 244 | |
| | 245 | ''The api_key and tls fingerprint have been removed in this example and should not be public. Always use secure channels to transport this information.'' |
| | 246 | |
| | 247 | Check that the schleuder-cli client is able to establish a connection to the api. |
| | 248 | |
| | 249 | {{{ |
| | 250 | schleuder-manager@herman:~$ schleuder-cli version -r |
| | 251 | 3.0.1 |
| | 252 | }}} |
| | 253 | |
| | 254 | Create an {{{.ssh/authorized_keys}}} file to allow authorized members of the support team to connect remotely and use the schleuder-cli. |
| | 255 | |
| | 256 | === List creation and management === |
| | 257 | |
| | 258 | Review the output of {{{schleuder-cli help}}}. |