You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,23 @@
2
2
3
3
All changes that impact users of this module are documented in this file, in the [Common Changelog](https://common-changelog.org) format with some additional specifications defined in the CONTRIBUTING file. This codebase adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
5
+
## Unreleased [major]
6
+
7
+
> Development of this release was supported by [Reset Tech](https://www.reset.tech).
8
+
9
+
### Added
10
+
11
+
- Support multi-tenant deployment on a single server, with isolated PM2 instances, nginx configurations, and SSH keys per collection
12
+
- Add configurable rate limiting for API requests through `ota_rate_limit_rate` and `ota_rate_limit_burst` inventory variables
13
+
14
+
### Changed
15
+
16
+
-**Breaking:** Rename `ota_source_repository` to `ota_collection_repository`
17
+
-**Breaking:** Rename `ota_source_repository_branch` to `ota_collection_repository_branch`
18
+
- Scope PM2 home directory per collection (`~/.pm2-{collection_id}`)
19
+
- Scope GitHub bot SSH keys per collection (`~/.ssh/ota-github-bot-key-{collection_id}`)
20
+
- Scope nginx configuration files per collection
21
+
5
22
## 2.1.1 - 2025-11-28
6
23
7
24
_Full changeset and discussions: [#57](https://github.com/OpenTermsArchive/deployment/pull/57)._
Once installed, the playbook `deploy` allows to set up the two main Open Terms Archive applications: [Engine](https://github.com/OpenTermsArchive/engine) and [Federation API](https://github.com/OpenTermsArchive/federation-api).
33
+
Once installed, the playbook `deploy` allows to set up and deploy an Open Terms Archive [collection](https://docs.opentermsarchive.org/#collection) powered by the [Engine](https://github.com/OpenTermsArchive/engine).
34
34
35
35
The playbook can be executed using the `ansible-playbook` command-line tool:
36
36
@@ -65,44 +65,51 @@ deployment/
65
65
The `inventory.yml` file defines the hosts and the variables required for the deployment. This file should contain all the necessary variables as described below.
66
66
67
67
| Variable | Description | Required or default value |
|`ota_source_repository`| URL of the declarations repository to deploy |**required**|
70
-
|`ota_source_repository_branch`|[Git branch or tag](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftree-ishatree-ishalsotreeish) of the source repository |`main`|
71
-
|`ota_directory`| Directory path where the code will be deployed on the server | Name of the repository |
|`ota_collection_repository`| URL of the declarations repository to deploy |**required**|
70
+
|`ota_collection_repository_branch`|[Git branch or tag](https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddeftree-ishatree-ishalsotreeish) of the source repository |`main`|
72
71
73
72
These variables are defined in the inventory file, for example:
- `ota_directory`: The directory where the code will be deployed (extracted from the repository URL, e.g., `demo-declarations`)
85
+
- `ota_collection_id`: The collection identifier used for PM2 and nginx configuration (directory name without the `-declarations` suffix, e.g., `demo`)
86
+
- `ota_pm2_home`: The PM2 home directory for isolating PM2 processes (e.g., `/home/debian/.pm2-demo`)
87
+
88
+
#### Multi-tenant deployment
89
+
90
+
Multiple collections can be deployed to the same server. Each collection will have its own isolated PM2 instance and nginx configuration. Simply define multiple hosts with different `ota_collection_repository` values, or deploy collections sequentially to the same host.
86
91
87
-
If the `ota_source_repository` is changed on an existing target, the application has to be [stopped](#playbook-execution-refinement) before the new configuration is deployed.
92
+
#### Changes on an existing deployment
93
+
94
+
If the `ota_collection_repository` is changed on an existing target, the application has to be [stopped](#playbook-execution-refinement) before the new configuration is deployed.
88
95
89
96
- ### PM2 Configuration File — `pm2.config.cjs`
90
97
91
98
**This file is mandatory**
92
99
93
-
The `pm2.config.cjs` file is used to configure the [PM2](https://pm2.keymetrics.io) process manager, which is used to start the applications.
100
+
The `pm2.config.cjs` file is used to configure the [PM2](https://pm2.keymetrics.io) process manager, which is used to start the applications.
The `github-bot-private-key` file contains a private SSH key for accessing and pushing to SSH Git URLs. This file is required if `ota_source_repository` is an SSH Git URL or if the URLs for versions and/or snapshots repositories in the `config/production.json` file of the source repository are SSH Git URLs.
104
+
The `github-bot-private-key` file contains a private SSH key for accessing and pushing to SSH Git URLs. This file is required if `ota_collection_repository` is an SSH Git URL or if the URLs for versions and/or snapshots repositories in the `config/production.json` file of the source repository are SSH Git URLs.
98
105
99
-
It is strongly recommended to [encrypt this file](#file-encryption) if is is checked in to a public repository.
106
+
It is strongly recommended to [encrypt this file](#file-encryption) if it is checked in to a public repository.
100
107
101
108
- ### Environment Variables File — `.env`
102
109
103
110
The `.env` file contains the environment variables for the deployed applications.
104
111
105
-
It is strongly recommended to [encrypt this file](#file-encryption) if is is checked in to a public repository.
112
+
It is strongly recommended to [encrypt this file](#file-encryption) if it is checked in to a public repository.
106
113
107
114
## File encryption
108
115
@@ -150,20 +157,20 @@ Use [tags](https://docs.ansible.com/ansible/latest/user_guide/playbooks_tags.htm
3. Install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) to manage virtual machines. If Docker is prefered, or on an Apple Silicon machine, install [Docker](https://docs.docker.com/get-docker/) instead.
160
+
3. Install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) to manage virtual machines. If Docker is preferred, or on an Apple Silicon machine, install [Docker](https://docs.docker.com/get-docker/) instead.
154
161
4. Create a dedicated SSH key with no password: `ssh-keygen -f ~/.ssh/ota-vagrant -q -N ""`. This key will be automatically used by Vagrant.
155
162
156
163
> VirtualBox is not compatible with Apple Silicon (M1…) processors. To use vagrant on this kind of machine, specifying the Docker provider will be required. Since MongoDB cannot be installed on ARM, it is skipped in the infrastructure installation process. This means the MongoDB storage repository cannot be tested with Vagrant with an Apple Silicon processor.
157
164
158
-
## Usage
165
+
### Usage
159
166
160
167
For testing this collection, a virtual machine description file is provided, inside the `tests` folder, to be used with [Vagrant](https://www.vagrantup.com).
161
168
162
169
All following commands must be executed from the `tests` folder:
163
170
164
171
cd tests
165
172
166
-
### Launch VM
173
+
#### Launch VM
167
174
168
175
```sh
169
176
vagrant up
@@ -173,7 +180,7 @@ vagrant up
173
180
174
181
Then the code can be deployed to the running machine with all the options described before.
175
182
176
-
### Test collection
183
+
#### Test collection
177
184
178
185
Testing the Ansible collection locally is crucial to ensure that changes function properly before submitting them as a pull request.
- Check that everything works as intended within the virtual machine. Depending on the nature of changes made, you can monitor logs or execute commands to validate functionality:
207
+
- Check that everything works as intended within the virtual machine. Depending on the nature of changes made, you can monitor logs or execute commands to validate functionality. Note that you need to set the `PM2_HOME` environment variable to the collection-specific PM2 home directory:
0 commit comments