iroco-co / france-public-declarations

Declarations for france-public. Maintained by Iroco.
https://opentermsarchive.org
GNU Affero General Public License v3.0
0 stars 1 forks source link

Déroulé de l'installation #2

Open marc-bouvier opened 2 months ago

marc-bouvier commented 2 months ago

Creating a collection

You are considering creating a new collection to track terms with Open Terms Archive? Amazing!

✅ Define metadata

First of all, define the metadata of the collection you would like to create.

✅ Check existing collections

Now that you have a clear idea what you would like to track, double-check that there are no existing federated collections that you could contribute to. If you have a doubt about whether some terms you want to track would fit a collection, reach out to the collection maintainers.

If no existing collection could be a good host for the terms you would like to track, then it is relevant to create your own.

Inform the community

Starting a new collection is an exciting endeavour, and would strongly benefit from the support of the community who already maintains existing collections. It is strongly recommended to share your intention to create a new collection as early as possible in the process, to get support and identify potential partners.

You can inform the community by posting on the instant messaging system, or sending an email to the core team.

Define governance

Setting up and maintaining a collection over time needs fulfilling certain tasks on a regular basis. These tasks are handled through roles. To make sure that all these roles are covered, define the governance of your collection.

At any time, feel free to ask for help or partners in the community.

✅ Create repositories

Collections rely on three git repositories being set up to hold the data.

The instructions below assume the usage of GitHub to host repositories. If you don’t use GitHub, try to set up the equivalent metadata in your git hosting platform. Contributions to the documentation to make it independent from GitHub are very welcome!

✅ Declarations

Create the collection declarations repository by using the demo-declarations repository as template.

✅ Fill the “About” section

✅ Define repository settings

These settings ease the whole contribution process.

✅ Remove default labels

Issues labels will be added by the engine as problems are encountered when tracking. The default labels offered by GitHub, such as question or wontfix, are relevant for software development but less so for the process prescribed by Open Terms Archive.

✅ Update README

✅ Snapshots

Create the snapshots repository by using the demo-snapshots repository as template:

✅ Fill the “About” section

✅ Define repository settings

These settings aim at minimising the otherwise overwhelming amount of information and click targets.

✅ Versions

Create the versions repository by using the demo-versions repository as template:

✅ Fill the “About” section

✅ Define repository settings

These settings aim at minimising the otherwise overwhelming amount of information and click targets.

✅ Update README

👉 Set up GitHub teams

For collections to be included in the Iroco organisation only. For third parties, handle rights however you see fit.

✅ Set up deployment

✅ Check server configuration

Before proceeding with deployment, ensure that the server meets the following requirements:

ota.iroco.co ssh-ed25519 AAAAC3NzaC1lAAAAAAAAAAAAAAAAAAAAAA999999999999999999993crzHxk7GwrD
# ota.iroco.co SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.3
ota.iroco.co ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDqruXk1P6vIVvN2i6ffLO6TlYCcC6lqF3oBYT7sC+nfIb5C9HYsUFWptSxohOy41wV3AbSzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQzF3YUZI7HcqjxIIFsIsG+loUGWYB7a0HHn0FrAq79Q==
ota.iroco.co ecdsa-sha2-nistp256 AAAAE2VjZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6LgFt3vlC2k62BkSoXgryY3+8=
ota  ALL=(ALL) NOPASSWD:ALL

✅ Define the inventory

On your local machine:

✅ Add fingerprint to GitHub france-public-declarations settings

✅ Set up a SSH deployment key

This key will enable automated deployment via GitHub Actions.

✅ Create the SSH key

✅ Add key to GitHub france-public-declarations repository secrets

✅ Back key up

On your local machine:

✅ Allow irocodeploy to create issues and publish dataset on GitHub

✅ Create a fine-grained repo-scoped token

✅ Backup the token

On your local machine:

✅ Validate the token

✅ Add secrets

✅ Generate vault key

On your local machine:

✅ Create vault key file

On your local machine:

✅ Add vault key to GitHub france-public-declarations settings

✅ Encrypt token and update deployment

On your local machine:

✅ Set up an irocodeploy SSH key specific to this collection

✅ Create the SSH key

✅ Encrypt private key and update deployment

On your local machine:

✅ Back key up

On your local machine:

✅ Attach the key to irocodeploy GitHub user

🏗️ Enable sending error reports over email

Create an SMTP key

Create an SMTP key to allow sending error notifications by email.

Backup key

On your local machine:

Encrypt key and update deployment

On your local machine:

Test

Via GitHub Actions

Locally

To test deployment from your local machine, your SSH keys must be authorized to connect to the server.

marc-bouvier commented 2 months ago

.env

A la fin du déroulé, voici les variables qu'on peut trouver dans le .env chiffré de https://github.com/iroco-co/france-public-declarations/tree/main/deployment

OTA_ENGINE_GITHUB_TOKEN=xxxxxxxxxxx
OTA_ENGINE_SMTP_PASSWORD=xxxxxxxxxx
marc-bouvier commented 2 months ago

Pour le moment, le compte ota@ota.iroco.co ne parvient pas à se connecter en SSH.

https://github.com/iroco-co/france-public-declarations/actions/runs/10735479719/job/29772886366#step:11:35

TASK [ota/apps : Clone repository] *********************************************
fatal: [ota.iroco.co]: FAILED! => changed=false 
  cmd: /usr/bin/git ls-remote 'ssh:********@ssh.github.com:443/iroco-co/france-public-declarations.git' -h refs/heads/main
  msg: |-
    Host key verification failed.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.
  rc: 128
  stderr: |-
    Host key verification failed.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>

PLAY RECAP *********************************************************************
ota.iroco.co               : ok=5    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
marc-bouvier commented 2 months ago

En local je parviens à cloner le dépôt en utilisant la clé privée que j'ai déchiffrée à l'aide du vault.

git clone --config core.sshCommand="ssh -i /Users/marco/.ssh/france-public-bot" git@github.com:iroco-co/france-public-declarations.git
marc-bouvier commented 2 months ago

En remettant les URLs des dépôts GIT dans le format préconisé par la doc plutôt que ssh:...443... , ça à l'air d'aller plus loin. Etant passé à OVH, nous n'avons plus cette limitation qui venait de Eolas.

https://github.com/iroco-co/france-public-declarations/commit/de61f08bdf2de9148a5e271b7fdde657dcf7cfac

marc-bouvier commented 2 months ago

Je m'attends à ce que la prochaine erreur concerne soit le bot, soit le mail (Brevo) , vu qu'on n'a pas positionné les variables d'environnement correspondantes.

marc-bouvier commented 2 months ago

Pour le moment, ça déroule

https://github.com/iroco-co/france-public-declarations/actions/runs/10736289101/job/29775392336

marc-bouvier commented 2 months ago

Le build et OK.

Attendons le premier crawl.

marc-bouvier commented 2 months ago

Reste à faire 👇

marc-bouvier commented 2 months ago

👉 Set up GitHub teams

For collections to be included in the Iroco organisation only. For third parties, handle rights however you see fit.

marc-bouvier commented 2 months ago

Peut-être pourrait-on utiliser Iroco plutôt que Brevo pour envoyer des e-mails?

A voir si on peut le faire avec l'engine ou si on est contraint de fonctionner avec Brevo (proposer une PR pour SMTP classique?)

🏗️ Enable sending error reports over email

Create an SMTP key

Create an SMTP key to allow sending error notifications by email.

Backup key

On your local machine:

Encrypt key and update deployment

On your local machine: