mediabox-cl / nextcloud-user-ispconfig-api

This Backend allows users to sign in with their email or custom login name using the ISPConfig 3 Control Panel API.
GNU Affero General Public License v3.0
3 stars 1 forks source link
backend ispconfig nextcloud

Nextcloud - User ISPConfig API

This Backend allows users to sign in with their email or custom login name using the ISPConfig 3 Control Panel API.

IMPORTANT: This APP requires the installation of a plugin in the ISPConfig 3 Control Panel. ISPConfig - Nextcloud Plugin

Features

Users

Groups

Federated Cloud ID

For a user with this email user@happy.tld and Nextcloud running in the subdomain cloud.domain.tld, the Federated Cloud ID will have this format: user.happy.tld@cloud.domain.tld (This can't be changed)

Installation

Automatic installation (recommended)

Just install it from your Nextcloud application catalogue.

Manual installation

Clone this repository into your Nextcloud apps directory:

cd /var/www/nextcloud/site/apps/
git clone https://github.com/mediabox-cl/nextcloud-user-ispconfig-api.git user_ispconfig_api
chown -R www-data:www-data user_ispconfig_api

Install it as usual from admin app list or CLI with:

cd ..
sudo -u www-data php occ app:install user_ispconfig_api
sudo -u www-data php occ app:enable user_ispconfig_api

Update

Manual Update

Update the cloned repository in your Nextcloud apps directory:

cd /var/www/nextcloud/site/apps/user_ispconfig_api
git pull
cd ..
chown -R www-data:www-data user_ispconfig_api

Update the Nextcloud APP:

cd ..
sudo -u www-data php occ upgrade

Configuration

Prerequisites

This backend uses the ISPConfig 3 SOAP API. Thus, it requires credentials for a legitimate remote API user.

In your ISPConfig 3 control panel go to System > Remote Users and create a new user with permissions for Server functions, Mail domain functions and Mail user functions.

Note: I recommend to restrict the allowed client IP to the Nextcloud server IP.

Along with that, you have to provide the SOAP API Location and Uri.
If you didn't modify it, these should be:

To finally enable authentication against the ISPConfig 3 API, you need to add it to your Nextcloud config file in config/config.php. Using this basic configuration will allow any mail user to authenticate with their email address or custom login name and password and will create a new Nextcloud account on first login.

<?php
$CONFIG = array(
//  [ ... ],
    'user_ispconfig_api' => array(
        'location' => 'https://host.domain.tld:8080/remote/index.php',
        'uri' => 'https://host.domain.tld:8080/remote/',
        'user' => 'remote_user',
        'password' => 'secure_remote_user_password',
    ),
);

What's next?

Now you must follow the instruction to install the ISPConfig - Nextcloud Plugin

Troubleshooting

Always get 'Invalid Password'

Ensure you have the PHP SOAP extension installed and activated.

php -m | grep soap

The soap output indicates SOAP is installed, if not:

sudo apt update && sudo apt install php-soap -y

For Apache, enable the module and restart the service and for PHP FPM just restart the service.

Thanks to: