From e6f2ed69a5c24ffe767f179c4e1c152d8da7a76a Mon Sep 17 00:00:00 2001 From: soundgoof Date: Tue, 28 Jul 2026 23:04:37 +0200 Subject: [PATCH] dhmap: stop deploying development files to the web root /opt/dhmap is symlinked to /var/www/html/dhmap and the whole repository is synced there recursively, with only .git excluded. So anything added to the repository becomes publicly readable, whether or not it has anything to do with serving the map. dhmap is gaining a test suite, which brings a test tree, a Makefile, npm manifests and CI configuration - none of it useful in production. Two of the excluded names matter beyond tidiness. Neither is committed, so neither should reach a puppetmaster checkout, but the cost of being wrong is uneven: local/ is where a real ipplan database is dropped during development, and publishing that would expose host addressing and network definitions; node_modules appears the moment anyone runs npm install in the checkout, and would sync several hundred megabytes into the web root. Excluding them here means the deploy no longer depends on those files merely happening to be absent. --- modules/dhmap/manifests/init.pp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/modules/dhmap/manifests/init.pp b/modules/dhmap/manifests/init.pp index 292010d2..89c59446 100644 --- a/modules/dhmap/manifests/init.pp +++ b/modules/dhmap/manifests/init.pp @@ -11,11 +11,29 @@ # class dhmap { + # /opt/dhmap is symlinked into the web root below, so everything synced + # here is publicly readable. The repository holds development and test + # material that has no business being served, so exclude it rather than + # relying on it being absent. + # + # 'local' and 'node_modules' matter most: neither is committed, but local + # is where a real ipplan database is dropped during development, and + # node_modules appears the moment anyone runs npm install in the checkout. file { '/opt/dhmap': ensure => directory, source => 'puppet:///repos/dhmap', recurse => true, - ignore => ['.git'], + ignore => [ + '.git', + '.github', + 'local', + 'node_modules', + 'test', + 'Makefile', + 'package.json', + 'package-lock.json', + 'playwright.config.js', + ], } file { '/opt/dhmap/src/ipplan2dhmap.py':