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
Copy file name to clipboardExpand all lines: application/configuration/multitenancy.md
+49-6Lines changed: 49 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Resource sharing and isolation:
21
21
- Database: table prefixing per tenant.
22
22
- Cache: key prefixing per tenant.
23
23
- Storage: tenants configure their own “Site storage” and “Upload storage” in application settings.
24
-
- Sessions: only Redis is supported as backend.
24
+
- Sessions: only Redis is supported as the backend.
25
25
- Tenant ID: unique, up to 16 characters.
26
26
- Tenant hostname: unique, up to 255 characters.
27
27
@@ -35,24 +35,67 @@ To enable tenants, set the following environment variables. You must provide an
35
35
CHEVERETO_ENABLE_TENANTS=1
36
36
CHEVERETO_ENCRYPTION_KEY=your_encryption_key
37
37
CHEVERETO_PROVIDER_NAME=your_provider_name
38
+
CHEVERETO_PROVIDER_URL=your_provider_url
39
+
```
40
+
41
+
### SaaS context
42
+
43
+
The Chevereto SaaS context is a special mode for service providers offering Chevereto as a service to multiple customers. When running Chevereto in a SaaS context, the system alters functionality and display that otherwise would allow tenants to interfere with each other or the host system. In particular, it affects the following features:
44
+
45
+
- Self-upgrade capabilities
46
+
- HTTP cron trigger
47
+
- License key management
48
+
- System information display (database version, PHP info, FFmpeg, etc.)
38
49
39
-
If you want to run Chevereto in SaaS context, also set:
50
+
To run Chevereto in a SaaS context set:
40
51
41
52
```plain
42
53
CHEVERETO_CONTEXT=saas
43
54
```
44
55
45
56
### Environment variables
46
57
47
-
Use plans and tenant configurations to define resource limits and environment variables on a per-tenant basis. Use `CHEVERETO_TENANT_ENFORCED` to define a JSON object with environment variables that will be late enforced (overridden) on runtime to all tenants.
58
+
Define resource limits and environment variables per tenant via plans and tenant configurations. To enforce overrides at runtime for all tenants, set `CHEVERETO_TENANT_ENFORCED` to a JSON object.
59
+
60
+
Precedence (highest to lowest):
61
+
62
+
-`CHEVERETO_TENANT_ENFORCED` (runtime enforced, not stored)
**Tip:** When using yaml you can define `CHEVERETO_TENANT_ENFORCED` multi-line as:
72
+
73
+
```yaml
74
+
CHEVERETO_TENANT_ENFORCED: >
75
+
{
76
+
"CHEVERETO_CONTEXT":"saas",
77
+
"CHEVERETO_ENABLE_BULK_IMPORTER":"0",
78
+
"CHEVERETO_ENABLE_CDN":"0",
79
+
"CHEVERETO_ENABLE_DEBUG":"0",
80
+
"CHEVERETO_ENABLE_LOCAL_STORAGE":"0",
81
+
"CHEVERETO_ENABLE_NEWS_CHECK":"1",
82
+
"CHEVERETO_ENABLE_PHP_PAGES":"0",
83
+
"CHEVERETO_ENABLE_POWERED_BY_SETTING":"1",
84
+
"CHEVERETO_ENABLE_FORCE_POWERED_BY_FOOTER":"0",
85
+
"CHEVERETO_ENABLE_PUP_CUSTOM_URL":"0",
86
+
"CHEVERETO_ENABLE_UPDATE_CHECK":"0",
87
+
"CHEVERETO_ENABLE_UPDATE_HTTP":"0",
88
+
"CHEVERETO_ENABLE_UPLOAD_URL":"0",
89
+
"CHEVERETO_ENABLE_SERVICE_MODERATECONTENT":"0",
90
+
"CHEVERETO_MAX_LISTING_ITEMS_PER_PAGE":"48",
91
+
"CHEVERETO_MAX_CACHE_TTL":"3600",
92
+
"CHEVERETO_MIN_STORAGES_ACTIVE":"1"
93
+
}
94
+
```
95
+
53
96
### Initializing the multi-tenant system
54
97
55
-
Then, initialize the multi-tenant database system:
98
+
Initialize the multi-tenant database (run once after enabling multitenancy):
56
99
57
100
```sh
58
101
app/bin/tenants -C init
@@ -81,7 +124,7 @@ This creates plan `1` named “Basic Plan” with a maximum of `10000` tags and
81
124
82
125
### Editing a tenant plan
83
126
84
-
Use [plan:edit](../../application/reference/cli.md#edit-tenant-plan) to change the name, limits, or environment of an existing plan. Affected tenants will inherited the updated plan settings; the system re-caches them automatically.
127
+
Use [plan:edit](../../application/reference/cli.md#edit-tenant-plan) to change the name, limits, or environment of an existing plan. Affected tenants will inherit the updated plan settings; the settings are re-cached automatically.
85
128
86
129
```sh
87
130
app/bin/tenants -C plan:edit \
@@ -100,7 +143,7 @@ app/bin/tenants -C plan:list
100
143
101
144
### Deleting a tenant plan
102
145
103
-
Use [plan:delete](../../application/reference/cli.md#delete-tenant-plan) by plan ID. Affected tenants will lose the inherited plan settings; the system re-caches them automatically.
146
+
Use [plan:delete](../../application/reference/cli.md#delete-tenant-plan) by plan ID. Affected tenants will lose the inherited plan settings; the settings are re-cached automatically.
0 commit comments