Перейти к файлу
Andy Scherzinger a46a5a2b7a
Merge pull request #25 from nextcloud/automated/update-workflows/default
chore: update workflows from templates
2024-07-13 14:24:35 +02:00
.github/workflows chore: update workflows from templates 2024-07-13 11:02:53 +02:00
appinfo build: declare support for current Nextlcoud versions 2024-06-26 21:45:22 +02:00
composer bump Nextcloud requirements 2023-04-03 16:40:35 +02:00
lib test(psalm): add template information 2023-12-15 12:29:16 +01:00
tests ci: add psalm 2023-06-29 13:42:40 +02:00
.gitignore add .gitignore 2022-01-06 11:15:02 +01:00
.nextcloudignore bump Nextcloud requirements 2023-04-03 16:40:35 +02:00
.php-cs-fixer.dist.php add php-cs-fixer config 2022-01-06 11:07:16 +01:00
LICENSE Initial commit 2022-01-05 22:46:21 +01:00
README.de.md Added README files for shareimporter 2023-10-13 15:36:51 +02:00
README.md Added README files for shareimporter 2023-10-13 15:36:51 +02:00
composer.json feat(deps): support Nextcloud 28 2023-12-13 15:27:30 +01:00
krankerl.toml bump Nextcloud requirements 2023-04-03 16:40:35 +02:00
psalm.xml ci: add psalm 2023-06-29 13:42:40 +02:00

README.md

Share-Importer

Share-Importer is a Nextcloud app which automatically mounts SMB shares for a user at login time. Information about which shares are assigned to a user is provided by an external web service. This web services is not part of the app.

Method of Operation

The Share-Importer app uses an Event-Listener for the UserLoggedIn event, to be activated whenever a user logs in. A HTTP request is then sent to the web service to get a list of SMB shares which are assigned to the user. This list is used to mount the shares within Nextcloud so that they are automatically accessible to the user after logging in.

Installation

The directory shareimporter should be placed in the Nextcloud base directory under apps. Some changes to the configuration variables are required for the app to work (see below).

Configuration

Configuration is done in the main Nextcloud configuration file config.php.

Configuration Variable Description Type Default
share_importer_exclude_users List of users which are ignored by the share importer. Array
share_importer_webservice_url Full URL for accessing the web service. Required. String
share_importer_webservice_api_key API key for accessing the web service. Required. String
share_importer_webservice_verify_certificate true if the TLS certificate of the web service should be verified, otherwise false Boolean true
share_importer_webservice_timeout Timeout in seconds for a reply of the web service. Integer 5
share_importer_webservice_connect_timeout Timeout in seconds for the connection setup to the web service. Integer 5
share_importer_auth_mech Name of the Nextcloud-internal authentication mechanism for the SMB share. The default value "password:sessioncredentials" means that the saved login credentials are being used. String password:sessioncredentials

Webservice

The share importer sends a HTTP GET request to the configured URL. The username is passed as an URL-encoded parameter in the following form: ?username=<username> The API key is sent as an HTTP header named "ApiKey".

Example JSON Response:

{ "username": "testuser", "shares" : [ { "mountpoint": "T:test", "share": "test", "host": "localhost","domain":"WORKGROUP","type":"smb" } ]}