@opentermsarchive/engine 0.15.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/.env.example +3 -0
- package/.eslintrc.yaml +116 -0
- package/.github/workflows/deploy.yml +50 -0
- package/.github/workflows/release.yml +64 -0
- package/.github/workflows/test.yml +77 -0
- package/CHANGELOG.md +14 -0
- package/CODE_OF_CONDUCT.md +128 -0
- package/CONTRIBUTING.md +143 -0
- package/LICENSE +153 -0
- package/MIGRATING.md +42 -0
- package/README.fr.md +110 -0
- package/README.md +438 -0
- package/Vagrantfile +38 -0
- package/ansible.cfg +13 -0
- package/bin/.env.js +1 -0
- package/bin/lint-declarations.js +31 -0
- package/bin/track.js +26 -0
- package/bin/validate-declarations.js +68 -0
- package/config/ci.json +5 -0
- package/config/contrib.json +35 -0
- package/config/dating.json +37 -0
- package/config/default.json +71 -0
- package/config/france.json +40 -0
- package/config/p2b-compliance.json +40 -0
- package/config/pga.json +40 -0
- package/config/production.json +27 -0
- package/config/test.json +49 -0
- package/config/vagrant.json +24 -0
- package/decision-records/0001-service-name-and-id.md +73 -0
- package/decision-records/0002-service-history.md +212 -0
- package/decision-records/0003-snapshots-database.md +123 -0
- package/ops/README.md +280 -0
- package/ops/app.yml +5 -0
- package/ops/infra.yml +6 -0
- package/ops/inventories/dev.yml +7 -0
- package/ops/inventories/production.yml +27 -0
- package/ops/roles/infra/defaults/main.yml +2 -0
- package/ops/roles/infra/files/.gitconfig +3 -0
- package/ops/roles/infra/files/mongod.conf +18 -0
- package/ops/roles/infra/files/ota-bot-key.private_key +26 -0
- package/ops/roles/infra/tasks/main.yml +78 -0
- package/ops/roles/infra/tasks/mongo.yml +40 -0
- package/ops/roles/infra/templates/ssh_config.j2 +5 -0
- package/ops/roles/ota/defaults/main.yml +14 -0
- package/ops/roles/ota/files/.env +21 -0
- package/ops/roles/ota/tasks/database.yml +65 -0
- package/ops/roles/ota/tasks/main.yml +110 -0
- package/ops/site.yml +6 -0
- package/package.json +101 -0
- package/pm2.config.cjs +20 -0
- package/scripts/dataset/README.md +37 -0
- package/scripts/dataset/assets/LICENSE +540 -0
- package/scripts/dataset/assets/README.template.js +65 -0
- package/scripts/dataset/export/index.js +106 -0
- package/scripts/dataset/export/index.test.js +155 -0
- package/scripts/dataset/export/test/fixtures/dataset/LICENSE +540 -0
- package/scripts/dataset/export/test/fixtures/dataset/README.md +40 -0
- package/scripts/dataset/export/test/fixtures/dataset/ServiceA/Terms of Service/2021-01-01T11-27-00Z.md +1 -0
- package/scripts/dataset/export/test/fixtures/dataset/ServiceA/Terms of Service/2021-01-11T11-32-47Z.md +1 -0
- package/scripts/dataset/export/test/fixtures/dataset/ServiceB/Privacy Policy/2022-01-01T12-12-24Z.md +1 -0
- package/scripts/dataset/export/test/fixtures/dataset/ServiceB/Terms of Service/2022-01-06T11-32-47Z.md +1 -0
- package/scripts/dataset/index.js +40 -0
- package/scripts/dataset/logger/index.js +17 -0
- package/scripts/dataset/main.js +25 -0
- package/scripts/dataset/publish/index.js +39 -0
- package/scripts/declarations/lint/index.js +36 -0
- package/scripts/declarations/utils/index.js +81 -0
- package/scripts/declarations/validate/definitions.js +63 -0
- package/scripts/declarations/validate/index.mocha.js +262 -0
- package/scripts/declarations/validate/service.history.schema.js +86 -0
- package/scripts/declarations/validate/service.schema.js +91 -0
- package/scripts/history/logger/index.js +39 -0
- package/scripts/history/migrate-services.js +212 -0
- package/scripts/history/update-to-full-hash.js +61 -0
- package/scripts/history/utils/index.js +23 -0
- package/scripts/import/README.md +59 -0
- package/scripts/import/config/import.json +12 -0
- package/scripts/import/index.js +224 -0
- package/scripts/import/loadCommits.js +66 -0
- package/scripts/import/logger/index.js +43 -0
- package/scripts/rewrite/README.md +131 -0
- package/scripts/rewrite/config/rewrite-snapshots.json +32 -0
- package/scripts/rewrite/config/rewrite-versions.json +32 -0
- package/scripts/rewrite/initializer/files/license +428 -0
- package/scripts/rewrite/initializer/files/readme.md +8 -0
- package/scripts/rewrite/initializer/index.js +44 -0
- package/scripts/rewrite/rewrite-snapshots.js +108 -0
- package/scripts/rewrite/rewrite-versions.js +160 -0
- package/scripts/rewrite/utils.js +33 -0
- package/scripts/utils/renamer/README.md +49 -0
- package/scripts/utils/renamer/index.js +45 -0
- package/scripts/utils/renamer/rules/documentTypes.json +25 -0
- package/scripts/utils/renamer/rules/documentTypesByService.json +170 -0
- package/scripts/utils/renamer/rules/serviceNames.json +92 -0
- package/src/archivist/errors.js +9 -0
- package/src/archivist/fetcher/errors.js +6 -0
- package/src/archivist/fetcher/exports.js +18 -0
- package/src/archivist/fetcher/fullDomFetcher.js +84 -0
- package/src/archivist/fetcher/htmlOnlyFetcher.js +62 -0
- package/src/archivist/fetcher/index.js +35 -0
- package/src/archivist/fetcher/index.test.js +239 -0
- package/src/archivist/filter/exports.js +3 -0
- package/src/archivist/filter/index.js +178 -0
- package/src/archivist/filter/index.test.js +561 -0
- package/src/archivist/index.js +276 -0
- package/src/archivist/index.test.js +600 -0
- package/src/archivist/recorder/index.js +77 -0
- package/src/archivist/recorder/index.test.js +463 -0
- package/src/archivist/recorder/record.js +35 -0
- package/src/archivist/recorder/record.test.js +91 -0
- package/src/archivist/recorder/repositories/factory.js +23 -0
- package/src/archivist/recorder/repositories/git/dataMapper.js +83 -0
- package/src/archivist/recorder/repositories/git/git.js +122 -0
- package/src/archivist/recorder/repositories/git/git.test.js +86 -0
- package/src/archivist/recorder/repositories/git/index.js +182 -0
- package/src/archivist/recorder/repositories/git/index.test.js +714 -0
- package/src/archivist/recorder/repositories/interface.js +108 -0
- package/src/archivist/recorder/repositories/mongo/dataMapper.js +32 -0
- package/src/archivist/recorder/repositories/mongo/index.js +121 -0
- package/src/archivist/recorder/repositories/mongo/index.test.js +721 -0
- package/src/archivist/services/documentDeclaration.js +26 -0
- package/src/archivist/services/documentDeclaration.test.js +85 -0
- package/src/archivist/services/documentTypes.json +386 -0
- package/src/archivist/services/index.js +255 -0
- package/src/archivist/services/index.test.js +327 -0
- package/src/archivist/services/pageDeclaration.js +51 -0
- package/src/archivist/services/pageDeclaration.test.js +224 -0
- package/src/archivist/services/service.js +60 -0
- package/src/archivist/services/service.test.js +164 -0
- package/src/exports.js +3 -0
- package/src/index.js +59 -0
- package/src/logger/README.md +1 -0
- package/src/logger/index.js +131 -0
- package/src/main.js +18 -0
- package/src/notifier/README.md +1 -0
- package/src/notifier/index.js +150 -0
- package/src/tracker/README.md +1 -0
- package/src/tracker/index.js +215 -0
- package/test/fixtures/service_A.js +22 -0
- package/test/fixtures/service_A_terms.md +10 -0
- package/test/fixtures/service_A_terms_snapshot.html +14 -0
- package/test/fixtures/service_B.js +22 -0
- package/test/fixtures/service_with_declaration_history.js +65 -0
- package/test/fixtures/service_with_filters_history.js +155 -0
- package/test/fixtures/service_with_history.js +188 -0
- package/test/fixtures/service_with_multipage_document.js +100 -0
- package/test/fixtures/service_without_history.js +31 -0
- package/test/fixtures/services.js +19 -0
- package/test/fixtures/terms.pdf +0 -0
- package/test/fixtures/termsFromPDF.md +25 -0
- package/test/fixtures/termsModified.pdf +0 -0
- package/test/services/service_A.json +9 -0
- package/test/services/service_B.json +9 -0
- package/test/services/service_with_declaration_history.filters.js +7 -0
- package/test/services/service_with_declaration_history.history.json +17 -0
- package/test/services/service_with_declaration_history.json +13 -0
- package/test/services/service_with_filters_history.filters.history.js +29 -0
- package/test/services/service_with_filters_history.filters.js +7 -0
- package/test/services/service_with_filters_history.json +13 -0
- package/test/services/service_with_history.filters.history.js +29 -0
- package/test/services/service_with_history.filters.js +7 -0
- package/test/services/service_with_history.history.json +26 -0
- package/test/services/service_with_history.json +17 -0
- package/test/services/service_with_multipage_document.filters.js +7 -0
- package/test/services/service_with_multipage_document.history.json +37 -0
- package/test/services/service_with_multipage_document.json +28 -0
- package/test/services/service_without_history.filters.js +7 -0
- package/test/services/service_without_history.json +13 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
$ANSIBLE_VAULT;1.1;AES256
|
|
2
|
+
65653333633465346264373663643062363265383439323061633338323166393262663332646534
|
|
3
|
+
3034646331313536623831616466653564396663636166650a643831383438613765323264386266
|
|
4
|
+
37383663326333636366653537383339636231313261323239663164393933366535623730313337
|
|
5
|
+
3230323166306336630a646239643135326335393364366534663535316334333531353431323331
|
|
6
|
+
62376464333830643539333764646534613935386263633634623962653537363139363265353864
|
|
7
|
+
34623031333535313930633964626438343432363366633263396466323830323035343333373763
|
|
8
|
+
31303962353238383666343834653539663536623561393966373763393535663038333833396433
|
|
9
|
+
61326137363133373861343732336335373037613134336362396563653563646364376438366363
|
|
10
|
+
61613437393364396332313833356138303835633739653937656631313737623762346235316164
|
|
11
|
+
30353961393663663635393630653535353064353031623962333038366638376333646130663263
|
|
12
|
+
35346637303534663639613537316538663134356166323566613333343236383631653563643433
|
|
13
|
+
65373533656236613631653665383039303564613830343530363130663462343665343865666637
|
|
14
|
+
61353766623634303537326163623564663433343835366463613837303361393538656365633365
|
|
15
|
+
64306532626533373561633066616336663439653734313832366333323461383065326166313635
|
|
16
|
+
38343261656638396235326266376531633662343235633336363361313266643166346433356539
|
|
17
|
+
38363833336562623631306432656531326465306535623164353035366339336663626161613364
|
|
18
|
+
39616539616532643935623939313834343964303035383334666261363336303034346439316663
|
|
19
|
+
65306530333965353766363336386564383932333234303334633438333839316362666533363330
|
|
20
|
+
34336232623333353366363232656461646236383061383634653137623661376639323162383162
|
|
21
|
+
38653230353662316366
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
- name: Check if {{ name }} base data has already been obtained from {{ repository }}
|
|
2
|
+
git:
|
|
3
|
+
repo: '{{ repository }}'
|
|
4
|
+
version: '{{ branch }}'
|
|
5
|
+
dest: '/home/{{ ansible_user }}/{{ directory }}'
|
|
6
|
+
clone: no
|
|
7
|
+
update: no
|
|
8
|
+
accept_hostkey: yes
|
|
9
|
+
key_file: '/home/{{ ansible_user }}/.ssh/ota-bot-key'
|
|
10
|
+
register: existing_repository # the `before` property of the return value can tell us if the repository has been cloned already or not, see <https://docs.ansible.com/ansible/latest/collections/ansible/builtin/git_module.html#return-values>
|
|
11
|
+
tags:
|
|
12
|
+
- restart
|
|
13
|
+
- start
|
|
14
|
+
- update
|
|
15
|
+
- setup
|
|
16
|
+
|
|
17
|
+
- name: Obtain {{ name }} initial data from branch {{ branch }} of {{ repository }}
|
|
18
|
+
git:
|
|
19
|
+
repo: '{{ repository }}'
|
|
20
|
+
version: '{{ branch }}'
|
|
21
|
+
dest: '/home/{{ ansible_user }}/{{ directory }}'
|
|
22
|
+
accept_hostkey: yes
|
|
23
|
+
key_file: '/home/{{ ansible_user }}/.ssh/ota-bot-key'
|
|
24
|
+
when: existing_repository.before is defined and not existing_repository.before # if existing_repository.before is null, then the repository is new
|
|
25
|
+
tags:
|
|
26
|
+
- setup
|
|
27
|
+
|
|
28
|
+
- name: Remove existing locks in {{ name }}
|
|
29
|
+
file:
|
|
30
|
+
path: '/home/{{ ansible_user }}/{{ directory }}/.git/index.lock'
|
|
31
|
+
state: absent
|
|
32
|
+
tags:
|
|
33
|
+
- restart
|
|
34
|
+
- start
|
|
35
|
+
- update
|
|
36
|
+
|
|
37
|
+
- name: Get latest data from {{ repository }}
|
|
38
|
+
command:
|
|
39
|
+
cmd: git fetch origin
|
|
40
|
+
chdir: '/home/{{ ansible_user }}/{{ directory }}'
|
|
41
|
+
tags:
|
|
42
|
+
- restart
|
|
43
|
+
- start
|
|
44
|
+
- update
|
|
45
|
+
- setup
|
|
46
|
+
|
|
47
|
+
- name: Clean {{ name }} local copy
|
|
48
|
+
command:
|
|
49
|
+
cmd: git reset --hard origin/{{ branch }}
|
|
50
|
+
chdir: '/home/{{ ansible_user }}/{{ directory }}'
|
|
51
|
+
tags:
|
|
52
|
+
- restart
|
|
53
|
+
- start
|
|
54
|
+
- update
|
|
55
|
+
- setup
|
|
56
|
+
|
|
57
|
+
- name: Ensure {{ name }} is on branch {{ branch }}
|
|
58
|
+
command:
|
|
59
|
+
cmd: git checkout {{ branch }}
|
|
60
|
+
chdir: '/home/{{ ansible_user }}/{{ directory }}'
|
|
61
|
+
tags:
|
|
62
|
+
- restart
|
|
63
|
+
- start
|
|
64
|
+
- update
|
|
65
|
+
- setup
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
- name: Clone Open Terms Archive engine
|
|
2
|
+
git:
|
|
3
|
+
repo: '{{ ota_repository }}'
|
|
4
|
+
dest: '/home/{{ ansible_user }}/{{ ota_directory }}'
|
|
5
|
+
version: '{{ ota_branch }}'
|
|
6
|
+
force: yes
|
|
7
|
+
accept_hostkey: yes
|
|
8
|
+
key_file: '/home/{{ ansible_user }}/.ssh/ota-bot-key'
|
|
9
|
+
depth: 1
|
|
10
|
+
tags:
|
|
11
|
+
- setup
|
|
12
|
+
- update
|
|
13
|
+
|
|
14
|
+
- name: Install dependencies
|
|
15
|
+
command:
|
|
16
|
+
cmd: npm ci --production
|
|
17
|
+
chdir: '/home/{{ ansible_user }}/{{ ota_directory }}'
|
|
18
|
+
tags:
|
|
19
|
+
- setup
|
|
20
|
+
- update
|
|
21
|
+
|
|
22
|
+
- name: Add .env file
|
|
23
|
+
copy:
|
|
24
|
+
src: .env
|
|
25
|
+
dest: '/home/{{ ansible_user }}/{{ ota_directory }}/.env'
|
|
26
|
+
tags:
|
|
27
|
+
- setup
|
|
28
|
+
|
|
29
|
+
- name: Load app config
|
|
30
|
+
ansible.builtin.include_vars:
|
|
31
|
+
name: app_config
|
|
32
|
+
file: '../config/{{ config_file_name }}.json'
|
|
33
|
+
tags:
|
|
34
|
+
- setup
|
|
35
|
+
- update
|
|
36
|
+
- update-declarations
|
|
37
|
+
|
|
38
|
+
- name: Make config available to app
|
|
39
|
+
ansible.builtin.file:
|
|
40
|
+
src: '/home/{{ ansible_user }}/{{ ota_directory }}/config/{{ config_file_name }}.json'
|
|
41
|
+
dest: '/home/{{ ansible_user }}/{{ ota_directory }}/config/local.json'
|
|
42
|
+
state: link
|
|
43
|
+
|
|
44
|
+
- name: Install services declarations
|
|
45
|
+
git:
|
|
46
|
+
repo: '{{ app_config.services.repository }}'
|
|
47
|
+
dest: '/home/{{ ansible_user }}/{{ declarations_directory }}'
|
|
48
|
+
version: '{{ declarations_branch }}'
|
|
49
|
+
force: yes
|
|
50
|
+
accept_hostkey: yes
|
|
51
|
+
key_file: '/home/{{ ansible_user }}/.ssh/ota-bot-key'
|
|
52
|
+
depth: 1
|
|
53
|
+
tags:
|
|
54
|
+
- setup
|
|
55
|
+
- update
|
|
56
|
+
- update-declarations
|
|
57
|
+
|
|
58
|
+
- name: Install services declarations dependencies
|
|
59
|
+
command:
|
|
60
|
+
cmd: npm install --production
|
|
61
|
+
chdir: '/home/{{ ansible_user }}/{{ declarations_directory }}'
|
|
62
|
+
tags:
|
|
63
|
+
- setup
|
|
64
|
+
- update
|
|
65
|
+
- update-declarations
|
|
66
|
+
|
|
67
|
+
- name: Stop Open Terms Archive schedulers
|
|
68
|
+
command:
|
|
69
|
+
cmd: pm2 stop pm2.config.cjs
|
|
70
|
+
chdir: '/home/{{ ansible_user }}/{{ ota_directory }}'
|
|
71
|
+
tags:
|
|
72
|
+
- stop
|
|
73
|
+
- update
|
|
74
|
+
- update-declarations
|
|
75
|
+
|
|
76
|
+
- include_tasks: database.yml
|
|
77
|
+
name: Setup snapshots git repository
|
|
78
|
+
when: app_config.recorder.snapshots.storage.git.repository is defined
|
|
79
|
+
vars:
|
|
80
|
+
name: snapshots
|
|
81
|
+
repository: '{{ app_config.recorder.snapshots.storage.git.repository }}'
|
|
82
|
+
branch: '{{ snapshots_branch }}'
|
|
83
|
+
directory: '{{ snapshots_directory }}'
|
|
84
|
+
tags:
|
|
85
|
+
- setup
|
|
86
|
+
- update
|
|
87
|
+
|
|
88
|
+
- include_tasks: database.yml
|
|
89
|
+
name: Setup versions git repository
|
|
90
|
+
when: app_config.recorder.versions.storage.git.repository is defined
|
|
91
|
+
vars:
|
|
92
|
+
name: versions
|
|
93
|
+
repository: '{{ app_config.recorder.versions.storage.git.repository }}'
|
|
94
|
+
branch: '{{ versions_branch }}'
|
|
95
|
+
directory: '{{ versions_directory }}'
|
|
96
|
+
tags:
|
|
97
|
+
- setup
|
|
98
|
+
- update
|
|
99
|
+
|
|
100
|
+
- name: Start Open Terms Archive schedulers
|
|
101
|
+
command:
|
|
102
|
+
cmd: pm2 startOrRestart pm2.config.cjs
|
|
103
|
+
chdir: '/home/{{ ansible_user }}/{{ ota_directory }}'
|
|
104
|
+
environment:
|
|
105
|
+
NODE_ENV: production
|
|
106
|
+
tags:
|
|
107
|
+
- restart
|
|
108
|
+
- start
|
|
109
|
+
- update
|
|
110
|
+
- update-declarations
|
package/ops/site.yml
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opentermsarchive/engine",
|
|
3
|
+
"version": "0.15.0",
|
|
4
|
+
"description": "Tracks and makes visible changes to the terms of online services",
|
|
5
|
+
"homepage": "https://github.com/ambanum/OpenTermsArchive#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/ambanum/OpenTermsArchive/issues"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/ambanum/OpenTermsArchive.git"
|
|
12
|
+
},
|
|
13
|
+
"license": "EUPL-1.2",
|
|
14
|
+
"author": "ambanum",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./src/exports.js",
|
|
18
|
+
"./fetch": "./src/archivist/fetcher/exports.js",
|
|
19
|
+
"./filter": "./src/archivist/filter/exports.js",
|
|
20
|
+
"./page-declaration": "./src/archivist/services/pageDeclaration.js"
|
|
21
|
+
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"ota-lint-declarations": "./bin/lint-declarations.js",
|
|
24
|
+
"ota-track": "./bin/track.js",
|
|
25
|
+
"ota-validate-declarations": "./bin/validate-declarations.js"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"dataset:generate": "node scripts/dataset/main.js",
|
|
29
|
+
"dataset:release": "node scripts/dataset/main.js --publish --remove-local-copy",
|
|
30
|
+
"dataset:scheduler": "npm run dataset:release -- --schedule",
|
|
31
|
+
"declarations:lint": "node ./bin/lint-declarations.js",
|
|
32
|
+
"declarations:validate": "node ./bin/validate-declarations.js",
|
|
33
|
+
"declarations:validate:schema": "npm run declarations:validate -- --schema-only",
|
|
34
|
+
"lint": "eslint src test scripts bin",
|
|
35
|
+
"lint:fix": "npm run lint -- --fix",
|
|
36
|
+
"refilter": "npm start -- --refilter-only",
|
|
37
|
+
"start": "node --max-http-header-size=32768 src/main.js",
|
|
38
|
+
"start:scheduler": "npm start -- --schedule",
|
|
39
|
+
"test": "cross-env NODE_ENV=test mocha --recursive \"./src/**/*.test.js\" \"./scripts/**/*.test.js\" --exit",
|
|
40
|
+
"posttest": "npm run lint",
|
|
41
|
+
"test:debug": "npm run test -- --inspect-brk --exit"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@accordproject/markdown-cicero": "^0.15.2",
|
|
45
|
+
"@accordproject/markdown-pdf": "^0.15.2",
|
|
46
|
+
"@opentermsarchive/fetch-charset-detection": "^1.0.1",
|
|
47
|
+
"@opentermsarchive/turndown": "^7.1.3",
|
|
48
|
+
"abort-controller": "^3.0.0",
|
|
49
|
+
"ajv": "^6.12.6",
|
|
50
|
+
"archiver": "^5.3.0",
|
|
51
|
+
"async": "^3.2.2",
|
|
52
|
+
"chai": "^4.3.4",
|
|
53
|
+
"chai-as-promised": "^7.1.1",
|
|
54
|
+
"chai-exclude": "^2.1.0",
|
|
55
|
+
"commander": "^9.4.1",
|
|
56
|
+
"config": "^3.3.6",
|
|
57
|
+
"croner": "^4.3.6",
|
|
58
|
+
"cross-env": "^7.0.3",
|
|
59
|
+
"datauri": "^4.1.0",
|
|
60
|
+
"deep-diff": "^1.0.2",
|
|
61
|
+
"dotenv": "^10.0.0",
|
|
62
|
+
"eslint": "^8.2.0",
|
|
63
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
64
|
+
"eslint-plugin-chai-friendly": "^0.7.2",
|
|
65
|
+
"eslint-plugin-import": "^2.25.3",
|
|
66
|
+
"eslint-plugin-json-format": "^2.0.1",
|
|
67
|
+
"fs-extra": "^10.0.0",
|
|
68
|
+
"http-proxy-agent": "^5.0.0",
|
|
69
|
+
"https": "^1.0.0",
|
|
70
|
+
"https-proxy-agent": "^5.0.0",
|
|
71
|
+
"iconv-lite": "^0.6.3",
|
|
72
|
+
"joplin-turndown-plugin-gfm": "^1.0.12",
|
|
73
|
+
"jsdom": "^18.1.0",
|
|
74
|
+
"json-source-map": "^0.6.1",
|
|
75
|
+
"lodash": "^4.17.21",
|
|
76
|
+
"mime": "^2.5.2",
|
|
77
|
+
"mocha": "^9.1.3",
|
|
78
|
+
"mongodb": "^4.9.0",
|
|
79
|
+
"node-fetch": "^3.1.0",
|
|
80
|
+
"octokit": "^1.7.0",
|
|
81
|
+
"pdfjs-dist": "^2.9.359",
|
|
82
|
+
"puppeteer": "14.3.0",
|
|
83
|
+
"puppeteer-extra": "^3.2.3",
|
|
84
|
+
"puppeteer-extra-plugin-stealth": "^2.9.0",
|
|
85
|
+
"sib-api-v3-sdk": "^8.2.1",
|
|
86
|
+
"simple-git": "^3.8.0",
|
|
87
|
+
"winston": "^3.3.3",
|
|
88
|
+
"winston-mail": "^2.0.0"
|
|
89
|
+
},
|
|
90
|
+
"devDependencies": {
|
|
91
|
+
"dir-compare": "^4.0.0",
|
|
92
|
+
"nock": "^13.2.1",
|
|
93
|
+
"node-stream-zip": "^1.15.0",
|
|
94
|
+
"prettier": "^2.2.1",
|
|
95
|
+
"sinon": "^12.0.1",
|
|
96
|
+
"sinon-chai": "^3.7.0"
|
|
97
|
+
},
|
|
98
|
+
"engines": {
|
|
99
|
+
"node": ">=16.0.0"
|
|
100
|
+
}
|
|
101
|
+
}
|
package/pm2.config.cjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
apps: [
|
|
3
|
+
{
|
|
4
|
+
name: 'ota',
|
|
5
|
+
script: 'npm',
|
|
6
|
+
args: 'run start:scheduler',
|
|
7
|
+
max_restarts: 2,
|
|
8
|
+
min_uptime: '1h', // Set a relatively high duration (more than the longest run) so that restarts that occur before this duration has elapsed are considered unstable.
|
|
9
|
+
restart_delay: 15 * 60 * 1000,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: 'ota-release',
|
|
13
|
+
script: 'npm',
|
|
14
|
+
args: 'run dataset:scheduler',
|
|
15
|
+
max_restarts: 2,
|
|
16
|
+
min_uptime: '1h', // Set a relatively high duration (more than the longest run) so that restarts that occur before this duration has elapsed are considered unstable.
|
|
17
|
+
restart_delay: 15 * 60 * 1000,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Dataset release
|
|
2
|
+
|
|
3
|
+
Export the versions dataset into a ZIP file and publish it to GitHub releases.
|
|
4
|
+
|
|
5
|
+
## Configuring
|
|
6
|
+
|
|
7
|
+
You can change the configuration in the appropriate config file in the `config` folder. See the [main README](https://github.com/ambanum/OpenTermsArchive#configuring) for documentation on using the configuration file.
|
|
8
|
+
|
|
9
|
+
## Running
|
|
10
|
+
|
|
11
|
+
To export the dataset into a local ZIP file:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
node scripts/dataset/main.js [$filename]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
To export the dataset into a ZIP file and publish it on GitHub releases:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
node scripts/dataset/main.js --publish
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
To export, publish the dataset and remove the local copy that was created after it has been uploaded:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
node scripts/dataset/main.js --publish --remove-local-copy
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
To schedule export, publishing and local copy removal:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
node scripts/dataset/main.js --schedule --publish --remove-local-copy
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Adding renaming rules
|
|
36
|
+
|
|
37
|
+
See the [renamer module documentation](../renamer/README.md).
|