8104
Commentaire: révision : 2nde passe
|
← Version 4 à la date du 2008-11-30 18:29:26 ⇥
7471
première passe...
|
Texte supprimé. | Texte ajouté. |
Ligne 3: | Ligne 3: |
=== Utilisation === | === Utilisation implicite (automatique) des miroirs === |
Ligne 5: | Ligne 5: |
On ne modifie plus les sources APT mais on intercepte les téléchargements au niveau du proxy transparent pour les rediriger vers le miroir local (cf [[Squid]]). Cela suppose bien sûr un miroir dans un parfait état et mis à jour tous les jours. Néanmoins, si on souhaitait tout de même un accès explicite au miroir il se ferait comme suit : | On ne modifie plus les sources APT mais on intercepte les téléchargements au niveau du proxy transparent pour les rediriger vers le miroir local (cf [[Squid]]). La technique utilisée teste la présence du fichier dans le miroir et fonctionne donc même dans le cas où il y aurait un souci avec le miroir. Néanmoins, si on souhaitait tout de même un accès explicite au miroir, voir la section suivante. === Utilisation explicite (manuelle) des miroirs === |
Ligne 14: | Ligne 18: |
deb http://apt.auf.org/ etch auf | |
Ligne 24: | Ligne 29: |
deb http://apt.auf.org/ hardy auf | |
Ligne 36: | Ligne 42: |
/* Parler du fait que j'utilise le paquet `debmirror` de Lenny => retrouver d'abord pourquoi... ;-) */ | /* Parler du fait que j'utilise le paquet `debmirror` de Lenny => retrouver d'abord pourquoi... ;-) il me semble que c'est pour les .udeb de debian-installer... */ |
Ligne 66: | Ligne 72: |
* Fichier `/usr/local/lib/srv-mirror-functions` '''(obsolète)''' : {{{ #!/bin/bash function make_repository { root="$1" ; dist="$2" ; component="$3" ; arch="$4" ; url="$5" dir="dists/${dist}/${component}" mkdir -p "${root}/${dir}" || return -1 pushd "${root}/${dir}" >/dev/null mkdir -p "pool" "source" "binary-${arch}" lftp -e "set net:no-proxy . ; mirror -cepP ${url} pool ; quit" apt-ftparchive sources "pool" /dev/null "${dir}" | gzip -c9 > "source/Sources.gz" apt-ftparchive packages "pool" /dev/null "${dir}" | gzip -c9 > "binary-${arch}/Packages.gz" cat > "binary-${arch}/Release" << __EOF__ Archive: stable Version: (unspecified) Component: ${component} Origin: AuF-ZAP Label: Mirror Architecture: ${arch} __EOF__ apt-ftparchive release "pool" | gzip -c9 > "Release.gz" #apt-ftparchive contents "pool" | gzip -c9 > "Contents-${arch}.gz" popd >/dev/null return 0 } }}} |
|
Ligne 94: | Ligne 73: |
{{{ | {{{#!shell |
Ligne 102: | Ligne 81: |
{{{ | {{{#!shell |
Cette page présente le modèle des miroirs mis en place au CNF de Hanoï.
Utilisation implicite (automatique) des miroirs
On ne modifie plus les sources APT mais on intercepte les téléchargements au niveau du proxy transparent pour les rediriger vers le miroir local (cf Squid). La technique utilisée teste la présence du fichier dans le miroir et fonctionne donc même dans le cas où il y aurait un souci avec le miroir.
Néanmoins, si on souhaitait tout de même un accès explicite au miroir, voir la section suivante.
Utilisation explicite (manuelle) des miroirs
pour Debian GNU/Linux "Etch" 4.0 :
deb http://mirror.vn.refer.org/debian/archive etch main contrib non-free deb http://mirror.vn.refer.org/debian/security etch/updates main contrib non-free deb http://mirror.vn.refer.org/debian/volatile etch/volatile main contrib non-free deb http://mirror.vn.refer.org/debian/backports etch-backports main #deb http://mirror.vn.refer.org/debian/multimedia etch main deb http://apt.auf.org/ etch auf
pour Ubuntu Linux "Hardy Heron" 8.04.1 (LTS) :
deb http://mirror.vn.refer.org/ubuntu/archive hardy main restricted universe multiverse deb http://mirror.vn.refer.org/ubuntu/archive hardy-updates main restricted universe multiverse deb http://mirror.vn.refer.org/ubuntu/archive hardy-backports main restricted universe multiverse deb http://mirror.vn.refer.org/ubuntu/security hardy-security main restricted universe multiverse deb http://mirror.vn.refer.org/ubuntu/medibuntu hardy free non-free deb http://mirror.vn.refer.org/ubuntu/hanoilug hardy contrib import # experimental deb http://apt.auf.org/ hardy auf
Tout (ou presque) est également accessible via rsync mirror.vn.refer.org::
Mise en place
Pré-requis :
- ces scripts utilisent des outils externes qui doivent donc être installés :
sudo aptitude install debmirror gnupg rsync lftp apt-utils
les miroirs sont fait par un utilisateur dédié mirror qui doit donc être créé :
sudo useradd -s /bin/false -m mirror
les miroirs sont installés dans le répertoire /srv/mirror/ qui doit donc être créé :
sudo mkdir /srv/mirror sudo chown mirror /srv/mirror
le compte mirror doit posséder une copie des clés publiques de signature des archives :
sudo -u mirror /bin/sh mkdir .gnupg tail +4 /usr/share/gnupg/options.skel > .gnupg/gpg.conf gpg --no-default-keyring --keyring trustedkeys.gpg --recv ADB11277 # Etch Stable Release Key gpg --no-default-keyring --keyring trustedkeys.gpg --recv A70DAF536070D3A1 # Debian Archive Automatic Signing Key (4.0/etch) gpg --no-default-keyring --keyring trustedkeys.gpg --recv EC61E0B0BBE55AB3 # Debian-Volatile Archive Automatic Signing Key (4.0/etch) gpg --no-default-keyring --keyring trustedkeys.gpg --recv EA8E8B2116BA136C # Backports.org Archive Key #gpg --no-default-keyring --keyring trustedkeys.gpg --recv 1F41B907 # Christian Marillat (Debian-Multimedia) gpg --no-default-keyring --keyring trustedkeys.gpg --recv 40976EAF437D05B5 # Ubuntu Archive Automatic Signing Key gpg --no-default-keyring --keyring trustedkeys.gpg --recv 2EBC26B60C5A2783 # Medibuntu Packaging Team gpg --no-default-keyring --keyring trustedkeys.gpg --recv 735B04432B7ADF77 # Jean Christophe ANDRÉ (HanoiLUG)
Scripts :
Fichier /usr/local/sbin/srv-mirror-rfc :
#!/bin/bash [ "$(id -u)" = 0 ] && exec su -s /bin/bash mirror -c "\"$0\" $@" DIR="/srv/mirror/rfc" exec lftp -e "mirror -cepvP /pub/rfc/rfc ${DIR} ; quit" ftp.lip6.fr
Fichier /usr/local/sbin/srv-mirror-debian :
#!/bin/bash # Depends: debmirror [ "$(id -u)" = 0 ] && exec su -s /bin/bash mirror -c "\"$0\" $@" DIR="/srv/mirror/debian" OPT="--exclude=.*-dbg_.*.deb --exclude=.*-debug_.*.deb --include=.*.udeb $@" ARCH="i386" DIST="etch" RELEASE="4.0" DISTNAME="Etch" mkdir -p "${DIR}" || exit -1 debmirror "${DIR}/security" \ --host=security.debian.org --method=http --root=/debian-security \ --dist="${DIST}/updates" \ --section=main,contrib,non-free \ --arch="${ARCH}" --nosource $OPT debmirror "${DIR}/volatile" \ --host=volatile.debian.org --method=http --root=/debian-volatile \ --dist="${DIST}/volatile" \ --section=main,contrib,non-free \ --arch="${ARCH}" --nosource $OPT debmirror "${DIR}/backports" \ --host=www.backports.org --method=http --root=/debian \ --dist="${DIST}-backports" \ --section=main \ --arch="${ARCH}" --nosource $OPT #debmirror "${DIR}/multimedia" \ # --host=www.debian-multimedia.org --method=http --root=/ \ # --dist="${DIST}" \ # --section=main \ # --arch="${ARCH}" --nosource $OPT debmirror "${DIR}/archive" \ --host=ftp.debian.org --method=http --root=/debian \ --dist="${DIST}" \ --section=main,contrib,non-free,main/debian-installer \ --arch="${ARCH}" --nosource $OPT exit 0
Fichier /usr/local/sbin/srv-mirror-ubuntu :
# Depends: debmirror rsync [ "$(id -u)" = 0 ] && exec su -s /bin/bash mirror -c "\"$0\" $@" DIR="/srv/mirror/ubuntu" OPT="--exclude=.*-dbg_.*.deb --exclude=.*-debug_.*.deb --include=.*.udeb $@" ARCH="i386" LTSDIST="hardy" ; OLDDIST="feisty" ; DIST="gutsy" ; NEWDIST="intrepid" LTSRELEASE="8.04" ; OLDRELEASE="7.04" ; RELEASE="7.10" ; NEWRELEASE="8.10" LTSDISTNAME="Hardy Heron" ; OLDDISTNAME="Feisty Fawn" ; DISTNAME="Gutsy Gibbon" ; NEWDISTNAME="Intrepid Ibex" mkdir -p "${DIR}" || exit -1 debmirror "${DIR}/security" \ --host=security.ubuntu.com --method=http --root=/ubuntu \ --dist="${LTSDIST}-security","${OLDDIST}-security","${DIST}-security","${NEWDIST}-security" \ --section=main,restricted,universe,multiverse \ --arch="${ARCH}" --nosource ${OPT} debmirror "${DIR}/medibuntu" \ --host=packages.medibuntu.org --method=http --root=/ \ --dist="${LTSDIST}","${DIST}" \ --section=free,non-free \ --arch="${ARCH}" --nosource ${OPT} debmirror "${DIR}/hanoilug" \ --host=apt.hanoilug.org --method=http --root=/ubuntu \ --dist="${LTSDIST}","${DIST}","${NEWDIST}" \ --section=contrib,import,experimental \ --arch="${ARCH}" --nosource ${OPT} debmirror "${DIR}/archive" \ --host=archive.ubuntu.com --method=http --root=/ubuntu \ --dist="${LTSDIST}-updates,${DIST}-updates,${OLDDIST}-updates,${LTSDIST}-backports,${DIST}-backports,${LTSDIST},${DIST},${NEWDIST}-updates,${NEWDIST}-backports,${NEWDIST}" \ --section=main,restricted,universe,multiverse,main/debian-installer,restricted/debian-installer \ --arch="${ARCH}" --nosource ${OPT} exit 0
Fichier /etc/cron.d/srv-mirror :
MAILTO=technique-log!vn.refer.org 0 1 * * * mirror /usr/local/sbin/srv-mirror-rfc 2>&1 & #30 1 * * * mirror /usr/local/sbin/srv-mirror-auf 2>&1 & 0 2 * * * mirror /usr/local/sbin/srv-mirror-debian 2>&1 & 0 3 * * * mirror /usr/local/sbin/srv-mirror-ubuntu 2>&1 &