All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 1m17s
Build & Deploy / 🧪 QA (push) Successful in 1m47s
Build & Deploy / 🏗️ Build (push) Successful in 3m29s
Build & Deploy / 🚀 Deploy (push) Successful in 35s
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 3s
26 lines
845 B
JavaScript
26 lines
845 B
JavaScript
/**
|
|
* LHCI Puppeteer Setup Script
|
|
* Sets the gatekeeper session cookie before auditing
|
|
*/
|
|
module.exports = async (browser, context) => {
|
|
const page = await browser.newPage();
|
|
// Using LHCI_URL or TARGET_URL if available
|
|
const targetUrl =
|
|
process.env.LHCI_URL || process.env.TARGET_URL || 'https://testing.e-tib.com';
|
|
const gatekeeperPassword = process.env.GATEKEEPER_PASSWORD || 'klz2026';
|
|
const authCookieName = process.env.AUTH_COOKIE_NAME || 'etib_gatekeeper_session';
|
|
|
|
console.log(`🔑 LHCI Auth: Setting gatekeeper cookie (${authCookieName}) for ${new URL(targetUrl).hostname}...`);
|
|
|
|
await page.setCookie({
|
|
name: authCookieName,
|
|
value: gatekeeperPassword,
|
|
domain: new URL(targetUrl).hostname,
|
|
path: '/',
|
|
httpOnly: true,
|
|
secure: targetUrl.startsWith('https://'),
|
|
});
|
|
|
|
await page.close();
|
|
};
|