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
For the migration from Cozy to Twake Workplace, we need a way to
redirect from the old domains to the new ones. So, an old domain field
was added to the Cozy instances, and the stack will do the redirections
from the old domains to the new ones. It works for the API endpoint, but
also for the apps pages (eg old.mycozy.cloud -> new.twake.app).
The old domain of a Cozy instance can be set with the `cozy-stack
instances modify` command, or directly by modifying the `old_domain`
field of the CouchDB document of the instance in the global database.
Copy file name to clipboardExpand all lines: cmd/instances.go
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ import (
26
26
)
27
27
28
28
varflagDomainAliases []string
29
+
varflagOldDomainstring
29
30
varflagListFields []string
30
31
varflagLocalestring
31
32
varflagTimezonestring
@@ -183,6 +184,7 @@ be used as the error message.
183
184
in, err:=ac.CreateInstance(&client.InstanceOptions{
184
185
Domain: domain,
185
186
DomainAliases: flagDomainAliases,
187
+
OldDomain: flagOldDomain,
186
188
Locale: flagLocale,
187
189
UUID: flagUUID,
188
190
OIDCID: flagOIDCID,
@@ -272,6 +274,7 @@ settings for a specified domain.
272
274
opts:=&client.InstanceOptions{
273
275
Domain: domain,
274
276
DomainAliases: flagDomainAliases,
277
+
OldDomain: flagOldDomain,
275
278
Locale: flagLocale,
276
279
UUID: flagUUID,
277
280
OIDCID: flagOIDCID,
@@ -1083,6 +1086,7 @@ func init() {
1083
1086
instanceCmdGroup.AddCommand(setAuthModeCmd)
1084
1087
instanceCmdGroup.AddCommand(cleanSessionsCmd)
1085
1088
addInstanceCmd.Flags().StringSliceVar(&flagDomainAliases, "domain-aliases", nil, "Specify one or more aliases domain for the instance (separated by ',')")
1089
+
addInstanceCmd.Flags().StringVar(&flagOldDomain, "old-domain", "", "Old domain of the cozy instance")
1086
1090
addInstanceCmd.Flags().StringVar(&flagLocale, "locale", consts.DefaultLocale, "Locale of the new cozy instance")
1087
1091
addInstanceCmd.Flags().StringVar(&flagUUID, "uuid", "", "The UUID of the instance")
1088
1092
addInstanceCmd.Flags().StringVar(&flagOIDCID, "oidc_id", "", "The identifier for checking authentication from OIDC")
@@ -1104,6 +1108,7 @@ func init() {
1104
1108
addInstanceCmd.Flags().BoolVar(&flagTrace, "trace", false, "Show where time is spent")
1105
1109
addInstanceCmd.Flags().StringVar(&flagPassphrase, "passphrase", "", "Register the instance with this passphrase (useful for tests)")
1106
1110
modifyInstanceCmd.Flags().StringSliceVar(&flagDomainAliases, "domain-aliases", nil, "Specify one or more aliases domain for the instance (separated by ',')")
1111
+
modifyInstanceCmd.Flags().StringVar(&flagOldDomain, "old-domain", "", "Old domain of the cozy instance")
1107
1112
modifyInstanceCmd.Flags().StringVar(&flagLocale, "locale", "", "New locale")
1108
1113
modifyInstanceCmd.Flags().StringVar(&flagUUID, "uuid", "", "New UUID")
1109
1114
modifyInstanceCmd.Flags().StringVar(&flagOIDCID, "oidc_id", "", "New identifier for checking authentication from OIDC")
0 commit comments