From c6fb1625b2bd7c8441886a692f84fd22be89e94c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20OUDOT?= Date: Sun, 6 Sep 2020 22:51:20 +0200 Subject: [PATCH] New script for parameter list in documentation (#1646) --- RELEASE | 6 +- scripts/parameters-for-doc.pl | 105 ++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 5 deletions(-) create mode 100755 scripts/parameters-for-doc.pl diff --git a/RELEASE b/RELEASE index c12621632..861da75f9 100644 --- a/RELEASE +++ b/RELEASE @@ -24,11 +24,7 @@ Before release - Update documentation: - $ ./scripts/parameters-for-wiki.pl >/tmp/prmlist.txt - - Replace https://lemonldap-ng.org/documentation/X.X/parameterlist by - /tmp/prmlist.txt content - + $ ./scripts/parameters-for-doc.pl > doc/sources/admin/parameterlist.rst $ make documentation - Update changelog: diff --git a/scripts/parameters-for-doc.pl b/scripts/parameters-for-doc.pl new file mode 100755 index 000000000..13dc756f8 --- /dev/null +++ b/scripts/parameters-for-doc.pl @@ -0,0 +1,105 @@ +#!/usr/bin/perl + +use strict; +use JSON; + +require './lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm'; +require './lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/ReConstants.pm'; + +my $rmg = +"^(?:(?:$Lemonldap::NG::Common::Conf::ReConstants::virtualHostKeys)|(?:$Lemonldap::NG::Common::Conf::ReConstants::casAppMetaDataNodeKeys)|(?:$Lemonldap::NG::Common::Conf::ReConstants::casSrvMetaDataNodeKeys)|(?:$Lemonldap::NG::Common::Conf::ReConstants::oidcOPMetaDataNodeKeys)|(?:$Lemonldap::NG::Common::Conf::ReConstants::oidcRPMetaDataNodeKeys)|(?:$Lemonldap::NG::Common::Conf::ReConstants::samlIDPMetaDataNodeKeys)|(?:$Lemonldap::NG::Common::Conf::ReConstants::samlSPMetaDataNodeKeys)|(?:$Lemonldap::NG::Common::Conf::ReConstants::specialNodeKeys))\$"; +$rmg = qr/$rmg/; + +my $complexNodes = qr/^(?:(?:(?:saml(?:ID|S)|oidc[OR])P|cas(?:App|Srv))MetaData|vhost)Options$/; + +my $ignore = qr/^(?:virtualHosts)$/; + +open F, 'lemonldap-ng-manager/site/htdocs/static/reverseTree.json'; + +my $managed = JSON::from_json( join '', ); + +my $prm = Lemonldap::NG::Manager::Build::Attributes::attributes(); + +my $ok = '✔'; + +print <`). + +Main parameters +--------------- + +======================================================= ==================================================================================== ====== ======= ======= ============= +Key name Documentation Portal Handler Manager ini file only +======================================================= ==================================================================================== ====== ======= ======= ============= +EOF + +#| Activate auto accept timer | activeTimer | ✔ | | | + +foreach my $k ( sort keys %$prm ) { + next if $k =~ $ignore; + next if $k =~ $rmg; + my $p = $prm->{$k}; + $p->{flags} ||= 'p'; + my $line = "$k". " "x(56-length($k)) + . "$p->{documentation}"." "x(85-length($p->{documentation})) + # Portal flag + . ( $p->{flags} =~ /p/ ? "$ok " : ' ') + # Handler flag + .( $p->{flags} =~ /h/ ? "$ok " : ' ') + # Manager flag + .( $p->{flags} =~ /m/ ? "$ok " : ' ') + # Ini-only flag + .( ( $managed->{$k} or $k =~ $rmg ) ? '' : ( $k =~ $complexNodes ? '[1]' : $ok ) ); + $line =~ s/\s*$//; + print "$line\n"; +} + +print <` +DBI user dbiUser +DBI password dbiPassword +DBI table name dbiTable +Directory dirName :doc:`File` / :doc:`YAML` +LDAP server ldapServer :doc:`LDAP` +LDAP port ldapPort +LDAP base ldapConfBase +LDAP bind dn ldapBindDN +LDAP bind password ldapBindPassword +LDAP ObjectClass ldapObjectClass +LDAP ID attribute ldapAttributeId +LDAP content attribute ldapAttributeContent +Certificate authorities file caFile +Certificate authorities directory caPath +MongoDB database dbName :doc:`MongoDB` +MongoDB collection collectionName +Pretty print prettyPrint :doc:`File` +REST base URL baseUrl :doc:`REST` +REST realm realm +REST user user +REST password password +SOAP server location (URL) proxy :doc:`SOAP` +`LWP::UserAgent `__ parameters proxyOptions +SOAP user User +SOAP password Password +============================================================================= ==================== =========================================================== +EOF