Commit graph

331 commits

Author SHA1 Message Date
Olof hagsand
df6f26c0de Misc cleanups, remove old yangs, typos, etc 2021-07-19 22:08:23 +02:00
Alan Yaniger
0c72100a05 implement yang-patch 2021-07-19 13:17:10 +03:00
Olof hagsand
85e2945ec9 * Netconf message-id attribute changed from optional to mandatory
* Made NETCONF message handling more strict according to RFC 6241
  * Set `CLICON_NETCONF_MESSAGE_ID_OPTIONAL` to true to accept omission of message-id attribute
* Fixed: [need make sure message-id exist in rpc validate #240](https://github.com/clicon/clixon/issues/240)
2021-06-30 10:59:10 +02:00
Olof hagsand
5ead099d0b * Added autotool check for getresuid (and related functions) necessary for lowering of priviliges for backend and restconf
* If getresuid is not available, CLICON_RESTCONF_PRIVILEGES must be set to 'none'
2021-06-11 14:42:41 +02:00
Olof hagsand
e0c3f5467c * Added new startup-mode: running-startup: First try running db, if it is empty try startup db.
* See [Can startup mode to be extended to support running-startup mode? #234](https://github.com/clicon/clixon/issues/234)
* Improved error message on failed MUST condition
2021-05-27 13:18:01 +02:00
Olof hagsand
1ef7a280d7 * Fixed: [when condition error under augment in restconf #227](https://github.com/clicon/clixon/issues/227)
* As part of this fix added custom constant XML_PARENT_CANDIDATE
2021-05-25 15:25:26 +02:00
Olof hagsand
5b39418e92 * [Need an option to disable restconf mandatory action of overwriting startup_db #230](https://github.com/clicon/clixon/issues/230)
* Disable RFC 8040 mandatory copy of running to startup after commit
* Rename CLICON_RESTCONF_INSTALL_DIR -> CLICON_RESTCONF_INSTALLDIR
2021-05-25 11:07:41 +02:00
Olof hagsand
c20c672d83 * Changed config and install options for Restconf
* clixon_restconf daemon is installed in /usr/local/sbin (as clixon_backend), instead of /www-data
    * `configure --with-wwwdir=<dir>` remains but only applies to fcgi socket and log
    * New option `CLICON_RESTCONF_INSTALL_DIR` is set to where clixon_restconf is installed, with default `/usr/local/sbin/`
  * Restconf drop privileges user is defined by `CLICON_RESTCONF_USER`
    * `configure --with-wwwuser=<user>` is removed
  * clixon_restconf drop of privileges is defined by `CLICON_RESTCONF_PRIVILEGES` option
* New clixon-restconf@2020-05-20.yang revision
  * Added: restconf `log-destination`
2021-05-23 17:14:18 +02:00
Olof hagsand
1c7e52f829 Merge branch 'autocli' of https://github.com/shmuelnatan/clixon into shmuelnatan-autocli 2021-04-22 20:56:04 +02:00
Olof hagsand
ecd5f7de70 * Add default network namespace constant: RESTCONF_NETNS_DEFAULT with default value "default". 2021-04-22 13:45:02 +02:00
shmuels
3736927efa completing the function of hide for autocli-op in the yang files 2021-04-20 18:35:20 +03:00
Dave Cornejo
bd20553362 missed a Makefile change 2021-04-15 07:36:48 -10:00
Dave Cornejo
ec0c5118a4 Cleanup pull request
Remove clixon-restconf 2021-04-12, add changes to 2021-03-15
Remove noisy debug logging
2021-04-15 07:30:26 -10:00
Dave Cornejo
e4885d51e6 Add ability to enable core dumps from RESTCONF process
Contributed by Rubicon Communications LLC, dbs Netgate
2021-04-14 09:42:37 -10:00
Olof hagsand
5af7ea9b38 * Added check of old config in upgrade scenarios.
* Added to clixon-config.yang `CLICON_XMLDB_UPGRADE_CHECKOLD`, set to false to keep less strict check
2021-04-12 21:03:20 +02:00
Olof hagsand
953326d39f - Rewrote process control to simpler state model: stopped/running/exiting
- Stricter CLICON_BACKEND_RESTCONF_PROCESS :
 - if set, restconf daemon queries backend for its config
 - if not set, restconf daemon reads its config from main config file
2021-04-12 10:31:17 +02:00
Olof hagsand
244060fddc - Added specific WITH_RESTCONF compile contants for _NATIVE and _FCGI for C code
- Restconf auth=none changes
  - Load clixon-restconf and resolve features earlier so that config features work
  - Removed auth=none code from example (this was non-std half-baked basic auth)
  - Changed tests that used auth-type=none to enable feature clixon-restconf:allow-auth-none
- Moved cert creation from sub-shell to servercert function
- Fixed typos for dockerfile rename of restconf evhtp to native
2021-04-07 20:54:41 +02:00
Olof Hagsand
2bf75158a6
Merge pull request #194 from dcornejo/master
Make authentication-type none a configurable feature
2021-04-07 10:31:20 +02:00
Olof hagsand
d8be601606 * To configure native mode use: configure --with-restconf=native, changed from: configure --with-restconf=evhtp 2021-04-06 08:48:45 +02:00
Dave Cornejo
d7fde95774 Make authentication-type none a configurable feature
Define the feature in clixon.xml to enable authentication-type
none for RESTCONF
2021-03-23 19:54:31 -10:00
Olof hagsand
f536b1dc67 Added: CLICON_CLI_AUTOCLI_EXCLUDE
Added openconfig interfaces tests
2021-03-15 13:08:42 +01:00
Olof hagsand
07d196dfd0 Added several fields to process-control status operation: active, description, command, status, starttime, pid 2021-03-12 17:22:22 +01:00
Olof hagsand
7e9a207ab2 * New clixon-lib@2020-03-08.yang revision
* Changed: RPC process-control output to choice dependent on operation
2021-03-12 12:10:25 +01:00
Olof hagsand
5692072d36 * Fixed: [CLIXON is not waiting for the hello message #184](https://github.com/clicon/clixon/issues/184)
* Hello message semantics has been made stricter according to RFC 6241 Sec 8.1, for example:
  * A client MUST send a <hello> element.
  * Each peer MUST send at least the base NETCONF capability, "urn:ietf:params:netconf:base:1.1" (or 1.0 for RFC 4741)
  * The netconf client will terminate (close the socket) if the client does not comply
  * You can set `CLICON_NETCONF_HELLO_OPTIONAL` to true to use the old behavior of essentially ignoring hellos.
* New clixon-config@2020-03-08.yang revision
  * Added: `CLICON_NETCONF_HELLO_OPTIONAL`
* The base capability has been changed to "urn:ietf:params:netconf:base:1.1" following RFC6241.
2021-03-10 14:18:16 +01:00
Olof hagsand
b2f9c59a34 * Reverted blocked signal behavior introduced in 5.0.
* Introduced a delay before making process start/stop/restart processes for race conditions when configuring eg restconf
* For restconf `CLICON_BACKEND_RESTCONF_PROCESS`, restart restconf if restconf is edited.
2021-03-02 12:24:07 +01:00
Olof hagsand
3d07db24d9 * Added CLICON_ANONYMOUS_USER to clicon-config.yang
* evhtp restconf closes session on -1 fatal error (no hang)
* restconf auth-type=none call ca_auth callback
* main example for auth_type=none uses basic auth to get user but without passwd check
2021-02-21 14:48:12 +01:00
Olof Hagsand
d1e5599572 reorder clixon-restconf.yang and some test fixes 2021-02-14 14:48:52 +00:00
Olof hagsand
c64878fd4a * RESTCONF configuration is unified and moved from clixon-config.yang to clixon-restconf.yang
* Except `CLICON_RESTCONF_DIR` which remains in clixon-config.yang due to bootstrapping
    * -d <dir> option removed
  * This applies to both evhtp and fcgi RESTCONF
    * Both can also read config from backend, and be started from backend
  * You may need to move config as follows (from clixon-config.yang to clixon-restconf.yang)
    * CLICON_RESTCONF_PRETTY -> restconf/pretty
    * CLICON_RESTCONF_PATH -> restconf/fcgi-path
2021-02-11 13:46:34 +01:00
Olof hagsand
92a3898c46 TSL->TLS, updated slack link, callhome docs 2021-02-09 21:36:01 +01:00
Olof hagsand
710fc76887 * Restconf authentication callback (ca_auth) signature changed
* Not backward compatible: All uses of the ca-auth callback in restconf plugins must be changed
  * New version is: `int ca_auth(h, req, auth_type, authp, userp)`
    * where `auth_type` is the requested authentication-type (none, client-cert or user-defined)
    * `authp` is the returned authentication flag
    * `userp` is the returned associated authenticated user
    * and the return value is three-valued: -1: Error, 0: ignored, 1: OK
  * For more info see [clixon-docs](https://clixon-docs.readthedocs.io/en/latest/restconf.html)
* New clixon-restconf@2020-12-30.yang revision
2021-02-09 21:26:35 +01:00
Olof hagsand
b41f68b677 debug print of backend state, split test-stream into a netconf and restconf part, change restconf yang auth-type from leaf-list to leaf 2021-01-27 14:40:34 +01:00
Olof hagsand
68371d4fc5 upgrade copyright, aux tools, etc 2021-01-21 12:23:46 +01:00
Olof hagsand
96b50b88e8 Copyright 2021 2021-01-13 14:40:34 +01:00
Olof hagsand
cf63d0f761 * New clixon-config@2020-12-30.yang revision
* New clixon-lib@2020-12-30.yang revision
* Added callback to process-control RPC feature in clixon-lib.yang to manage processes
* Changed behavior of starting restconf internally using `CLICON_BACKEND_RESTCONF_PROCESS` monitoring changes in enable flag, not only the RPC.
* Changed: RPC process-control output parameter status to pid
2021-01-02 17:27:44 +01:00
Olof hagsand
eaedb14918 Prepare for 4.9.0 release 2020-12-18 13:54:00 +01:00
Olof hagsand
b8f5d1dcae * Added CLICON_BACKEND_RESTCONF_PROCESS to clixon-config.yang 2020-12-17 12:13:06 +01:00
Olof hagsand
22adc58187 * New process-control RPC feature in clixon-lib.yang to manage processes
* This is an alternative to manage a clixon daemon via sudtemd, containerd or other
  * One important special case is starting the clixon-restconf daemon internally
  * This is how it works:
    * Register a process via `clixon_process_register(h, name, namespace, argv, argc)`
    * Use process-control RPC defined in clixon-lib.yang to start/stop/restart or query status on that process
  * Example code in the main example
2020-12-15 15:48:42 +01:00
Olof hagsand
8540820698 * New clixon-lib@2020-12-08.yang revision
* Added: autocli-op extension (see new features)
  * Added: rpc process-control for process/daemon management
* Added enable flag and removed presence in clixon-restconf
2020-12-13 22:19:25 +01:00
Olof hagsand
b8641f30bd * More YANG extension functionality,
* See [Augment auto-cli for hiding/modifying cli syntax #156](https://github.com/clicon/clixon/issues/156) and [hiding auto-generated CLI entries #153](https://github.com/clicon/clixon/issues/153)
  * Extensions can be used in augmentations
  * Extension `autocli-op` has been added to add "hidden" commands in the autocli
  * Documentation: https://clixon-docs.readthedocs.io/en/latest/misc.html#extensions
2020-12-08 17:21:37 +01:00
Olof hagsand
0b948248e4 * Reworked evhtp restconf config to only use clixon-restconf.yang and marked local restconf options as obsolete
* Extended clicon-config with clixon-restconf for local config
* Removed obsolete CLICON_TRANSACTION_MOD
2020-11-21 13:16:29 +01:00
Olof hagsand
c0ad6d3f8f remove global ssl-enable in clixon-restconf.yang 2020-11-18 21:52:47 +01:00
Olof hagsand
9016dde319 Modify tests so they all work with evhtp and backend config, eg that CLICON_RESTCONF_CONFIG is default true.
Note that some tests are forced to CLICON_RESTCONF_CONFIG is false due to test complexities.
2020-11-18 13:57:25 +01:00
Olof hagsand
6eb18da5e9 * Multi-socket feature (eg IPv4/IPv6 http/https) to restconf evhtp
* Added by-ref parameter to `ys_cv_validate()` returning which sub-yang spec was validated in a union.
2020-11-15 12:34:40 +01:00
Olof hagsand
a0006075c3 Merge branch 'topic_benavrhm_rfc8527a_20201103' of https://github.com/benavrhm/clixon into benavrhm-topic_benavrhm_rfc8527a_20201103 2020-11-11 13:41:05 +01:00
Jonathan Ben-Avraham
a1f54d71ac Update yang/mandatory files for rfc8527 compliance
Updated the yang/mandatory files and test scripts for rfc8527.
2020-11-07 22:06:05 +02:00
Olof hagsand
5088f23e6a disable nginx systemd check 2020-11-06 20:11:01 +01:00
Olof hagsand
6ecb0d5232 tests for restconf backend configure
rm client-cert-ca
2020-11-06 11:41:59 +01:00
Olof hagsand
7a0838da3a * Restconf configuration has a new configure model: clixon-restconf.yang enabling restconf daemon configuration from datastore instead of from config file. 2020-11-03 21:26:34 +01:00
Olof hagsand
8d901e1fde * Extended CLI_PROMPT syntax with %W as working path in tree, which more concretely is a path to the current position in a syntax tree in the autocli.
* Comments on clixon-config.yang
2020-10-12 11:19:43 +02:00
Olof hagsand
5c67bcd364 validation of list keys rearrangement of code 2020-10-08 15:32:23 +02:00