@geek-fun/serverlessinsight 0.8.1 → 0.8.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geek-fun/serverlessinsight",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Full life cycle cross providers serverless application management for your fast-growing business.",
|
|
5
5
|
"homepage": "https://serverlessinsight.geekfun.club",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -151,7 +151,9 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
151
151
|
// For CNAME verification: point the domain directly to the group subdomain
|
|
152
152
|
const verificationHost = domainName;
|
|
153
153
|
const verificationValue = groupSubdomain;
|
|
154
|
-
|
|
154
|
+
// Use domain-specific key so primary and www don't collide
|
|
155
|
+
const domainKey = domainName.replace(/[^a-zA-Z0-9]/g, '_');
|
|
156
|
+
const dnsResourceId = `${eventLogicalId}.dns_verification.${domainKey}`;
|
|
155
157
|
try {
|
|
156
158
|
// Check if DNS record is tracked in state
|
|
157
159
|
const existingDnsResource = (0, stateManager_1.getResource)(state, dnsResourceId);
|
|
@@ -262,7 +264,8 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
262
264
|
const addTxtVerificationRecord = async (groupId, domainName, groupSubdomain, region, state, eventLogicalId) => {
|
|
263
265
|
const mainDomain = (0, domainUtils_1.extractMainDomain)(domainName);
|
|
264
266
|
const txtRecord = buildTxtVerificationRecord(groupId, domainName, groupSubdomain, mainDomain);
|
|
265
|
-
const
|
|
267
|
+
const txtDomainKey = domainName.replace(/[^a-zA-Z0-9]/g, '_');
|
|
268
|
+
const txtResourceId = `${eventLogicalId}.dns_txt_verification.${txtDomainKey}`;
|
|
266
269
|
logger_1.logger.info(lang_1.lang.__('APIGW_TXT_ADDING_RECORD', { rr: txtRecord.rr, value: txtRecord.value }));
|
|
267
270
|
try {
|
|
268
271
|
const existingRecords = await dnsOps.describeDomainRecords(mainDomain, txtRecord.rr);
|
|
@@ -596,8 +596,13 @@ const updateApigwResource = async (context, event, serviceName, roleArn, state)
|
|
|
596
596
|
// the domain was previously successfully bound (DNS records exist in state).
|
|
597
597
|
// This avoids unnecessary DNS verification (minutes-long) on every deploy.
|
|
598
598
|
// We check DNS sub-resources to avoid skipping after a previously failed binding.
|
|
599
|
+
// Check for ANY DNS sub-resource — covers both primary and www domains.
|
|
600
|
+
// If any domain was previously bound, its DNS record exists in state.
|
|
599
601
|
const hasBoundDomains = (0, stateManager_1.getResource)(state, `${logicalId}.dns_verification`) !== undefined ||
|
|
600
|
-
(0, stateManager_1.getResource)(state, `${logicalId}.dns_txt_verification`) !== undefined
|
|
602
|
+
(0, stateManager_1.getResource)(state, `${logicalId}.dns_txt_verification`) !== undefined ||
|
|
603
|
+
Object.keys(state.resources ?? {}).some((k) => k.startsWith(`${logicalId}.dns_`) &&
|
|
604
|
+
k !== `${logicalId}.dns_verification` &&
|
|
605
|
+
k !== `${logicalId}.dns_txt_verification`);
|
|
601
606
|
if (previousDomainDef &&
|
|
602
607
|
desiredDomainDef &&
|
|
603
608
|
hasBoundDomains &&
|
|
@@ -815,10 +820,18 @@ exports.deleteApigwResource = deleteApigwResource;
|
|
|
815
820
|
*/
|
|
816
821
|
const cleanupDnsRecords = async (context, eventLogicalId, state) => {
|
|
817
822
|
const client = (0, aliyunClient_1.createAliyunClient)(context);
|
|
823
|
+
// Backward-compatible: always check old-style fixed keys, then scan for
|
|
824
|
+
// domain-specific keys (primary + www + any) created by the new code.
|
|
818
825
|
const dnsResourceIds = [
|
|
819
826
|
`${eventLogicalId}.dns_verification`,
|
|
820
827
|
`${eventLogicalId}.dns_txt_verification`,
|
|
821
828
|
];
|
|
829
|
+
const dnsPrefix = `${eventLogicalId}.dns_`;
|
|
830
|
+
for (const key of Object.keys(state.resources ?? {})) {
|
|
831
|
+
if (key.startsWith(dnsPrefix) && !dnsResourceIds.includes(key)) {
|
|
832
|
+
dnsResourceIds.push(key);
|
|
833
|
+
}
|
|
834
|
+
}
|
|
822
835
|
for (const dnsResourceId of dnsResourceIds) {
|
|
823
836
|
const dnsState = (0, stateManager_1.getResource)(state, dnsResourceId);
|
|
824
837
|
if (!dnsState) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geek-fun/serverlessinsight",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Full life cycle cross providers serverless application management for your fast-growing business.",
|
|
5
5
|
"homepage": "https://serverlessinsight.geekfun.club",
|
|
6
6
|
"main": "dist/src/index.js",
|