Changes between Version 9 and Version 10 of Mirroring


Ignore:
Timestamp:
Mar 10, 2016, 12:58:29 AM (8 years ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

add sample rsyncd configuration; update related instructions

Legend:

Unmodified
Added
Removed
Modified
  • Mirroring

    v9 v10  
    3535* **trunk** contains the latest development version of the MacPorts base source code. This small module is around 20MB.
    3636
     37We may in the future offer a single ''macports'' rsync module containing the above four modules as subdirectories, which is the configuration we recommend for mirrors.
     38
    3739== Get the files
    3840
     
    4143For your initial sync, you might speed up your transfer by using a nearby existing MacPorts mirror server. For subsequent scheduled syncing, use the master rsync server, rsync-origin.macports.org.
    4244
    43 **Note:** If you are syncing from rsync.macports.org, distfiles.macports.org, packages.macports.org, or a specific IP address, please switch to rsync-origin.macports.org.
     45**Note:** If you are syncing from a different hostname such as rsync.macports.org, or from a specific IP address, please switch to rsync-origin.macports.org.
    4446
    4547There is a sample script below for mirroring these modules via rsync. You don't have to use that script if you already have other arrangements for syncing, but please use the following `rsync` flags, for the following reasons:
     
    6365== Rsync server
    6466
    65 MacPorts retrieves the contents of the ''release'' and ''trunk'' modules via rsync. MacPorts comes preconfigured to use the server rsync.macports.org but users can edit their configuration to use your mirror instead. In addition, other mirror administrators may wish to copy your ''packages'' and ''distfiles'' modules. So you should run an rsync daemon to republish the modules you synced.
    66 
    67 The MacPorts rsync modules have generic names, so we suggest you put our modules in a "macports" folder. We would prefer you not rename our modules.
    68 
    69 **Note:** If you are providing the ''release'' or ''trunk'' modules under nonstandard names, please edit your rsyncd configuration to provide the module under both the nonstandard name and the standard name, and edit the [wiki:Mirrors Mirrors] page to reflect the standard name. If you are providing the ''packages'' or ''distfiles'' modules under nonstandard names, please edit your rsyncd configuration to provide the module under the standard name, edit the [wiki:Mirrors Mirrors] page to reflect the change, and let us know so that we can update mirror_sites.tcl and/or archive_sites.tcl.
     67MacPorts retrieves files from ''release'' and ''trunk'' via rsync. MacPorts comes preconfigured to use the server rsync.macports.org but users can edit their configuration to use your mirror instead. In addition, other mirror administrators may wish to copy your ''packages'' and ''distfiles''. So you should run an rsync daemon to republish the files you synced.
     68
     69The MacPorts rsync modules have generic names, so we suggest you put our files in subdirectories of a single "macports" module. We would prefer you not rename those subdirectories. If your site convention is to use the original server's hostname as the rsync module name, please use the name ''rsync.macports.org'' (even though you are actually syncing from rsync-origin.macports.org).
     70
     71**Note:** If you are providing the modules under nonstandard names, please edit your rsyncd configuration to provide the files under a single module with subdirectories, but continue to serve the files from your old module names so that existing users can still find the files. If you are already providing a single module but with nonstandard subdirectory names, rename the subdirectories to their standard names but add symlinks at their previous names. Edit the [wiki:Mirrors Mirrors] page to reflect your changes, and if you changed your configuration for ''packages'' or ''distfiles'' let us know so that we can update mirror_sites.tcl and/or archive_sites.tcl.
    7072
    7173There is a sample rsyncd configuration below.
     
    7375== Web server
    7476
    75 MacPorts retrieves files from the ''packages'' and ''distfiles'' modules via http. MacPorts automatically downloads these files from whichever mirror is closest. So you should run a web server to make these modules available.
     77MacPorts retrieves files from ''packages'' and ''distfiles'' via http. MacPorts automatically downloads these files from whichever mirror is closest. So you should run a web server to make these modules available.
    7678
    7779The contents of the ''packages'' module should be made available directly under !http://abc.xy.packages.macports.org/ and the contents of the ''distfiles'' module should be made available directly under !http://abc.xy.distfiles.macports.org/. It is not necessary to provide the contents of the ''release'' or ''trunk'' modules via http.
     
    284286=== Sample rsyncd configuration
    285287
    286 {{{
    287 TODO
    288 }}}
     288This sample rsyncd.conf file can be used to serve MacPorts files with the rsync daemon.
     289
     290{{{
     291dont compress = 7z ace avi bin bz2 deb distz dmg gem gif gpg gz \
     292    icns image img iso jar jpeg jpg lz lzma lzo mov mp3 mp4 mpkg msi \
     293    ogg pdf pkg png rar rmd160 rpm rzip sig sit sitx smi tbz tbz2 \
     294    tgz tlz ttf txz xz Z zip
     295forward lookup = false
     296gid = nobody
     297list = true
     298log file = /var/log/rsyncd/rsyncd.log
     299max connections = 0
     300pid file = /var/run/rsyncd.pid
     301read only = true
     302reverse lookup = false
     303timeout = 600
     304transfer logging = true
     305uid = nobody
     306use chroot = no
     307
     308[macports]
     309    comment = MacPorts release, trunk, distfiles and packages
     310    log file = /var/log/rsyncd/macports.log
     311    path = /var/www/html/macports
     312}}}
     313
     314Start rsync with:
     315
     316{{{
     317rsync --daemon --config=/etc/rsyncd.conf
     318}}}
     319
     320If you are serving individual rsync modules, move those directories into a single new ''macports'' module but continue to serve the old modules under your existing names so that users using the old names can still get the files. For example:
     321
     322{{{
     323cd /var/www/html
     324mkdir macports
     325mv packages distfiles release trunk macports/
     326}}}
     327
     328Adjust your rsyncd.conf to the new directory locations:
     329
     330{{{
     331[release]
     332    comment = MacPorts release (deprecated; use "macports/release" instead)
     333    log file = /var/log/rsyncd/macports.log
     334    path = /var/www/html/macports/release
     335
     336[trunk]
     337    comment = MacPorts trunk (deprecated; use "macports/trunk" instead)
     338    log file = /var/log/rsyncd/macports.log
     339    path = /var/www/html/macports/trunk
     340
     341[distfiles]
     342    comment = MacPorts distfiles (deprecated; use "macports/distfiles" instead)
     343    log file = /var/log/rsyncd/macports.log
     344    path = /var/www/html/macports/distfiles
     345
     346[mpdistfiles]
     347    comment = MacPorts distfiles (deprecated; use "macports/distfiles" instead)
     348    log file = /var/log/rsyncd/macports.log
     349    path = /var/www/html/macports/distfiles
     350
     351[packages]
     352    comment = MacPorts packages (deprecated; use "macports/packages" instead)
     353    log file = /var/log/rsyncd/macports.log
     354    path = /var/www/html/macports/packages
     355}}}
     356
     357If you are already serving a single module but with subdirectories with nonstandard names, move the subdirectories to their standard names and add a symlink so that users using the old nonstandard names can still get the files. For example, if you are currently serving ''mpdistfiles'', rename it to ''distfiles'' and add an ''mpdistfiles'' symlink:
     358
     359{{{
     360cd /var/www/html/macports
     361mv mpdistfiles distfiles
     362ln -s distfiles mpdistfiles
     363}}}