diff --git a/conf/plugin_authldap_single.json b/conf/plugin_authldap_single.json new file mode 100644 index 0000000..58da926 --- /dev/null +++ b/conf/plugin_authldap_single.json @@ -0,0 +1,10 @@ +{ + "Enabled": "1", + "URI": "ldap://localhost/ou=users,dc=yunohost,dc=org", + "Filter": "(&(objectclass=posixAccount)(|(uid=%1$s)(mail=%1$s))(permission=cn=wordpress.admin,ou=permission,dc=yunohost,dc=org))", + "NameAttr": "givenName", + "SecName": "sn", + "UidAttr": "uid", + "MailAttr": "mail", + "DefaultRole": "subscriber" +} \ No newline at end of file diff --git a/scripts/install b/scripts/install index 12f3567..e29cac0 100644 --- a/scripts/install +++ b/scripts/install @@ -225,12 +225,12 @@ then ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ../conf/sql/multisite.sql plugin_network="--network" else - db_prefix="wp_" - ynh_replace_string --match_string="__DB_PREFIX__" --replace_string="$db_prefix" --target_file=../conf/sql/single.sql - ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file=../conf/sql/single.sql - ynh_replace_string --match_string="__LENGTH__" --replace_string="$((${#app} + 108))" --target_file=../conf/sql/single.sql + #db_prefix="wp_" + #ynh_replace_string --match_string="__DB_PREFIX__" --replace_string="$db_prefix" --target_file=../conf/sql/single.sql + #ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file=../conf/sql/single.sql + #ynh_replace_string --match_string="__LENGTH__" --replace_string="$((${#app} + 108))" --target_file=../conf/sql/single.sql - ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ../conf/sql/single.sql + #ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ../conf/sql/single.sql plugin_network="" fi @@ -240,6 +240,11 @@ fi ynh_script_progression --message="Activating plugins..." --weight=4 $wpcli_alias plugin activate authldap $plugin_network +$wpcli_alias option update authLDAPOptions --format=json < ../conf/plugin_authldap.json +# to display the list of all the possibles options, from your server: +# $ php8.0 ./wp-cli.phar --path=/var/www/wordpress --allow-root option get authLDAPOptions --json | jq + + # Do not activate http-authentication, this plugin is sometimes unstable $wpcli_alias plugin activate companion-auto-update $plugin_network $wpcli_alias plugin activate wp-fail2ban-redux $plugin_network