X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=README;h=5c45655bfbe47b1debdfc93e9854c33cf0a2cb7e;hp=4a5f9cc6c3e14df075e3d6225b3da65dfa3a4531;hb=c192234993ad164de7d43cae78e4332185e91a24;hpb=eefc410c23df14d9e47bfc1eedcfb500d557c5a8 diff --git a/README b/README index 4a5f9cc..5c45655 100644 --- a/README +++ b/README @@ -6,63 +6,81 @@ ATTENTION: ne pas hésiter donc à bien relire les règles _avant_ de les exécuter. NOTE: - à priori les règles sont pensées pour être exécutées - plusieurs fois selon les erreurs que l'on rencontre + à priori les commandes sont idempotentes, + i.e. pensées pour être exécutées plusieurs fois + selon les erreurs que l'on rencontre ou les modifications que l'on y apporte. TASK: obtenir une installation chrootable @host % export TRACE=1 - @host % ~/tool/ateliers/vm_host disk_mount - @host % ~/tool/ateliers/vm_host disk_format - @host % ~/tool/ateliers/vm_host part_lvm_format - @host % ~/tool/ateliers/vm_host part_root_format - @host % ~/tool/ateliers/vm_host part_boot_format - @host % ~/tool/ateliers/vm_host part_swap_format - @host % ~/tool/ateliers/vm_host part_var_format - @host % ~/tool/ateliers/vm_host part_home_format - @host % ~/tool/ateliers/vm_host debian_install - @host % ~/tool/ateliers/vm_host disk_umount + @host % ~/tool/ateliers/host/disk-mount + @host % ~/tool/ateliers/host/disk-format + @host % ~/tool/ateliers/host/part-lvm-format + @host % ~/tool/ateliers/host/part-root-format + @host % ~/tool/ateliers/host/part-boot-format + @host % ~/tool/ateliers/host/part-swap-format + @host % ~/tool/ateliers/host/part-var-format + @host % ~/tool/ateliers/host/part-home-format + @host % ~/tool/ateliers/host/debootstrap + @host % ~/tool/ateliers/host/disk-umount TASK: obtenir une installation démarable - @host % ~/tool/ateliers/vm_host chroot + @host % ~/tool/ateliers/host/chroot @host % export TRACE=1 LANG=C LC_CTYPE=C - @host % /root/tool/vm/vm_hosted init + @host % /root/tool/ateliers/local/init # TODO: revoir ça @host % exit TASK: initialiser la VM - @host % ~/tool/ateliers/vm_host vm_configure - @host % ~/tool/ateliers/vm_host vm_start - @hosted % vm_hosted user_configure + @host % ~/tool/ateliers/xen-vm-configure + @host % ~/tool/ateliers/xen-vm-start + @local % local/user-configure TASK: démarrer la VM - @host % vm_host vm_start + @host % host/xen-vm-start TASK: ajouter un-e administrateurice $user @remote % cp .../id_rsa var/pub/ssh/$user.key @remote % gpg --armor --export --export-options export-clean >var/pub/openpgp/$user.key @remote % git add var/pub/{openpgp,ssh}/$user.key @remote % git commit -a -m "Ajout : admin : $user ." - @remote % ./vm_remote git_push - @hosted % vm_hosted git_reset - @hosted % vm_hosted user_admin_add $user + @remote % remote/git-push -f local + @local % local/git-reset + @local % local/user-admin-add $user +TASK: ajouter un compte IMAP $user + @local % password=maudepasse dovecot-user-add $user@$domain TASK: démarrer la VM - @host % vm_host vm_start - @remote % ./vm_remote key_disk_send + @host % host/xen-vm-start + @remote % remote/luks-key-disk-send TASK: pousser des changements locaux sur la VM - @remote % ./vm_remote push hosted - @hosted % vm_hosted git_reset + @remote % remote/git-push -f local TASK: se connecter interactivement en root à la VM avec une connection SSH persistante - @remote % ./vm_remote mosh -l root + @remote % remote/mosh -l root TASK: générer une autorité de certification et des sous-certificats TLS % export TRACE=all % random=/dev/urandom gpg_options="-r $USER@ -r $SOME_OTHER_USER@" lib/tool/openssl/make etc/openssl/heureux-cyclage.org % random=/dev/urandom gpg_options="-r $USER@ -r $SOME_OTHER_USER@" lib/tool/openssl/make etc/openssl/*.heureux-cyclage.org % lib/tool/openssl/check etc/openssl/* +TASK: générer un certificat utilisateurice TLS + % random=/dev/urandom gpg_options="-r $USER@autogeree.net" lib/tool/openssl/user/req/make etc/openssl/imap.heureux-cyclage.org $USER@heureux-cyclage.org + % random=/dev/urandom gpg_options="-r $USER@autogeree.net" lib/tool/openssl/user/make etc/openssl/imap.heureux-cyclage.org $USER@heureux-cyclage.org TASK: gérer gitolite % cd etc/gitolite % vim conf/gitolite.conf % git commit - % ../../vm_remote gitolite_push + % ../../remote/gitolite-push TASK: configurer une zone DNS - @hosted % vm runit_configure nsd3 -- heureux-cyclage.org + @local % local/runit-configure nsd3 -- heureux-cyclage.org TASK: configurer un membre du groupe php5-fpm - @remote % ./vm_remote runit_configure nginx -- lhc_www - @hosted % vm_hosted runit_configure nginx -- lhc_www + @remote % remote/runit-configure nginx -- lhc_www + @local % local/runit-configure nginx -- lhc_www TASK: configurer un site nginx - @hosted % vm_hosted runit_configure nginx -- lhc_www + @local % local/runit-configure nginx -- lhc_www +TASK: instancier une sauvegarde duplicity sur une machine distante + @remote % gpg-agent --allow-preset-passphrase --daemon $SHELL # NOTE: pour être sûr de passer par gpg-agent (plutôt que gnome-key qui plante a priori pour l'option --preset-passhrase) + @remote % name=mysql/test # NOTE: à adapter + @remote % remote/backup-fetch "$name" # NOTE: conserve les fichiers disparus ou modifiés dans var/backup/old/$(date +'%Y%m%d+%H%M%S%z')/ + @remote % remote/duplicity restore --time "7D" --name "$name" file://var/backup/current/data/"$name" var/backup/current/restore/"$name" +TASK: ajout d'une clé DKIM pour amavis + @local % sudo amavisd-new genrsa /var/lib/amavis/dkim/domaine.tld.pem 4096 + @local % sudo chown amavis: /var/lib/amavis/dkim/domaine.tld.pem +TASK: ajout d'un accès sftp + @local % sudo chown root ~website-user + @local % sudo mkdir -m 740 ~website-user/.ssh + @local % sudo touch ~website-user/.ssh/authorized_keys + @local % sudo adduser ~website-user ftp