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: packages/wrangler/src/r2/domain.ts
+21-21Lines changed: 21 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -74,11 +74,6 @@ export function AddOptions(yargs: CommonYargsArgv) {
74
74
type: "string",
75
75
demandOption: true,
76
76
})
77
-
.option("enabled",{
78
-
describe:
79
-
"Whether to enable public access at the custom domain (default is enabled)",
80
-
type: "boolean",
81
-
})
82
77
.option("min-tls",{
83
78
describe:
84
79
"Set the minimum TLS version for the custom domain (defaults to 1.0 if not set)",
@@ -90,6 +85,12 @@ export function AddOptions(yargs: CommonYargsArgv) {
90
85
alias: "J",
91
86
requiresArg: true,
92
87
type: "string",
88
+
})
89
+
.option("force",{
90
+
describe: "Skip confirmation",
91
+
type: "boolean",
92
+
alias: "y",
93
+
default: false,
93
94
});
94
95
}
95
96
@@ -100,14 +101,18 @@ export async function AddHandler(
100
101
constconfig=readConfig(args.config,args);
101
102
constaccountId=awaitrequireAuth(config);
102
103
103
-
const{
104
-
bucket,
105
-
domain,
106
-
zoneId,
107
-
enabled =true,
108
-
minTls ="1.0",
109
-
jurisdiction,
110
-
}=args;
104
+
const{ bucket, domain, zoneId, minTls ="1.0", jurisdiction, force }=args;
105
+
106
+
if(!force){
107
+
constconfirmedAdd=awaitconfirm(
108
+
`Are you sure you want to add the custom domain '${domain}' to bucket '${bucket}'? `+
109
+
`The contents of your bucket will be made publicly available at 'https://${domain}'`
110
+
);
111
+
if(!confirmedAdd){
112
+
logger.log("Add cancelled.");
113
+
return;
114
+
}
115
+
}
111
116
112
117
logger.log(`Connecting custom domain '${domain}' to bucket '${bucket}'...`);
113
118
@@ -117,7 +122,6 @@ export async function AddHandler(
117
122
{
118
123
domain,
119
124
zoneId,
120
-
enabled,
121
125
minTLS: minTls,
122
126
},
123
127
jurisdiction
@@ -163,7 +167,8 @@ export async function RemoveHandler(
163
167
164
168
if(!force){
165
169
constconfirmedRemoval=awaitconfirm(
166
-
`Are you sure you want to remove the custom domain '${domain}' from bucket '${bucket}'? Your bucket will no longer be available from 'https://${domain}'`
170
+
`Are you sure you want to remove the custom domain '${domain}' from bucket '${bucket}'? `+
171
+
`Your bucket will no longer be available from 'https://${domain}'`
167
172
);
168
173
if(!confirmedRemoval){
169
174
logger.log("Removal cancelled.");
@@ -190,10 +195,6 @@ export function UpdateOptions(yargs: CommonYargsArgv) {
190
195
type: "string",
191
196
demandOption: true,
192
197
})
193
-
.option("enabled",{
194
-
describe: "Enable or disable public access at the custom domain",
195
-
type: "boolean",
196
-
})
197
198
.option("min-tls",{
198
199
describe: "Update the minimum TLS version for the custom domain",
199
200
choices: ["1.0","1.1","1.2","1.3"],
@@ -214,7 +215,7 @@ export async function UpdateHandler(
0 commit comments