You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Get into the apps folder of your Nextcloud installation, for example */var/www/nextcloud/apps*.
17
+
18
+
3. Git clone this project: `git clone https://github.com/nextcloud/user_sql.git`.
19
+
20
+
4. Login to your Nextcloud instance as admin.
21
+
22
+
5. Navigate to Apps from the menu then find and enable the *User and Group SQL Backends* app.
23
+
24
+
6. Navigate to Admin from menu and switch to Additional Settings, scroll down the page and you will see *SQL Backends* settings.
25
+
26
+
*You can skip the first three steps as this app is available in the official [Nextcloud App Store](https://apps.nextcloud.com/apps/user_sql).*
27
+
28
+
## Configuration
29
+
30
+
Below are detailed descriptions of all available options.
31
+
32
+
#### Database connection
33
+
34
+
This section contains the database connection parameters.
35
+
36
+
Name | Description | Details
37
+
--- | --- | ---
38
+
**SQL driver** | The database driver to use. Currently supported drivers are: mysql, pgsql. | Mandatory.
39
+
**Hostname** | The hostname on which the database server resides. | Mandatory.
40
+
**Database** | The name of the database. | Mandatory.
41
+
**Username** | The name of the user for the connection. | Optional.
42
+
**Password** | The password of the user for the connection. | Optional.
43
+
44
+
#### Options
45
+
46
+
Here are all currently supported options.
47
+
48
+
Name | Description | Details
49
+
--- | --- | ---
50
+
**Allow display name change** | With this option enabled user can change its display name. The display name change is propagated to the database. | Optional.<br/>Default: false.<br/>Requires: user *Display name* column.
51
+
**Allow password change** | Can user change its password. The password change is propagated to the database. See [Hash algorithms](#hash-algorithms). | Optional.<br/>Default: false.
52
+
**Use cache** | Use database query results cache. The cache can be cleared any time with the *Clear cache* button click. | Optional.<br/>Default: false.
53
+
**Hashing algorithm** | How users passwords are stored in the database. See [Hash algorithms](#hash-algorithms). | Mandatory.
54
+
**Email sync** | Sync e-mail address with the Nextcloud.<br/>- *None* - Disables this feature. This is the default option.<br/>- *Synchronise only once* - Copy the e-mail address to the Nextcloud storage if its not set.<br/>- *Nextcloud always wins* - Always copy the e-mail address to the database. This updates the user table.<br/>- *SQL always wins* - Always copy the e-mail address to the Nextcloud storage. | Optional.<br/>Default: *None*.<br/>Requires: user *Email* column.
55
+
**Home mode** | User storage path.<br/>- *Default* - Let the Nextcloud manage this. The default option.<br/>- *Query* - Use location from the user table pointed by the *home* column.<br/>- *Static* - Use static location. The `%u` variable is replaced with the username of the user. | Optional<br/>Default: *Default*.
56
+
**Home Location** | User storage path for the `static`*home mode*. | Mandatory if the *Home mode* is set to `Static`.
57
+
58
+
#### User table
59
+
60
+
The definition of user table. The table containing user accounts.
61
+
62
+
Name | Description | Details
63
+
--- | --- | ---
64
+
**Table name** | The table name. | Mandatory for user backend.
65
+
**Username** | Username column. | Mandatory for user backend.
66
+
**Email** | E-mail column. | Mandatory for *Email sync* option.
67
+
**Home** | Home path column. | Mandatory for `Query`*Home sync* option.
68
+
**Password** | Password hash column. | Mandatory for user backend.
69
+
**Display name** | Display name column. | Optional.
70
+
**Can change avatar** | Flag indicating if user can change its avatar. | Optional.<br/>Default: false.
71
+
72
+
#### Group table
73
+
74
+
The group definitions table.
17
75
18
-
4. Login your Nextcloud as admin
76
+
Name | Description | Details
77
+
--- | --- | ---
78
+
**Table name** | The table name. | Mandatory for group backend.
79
+
**Is admin** | Flag indicating if its the admin group | Optional.
80
+
**Display name** | Display name column. | Optional.
81
+
**Group name** | Group name column. | Mandatory for group backend.
19
82
20
-
5. Navigate to Apps from the menu and enable the SQL user backend
83
+
#### User group table
21
84
22
-
6. Navigate to Admin from menu and switch to Additional Settings, scroll down the page and you will see SQL User Backend settings
85
+
Associative table which maps users to groups.
86
+
87
+
Name | Description | Details
88
+
--- | --- | ---
89
+
**Table name** | The table name. | Mandatory for group backend.
90
+
**Username** | Username column. | Mandatory for group backend.
91
+
**Group name** | Group name column. | Mandatory for group backend.
23
92
24
93
## Integrations
25
94
26
-
### WordPress
95
+
The basic functionality requires only one database table: [User table](#user-table).
96
+
97
+
For all options to work three tables are required:
98
+
-[User table](#user-table),
99
+
-[Group table](#group-table),
100
+
-[User group table](#user-group-table).
101
+
102
+
If you already have an existing database you can always create database views which fits this model,
103
+
but be aware that some functionalities requires data changes (update queries).
104
+
105
+
If you don't have any database model yet you can use below tables (MySQL):
Thanks to this app, Nextcloud can easily integrate with Wordpress.
28
142
29
-
In the Nextcloud Column Settings of SQL User Backend, configure it as
143
+
In the Nextcloud user table settings of SQL Backends, configure it as:
30
144
```
31
-
Table: wp_users
32
-
Username Column: user_login
33
-
Password Column: user_pass
34
-
Encryption Type: Joomla > 2.5.18 phppass
145
+
User table: wp_users
146
+
Username column: user_login
147
+
Password column: user_pass
148
+
149
+
Hashing algorithm: Unix (Crypt)
35
150
```
36
151
37
-
### JHipster
38
-
It is very easy to integrate Nextcloud with JHipster.
152
+
#### JHipster
39
153
40
-
Follow the Using the Database instructions in [Using Jhipster in development](http://www.jhipster.tech/development/)to configure your database. Assume you chose MySQL as JHipster database.
154
+
It is very easy to integrate Nextcloud with JHipster.
41
155
42
-
In the Nextcloud Column Settings of SQL User Backend, configure it as
156
+
Follow the Using the Database instructions in [Using Jhipster in development](http://www.jhipster.tech/development/)
157
+
to configure your database. Assume you chose MySQL as JHipster database.
158
+
In the Nextcloud user table settings of SQL Backends, configure it as:
43
159
```
44
-
Table: jhi_users
45
-
Username Column: login
46
-
Password Column: password_hash
47
-
Encryption Type: Joomla > 2.5.18 phppass
48
-
User Activate Column: activated
49
-
Email Column: email
160
+
User table: jhi_users
161
+
Username column: login
162
+
Password column: password_hash
163
+
Email column: email
164
+
165
+
Hashing algorithm: Unix (Crypt)
50
166
```
51
167
52
-
## Features
53
-
Currently, it supports most of postfixadmin's encryption options, except dovecot and saslauthd.
54
-
It was tested and developed for a postfixadmin database.
55
-
56
-
Password changing is disabled by default, but can be enabled in the Admin area.
57
-
Caution: user_sql does not recreate password salts, which imposes a security risk.
58
-
Password salts should be newly generated whenever the password changes.
59
-
60
-
The column autocomplete works only for MySQL and PostgreSQL database which is used to validate form data.
61
-
If you use other database use *occ* command to set the application config parameters with domain suffix.
62
-
63
-
For example to set 'sql_hostname' parameter in default domain use:
0 commit comments