Skip to content

Helps to provision Nextcloud instances with new users and their groups.

License

Notifications You must be signed in to change notification settings

diehauswirtschaft/provision-nextcloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

die HausWirtschaft Logo

provision-nextcloud

Batch imports and manages users for Nextcloud using the Provisioning API. This is an alternative to the well-known Registration App for Nextcloud. If you cannot limit the allowed registrations to a specific domain-suffix, you open it up to the whole Web. In times of automated scripts scanning the Web for open instances, this is not the best idea.


This project has been developed in the scope of OPENhauswirtschaft to provision Nextcloud accounts to all members. OPENhauswirtschaft is powered by the Austrian "Klima- und Energiefonds"'s Smart Cities Demo - Living Urban Innovation program.

Usage

You can see all available commands and options with node index.js -h:

Usage: index [options] [command]

Options:
  -V, --version     output the version number
  -h, --help        output usage information

Commands:
  add [options] <users.json> <nextcloud-url>
  welcome [options] <users.json> <nextcloud-url>
  setting <users.json> <key> <value>

add command

Adds the given users to a Nextcloud instance. You can specify groups which will be applied to each newly created user. Use the --dry-run option to perform a local dry run without any requests sent to the given Nextcloud server.

node index.js add --dry-run myUsers.json https://nextcloud.example.com/

welcome command

Sends out a welcome email to the given users. You should use this command after you set the user's language to the correct language tag. Otherwise the welcome emails will be in English. Use the --dry-run option to perform a local dry run without any requests sent to the given Nextcloud server.

node index.js welcome --dry-run myUsers.json https://nextcloud.example.com/

setting command

Prints out a list of shell commands using the occ command to modify a user setting. You find a list of valid settings in the Nextloud documentation.

node index.js setting myUsers.json "core lang" "de"

Example user.json

You have to provide a JSON file with all the users you want to add inside an array. The userid and password properties are required for each user, all others are optional.

[
  {
    "userid": "exampleuser",
    "password": "randompasswordstring",
    "groups": [
      "Cool People",
      "Department X"
    ],
    "displayname": "Example User",
    "email": "user@example.com",
    "quota": "10GB",
    "phone": "+55 555 1234567",
    "address": "Taborstraße 12345, 1020 Wien, Austria",
    "website": "https://diehauswirtschaft.at",
    "twitter": "@DHausWirtschaft"
  }
]

License

MIT

About

Helps to provision Nextcloud instances with new users and their groups.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published