Traffic-source catalog lives in catalog/ (DATA_DIR=/app/data is the runtime volume in production and would hide a shipped file)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+1
-2
@@ -1,6 +1,5 @@
|
||||
node_modules/
|
||||
data/*
|
||||
data/
|
||||
*.log
|
||||
qa/out/
|
||||
|
||||
!data/traffic-sources.json
|
||||
|
||||
@@ -423,7 +423,7 @@ async function boot() {
|
||||
setInterval(() => health.tick().catch(e => console.error('health', e.message)), 30 * 60 * 1000);
|
||||
setInterval(() => { try { rotator.sweepDemos(); } catch (e) {} }, 60 * 60 * 1000); // unclaimed home-page demo spins expire after 24 h
|
||||
postbacks.init({ dataDir: DATA_DIR, ownHosts, rotator, sources });
|
||||
sources.init({ dataDir: DATA_DIR, postbacks, rotator, catalogFile: path.join(ROOT, 'data', 'traffic-sources.json'), linkHost: () => { const hs = String(siteConfig().linkDomains || '').split(',').map(x => x.trim()).filter(Boolean); return hs[0] || SITE_HOST; } });
|
||||
sources.init({ dataDir: DATA_DIR, postbacks, rotator, catalogFile: path.join(ROOT, 'catalog', 'traffic-sources.json'), linkHost: () => { const hs = String(siteConfig().linkDomains || '').split(',').map(x => x.trim()).filter(Boolean); return hs[0] || SITE_HOST; } });
|
||||
zones.init({ dataDir: DATA_DIR, ads, siteHost: SITE_HOST });
|
||||
pages.init({ dataDir: DATA_DIR, ownHosts, imageBase: () => (IS_PROD ? 'https' : 'http') + '://' + SITE_HOST, openrouterKey: () => { if (process.env.OPENROUTER_API_KEY) return process.env.OPENROUTER_API_KEY.trim(); try { return fs.readFileSync(path.join(DATA_DIR, 'openrouter.key'), 'utf8').trim(); } catch (e) { return ''; } } });
|
||||
audiences.init({ dataDir: DATA_DIR });
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// A source remembers the network's macro tokens (so the campaign URL to paste into the network is built for
|
||||
// the member), the network's own conversion postback (fired only for clicks that came through that source),
|
||||
// and shows up in Reports as a dimension (clicks and conversions by source, and by zone / placement / site when
|
||||
// the macro carried it). Sources are created from a template catalog (data/traffic-sources.json, shipped in the
|
||||
// the macro carried it). Sources are created from a template catalog (catalog/traffic-sources.json, shipped in the
|
||||
// repo, read at boot) or defined by hand. JSON store on the volume, same pattern as postbacks.js.
|
||||
'use strict';
|
||||
const fs = require('fs');
|
||||
|
||||
Reference in New Issue
Block a user