fhirsmith 0.18.2 → 1.0.0
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/ACCESSIBILITY.md +119 -0
- package/CHANGELOG.md +149 -0
- package/CONFIGURATION.md +305 -0
- package/LICENSE +29 -0
- package/README.md +29 -122
- package/cluster.js +1220 -0
- package/cluster.md +707 -0
- package/config-template.json +77 -8
- package/extension-tracker/extension-tracker-template.html +5 -8
- package/extension-tracker/extension-tracker.js +0 -2
- package/folder/folder.js +7 -6
- package/ips/analysis.js +560 -0
- package/ips/ips-template.html +5 -8
- package/ips/ips.js +132 -59
- package/ips/nationality.js +120 -0
- package/ips/pipeline.js +74 -21
- package/ips/presenter.js +1 -1
- package/ips/readme.md +132 -25
- package/ips/render.js +466 -77
- package/ips/store.js +79 -22
- package/ips/structure.js +247 -0
- package/ips/terminology.js +1 -1
- package/library/body-limit.js +22 -0
- package/library/cache-generation.js +15 -0
- package/library/cgroup-memory.js +133 -1
- package/library/cluster-counts.js +121 -0
- package/library/cluster-events.js +153 -0
- package/library/cluster-metrics.js +193 -0
- package/library/cluster-status.js +468 -0
- package/library/config-reader.js +96 -0
- package/library/daily-report.js +100 -2
- package/library/html-server.js +27 -1
- package/library/i18nsupport.js +23 -1
- package/library/keep-alive.js +18 -0
- package/library/languages.js +17 -3
- package/library/logger.js +31 -0
- package/library/memory-guard.js +428 -0
- package/library/native-memory.js +52 -0
- package/library/npm-audit.js +51 -25
- package/library/openapi-doc.js +7 -5
- package/library/package-manager.js +8 -0
- package/library/role.js +197 -0
- package/library/server-credentials.js +169 -0
- package/library/sqlite-utilities.js +59 -0
- package/library/ssrf-guard.js +100 -0
- package/library/static-response-stats.js +16 -0
- package/library/version-utilities.js +50 -0
- package/library/worker-count.js +192 -0
- package/nginx.md +30 -11
- package/npmprojector/indexer.js +18 -10
- package/package.json +11 -8
- package/packages/feed-check-page.js +117 -0
- package/packages/feed-check.js +279 -0
- package/packages/npm-check.js +57 -3
- package/packages/npm-signing.js +219 -0
- package/packages/openapi.yaml +207 -1
- package/packages/package-crawler.js +322 -41
- package/packages/packages-template.html +6 -8
- package/packages/packages.js +604 -57
- package/packages/readme.md +113 -1
- package/publisher/publisher-template.html +2 -5
- package/publisher/publisher.js +121 -110
- package/publisher/readme.md +75 -0
- package/registry/crawler.js +84 -108
- package/registry/documentation/configuration.md +34 -0
- package/registry/registry-template.html +5 -8
- package/registry/registry.js +5 -4
- package/root-bare-template.html +7 -4
- package/root-template.html +5 -8
- package/server.js +398 -198
- package/shl/shl.js +38 -37
- package/static/a11y/a11y-check.js +832 -0
- package/static/a11y/axe.min.js +12 -0
- package/static/assets/css/bootstrap-fhir.css +15 -15
- package/static/assets/images/flags/au.svg +18 -0
- package/static/assets/images/flags/unknown.svg +11 -0
- package/static/assets/images/flags/us.svg +63 -0
- package/static/assets/images/icon_audit.png +0 -0
- package/static/assets/images/icon_clinical.png +0 -0
- package/static/assets/images/icon_document.png +0 -0
- package/static/assets/images/icon_external.png +0 -0
- package/static/assets/images/icon_medication.png +0 -0
- package/static/assets/images/icon_organization.png +0 -0
- package/static/assets/images/icon_other.png +0 -0
- package/static/assets/images/icon_person.png +0 -0
- package/static/assets/images/icon_section.png +0 -0
- package/stats-db.js +45 -0
- package/stats.js +197 -10
- package/testing/testing-template.html +5 -8
- package/token/nginx_passport_setup.md +1 -1
- package/token/security_guide.md +1 -1
- package/token/token-template.html +2 -5
- package/token/token.js +40 -36
- package/translations/Messages.properties +19 -0
- package/tx/README.md +154 -4
- package/tx/closure/closure-store.js +126 -3
- package/tx/cm/cm-database.js +69 -57
- package/tx/cm/cm-package.js +29 -1
- package/tx/cs/cs-api.js +284 -19
- package/tx/cs/cs-api.md +41 -4
- package/tx/cs/cs-areacode.js +1 -1
- package/tx/cs/cs-country.js +17 -5
- package/tx/cs/cs-cpt.js +33 -16
- package/tx/cs/cs-cs.js +148 -14
- package/tx/cs/cs-currency.js +1 -1
- package/tx/cs/cs-icd11.js +21 -13
- package/tx/cs/cs-icf.js +22 -3
- package/tx/cs/cs-lang.js +2 -2
- package/tx/cs/cs-loinc.js +185 -66
- package/tx/cs/cs-mimetypes.js +12 -2
- package/tx/cs/cs-ndc.js +40 -25
- package/tx/cs/cs-omop.js +54 -29
- package/tx/cs/cs-rxnorm.js +300 -196
- package/tx/cs/cs-snomed.js +608 -64
- package/tx/cs/cs-ucum.js +14 -4
- package/tx/cs/cs-unii.js +18 -14
- package/tx/cs/cs-virtual.js +210 -0
- package/tx/ecosystem-resolver.js +413 -0
- package/tx/html/cluster-dash-metrics.liquid +26 -0
- package/tx/html/cluster-home-metrics.liquid +31 -0
- package/tx/html/cluster-metrics-script.liquid +251 -0
- package/tx/html/codesystem-operations.liquid +3 -3
- package/tx/html/ecl-panel.liquid +1 -1
- package/tx/html/external-metrics.liquid +17 -0
- package/tx/html/operations-form.liquid +17 -17
- package/tx/html/search-form.liquid +11 -11
- package/tx/html/status-line.liquid +58 -0
- package/tx/html/status-panel.liquid +140 -0
- package/tx/html/status-tasks.liquid +25 -0
- package/tx/html/tx-template.html +2 -5
- package/tx/importers/atc-to-fhir.js +17 -16
- package/tx/importers/export-icd11-codesystem.js +3 -2
- package/tx/importers/import-icd11.js +4 -3
- package/tx/importers/import-loinc.module.js +118 -56
- package/tx/importers/import-ndc.module.js +56 -44
- package/tx/importers/import-rxnorm.module.js +118 -79
- package/tx/importers/import-sct.module.js +57 -58
- package/tx/importers/import-unii.module.js +37 -36
- package/tx/importers/subset-loinc.module.js +49 -48
- package/tx/importers/subset-rxnorm.module.js +29 -28
- package/tx/importers/terminal.js +18 -0
- package/tx/importers/tx-import-base.js +13 -12
- package/tx/importers/tx-import-settings.js +5 -4
- package/tx/importers/tx-import.js +53 -52
- package/tx/library/canonical-resource.js +49 -0
- package/tx/library/codesystem.js +94 -5
- package/tx/library/designations.js +45 -2
- package/tx/library/extensions.js +13 -7
- package/tx/library/implicit-valuesets.js +66 -0
- package/tx/library/renderer.js +77 -21
- package/tx/library/sqlite-utilities.js +2 -0
- package/tx/library/ucum-parsers.js +11 -1
- package/tx/library/wait-for-cache.js +43 -0
- package/tx/library.js +321 -22
- package/tx/openapi-operations.js +6 -4
- package/tx/operation-context.js +460 -99
- package/tx/params.js +25 -0
- package/tx/problems.js +3 -5
- package/tx/provider.js +278 -42
- package/tx/resource-cache-sqlite.js +1050 -0
- package/tx/sct/ecl.js +47 -6
- package/tx/sct/editions.js +39 -0
- package/tx/sct/expressions.js +10 -1
- package/tx/sct/load-config.js +107 -0
- package/tx/sct/mmap.js +109 -0
- package/tx/sct/structures.js +166 -13
- package/tx/sct/text-index.js +5 -1
- package/tx/syndication/syndication-feed.js +2 -2
- package/tx/tx-html.js +44 -8
- package/tx/tx.fhir.org.yml +8 -8
- package/tx/tx.js +282 -80
- package/tx/usage-tracker.js +39 -11
- package/tx/vs/vs-api.js +19 -0
- package/tx/vs/vs-database.js +386 -62
- package/tx/vs/vs-package.js +27 -4
- package/tx/vs/vs-vsac.js +648 -100
- package/tx/workers/batch-validate.js +37 -10
- package/tx/workers/batch.js +6 -1
- package/tx/workers/cache-control.js +15 -4
- package/tx/workers/closure.js +156 -13
- package/tx/workers/compare.js +8 -5
- package/tx/workers/expand.js +1173 -289
- package/tx/workers/metadata.js +35 -0
- package/tx/workers/search.js +53 -1
- package/tx/workers/supplement-filters.js +145 -0
- package/tx/workers/translate.js +169 -4
- package/tx/workers/validate.js +223 -119
- package/tx/workers/worker.js +123 -31
- package/tx/xversion/xv-valueset.js +7 -4
- package/utilities/submit-test-report.js +3 -1
- package/utilities/tx-stress-test.js +482 -0
- package/vcl/readme.md +37 -0
- package/vcl/vcl-parser.js +15 -0
- package/xig/readme.md +52 -0
- package/xig/xig-template.html +5 -8
- package/xig/xig.js +238 -422
- package/changelog-template.md +0 -22
- package/registry/test-runner.js +0 -237
- package/release.sh +0 -80
- package/test-scripts/repro-re2-wasm-leak.js +0 -34
- package/tsconfig.eslint.json +0 -9
- package/tx/html/dash-metrics.liquid +0 -147
- package/tx/html/home-metrics.liquid +0 -225
package/config-template.json
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
+
// A starting point for config.json: every section, with comments (config.json may have
|
|
3
|
+
// // and /* */ comments too). Every module is off: set "enabled": true on the ones you run
|
|
2
4
|
"server": {
|
|
3
5
|
"port": 3000,
|
|
4
6
|
"cors": {
|
|
5
7
|
"origin": true,
|
|
6
8
|
"credentials": true
|
|
7
9
|
}
|
|
10
|
+
// The largest request body accepted, in MB (bigger: 413). Optional; this is the default.
|
|
11
|
+
// "maxBodyMB": 50,
|
|
12
|
+
// Memory protection, as fractions of the memory limit (the cgroup limit - MemoryMax on the
|
|
13
|
+
// systemd unit - or else the machine's RAM), measured against process RSS (with a role,
|
|
14
|
+
// the whole cgroup's private memory: cluster.md). Above
|
|
15
|
+
// rejectFraction new requests get 503 + Retry-After; above abortFraction running operations
|
|
16
|
+
// are aborted with 422 too-costly. While refusing, the server forces a GC now and then;
|
|
17
|
+
// with trimAllocator it also returns the C allocator's free memory (malloc_trim, Linux):
|
|
18
|
+
// off by default, on by default with a role (cluster.md). Optional; these are the defaults.
|
|
19
|
+
// "memory": { "rejectFraction": 0.85, "abortFraction": 0.92, "trimAllocator": false }
|
|
8
20
|
},
|
|
9
21
|
// Usage statistics. Request counts are kept per module, per endpoint and per
|
|
10
22
|
// operation, and written to a SQLite database every intervalMinutes so they
|
|
@@ -17,6 +29,8 @@
|
|
|
17
29
|
"database": "stats.db",
|
|
18
30
|
// how often the counters are written out
|
|
19
31
|
"intervalMinutes": 10
|
|
32
|
+
// how often the graphs take a sample: intervalMinutes unless set; with a role, at most 60
|
|
33
|
+
// "sampleSeconds": 60
|
|
20
34
|
},
|
|
21
35
|
// Once a day the server checks its installed npm packages against the npm advisory
|
|
22
36
|
// database (what `npm audit` does - report only, nothing is changed). Problems show on
|
|
@@ -45,6 +59,12 @@
|
|
|
45
59
|
"enabled": true,
|
|
46
60
|
"to": ["ops@example.org"]
|
|
47
61
|
},
|
|
62
|
+
// Accessibility. checkPanel adds a button to the bottom of every page that checks the page,
|
|
63
|
+
// as it is in the browser, against WCAG 2.0 A/AA (using axe-core) and checks its heading
|
|
64
|
+
// structure. axe-core is only loaded when the button is pressed. Optional.
|
|
65
|
+
"accessibility": {
|
|
66
|
+
"checkPanel": false
|
|
67
|
+
},
|
|
48
68
|
"modules": {
|
|
49
69
|
"shl": {
|
|
50
70
|
"enabled": false,
|
|
@@ -105,7 +125,29 @@
|
|
|
105
125
|
"maxDownloadMB": 250,
|
|
106
126
|
"maxUnpackedMB": 4096,
|
|
107
127
|
"maxFileMB": 50,
|
|
108
|
-
"maxFiles": 250000
|
|
128
|
+
"maxFiles": 250000,
|
|
129
|
+
// publishers' package signatures, for feeds that list signing keys in package-feeds.json:
|
|
130
|
+
// "ignore"; "check" (the default: a signature that fails is logged, and the package
|
|
131
|
+
// stored anyway, unless the feed says signing.required); or "require" (an unsigned
|
|
132
|
+
// package, or one whose signature fails, is refused, and feeds that list no keys aren't
|
|
133
|
+
// read at all)
|
|
134
|
+
"signatures": "check"
|
|
135
|
+
},
|
|
136
|
+
// npm registry signatures (npm audit signatures). On by default. keyFile is the EC
|
|
137
|
+
// P-256 signing key (PEM), relative to the database's folder; made if it's not there
|
|
138
|
+
"npmSigning": {
|
|
139
|
+
"enabled": true,
|
|
140
|
+
"keyFile": "npm-signing-key.pem"
|
|
141
|
+
},
|
|
142
|
+
// /packages/feed-check: checks a package feed the way the crawler reads it, storing
|
|
143
|
+
// nothing; one check at a time. On by default; the other settings are the defaults.
|
|
144
|
+
// maxItems: items checked per run (each one's package is downloaded); maxTotalMB:
|
|
145
|
+
// downloaded per run; keepMinutes: how long a run's report is kept
|
|
146
|
+
"feedCheck": {
|
|
147
|
+
"enabled": true,
|
|
148
|
+
"maxItems": 50,
|
|
149
|
+
"maxTotalMB": 500,
|
|
150
|
+
"keepMinutes": 60
|
|
109
151
|
},
|
|
110
152
|
// /packages/npm-check: checks any registry against the npm registry protocol. On by
|
|
111
153
|
// default; the other settings are the defaults. "control": false stops the daily
|
|
@@ -119,12 +161,15 @@
|
|
|
119
161
|
}
|
|
120
162
|
},
|
|
121
163
|
"registry": {
|
|
122
|
-
"enabled":
|
|
164
|
+
"enabled": false,
|
|
123
165
|
"masterUrl": "https://fhir.github.io/ig-registry/tx-servers.json",
|
|
124
166
|
"crawlInterval": 30,
|
|
125
167
|
"timeout": 30000,
|
|
126
168
|
"userAgent": "YourServer/1.0",
|
|
127
169
|
"apiKeys": {},
|
|
170
|
+
// OAuth2 client credentials for servers that need them to be scanned, by server code:
|
|
171
|
+
// "oauth": { "code": { "tokenEndpoint": "https://...", "clientId": "...", "clientSecret": "...", "scope": "" } }
|
|
172
|
+
"oauth": {},
|
|
128
173
|
// the most a crawled server's response can be, once unzipped
|
|
129
174
|
"maxResponseMB": 100,
|
|
130
175
|
// how far back the software page reports each server's uptime, and how long scan outcomes are kept
|
|
@@ -139,11 +184,14 @@
|
|
|
139
184
|
// }
|
|
140
185
|
},
|
|
141
186
|
"publisher": {
|
|
142
|
-
"enabled":
|
|
187
|
+
"enabled": false,
|
|
143
188
|
"database": "/absolute/path/to/publisher.db",
|
|
144
189
|
// required. Without it the publisher generates a random secret at startup, logs a
|
|
145
190
|
// warning, and logins stop working across restarts.
|
|
146
191
|
"sessionSecret": "change-this-to-a-secure-random-string",
|
|
192
|
+
// the password of the administrator, login 'admin' - set at every start, so changing it
|
|
193
|
+
// here changes it. Without it, the administrator gets a random password, which is logged
|
|
194
|
+
"adminPassword": "change-this-to-a-secure-password",
|
|
147
195
|
// session cookies are marked Secure by default, so they only travel over HTTPS.
|
|
148
196
|
// Set false only to run the publisher over plain HTTP - otherwise the browser will
|
|
149
197
|
// not send the cookie back and logins will appear to do nothing. Behind a TLS
|
|
@@ -189,7 +237,7 @@
|
|
|
189
237
|
}
|
|
190
238
|
},
|
|
191
239
|
"npmprojector": {
|
|
192
|
-
"enabled":
|
|
240
|
+
"enabled": false,
|
|
193
241
|
"fhirVersion": "r4", // Options: "r4", "r5", "stu3", "dstu2"
|
|
194
242
|
"basePath": "/fhir", // Default: "/npmprojector"
|
|
195
243
|
"npmPath": "./data/fhir-package",
|
|
@@ -198,7 +246,7 @@
|
|
|
198
246
|
"debounceMs": 500
|
|
199
247
|
},
|
|
200
248
|
"token": {
|
|
201
|
-
"enabled":
|
|
249
|
+
"enabled": false,
|
|
202
250
|
"database": "/absolute/path/to/token.db",
|
|
203
251
|
"sessionSecret": "change-this-to-a-secure-random-string-for-token-sessions",
|
|
204
252
|
"oauth": {
|
|
@@ -247,7 +295,25 @@
|
|
|
247
295
|
// (and a "Library" item in the tx nav bar), anything else gets the YAML file itself.
|
|
248
296
|
// Off by default - the file names every database, cache and package the server runs.
|
|
249
297
|
"publishLibrarySource": false,
|
|
298
|
+
// How SNOMED CT cache files are loaded (see tx/README.md, "Loading SNOMED CT"). Optional;
|
|
299
|
+
// without it every edition is read into the process, as before. "load": "read" or "mmap"
|
|
300
|
+
// for every edition; "prewarm": editions to map, then read through once in the background at startup;
|
|
301
|
+
// "read": editions to read into the process anyway. Entries are cache file names, edition
|
|
302
|
+
// version URIs or edition URIs
|
|
303
|
+
// "snomed": { "load": "mmap", "prewarm": ["sct_intl_20250201.cache", "sct_us_20250901b.cache"], "read": [] },
|
|
250
304
|
"cacheTimeout": 30,
|
|
305
|
+
// Memory limits (see tx/README.md, "Configuration Options"); these are the defaults,
|
|
306
|
+
// which apply when a limit is left out or null; 0 = no limit. Logged at startup ("Limits: ...")
|
|
307
|
+
// concepts one client side cache may hold; more is refused with 422 too-costly
|
|
308
|
+
"cacheMaxConcepts": 250000,
|
|
309
|
+
// concepts an endpoint's client side caches hold between them; the least recently used
|
|
310
|
+
// caches are dropped (their cache-id then gets a 404 cache-id-unknown)
|
|
311
|
+
"cacheMaxTotalConcepts": 1000000,
|
|
312
|
+
// distinct codes, and longest code (characters), counted for usage-count; others aren't counted
|
|
313
|
+
"usageTrackerMaxCodes": 1000000,
|
|
314
|
+
"usageTrackerMaxCodeLength": 100,
|
|
315
|
+
// parsed language tags kept (least recently used dropped)
|
|
316
|
+
"languageTagCacheSize": 1000,
|
|
251
317
|
// Optional. A short code (1-16 letters and digits) naming this server instance. Every
|
|
252
318
|
// cache-id the server issues then starts with "<code>.", so a proxy in front of
|
|
253
319
|
// several instances can route cached requests back to the instance that holds the
|
|
@@ -291,6 +357,8 @@
|
|
|
291
357
|
},
|
|
292
358
|
"expansionCacheSize": 1000,
|
|
293
359
|
"expansionCacheMemoryThreshold": 0,
|
|
360
|
+
// most codes the expansion caches hold in all (default: a quarter of the heap limit, at 1 KB a code)
|
|
361
|
+
// "expansionCacheMaxCodes": 1000000,
|
|
294
362
|
"endpoints": [
|
|
295
363
|
{
|
|
296
364
|
"path": "/tx/r5",
|
|
@@ -321,7 +389,7 @@
|
|
|
321
389
|
]
|
|
322
390
|
},
|
|
323
391
|
"ext-tracker": {
|
|
324
|
-
"enabled":
|
|
392
|
+
"enabled": false,
|
|
325
393
|
"database": "/var/fhir/data/extension-tracker.db",
|
|
326
394
|
"url": "/ext-tracker",
|
|
327
395
|
// the token submissions must carry (Authorization: Bearer ...). The IG Publisher sends
|
|
@@ -419,8 +487,9 @@
|
|
|
419
487
|
"port": 8082,
|
|
420
488
|
"packages": ["hl7.fhir.uv.ips#1.1.0"],
|
|
421
489
|
"timeout": 120000,
|
|
422
|
-
// the
|
|
423
|
-
|
|
490
|
+
// the analysis step looks up extension definitions in the validator: let it find, download
|
|
491
|
+
// and load the package that defines one it doesn't have (default true; validator 7.0.5)
|
|
492
|
+
"autoLoadPackages": true
|
|
424
493
|
// , "profiles": ["http://hl7.org/fhir/uv/ips/StructureDefinition/Bundle-uv-ips"]
|
|
425
494
|
}
|
|
426
495
|
}
|
|
@@ -53,8 +53,6 @@
|
|
|
53
53
|
<div id="stripe"> </div>
|
|
54
54
|
<div class="container"> <!-- container -->
|
|
55
55
|
<div style="background-color: #ad1f2f; padding: 6px; color: white;"> <!-- container -->
|
|
56
|
-
<a href="http://www.hl7.org/fhir" style="color: gold" title="Fast Healthcare Interoperability Resources - Home Page"><img border="0" src="/icon-fhir-16.png" style="vertical-align: text-bottom"/> <b>FHIR</b></a> © HL7.org |
|
|
57
|
-
<a href="https://github.com/HealthIntersections/FHIRsmith/blob/main/README.md" style="color: gold"><img border="0" src="/FHIRsmith16.png" style="vertical-align: text-bottom"/> FHIRsmith</a> [%ver%] |
|
|
58
56
|
<a href="/" style="color: gold"> Server Home</a> |
|
|
59
57
|
<a href="/ext-tracker" style="color: gold">Extension Tracker</a> |
|
|
60
58
|
<a href="/ext-tracker/extensions" style="color: gold">Extensions</a> |
|
|
@@ -72,7 +70,7 @@
|
|
|
72
70
|
<div class="inner-wrapper">
|
|
73
71
|
<div class="col-9">
|
|
74
72
|
|
|
75
|
-
<h2><img border="0" src="
|
|
73
|
+
<h2><a href="https://github.com/HealthIntersections/FHIRsmith/blob/main/README.md" title="FHIRsmith [%ver%]"><img border="0" src="/FHIRsmith32.png" alt="FHIRsmith Logo" style="vertical-align: text-bottom"/></a> [%title%] </h2>
|
|
76
74
|
|
|
77
75
|
[%content%]
|
|
78
76
|
|
|
@@ -90,8 +88,7 @@
|
|
|
90
88
|
<div class="container"> <!-- container -->
|
|
91
89
|
<div class="inner-wrapper">
|
|
92
90
|
<p>
|
|
93
|
-
<a href="
|
|
94
|
-
<a href="https://github.com/HealthIntersections/FHIRsmith/blob/main/README.md" style="color: gold"><img border="0" src="/FHIRsmith16.png" style="vertical-align: text-bottom"/> FHIRsmith</a> [%ver%] © HealthIntersections.com.au 2023+ |
|
|
91
|
+
<a href="https://github.com/HealthIntersections/FHIRsmith/blob/main/README.md" style="color: gold"><img border="0" src="/FHIRsmith16.png" alt="FHIRsmith Logo" style="vertical-align: text-bottom"/> FHIRsmith</a> [%ver%] © HealthIntersections.com.au 2023+ |
|
|
95
92
|
[%total-packages%] packages tracked |
|
|
96
93
|
([%ms%] ms)
|
|
97
94
|
[%sponsorMessage%]
|
|
@@ -113,10 +110,10 @@
|
|
|
113
110
|
================================================== -->
|
|
114
111
|
<!-- Placed at the end of the document so the pages load faster -->
|
|
115
112
|
<!-- <script src="/assets/js/jquery.js"/> -->
|
|
116
|
-
<script src="/assets/js/bootstrap.min.js"
|
|
117
|
-
<script src="/assets/js/respond.min.js"
|
|
113
|
+
<script src="/assets/js/bootstrap.min.js"></script>
|
|
114
|
+
<script src="/assets/js/respond.min.js"></script>
|
|
118
115
|
|
|
119
|
-
<script src="/assets/js/fhir.js"
|
|
116
|
+
<script src="/assets/js/fhir.js"></script>
|
|
120
117
|
|
|
121
118
|
<!-- Analytics Below
|
|
122
119
|
================================================== -->
|
|
@@ -137,8 +137,6 @@ class ExtensionTrackerModule {
|
|
|
137
137
|
router.get(this.urlBase + '/package/:pkg', (req, res) => this.handlePackageDetail(req, res));
|
|
138
138
|
|
|
139
139
|
app.use('/', router);
|
|
140
|
-
const count = this.db.prepare('SELECT COUNT(*) as count FROM packages').get().count;
|
|
141
|
-
console.log(`Extension tracker: loaded (${count} packages in database) at ${this.urlBase}`);
|
|
142
140
|
}
|
|
143
141
|
|
|
144
142
|
createSchema() {
|
package/folder/folder.js
CHANGED
|
@@ -5,6 +5,7 @@ const USERS_FILE = '.users.json';
|
|
|
5
5
|
const MAX_UPLOAD_BYTES = 10 * 1024 * 1024; // 10 MB
|
|
6
6
|
const SAFE_NAME = /^[a-zA-Z0-9._-]+$/;
|
|
7
7
|
const AUTH_FAIL_DELAY_MS = 5000;
|
|
8
|
+
const folderLog = require('../library/logger').getInstance().child({ module: 'folder' });
|
|
8
9
|
|
|
9
10
|
function escapeHtml(str) {
|
|
10
11
|
return String(str)
|
|
@@ -30,12 +31,12 @@ class FolderModule {
|
|
|
30
31
|
continue;
|
|
31
32
|
}
|
|
32
33
|
if (!fc.folder || !fc.url || !fc.name) {
|
|
33
|
-
|
|
34
|
+
folderLog.warn(`config entry missing required fields (name, folder, url) - skipping`);
|
|
34
35
|
continue;
|
|
35
36
|
}
|
|
36
37
|
const rootDir = path.resolve(fc.folder);
|
|
37
38
|
if (!fs.existsSync(rootDir)) {
|
|
38
|
-
|
|
39
|
+
folderLog.warn(`path ${rootDir} does not exist - skipping "${fc.name}"`);
|
|
39
40
|
continue;
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -57,11 +58,11 @@ class FolderModule {
|
|
|
57
58
|
|
|
58
59
|
app.use('/', router);
|
|
59
60
|
this.folders.push({ name: fc.name, folder: rootDir, url: urlBase });
|
|
60
|
-
|
|
61
|
+
folderLog.info(`serving "${fc.name}" from ${rootDir} at ${urlBase}`);
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
if (this.folders.length === 0) {
|
|
64
|
-
|
|
65
|
+
folderLog.warn('no folders configured');
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
|
|
@@ -213,7 +214,7 @@ class FolderModule {
|
|
|
213
214
|
|
|
214
215
|
return res.status(200).send('OK');
|
|
215
216
|
}).catch(err => {
|
|
216
|
-
|
|
217
|
+
folderLog.error(`PUT failed for ${fullPath}: ${err.message}`);
|
|
217
218
|
return res.status(500).send('Upload failed');
|
|
218
219
|
});
|
|
219
220
|
}
|
|
@@ -260,7 +261,7 @@ class FolderModule {
|
|
|
260
261
|
let current = path.resolve(dir);
|
|
261
262
|
const root = path.resolve(rootDir);
|
|
262
263
|
|
|
263
|
-
|
|
264
|
+
for (;;) {
|
|
264
265
|
const usersPath = path.join(current, USERS_FILE);
|
|
265
266
|
if (fs.existsSync(usersPath)) {
|
|
266
267
|
try {
|