@sentry/craft 2.25.4 → 2.25.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/craft +94 -443
- package/package.json +1 -2
package/dist/craft
CHANGED
|
@@ -156808,371 +156808,6 @@ var init_upm = __esm({
|
|
|
156808
156808
|
}
|
|
156809
156809
|
});
|
|
156810
156810
|
|
|
156811
|
-
// node_modules/.pnpm/nvar@1.3.1/node_modules/nvar/lib/nvar.js
|
|
156812
|
-
var require_nvar = __commonJS({
|
|
156813
|
-
"node_modules/.pnpm/nvar@1.3.1/node_modules/nvar/lib/nvar.js"(exports2, module2) {
|
|
156814
|
-
init_import_meta_url();
|
|
156815
|
-
module2.exports = nvar2;
|
|
156816
|
-
function nvar2(opts) {
|
|
156817
|
-
if (typeof opts === "string") opts = { path: opts };
|
|
156818
|
-
const pathExplicitlySpecified = !!(opts || {}).path;
|
|
156819
|
-
let {
|
|
156820
|
-
// Destructure opts while stating defaults.
|
|
156821
|
-
path: path19 = ".env",
|
|
156822
|
-
source = null,
|
|
156823
|
-
target = process.env,
|
|
156824
|
-
enoent = pathExplicitlySpecified ? "error" : "warn",
|
|
156825
|
-
override = "all"
|
|
156826
|
-
} = opts || {};
|
|
156827
|
-
try {
|
|
156828
|
-
if (!source) source = require("fs").readFileSync(path19, "utf8");
|
|
156829
|
-
} catch (e4) {
|
|
156830
|
-
if (e4.code === "ENOENT") {
|
|
156831
|
-
if (!enoent) return;
|
|
156832
|
-
if (enoent === "warn") return console.error(`nvar did not assign any values, as it could not locate ${path19}.`);
|
|
156833
|
-
}
|
|
156834
|
-
throw e4;
|
|
156835
|
-
}
|
|
156836
|
-
let assignmentAllower;
|
|
156837
|
-
switch (typeof override) {
|
|
156838
|
-
case "function":
|
|
156839
|
-
assignmentAllower = override;
|
|
156840
|
-
break;
|
|
156841
|
-
case "string":
|
|
156842
|
-
assignmentAllower = {
|
|
156843
|
-
all: () => true,
|
|
156844
|
-
empty: (key2, target2) => !target2[key2],
|
|
156845
|
-
none: (key2, target2) => target2[key2] === void 0
|
|
156846
|
-
}[override];
|
|
156847
|
-
if (assignmentAllower) break;
|
|
156848
|
-
default:
|
|
156849
|
-
throw new Error("[nvar] `override` should be set to 'all', 'empty', 'none', or a function.");
|
|
156850
|
-
}
|
|
156851
|
-
let mode = "n";
|
|
156852
|
-
let i4 = 0;
|
|
156853
|
-
let marker;
|
|
156854
|
-
let word, key;
|
|
156855
|
-
let exportPrefixEncountered = false;
|
|
156856
|
-
let quoteMode, escapeMode;
|
|
156857
|
-
while (source[i4] !== void 0) {
|
|
156858
|
-
let char = source[i4];
|
|
156859
|
-
switch (mode) {
|
|
156860
|
-
case "n":
|
|
156861
|
-
while (/\s/.test(char)) {
|
|
156862
|
-
char = source[++i4];
|
|
156863
|
-
}
|
|
156864
|
-
if (char === "#") {
|
|
156865
|
-
mode = "x";
|
|
156866
|
-
break;
|
|
156867
|
-
}
|
|
156868
|
-
if (/[a-z_]/i.test(char)) {
|
|
156869
|
-
marker = i4++;
|
|
156870
|
-
mode = "k";
|
|
156871
|
-
break;
|
|
156872
|
-
}
|
|
156873
|
-
throw new Error("[nvar] Unexpected character '" + char + "' (position " + i4 + ")");
|
|
156874
|
-
case "k":
|
|
156875
|
-
while (/\w/.test(char = source[i4]) && char !== void 0) ++i4;
|
|
156876
|
-
if (char === "=") {
|
|
156877
|
-
word = source.slice(marker, i4);
|
|
156878
|
-
mode = "v";
|
|
156879
|
-
break;
|
|
156880
|
-
}
|
|
156881
|
-
if (char === "\\") {
|
|
156882
|
-
if (source[i4 + 1] === "\n") {
|
|
156883
|
-
i4 += 2;
|
|
156884
|
-
if (source[i4] === "=") {
|
|
156885
|
-
word = source.slice(marker, i4);
|
|
156886
|
-
mode = "v";
|
|
156887
|
-
}
|
|
156888
|
-
break;
|
|
156889
|
-
}
|
|
156890
|
-
} else if (/[\t ]/.test(char) && (word = source.slice(marker, i4)) === "export" && !exportPrefixEncountered) {
|
|
156891
|
-
exportPrefixEncountered = true;
|
|
156892
|
-
mode = "n";
|
|
156893
|
-
break;
|
|
156894
|
-
}
|
|
156895
|
-
mode = "x";
|
|
156896
|
-
break;
|
|
156897
|
-
case "v":
|
|
156898
|
-
exportPrefixEncountered = false;
|
|
156899
|
-
key = word.replace(/\\\n/g, "");
|
|
156900
|
-
word = "";
|
|
156901
|
-
quoteMode = null;
|
|
156902
|
-
marker = ++i4;
|
|
156903
|
-
while (mode === "v" && (char = source[i4])) {
|
|
156904
|
-
switch (quoteMode) {
|
|
156905
|
-
case "s":
|
|
156906
|
-
while ((char = source[i4]) && char !== "'") i4++;
|
|
156907
|
-
word += source.slice(marker, i4);
|
|
156908
|
-
marker = ++i4;
|
|
156909
|
-
quoteMode = null;
|
|
156910
|
-
break;
|
|
156911
|
-
case "d":
|
|
156912
|
-
if (char === "\\") {
|
|
156913
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
156914
|
-
if (["\n", '"', "$", "\\"].indexOf(source[i4 + 1]) === -1) word += "\\" + source[i4 + 1];
|
|
156915
|
-
if (['"', "$", "\\"].indexOf(source[i4 + 1]) > -1) word += source[i4 + 1];
|
|
156916
|
-
i4 += 2;
|
|
156917
|
-
marker = i4;
|
|
156918
|
-
break;
|
|
156919
|
-
}
|
|
156920
|
-
if (char === '"') {
|
|
156921
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
156922
|
-
quoteMode = null;
|
|
156923
|
-
marker = ++i4;
|
|
156924
|
-
break;
|
|
156925
|
-
}
|
|
156926
|
-
++i4;
|
|
156927
|
-
break;
|
|
156928
|
-
default:
|
|
156929
|
-
if (char === "\\") {
|
|
156930
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
156931
|
-
if (source[i4 + 1] !== "\n") word += source[i4 + 1];
|
|
156932
|
-
i4 += 2;
|
|
156933
|
-
marker = i4;
|
|
156934
|
-
break;
|
|
156935
|
-
}
|
|
156936
|
-
if (char === "'") {
|
|
156937
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
156938
|
-
quoteMode = "s";
|
|
156939
|
-
marker = ++i4;
|
|
156940
|
-
break;
|
|
156941
|
-
}
|
|
156942
|
-
if (char === '"') {
|
|
156943
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
156944
|
-
quoteMode = "d";
|
|
156945
|
-
marker = ++i4;
|
|
156946
|
-
break;
|
|
156947
|
-
}
|
|
156948
|
-
if ([" ", " ", "\n"].indexOf(char) !== -1) {
|
|
156949
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
156950
|
-
if (assignmentAllower(key, target)) target[key] = word;
|
|
156951
|
-
word = "";
|
|
156952
|
-
i4++;
|
|
156953
|
-
mode = "n";
|
|
156954
|
-
break;
|
|
156955
|
-
}
|
|
156956
|
-
++i4;
|
|
156957
|
-
}
|
|
156958
|
-
}
|
|
156959
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
156960
|
-
if (mode === "v" && word) {
|
|
156961
|
-
if (assignmentAllower(key, target)) target[key] = word;
|
|
156962
|
-
word = "";
|
|
156963
|
-
}
|
|
156964
|
-
break;
|
|
156965
|
-
case "x":
|
|
156966
|
-
exportPrefixEncountered = false;
|
|
156967
|
-
do {
|
|
156968
|
-
++i4;
|
|
156969
|
-
} while ([void 0, "\n"].indexOf(char = source[i4]) === -1);
|
|
156970
|
-
mode = "n";
|
|
156971
|
-
break;
|
|
156972
|
-
}
|
|
156973
|
-
}
|
|
156974
|
-
return target;
|
|
156975
|
-
function parameterExpand(str2) {
|
|
156976
|
-
return str2.replace(/\$({?)([a-z_]\w*)(}?)/gi, (match2, p1, p22, p32) => {
|
|
156977
|
-
if (p1 === "" && p32 === "" || p1 === "{" && p32 === "}") return target[p22] || "";
|
|
156978
|
-
return match2;
|
|
156979
|
-
});
|
|
156980
|
-
}
|
|
156981
|
-
}
|
|
156982
|
-
}
|
|
156983
|
-
});
|
|
156984
|
-
|
|
156985
|
-
// node_modules/.pnpm/nvar@1.3.1/node_modules/nvar/lib/nvar-es5.js
|
|
156986
|
-
var require_nvar_es5 = __commonJS({
|
|
156987
|
-
"node_modules/.pnpm/nvar@1.3.1/node_modules/nvar/lib/nvar-es5.js"(exports2, module2) {
|
|
156988
|
-
"use strict";
|
|
156989
|
-
init_import_meta_url();
|
|
156990
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
|
|
156991
|
-
return typeof obj;
|
|
156992
|
-
} : function(obj) {
|
|
156993
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
156994
|
-
};
|
|
156995
|
-
module2.exports = nvar2;
|
|
156996
|
-
function nvar2(opts) {
|
|
156997
|
-
if (typeof opts === "string") opts = { path: opts };
|
|
156998
|
-
var pathExplicitlySpecified = !!(opts || {}).path;
|
|
156999
|
-
var _ref = opts || {}, _ref$path = _ref.path, path19 = _ref$path === void 0 ? ".env" : _ref$path, _ref$source = _ref.source, source = _ref$source === void 0 ? null : _ref$source, _ref$target = _ref.target, target = _ref$target === void 0 ? process.env : _ref$target, _ref$enoent = _ref.enoent, enoent = _ref$enoent === void 0 ? pathExplicitlySpecified ? "error" : "warn" : _ref$enoent, _ref$override = _ref.override, override = _ref$override === void 0 ? "all" : _ref$override;
|
|
157000
|
-
try {
|
|
157001
|
-
if (!source) source = require("fs").readFileSync(path19, "utf8");
|
|
157002
|
-
} catch (e4) {
|
|
157003
|
-
if (e4.code === "ENOENT") {
|
|
157004
|
-
if (!enoent) return;
|
|
157005
|
-
if (enoent === "warn") return console.error("nvar did not assign any values, as it could not locate " + path19 + ".");
|
|
157006
|
-
}
|
|
157007
|
-
throw e4;
|
|
157008
|
-
}
|
|
157009
|
-
var assignmentAllower = void 0;
|
|
157010
|
-
switch (typeof override === "undefined" ? "undefined" : _typeof(override)) {
|
|
157011
|
-
case "function":
|
|
157012
|
-
assignmentAllower = override;
|
|
157013
|
-
break;
|
|
157014
|
-
case "string":
|
|
157015
|
-
assignmentAllower = {
|
|
157016
|
-
all: function all() {
|
|
157017
|
-
return true;
|
|
157018
|
-
},
|
|
157019
|
-
empty: function empty(key2, target2) {
|
|
157020
|
-
return !target2[key2];
|
|
157021
|
-
},
|
|
157022
|
-
none: function none(key2, target2) {
|
|
157023
|
-
return target2[key2] === void 0;
|
|
157024
|
-
}
|
|
157025
|
-
}[override];
|
|
157026
|
-
if (assignmentAllower) break;
|
|
157027
|
-
default:
|
|
157028
|
-
throw new Error("[nvar] `override` should be set to 'all', 'empty', 'none', or a function.");
|
|
157029
|
-
}
|
|
157030
|
-
var mode = "n";
|
|
157031
|
-
var i4 = 0;
|
|
157032
|
-
var marker = void 0;
|
|
157033
|
-
var word = void 0, key = void 0;
|
|
157034
|
-
var exportPrefixEncountered = false;
|
|
157035
|
-
var quoteMode = void 0, escapeMode = void 0;
|
|
157036
|
-
while (source[i4] !== void 0) {
|
|
157037
|
-
var char = source[i4];
|
|
157038
|
-
switch (mode) {
|
|
157039
|
-
case "n":
|
|
157040
|
-
while (/\s/.test(char)) {
|
|
157041
|
-
char = source[++i4];
|
|
157042
|
-
}
|
|
157043
|
-
if (char === "#") {
|
|
157044
|
-
mode = "x";
|
|
157045
|
-
break;
|
|
157046
|
-
}
|
|
157047
|
-
if (/[a-z_]/i.test(char)) {
|
|
157048
|
-
marker = i4++;
|
|
157049
|
-
mode = "k";
|
|
157050
|
-
break;
|
|
157051
|
-
}
|
|
157052
|
-
throw new Error("[nvar] Unexpected character '" + char + "' (position " + i4 + ")");
|
|
157053
|
-
case "k":
|
|
157054
|
-
while (/\w/.test(char = source[i4]) && char !== void 0) {
|
|
157055
|
-
++i4;
|
|
157056
|
-
}
|
|
157057
|
-
if (char === "=") {
|
|
157058
|
-
word = source.slice(marker, i4);
|
|
157059
|
-
mode = "v";
|
|
157060
|
-
break;
|
|
157061
|
-
}
|
|
157062
|
-
if (char === "\\") {
|
|
157063
|
-
if (source[i4 + 1] === "\n") {
|
|
157064
|
-
i4 += 2;
|
|
157065
|
-
if (source[i4] === "=") {
|
|
157066
|
-
word = source.slice(marker, i4);
|
|
157067
|
-
mode = "v";
|
|
157068
|
-
}
|
|
157069
|
-
break;
|
|
157070
|
-
}
|
|
157071
|
-
} else if (/[\t ]/.test(char) && (word = source.slice(marker, i4)) === "export" && !exportPrefixEncountered) {
|
|
157072
|
-
exportPrefixEncountered = true;
|
|
157073
|
-
mode = "n";
|
|
157074
|
-
break;
|
|
157075
|
-
}
|
|
157076
|
-
mode = "x";
|
|
157077
|
-
break;
|
|
157078
|
-
case "v":
|
|
157079
|
-
exportPrefixEncountered = false;
|
|
157080
|
-
key = word.replace(/\\\n/g, "");
|
|
157081
|
-
word = "";
|
|
157082
|
-
quoteMode = null;
|
|
157083
|
-
marker = ++i4;
|
|
157084
|
-
while (mode === "v" && (char = source[i4])) {
|
|
157085
|
-
switch (quoteMode) {
|
|
157086
|
-
case "s":
|
|
157087
|
-
while ((char = source[i4]) && char !== "'") {
|
|
157088
|
-
i4++;
|
|
157089
|
-
}
|
|
157090
|
-
word += source.slice(marker, i4);
|
|
157091
|
-
marker = ++i4;
|
|
157092
|
-
quoteMode = null;
|
|
157093
|
-
break;
|
|
157094
|
-
case "d":
|
|
157095
|
-
if (char === "\\") {
|
|
157096
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
157097
|
-
if (["\n", '"', "$", "\\"].indexOf(source[i4 + 1]) === -1) word += "\\" + source[i4 + 1];
|
|
157098
|
-
if (['"', "$", "\\"].indexOf(source[i4 + 1]) > -1) word += source[i4 + 1];
|
|
157099
|
-
i4 += 2;
|
|
157100
|
-
marker = i4;
|
|
157101
|
-
break;
|
|
157102
|
-
}
|
|
157103
|
-
if (char === '"') {
|
|
157104
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
157105
|
-
quoteMode = null;
|
|
157106
|
-
marker = ++i4;
|
|
157107
|
-
break;
|
|
157108
|
-
}
|
|
157109
|
-
++i4;
|
|
157110
|
-
break;
|
|
157111
|
-
default:
|
|
157112
|
-
if (char === "\\") {
|
|
157113
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
157114
|
-
if (source[i4 + 1] !== "\n") word += source[i4 + 1];
|
|
157115
|
-
i4 += 2;
|
|
157116
|
-
marker = i4;
|
|
157117
|
-
break;
|
|
157118
|
-
}
|
|
157119
|
-
if (char === "'") {
|
|
157120
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
157121
|
-
quoteMode = "s";
|
|
157122
|
-
marker = ++i4;
|
|
157123
|
-
break;
|
|
157124
|
-
}
|
|
157125
|
-
if (char === '"') {
|
|
157126
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
157127
|
-
quoteMode = "d";
|
|
157128
|
-
marker = ++i4;
|
|
157129
|
-
break;
|
|
157130
|
-
}
|
|
157131
|
-
if ([" ", " ", "\n"].indexOf(char) !== -1) {
|
|
157132
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
157133
|
-
if (assignmentAllower(key, target)) target[key] = word;
|
|
157134
|
-
word = "";
|
|
157135
|
-
i4++;
|
|
157136
|
-
mode = "n";
|
|
157137
|
-
break;
|
|
157138
|
-
}
|
|
157139
|
-
++i4;
|
|
157140
|
-
}
|
|
157141
|
-
}
|
|
157142
|
-
word += parameterExpand(source.slice(marker, i4));
|
|
157143
|
-
if (mode === "v" && word) {
|
|
157144
|
-
if (assignmentAllower(key, target)) target[key] = word;
|
|
157145
|
-
word = "";
|
|
157146
|
-
}
|
|
157147
|
-
break;
|
|
157148
|
-
case "x":
|
|
157149
|
-
exportPrefixEncountered = false;
|
|
157150
|
-
do {
|
|
157151
|
-
++i4;
|
|
157152
|
-
} while ([void 0, "\n"].indexOf(char = source[i4]) === -1);
|
|
157153
|
-
mode = "n";
|
|
157154
|
-
break;
|
|
157155
|
-
}
|
|
157156
|
-
}
|
|
157157
|
-
return target;
|
|
157158
|
-
function parameterExpand(str2) {
|
|
157159
|
-
return str2.replace(/\$({?)([a-z_]\w*)(}?)/gi, function(match2, p1, p22, p32) {
|
|
157160
|
-
if (p1 === "" && p32 === "" || p1 === "{" && p32 === "}") return target[p22] || "";
|
|
157161
|
-
return match2;
|
|
157162
|
-
});
|
|
157163
|
-
}
|
|
157164
|
-
}
|
|
157165
|
-
}
|
|
157166
|
-
});
|
|
157167
|
-
|
|
157168
|
-
// node_modules/.pnpm/nvar@1.3.1/node_modules/nvar/lib/index.js
|
|
157169
|
-
var require_lib11 = __commonJS({
|
|
157170
|
-
"node_modules/.pnpm/nvar@1.3.1/node_modules/nvar/lib/index.js"(exports2, module2) {
|
|
157171
|
-
init_import_meta_url();
|
|
157172
|
-
module2.exports = parseInt(/^v(\d+)/.exec(process.version)[1]) >= 6 ? require_nvar() : require_nvar_es5();
|
|
157173
|
-
}
|
|
157174
|
-
});
|
|
157175
|
-
|
|
157176
156811
|
// src/utils/env.ts
|
|
157177
156812
|
function envHasVar(envVar) {
|
|
157178
156813
|
const { name, legacyName } = envVar;
|
|
@@ -157195,62 +156830,44 @@ function envHasVar(envVar) {
|
|
|
157195
156830
|
}
|
|
157196
156831
|
return true;
|
|
157197
156832
|
}
|
|
157198
|
-
function
|
|
157199
|
-
const
|
|
157200
|
-
const
|
|
157201
|
-
|
|
157202
|
-
|
|
157203
|
-
if (
|
|
157204
|
-
|
|
156833
|
+
function sanitizeDynamicLinkerEnv() {
|
|
156834
|
+
const allowOverride = process.env[ALLOW_DYNAMIC_LINKER_ENV_VAR] === "1";
|
|
156835
|
+
const presentKeys = DYNAMIC_LINKER_ENV_VARS.filter(
|
|
156836
|
+
(key) => process.env[key] !== void 0
|
|
156837
|
+
);
|
|
156838
|
+
if (presentKeys.length === 0) {
|
|
156839
|
+
return;
|
|
156840
|
+
}
|
|
156841
|
+
if (allowOverride) {
|
|
156842
|
+
logger.info(
|
|
156843
|
+
`${ALLOW_DYNAMIC_LINKER_ENV_VAR}=1 set; preserving dynamic-linker environment variables: ${presentKeys.join(
|
|
156844
|
+
", "
|
|
156845
|
+
)}. This is not recommended.`
|
|
156846
|
+
);
|
|
156847
|
+
return;
|
|
156848
|
+
}
|
|
156849
|
+
for (const key of presentKeys) {
|
|
157205
156850
|
logger.warn(
|
|
157206
|
-
`
|
|
156851
|
+
`Stripping dynamic-linker environment variable "${key}" for security reasons. Set ${ALLOW_DYNAMIC_LINKER_ENV_VAR}=1 to override (not recommended).`
|
|
157207
156852
|
);
|
|
157208
|
-
|
|
156853
|
+
delete process.env[key];
|
|
157209
156854
|
}
|
|
157210
|
-
return true;
|
|
157211
156855
|
}
|
|
157212
|
-
function
|
|
157213
|
-
|
|
157214
|
-
|
|
157215
|
-
|
|
157216
|
-
|
|
157217
|
-
"Found environment file in the home directory:",
|
|
157218
|
-
homedirEnvFile
|
|
157219
|
-
);
|
|
157220
|
-
checkFileIsPrivate(homedirEnvFile);
|
|
157221
|
-
const homedirEnv = {};
|
|
157222
|
-
(0, import_nvar.default)({ path: homedirEnvFile, target: homedirEnv });
|
|
157223
|
-
newEnv = { ...newEnv, ...homedirEnv };
|
|
157224
|
-
logger.trace("Read the following variables from env file:", homedirEnv);
|
|
157225
|
-
} else {
|
|
157226
|
-
logger.debug(
|
|
157227
|
-
"No environment file found in the home directory:",
|
|
157228
|
-
homedirEnvFile
|
|
157229
|
-
);
|
|
156856
|
+
function warnIfCraftEnvFileExists() {
|
|
156857
|
+
const candidatePaths = [];
|
|
156858
|
+
try {
|
|
156859
|
+
candidatePaths.push((0, import_path16.join)(os5.homedir(), LEGACY_ENV_FILE_NAME));
|
|
156860
|
+
} catch {
|
|
157230
156861
|
}
|
|
157231
156862
|
const configFileDir = getConfigFileDir();
|
|
157232
|
-
|
|
157233
|
-
|
|
157234
|
-
logger.debug("No configuration file found:", CONFIG_FILE_NAME);
|
|
157235
|
-
} else if (configDirEnvFile && (0, import_fs19.existsSync)(configDirEnvFile)) {
|
|
157236
|
-
logger.debug(
|
|
157237
|
-
"Found environment file in the configuration directory:",
|
|
157238
|
-
configDirEnvFile
|
|
157239
|
-
);
|
|
157240
|
-
checkFileIsPrivate(configDirEnvFile);
|
|
157241
|
-
const configDirEnv = {};
|
|
157242
|
-
(0, import_nvar.default)({ path: configDirEnvFile, target: configDirEnv });
|
|
157243
|
-
newEnv = { ...newEnv, ...configDirEnv };
|
|
157244
|
-
logger.trace("Read the following variables from env file:", configDirEnv);
|
|
157245
|
-
} else {
|
|
157246
|
-
logger.debug(
|
|
157247
|
-
"No environment file found in the configuration directory:",
|
|
157248
|
-
configDirEnvFile
|
|
157249
|
-
);
|
|
156863
|
+
if (configFileDir) {
|
|
156864
|
+
candidatePaths.push((0, import_path16.join)(configFileDir, LEGACY_ENV_FILE_NAME));
|
|
157250
156865
|
}
|
|
157251
|
-
for (const
|
|
157252
|
-
if (
|
|
157253
|
-
|
|
156866
|
+
for (const path19 of candidatePaths) {
|
|
156867
|
+
if ((0, import_fs19.existsSync)(path19)) {
|
|
156868
|
+
logger.warn(
|
|
156869
|
+
`Found legacy "${LEGACY_ENV_FILE_NAME}" file at "${path19}". Craft no longer reads this file for security reasons. Please set the required variables in your shell or CI environment instead.`
|
|
156870
|
+
);
|
|
157254
156871
|
}
|
|
157255
156872
|
}
|
|
157256
156873
|
}
|
|
@@ -157263,19 +156880,31 @@ function checkEnvForPrerequisite(...varList) {
|
|
|
157263
156880
|
);
|
|
157264
156881
|
}
|
|
157265
156882
|
}
|
|
157266
|
-
var import_fs19, import_path16,
|
|
156883
|
+
var import_fs19, import_path16, os5, LEGACY_ENV_FILE_NAME, DYNAMIC_LINKER_ENV_VARS, ALLOW_DYNAMIC_LINKER_ENV_VAR;
|
|
157267
156884
|
var init_env = __esm({
|
|
157268
156885
|
"src/utils/env.ts"() {
|
|
157269
156886
|
"use strict";
|
|
157270
156887
|
init_import_meta_url();
|
|
157271
156888
|
import_fs19 = require("fs");
|
|
157272
156889
|
import_path16 = require("path");
|
|
157273
|
-
import_nvar = __toESM(require_lib11());
|
|
157274
156890
|
init_config2();
|
|
157275
156891
|
init_errors2();
|
|
157276
156892
|
init_logger2();
|
|
157277
156893
|
os5 = require("os");
|
|
157278
|
-
|
|
156894
|
+
LEGACY_ENV_FILE_NAME = ".craft.env";
|
|
156895
|
+
DYNAMIC_LINKER_ENV_VARS = [
|
|
156896
|
+
// Linux / glibc / musl
|
|
156897
|
+
"LD_PRELOAD",
|
|
156898
|
+
"LD_LIBRARY_PATH",
|
|
156899
|
+
"LD_AUDIT",
|
|
156900
|
+
// macOS dyld
|
|
156901
|
+
"DYLD_INSERT_LIBRARIES",
|
|
156902
|
+
"DYLD_LIBRARY_PATH",
|
|
156903
|
+
"DYLD_FRAMEWORK_PATH",
|
|
156904
|
+
"DYLD_FALLBACK_LIBRARY_PATH",
|
|
156905
|
+
"DYLD_FALLBACK_FRAMEWORK_PATH"
|
|
156906
|
+
];
|
|
156907
|
+
ALLOW_DYNAMIC_LINKER_ENV_VAR = "CRAFT_ALLOW_DYNAMIC_LINKER_ENV";
|
|
157279
156908
|
}
|
|
157280
156909
|
});
|
|
157281
156910
|
|
|
@@ -159077,7 +158706,7 @@ var require_package6 = __commonJS({
|
|
|
159077
158706
|
"package.json"(exports2, module2) {
|
|
159078
158707
|
module2.exports = {
|
|
159079
158708
|
name: "@sentry/craft",
|
|
159080
|
-
version: "2.25.
|
|
158709
|
+
version: "2.25.5",
|
|
159081
158710
|
description: "The universal sentry workflow CLI",
|
|
159082
158711
|
main: "dist/craft",
|
|
159083
158712
|
repository: "https://github.com/getsentry/craft",
|
|
@@ -159132,7 +158761,6 @@ var require_package6 = __commonJS({
|
|
|
159132
158761
|
mustache: "3.0.1",
|
|
159133
158762
|
nock: "^13.2.4",
|
|
159134
158763
|
"node-fetch": "^2.6.1",
|
|
159135
|
-
nvar: "1.3.1",
|
|
159136
158764
|
ora: "5.4.0",
|
|
159137
158765
|
prettier: "^3.4.2",
|
|
159138
158766
|
prompts: "2.4.1",
|
|
@@ -159249,7 +158877,7 @@ function getPackage() {
|
|
|
159249
158877
|
}
|
|
159250
158878
|
function getPackageVersion() {
|
|
159251
158879
|
const { version: version2 } = getPackage();
|
|
159252
|
-
const buildInfo = "
|
|
158880
|
+
const buildInfo = "cdc6127f84ebbad92bd4dbf11f1e6dd4129590ab";
|
|
159253
158881
|
return buildInfo ? `${version2} (${buildInfo})` : version2;
|
|
159254
158882
|
}
|
|
159255
158883
|
function semVerToString(s6) {
|
|
@@ -167152,6 +166780,7 @@ init_tracing3();
|
|
|
167152
166780
|
var prepare_exports = {};
|
|
167153
166781
|
__export(prepare_exports, {
|
|
167154
166782
|
aliases: () => aliases2,
|
|
166783
|
+
assertRemoteConfigAllowed: () => assertRemoteConfigAllowed,
|
|
167155
166784
|
builder: () => builder2,
|
|
167156
166785
|
checkVersionOrPart: () => checkVersionOrPart,
|
|
167157
166786
|
command: () => command3,
|
|
@@ -167257,6 +166886,28 @@ init_git();
|
|
|
167257
166886
|
init_helpers();
|
|
167258
166887
|
init_strings();
|
|
167259
166888
|
init_system();
|
|
166889
|
+
|
|
166890
|
+
// src/utils/releaseCommandEnv.ts
|
|
166891
|
+
init_import_meta_url();
|
|
166892
|
+
var ALLOWED_ENV_VARS = [
|
|
166893
|
+
"HOME",
|
|
166894
|
+
"USER",
|
|
166895
|
+
"GIT_COMMITTER_NAME",
|
|
166896
|
+
"GIT_AUTHOR_NAME",
|
|
166897
|
+
"EMAIL"
|
|
166898
|
+
];
|
|
166899
|
+
function buildReleaseCommandEnv(extras = {}) {
|
|
166900
|
+
const env2 = {
|
|
166901
|
+
PATH: process.env.PATH,
|
|
166902
|
+
GITHUB_TOKEN: process.env.GITHUB_TOKEN
|
|
166903
|
+
};
|
|
166904
|
+
for (const key of ALLOWED_ENV_VARS) {
|
|
166905
|
+
env2[key] = process.env[key];
|
|
166906
|
+
}
|
|
166907
|
+
return { ...env2, ...extras };
|
|
166908
|
+
}
|
|
166909
|
+
|
|
166910
|
+
// src/commands/prepare.ts
|
|
167260
166911
|
init_tracing3();
|
|
167261
166912
|
init_version9();
|
|
167262
166913
|
|
|
@@ -167346,13 +166997,6 @@ init_esm9();
|
|
|
167346
166997
|
init_git();
|
|
167347
166998
|
init_tracing3();
|
|
167348
166999
|
var DEFAULT_POST_RELEASE_SCRIPT_PATH = (0, import_path27.join)("scripts", "post-release.sh");
|
|
167349
|
-
var ALLOWED_ENV_VARS = [
|
|
167350
|
-
"HOME",
|
|
167351
|
-
"USER",
|
|
167352
|
-
"GIT_COMMITTER_NAME",
|
|
167353
|
-
"GIT_AUTHOR_NAME",
|
|
167354
|
-
"EMAIL"
|
|
167355
|
-
];
|
|
167356
167000
|
var command2 = ["publish NEW-VERSION"];
|
|
167357
167001
|
var aliases = ["pp", "publish"];
|
|
167358
167002
|
var description = "\u{1F6EB} Publish artifacts";
|
|
@@ -167666,14 +167310,7 @@ async function runPostReleaseCommand(newVersion, postReleaseCommand) {
|
|
|
167666
167310
|
args = [...args, "", newVersion];
|
|
167667
167311
|
logger.info(`Running the post-release command...`);
|
|
167668
167312
|
await spawnProcess(sysCommand, args, {
|
|
167669
|
-
env: {
|
|
167670
|
-
CRAFT_RELEASED_VERSION: newVersion,
|
|
167671
|
-
PATH: process.env.PATH,
|
|
167672
|
-
GITHUB_TOKEN: process.env.GITHUB_TOKEN,
|
|
167673
|
-
...Object.fromEntries(
|
|
167674
|
-
ALLOWED_ENV_VARS.map((key) => [key, process.env[key]])
|
|
167675
|
-
)
|
|
167676
|
-
}
|
|
167313
|
+
env: buildReleaseCommandEnv({ CRAFT_RELEASED_VERSION: newVersion })
|
|
167677
167314
|
});
|
|
167678
167315
|
return true;
|
|
167679
167316
|
}
|
|
@@ -167948,13 +167585,24 @@ var builder2 = (yargs) => yargs.positional("NEW-VERSION", {
|
|
|
167948
167585
|
description: "The git remote to use when pushing",
|
|
167949
167586
|
type: "string"
|
|
167950
167587
|
}).option("config-from", {
|
|
167951
|
-
description: "Load .craft.yml from the specified remote branch instead of local file",
|
|
167588
|
+
description: "Load .craft.yml from the specified remote branch instead of local file. Requires --allow-remote-config since the remote config can run arbitrary commands via preReleaseCommand.",
|
|
167952
167589
|
type: "string"
|
|
167590
|
+
}).option("allow-remote-config", {
|
|
167591
|
+
description: "Opt in to loading .craft.yml from a remote branch via --config-from. Without this flag, --config-from is rejected because remotely-fetched config is untrusted input that can execute arbitrary commands.",
|
|
167592
|
+
type: "boolean",
|
|
167593
|
+
default: false
|
|
167953
167594
|
}).option("calver-offset", {
|
|
167954
167595
|
description: "Days to go back for CalVer date calculation (overrides config)",
|
|
167955
167596
|
type: "number"
|
|
167956
167597
|
}).check(checkVersionOrPart);
|
|
167957
167598
|
var SLEEP_BEFORE_PUBLISH_SECONDS = 30;
|
|
167599
|
+
function assertRemoteConfigAllowed(configFrom, allowRemoteConfig) {
|
|
167600
|
+
if (!allowRemoteConfig) {
|
|
167601
|
+
throw new ConfigurationError(
|
|
167602
|
+
`--config-from loads ${CONFIG_FILE_NAME} from a remote git ref, which can execute arbitrary commands via preReleaseCommand. Pass --allow-remote-config (or set CRAFT_ALLOW_REMOTE_CONFIG=1) to confirm you trust the remote branch "${configFrom}".`
|
|
167603
|
+
);
|
|
167604
|
+
}
|
|
167605
|
+
}
|
|
167958
167606
|
function checkVersionOrPart(argv, _opt) {
|
|
167959
167607
|
const version2 = argv.newVersion;
|
|
167960
167608
|
if (!version2) {
|
|
@@ -168075,12 +167723,11 @@ async function runCustomPreReleaseCommand(oldVersion, newVersion, preReleaseComm
|
|
|
168075
167723
|
}
|
|
168076
167724
|
args = [...args, nonEmptyOldVersion, newVersion];
|
|
168077
167725
|
logger.info("Running the pre-release command...");
|
|
168078
|
-
const additionalEnv = {
|
|
168079
|
-
CRAFT_NEW_VERSION: newVersion,
|
|
168080
|
-
CRAFT_OLD_VERSION: nonEmptyOldVersion
|
|
168081
|
-
};
|
|
168082
167726
|
await spawnProcess(sysCommand, args, {
|
|
168083
|
-
env: {
|
|
167727
|
+
env: buildReleaseCommandEnv({
|
|
167728
|
+
CRAFT_NEW_VERSION: newVersion,
|
|
167729
|
+
CRAFT_OLD_VERSION: nonEmptyOldVersion
|
|
167730
|
+
})
|
|
168084
167731
|
});
|
|
168085
167732
|
return true;
|
|
168086
167733
|
}
|
|
@@ -168294,7 +167941,10 @@ async function resolveVersion(git, options) {
|
|
|
168294
167941
|
async function prepareMain(argv) {
|
|
168295
167942
|
let git = await getGitClient();
|
|
168296
167943
|
if (argv.configFrom) {
|
|
168297
|
-
|
|
167944
|
+
assertRemoteConfigAllowed(argv.configFrom, argv.allowRemoteConfig);
|
|
167945
|
+
logger.warn(
|
|
167946
|
+
`Loading configuration from remote branch "${argv.configFrom}" (opted in via --allow-remote-config). Ensure this branch is trusted \u2014 its .craft.yml will configure commands Craft will execute.`
|
|
167947
|
+
);
|
|
168298
167948
|
try {
|
|
168299
167949
|
await git.fetch([argv.remote, argv.configFrom]);
|
|
168300
167950
|
const configContent = await git.show([
|
|
@@ -168756,8 +168406,9 @@ function fixGlobalBooleanFlags(argv) {
|
|
|
168756
168406
|
return result;
|
|
168757
168407
|
}
|
|
168758
168408
|
async function main() {
|
|
168409
|
+
sanitizeDynamicLinkerEnv();
|
|
168759
168410
|
printVersion();
|
|
168760
|
-
|
|
168411
|
+
warnIfCraftEnvFileExists();
|
|
168761
168412
|
const argv = fixGlobalBooleanFlags(process.argv.slice(2));
|
|
168762
168413
|
await yargs_default().parserConfiguration({
|
|
168763
168414
|
"boolean-negation": false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/craft",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.5",
|
|
4
4
|
"description": "The universal sentry workflow CLI",
|
|
5
5
|
"main": "dist/craft",
|
|
6
6
|
"repository": "https://github.com/getsentry/craft",
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
"mustache": "3.0.1",
|
|
56
56
|
"nock": "^13.2.4",
|
|
57
57
|
"node-fetch": "^2.6.1",
|
|
58
|
-
"nvar": "1.3.1",
|
|
59
58
|
"ora": "5.4.0",
|
|
60
59
|
"prettier": "^3.4.2",
|
|
61
60
|
"prompts": "2.4.1",
|