This guide will help you deploy an Open Terms Archive collection to a server.
First, ensure your server provides unsupervised access:
Check the SSH host key:
ssh-keyscan --type=ed25519 <server_address>
If no Ed25519 key appears, generate one on the server:
sudo ssh-keygen --type=ed25519 --file=/etc/ssh/ssh_host_ed25519_key
sudo systemctl restart ssh
Create a non-root user if needed:
adduser <user>
usermod --append --groups=sudo <user>
Grant passwordless sudo access:
# Add to /etc/sudoers:
<user> ALL=(ALL) NOPASSWD:ALL
Clone the collection declarations repository:
git clone https://github.com/OpenTermsArchive/<collection_id>-declarations.git
Configure the inventory file deployment/inventory.yml
:
<host>: "your.server.ip"
ansible_user: "your_username"
ed25519_fingerprint: "your_ssh_fingerprint"
Add the server fingerprint to GitHub:
https://github.com/OpenTermsArchive/<collection_name>-declarations/settings/secrets/actions
SERVER_FINGERPRINT
with your Ed25519 fingerprintOn the server, generate a deployment key:
ssh-keygen --type=ed25519 --quiet --passphrase="" --file=~/.ssh/ota-deploy
cat ~/.ssh/ota-deploy.pub >> ~/.ssh/authorized_keys
Add the private key to GitHub:
SERVER_SSH_KEY
with the private key contentBack up the keys:
Create a fine-grained GitHub token:
Back up the token:
Get the token approved:
Generate and store a vault key:
deployment/vault.key
with the passwordANSIBLE_VAULT_KEY
in GitHub secretsStore GitHub token:
# In deployment/.env:
OTA_ENGINE_GITHUB_TOKEN=your_token
Encrypt the .env
file:
ansible-vault encrypt .env
Generate a new key:
ssh-keygen --type=ed25519 --comment=bot@opentermsarchive.org --passphrase="" --file=./<collection_name>-key
Encrypt and store the private key:
# Copy private key to deployment/github-bot-private-key
ansible-vault encrypt github-bot-private-key
Add the public key to OTA-Bot’s GitHub account:
Generate SMTP credentials:
Store the credentials:
# In deployment/.env:
OTA_ENGINE_SMTP_PASSWORD=your_smtp_key
Encrypt the .env
file:
ansible-vault encrypt .env
Via GitHub Actions:
deploy
action completes successfullyVia local deployment:
cd <collection_id>-declarations/deployment
ansible-galaxy collection install --requirements-file requirements.yml
ansible-playbook opentermsarchive.deployment.deploy
If all steps complete successfully, your collection should now be properly deployed and running.