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: content/deployment/how-to/deploy.md
+64-22Lines changed: 64 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,44 +7,67 @@ weight: 1
7
7
8
8
This guide will help you deploy an Open Terms Archive collection to a server.
9
9
10
+
> **Note**: This guide is intended for both Open Terms Archive organization members and external contributors. Some steps marked with [🔒 **Specific to Open Terms Archive organization members**] are only relevant for organization members as they involve access to the organization's shared password database. External contributors should adapt these steps to their own security practices while following the same deployment principles.
11
+
12
+
## Prerequisites
13
+
14
+
Before starting, ensure you have:
15
+
16
+
- A server with admin access
17
+
- All collections repositories created, if not, see the [guide to create repositories]({{< relref "collections/how-to/create-repositories" >}}).
18
+
- A GitHub user account dedicated to bot-related actions (commit entries in versions and snapshots repositories, report issues when tracking fails, publish releases, …)
19
+
10
20
## 1. Configure the server
11
21
12
22
First, ensure your server provides unsupervised access:
13
23
14
-
1. Check the SSH host key:
24
+
1. Check the SSH host key and get the SSH fingerprint by running the following command on your local machine:
25
+
15
26
```shell
16
-
ssh-keyscan --type=ed25519 <server_address>
27
+
ssh-keyscan -t ed25519 <server_address>
17
28
```
18
-
If no Ed25519 key appears, generate one on the server:
29
+
30
+
If no Ed25519 key appears, generate one by running the following commands on the server:
> **Note**: A server fingerprint is a unique identifier for your server's SSH key. It helps verify that you're connecting to the correct server and not a malicious one. The fingerprint is a hash of the server's public key and is used to prevent man-in-the-middle attacks. You'll need this fingerprint in the next steps for secure deployment.
38
+
39
+
2. Create a dedicated user account specifically for deployment purposes, by running the following commands on the server:
40
+
25
41
```shell
26
42
adduser <user>
27
43
usermod --append --groups=sudo <user>
28
44
```
29
45
30
-
3. Grant passwordless sudo access:
46
+
> **Note**: The `adduser` command might not be installed by default on your system. It can be installed with `sudo apt-get install adduser`.
47
+
48
+
3. Configure sudo access for this user, by running the following command on the server:
49
+
31
50
```shell
32
51
# Add to /etc/sudoers:
33
52
<user> ALL=(ALL) NOPASSWD:ALL
34
53
```
35
54
55
+
> **Note**: While passwordless sudo access does reduce security compared to requiring a password, it is essential for full automation in deployment workflows with Ansible. The deployment process requires system-level operations (like installing packages and configuring services) that must be executed without manual intervention. To mitigate security risks, this configuration is limited to a dedicated deployment user that should only be used for deployment purposes, and the server must be properly secured with SSH key authentication.
2. Configure the inventory file `deployment/inventory.yml`:
65
+
2. Configure the inventory file `deployment/inventory.yml` with your server's IP address, deployment user (from step 1), and server fingerprint (from step 1):
66
+
44
67
```yaml
45
-
<host>: "your.server.ip"
46
-
ansible_user: "your_username"
47
-
ed25519_fingerprint: "your_ssh_fingerprint"
68
+
<host>: "server_ip"
69
+
ansible_user: "deployment_user"
70
+
ed25519_fingerprint: "server_ssh_fingerprint"
48
71
```
49
72
50
73
3. Add the server fingerprint to GitHub:
@@ -53,7 +76,8 @@ First, ensure your server provides unsupervised access:
53
76
54
77
## 3. Configure SSH deployment keys
55
78
56
-
1. On the server, generate a deployment key:
79
+
1. On the server, generate a deployment key, which will be used by the continuous deployment workflow to deploy the collection:
0 commit comments