Skip to content

Commit 5290fb3

Browse files
authored
Support etherpad 2.4.1 by identifying correct version via static files (#101)
* Support etherpad 2.4.1 by identifying correct version via static files * Remove version constraint if attributes.js does not exist * Disable verify of ssl * Wait for etherpad service to be running
1 parent b811c00 commit 5290fb3

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

.github/workflows/test-file-hashes.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
outputs:
1414
matrix: '[
1515
{ tag: "${{ steps.etherpad-version-cleaned.outputs.version }}", expected: "${{ steps.etherpad-version-cleaned.outputs.version }}" },
16+
{ tag: "2.3.2", expected: "2.3.2" },
1617
{ tag: "2.3.0", expected: "2.3.0" },
1718
{ tag: "2.2.7", expected: "2.2.7" },
1819
{ tag: "2.2.2", expected: "2.2.2" },
@@ -68,5 +69,8 @@ jobs:
6869
- name: Install dependencies
6970
run: composer install --prefer-dist --no-progress
7071

72+
- name: Wait for etherpad service to be ready
73+
run: timeout 30 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9001)" != "200" ]]; do sleep 5; done' || false
74+
7175
- name: Scan etherpad instance for file hashes
7276
run: bin/console.php ether:check-file-hashes http://localhost:9001 ${{ matrix.versions.expected }}

src/Console/CheckFileHashesCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ private function getFileHash(string $url, string $path): ?string
9191
$client = new Client([
9292
'base_uri' => $url,
9393
'timeout' => 5.0,
94+
'verify' => false,
9495
]);
9596
$response = $client->get($path, [
9697
'headers' => ['Accept-Encoding' => 'gzip'],

src/Console/GenerateFileHashesCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ private function getFileHash(string $url, string $path): ?string
5252
$client = new Client([
5353
'base_uri' => $url,
5454
'timeout' => 5.0,
55+
'verify' => false,
5556
]);
5657
$response = $client->get($path, [
5758
'headers' => ['Accept-Encoding' => 'gzip'],

src/Service/FileHashLookupService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class FileHashLookupService
2323
'24478719e9641726d55b26e97466708b' => ['2.1.1', null],
2424
],
2525
'static/js/attributes.js' => [
26-
null => [null, '1.8.18'],
2726
'3b78aa8c55200e09fe709178721c0e30' => ['1.9.0', '2.1.0'],
2827
'9dbc0d1414a1f4696d66c5b89c3e9abc' => ['2.1.1', null],
2928
],
@@ -78,7 +77,8 @@ class FileHashLookupService
7877
'169c79ec1a44c5c45dfce64c0f62c7ef' => [null, '1.9.7'],
7978
'2a37d1ffbd906c905fe7f1b42564caa5' => ['2.0.0', '2.1.0'],
8079
'8fab111c95434eac9414f0d8ea5d81b8' => ['2.1.1', '2.1.1'],
81-
'8ae26862f7716d1bada457fdc92bb1d1' => ['2.2.2', null],
80+
'8ae26862f7716d1bada457fdc92bb1d1' => ['2.2.2', '2.3.2'],
81+
'12ba3a5933f399b882cf847d407c31f0' => ['2.4.1', null],
8282
],
8383
];
8484

0 commit comments

Comments
 (0)