Repository navigation
Expand file tree
/
Copy pathcomposer.json
More file actions
223 lines (219 loc) · 12.1 KB
/
Copy pathcomposer.json
File metadata and controls
223 lines (219 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
{
"name": "poweradmin/poweradmin",
"description": "A web-based control panel for PowerDNS.",
"type": "project",
"homepage": "https://www.poweradmin.org",
"license": "GPL-3.0-or-later",
"support": {
"issues": "https://github.com/poweradmin/poweradmin/issues",
"forum": "https://github.com/poweradmin/poweradmin/discussions",
"source": "https://github.com/poweradmin/poweradmin",
"docs": "https://docs.poweradmin.org"
},
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/poweradmin"
},
{
"type": "other",
"url": "https://paypal.me/egirkantas"
}
],
"require": {
"php": ">=8.2",
"ext-intl": "*",
"ext-gettext": "*",
"ext-openssl": "*",
"ext-pdo": "*",
"jeremykendall/php-domain-parser": "^6.4.0",
"psr/log": "^3.0.2",
"symfony/config": "^7.4.4",
"symfony/console": "^7.4.4",
"symfony/filesystem": "^7.4.0",
"symfony/http-foundation": "^7.4.5",
"symfony/property-access": "^7.4.4",
"symfony/routing": "^7.4.4",
"symfony/serializer": "^7.4.5",
"symfony/string": "^7.4.4",
"symfony/translation": "^7.4.4",
"symfony/twig-bridge": "^7.4.5",
"symfony/validator": "^7.4.5",
"twbs/bootstrap": "^5.3.7",
"twbs/bootstrap-icons": "^1.13.1",
"twig/twig": "^3.21.1",
"pragmarx/google2fa": "^9.0.0",
"bacon/bacon-qr-code": "^3.0.1",
"zircote/swagger-php": "^6.0.5",
"league/oauth2-client": "^2.8",
"onelogin/php-saml": "^4.2",
"symfony/security-bundle": "^7.4.4",
"symfony/mailer": "^7.4.4",
"twig/intl-extra": "^3.26"
},
"suggest": {
"ext-ldap": "For LDAP support"
},
"autoload": {
"psr-4": {
"Poweradmin\\": "lib/",
"PoweradminInstall\\": "install/helpers"
}
},
"autoload-dev": {
"psr-4": {
"Poweradmin\\Tests\\Unit\\": "tests/unit/",
"Poweradmin\\Tests\\Integration\\": "tests/integration/",
"TestHelpers\\": "tests/helpers"
}
},
"require-dev": {
"phpunit/phpunit": "^11.5",
"squizlabs/php_codesniffer": "^4.0.1",
"phpstan/phpstan": "^2.1",
"vimeo/psalm": "^6.15",
"phpstan/phpstan-deprecation-rules": "^2.0",
"tomasvotruba/cognitive-complexity": "^1.1",
"spaze/phpstan-disallowed-calls": "^4.13"
},
"scripts-descriptions": {
"docs:api": "Print the OpenAPI spec as JSON; add -- --output <file> to write it",
"docs:reference": "Build the local class reference into docs/reference with Doctum",
"lint:docblocks": "Fail on @param tags that do not match the method signature (Doctum parse)",
"sql:seed": "Regenerate the seed INSERT blocks of sql/poweradmin-*-db-structure.sql from PermissionCatalogue; add -- --check to only verify"
},
"scripts": {
"docs:api": "openapi lib/Application/Controller/Api/V2/ --format json",
"doctum:install": "test -f .doctum/doctum.phar || (mkdir -p .doctum && curl -fsSL --retry 3 --retry-all-errors --max-time 120 -o .doctum/doctum.phar.tmp https://doctum.long-term.support/releases/5.6.0/doctum.phar && mv .doctum/doctum.phar.tmp .doctum/doctum.phar)",
"docs:reference": ["@doctum:install", "php .doctum/doctum.phar update doctum.php --force"],
"lint:docblocks": ["@doctum:install", "out=$(php .doctum/doctum.phar parse doctum.php --force --no-progress -v 2>&1) || { printf '%s\n' \"$out\" | grep '^ERROR'; echo 'ERROR: fix the docblocks above (composer lint:docblocks)'; exit 1; }"],
"sql:seed": "php bin/regenerate-seed-sql.php",
"tests": "phpunit --testsuite unit",
"tests:integration": "phpunit --testsuite integration",
"tests:functional": "phpunit --testsuite functional",
"tests:all": "phpunit",
"tests:matrix": ".devcontainer/scripts/test-php-matrix.sh",
"check:all": "phpcs --standard=phpcs.xml addons bin bin/poweradmin config index.php install lib tests dynamic_update.php",
"format:all": "phpcbf --standard=phpcs.xml addons bin bin/poweradmin config index.php install lib tests dynamic_update.php",
"analyse:phpstan": "phpstan analyse --level=4 --memory-limit=512M addons bin bin/poweradmin config index.php install lib tests dynamic_update.php",
"analyse:complexity": "phpstan analyse -c phpstan-complexity.neon --level=4 --memory-limit=512M addons config index.php install lib tests dynamic_update.php",
"analyse:taint": "psalm --taint-analysis --no-cache",
"lint:twig": [
"! grep -rn 'name=\"csrf_token\"' templates/ lib/ --include='*.html' || (echo 'ERROR: Use name=\"_token\" instead of name=\"csrf_token\" for CSRF token fields' && false)",
"! grep -rn 'name=\"_token\"' templates/ lib/ --include='*.html' | grep -v '_macros.html' || (echo 'ERROR: Use the csrf_field() macro from _macros.html instead of a raw _token input' && false)"
],
"lint:themes": "failed=0; for f in $(cd templates/modern && find . -name '*.html' | sed 's|^\\./||' | sort); do if ! grep -qx \"$f\" templates/theme-specific-templates.txt; then echo \"Theme drift: templates/modern/$f is not listed in templates/theme-specific-templates.txt (identical templates live only in templates/default)\"; failed=1; elif cmp -s \"templates/default/$f\" \"templates/modern/$f\"; then echo \"Theme drift: $f is identical in both themes; delete the modern copy and its allowlist entry\"; failed=1; fi; done; for f in $(grep -v '^#' templates/theme-specific-templates.txt); do [ -f \"templates/modern/$f\" ] || { echo \"Theme drift: $f is allowlisted but missing from templates/modern\"; failed=1; }; done; exit $failed",
"lint:e2e-assertions": "node playwright/tools/check-assertions.js",
"lint:js": "npx --yes eslint@10.12.0 playwright/",
"lint:e2e-routes": "php playwright/tools/check-route-paths.php",
"lint:e2e-urls": "php playwright/tools/check-url-literals.php",
"lint:no-traits": "! grep -rnE '^\\s*trait ' lib/ --include='*.php' || (echo 'ERROR: lib/ does not use traits; share behaviour through a service or an abstract class instead (the installer keeps its five legacy ones)' && false)",
"lint:domain-imports": "! grep -rnE '^use (function |const )?\\\\?[A-Za-z0-9_]+\\\\' lib/Domain/ --include='*.php' | grep -vE ':[0-9]+:use (function |const )?\\\\?(Poweradmin|Psr)\\\\' || (echo 'ERROR: lib/Domain must not import a third-party library. Put it behind a port in lib/Domain/Port with an adapter in lib/Infrastructure, the way TotpInterface and PublicSuffixInterface are wired. Psr interfaces are the only exception.' && false)",
"lint:permission-literals": [
"! grep -rnE \"(hasPermission|userHasPermission|checkPermission|canPerformZoneAction|requirePermission|logAccessDenied)\\([^)]*'(zone_master_add|zone_slave_add|zone_content_view_own|zone_content_edit_own|zone_meta_edit_own|zone_content_view_others|zone_content_edit_others|zone_meta_edit_others|search|supermaster_view|supermaster_add|supermaster_edit|user_is_ueberuser|user_view_others|user_add_new|user_edit_own|user_edit_others|user_passwd_edit_others|user_edit_templ_perm|templ_perm_add|templ_perm_edit|zone_content_edit_own_as_client|zone_templ_add|zone_templ_edit|api_manage_keys|zone_delete_own|zone_delete_others|user_enforce_mfa|zone_dnssec_manage_own|zone_logs_view_own|zone_logs_view_others|user_logs_view|group_logs_view|zone_content_edit_ns_subzone|zone_metadata_view_own|zone_metadata_view_others|zone_ownership_view_own|zone_ownership_view_others|server_status_view)'\" lib/ --include='*.php' | grep -vE ':[0-9]+:[[:space:]]*(\\*|//)' || (echo 'ERROR: pass a Permission::PERM_* constant instead of a raw permission-name string literal, see lib/Domain/Model/Permission.php' && false)"
],
"lint:zone-ids": [
"! grep -rnE 'zg[0-9]*\\.domain_id *(= *z[0-9_]*\\.id\\b|IN *\\( *z[0-9_]*\\.id)' lib/ || (echo 'ERROR: match zones_groups.domain_id against COALESCE(z.domain_id, z.id); zones.id and zones.domain_id overlap, see CanonicalZoneSql' && false)"
],
"lint:sensitive-params": [
"! grep -rnE '\\??string \\$(password|passwd|newPassword|oldPassword|user_password|plainPassword|currentPassword|paPass|pa_pass|dbPass|secret|privateKey|privateKeyPem)\\b' lib/ install/ --include='*.php' | grep -vE ':[0-9]+:[[:space:]]*\\*' | grep -v 'SensitiveParameter' || (echo 'ERROR: annotate the parameter above with #[\\SensitiveParameter]; the attribute does not inherit, so every frame carrying a password or private key needs its own' && false)"
],
"lint:error-traces": [
"! grep -rnE 'getTrace(AsString)?\\(\\)' lib/ install/ index.php dynamic_update.php --include='*.php' | grep -vE ':[0-9]+:[[:space:]]*\\*' | grep -v 'BootstrapErrorResponder.php' || (echo 'ERROR: a stack trace prints call arguments, including passwords. Log the file and line instead of the trace. The only permitted traces live in BootstrapErrorResponder, gated behind misc.display_errors' && false)"
],
"gate": [
"composer validate --strict --check-lock",
"@check:all",
"@lint:all",
"@analyse:phpstan",
"@compat:8.2",
"@tests",
"@tests:integration"
],
"lint:all": [
"@lint:twig",
"@lint:themes",
"@lint:zone-ids",
"@lint:sensitive-params",
"@lint:error-traces",
"@lint:e2e-routes",
"@lint:e2e-urls",
"@lint:docblocks",
"@lint:no-traits",
"@lint:permission-literals",
"@lint:domain-imports",
"@lint:js"
],
"analyse:all": [
"@check:all",
"@analyse:phpstan",
"@lint:all"
],
"locale:check": "failed=0; for f in locale/*/LC_MESSAGES/messages.po; do if msgfmt --check -o /dev/null \"$f\" 2>&1 | grep -q 'fatal error'; then echo \"FAIL: $f\"; failed=1; fi; done; exit $failed",
"locale:stats": "python3 scripts/check_translation_stats.py",
"locale:msgfmt": "failed=0; for f in locale/*/LC_MESSAGES/messages.po lib/Module/*/locale/*/messages.po; do [ -f \"$f\" ] || continue; if ! msgfmt --check -o /dev/null \"$f\" 2>/dev/null; then echo \"FAIL: $f\"; msgfmt --check -o /dev/null \"$f\" 2>&1 | grep -v 'warning:' | head -5; failed=1; fi; done; exit $failed",
"locale:mo-sync": "failed=0; for f in locale/*/LC_MESSAGES/messages.po; do mo=\"${f%.po}.mo\"; msgfmt -o /tmp/pa-mo-check.mo \"$f\" 2>/dev/null || continue; if ! cmp -s /tmp/pa-mo-check.mo \"$mo\"; then echo \"STALE: $mo does not match $f\"; failed=1; fi; done; rm -f /tmp/pa-mo-check.mo; exit $failed",
"locale:verify": [
"@locale:msgfmt",
"@locale:mo-sync",
"python3 scripts/check_translation_integrity.py --quiet",
"python3 scripts/check_locale_unicode.py"
],
"locale:all": [
"@locale:check",
"@locale:stats"
],
"phan:install": "test -f .phan/phan.phar || (curl -fsSL --retry 3 --retry-all-errors --max-time 120 -o .phan/phan.phar.tmp https://github.com/phan/phan/releases/download/6.0.1/phan.phar && mv .phan/phan.phar.tmp .phan/phan.phar)",
"compat:8.2": ["@phan:install", "php .phan/phan.phar --target-php-version=8.2 --allow-polyfill-parser"],
"compat:8.3": ["@phan:install", "php .phan/phan.phar --target-php-version=8.3 --allow-polyfill-parser"],
"compat:8.4": ["@phan:install", "php .phan/phan.phar --target-php-version=8.4 --allow-polyfill-parser"],
"compat:8.5": ["@phan:install", "php .phan/phan.phar --target-php-version=8.5 --allow-polyfill-parser"],
"compat:all": [
"@compat:8.2",
"@compat:8.3",
"@compat:8.4",
"@compat:8.5"
],
"post-create-project-cmd": [
"rm -rf install/",
"rm -rf tests/"
]
},
"config": {
"process-timeout": 0,
"platform": {
"php": "8.2.27"
},
"allow-plugins": {
"cweagans/composer-patches": true
},
"audit": {
"ignore": {
"GHSA-qrr6-mg7r-m243": "phpunit is a dev-only dependency; 11.x line did not receive a back-port. Upgrading requires dropping PHP 8.2 support."
}
}
},
"archive": {
"exclude": [
".devcontainer",
".github",
".phan",
".doctum",
"playwright/",
"install/",
"tests",
".dockerignore",
".gitignore",
".hadolint.yaml",
"playwright.config.js",
"DONORS.md",
"package.json",
"phpcs.xml",
"doctum.php",
"phpstan-baseline.neon",
"phpstan.neon",
"phpunit.xml.dist",
"psalm.xml"
]
}
}