Nextcloud is a platform for creating private cloud storage (similar to Google Drive or Dropbox) that can be deployed on your own servers. It allows users to store files, share them, and collaborate. The BILLmanager and Nextcloud integration module allows hosting providers to:
- automate the sale of disk space as a service;
- manage Nextcloud user quotas directly from BILLmanager;
- configure the sale of disk space:
- by fixed volume;
- based on usage statistics.
Integration is implemented via an external pmnextcloud
service processing module that interacts with the Nextcloud API. Main components for integration are:
- service handler in BILLmanager with the product type "Backup";
- external script for installation from the bill-nextcloud repository, providing communication between BILLmanager and the Nextcloud API;
- Nextcloud API for user and quota management.
Installation and configuration requirements for integration
Integration is configured as part of creating a service handler in BILLmanager.
General requirements
To correctly integrate Nextcloud with BILLmanager, the following conditions must be met:
- one instance of Nextcloud can only be used for one BILLmanager platform. Each BILLmanager platform creates accounts starting with
id 1
(user_1
), which leads to name conflicts and prevents correct operation. - It is recommended to use isolated environments. For Nextcloud, this can be achieved in one of two ways:
- running in docker container;
- installing on a separate physical or virtual server.
Nextcloud installation requirements
The following conditions must be met for the successful installation and configuration of the Nextcloud platform:
- a server for installing the Nextcloud platform or running a Docker container with command line access. For more information about Nextcloud server requirements, see the official Nextcloud documentation.
- the following utilities must be installed on the server:
git
;bash
;curl
orwget
.
- Internet access to clone the repository.
Nextcloud side configuration
To set up the integration on Nextcloud's end:
-
Install the Nextcloud platform using one of the following ways:
- on a server. For more information on installation, see the official Nextcloud documentation;
- into a Docker container. Download the container from the repository https://github.com/LC208/bill-nextcloud. For an example of installation using a Docker container, see the official Nextcloud documentation.
- Log in to the platform interface and generate an application password to access the API: in the upper right corner, open Platform administrator profile → Personal settings → Security → Application passwords → specify any application name → Create application password
BILLmanager side configuration
Installing the module
Before you start configuring the interface:
- If you are using BILLmanager version lower than 6.128.0, please update the platform. For more details, see the Upgrade article.
- Connect to the server with the platform via SSH. For more information about connecting via SSH, see Workstation setup.
- Clone the repository:
git clone https://github.com/LC208/bill-nextcloud.git
-
Navigate to the directory with the module:
Sample command for navigationcd /usr/local/mgr5/src/bill-nextcloud
-
Launch the installation:
Installation scriptsh install.sh
Connecting the handler
To create a service handler, go to Integration → Processing modules → Add button:
- Product type: Backup.
- Processing module: Nextcloud.
- Integration settings:
- URL-address — enter the URL address of the Nextcloud dashboard home page. For example, http://my.panel.example.
- Client ID — enter your Nextcloud username;
- Password — enter the password to access the API.
- Processing module settings. Configure the internal (within BILLmanager) parameters of the service handler:
- Name — Enter the name of the handler that will be displayed in the interface. Mandatory field.
- Responsible — choose the department to which tasks from the handler will be assigned;
- Sorting — enter a value for the sorting parameter. The lower the value, the higher the position in the list. If there are several handlers with the same sorting priority, they will be sorted alphabetically.
Setting the tariff
To set up a tariff:
- Go to Products → Tariff plans → Add button:
- Product type — select Backup.
- Tariff plan parameters:
- Processing module — select the handler you created for Nextcloud..
- Internal name
nextcloud
- Handler settings:
- User group — select the group that will be assigned to the user account when it is created in Nextcloud.
- Disable the "Cloud disk" and "Local disk" parameters in the tariff content. They are added by default for the "Backup" product type, but are not processed by the Nextcloud module. To disable the parameters, go to Products → Tariff plans → choose tariff → Options → choose parameter → Disable button.
For more information on creating tariff plans, see About tariff plan configuration article.
Product type parameters
To manage default settings, go to Products → Product types → Backup → Parameters button → select the parameter you want to change → click the Edit button. For more details, see Product types.
Key product parameters:
Statistical data collection
Statistics are collected for the following items:
disk;
disc.
The cron scheduler task statdaily.cron
is responsible for collecting statistics. Statistics for the same date are summarized.
Logging
The log of BILLmanager interaction with the Nextcloud handler is stored in the file /usr/local/mgr5/var/pmnexctloud.log