repomirror/example.config.xml

189 lines
8.7 KiB
XML
Raw Permalink Normal View History

2020-06-13 03:46:49 -04:00
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This is by default placed in ~/.config/repomirror.xml
2020-06-16 15:44:50 -04:00
Remember to replace any necessary special characters (https://stackoverflow.com/a/1091953/733214).
2020-07-24 22:52:15 -04:00
Also, your mirror server should definitely be using UTC. You're going to see a LOT of weirdness if not.
2020-06-13 03:46:49 -04:00
-->
<mirror xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://git.square-r00t.net/RepoMirror/"
xsi:schemaLocation="https://git.square-r00t.net/RepoMirror/ http://schema.xml.r00t2.io/projects/repomirror.xsd">
<distro name="arch">
2020-06-14 00:53:12 -04:00
<!--
If provided (and the sync script is running as the root user), the files/directories can be chowned to the
provided user/group. Otherwise they'll be owned by whatever user the script is running as (and its primary group).
-->
<owner>
<user>root</user>
<group>root</group>
</owner>
2020-06-13 03:46:49 -04:00
<!--
The local path to where the hierarchy/files should be synced to.
-->
<dest>/srv/repos/arch/.</dest>
<!--
2020-06-14 00:53:12 -04:00
The local file to update with a timestamp with the last time we *checked* for updates.
If not provided, don't update a file (NOT recommended!).
It may or may not be optional; check with the spec for mirroring for the specified distro.
If the timeFormat attribute is provided, write the timestamp format in the specified format.
See the following for details:
* https://docs.python.org/library/datetime.html#strftime-and-strptime-format-codes
* https://strftime.org/
The default is to use a regular UNIX Epoch integer (e.g. June 13, 2020 5:03:53 PM UTC => 1592067833).
This can be manually specified by the special string "UNIX_EPOCH".
2020-06-14 03:46:29 -04:00
Optionally, you can use the special string "MICROSECOND_EPOCH", which will specify the above with left-padded
microseconds (e.g. June 13, 2020 5:09:13.995777 PM UTC => 1592068153.995777).
2020-06-13 03:46:49 -04:00
-->
2020-06-14 00:53:12 -04:00
<lastLocalCheck timeFormat="MICROSECOND_EPOCH">/srv/http/arch.lastcheck</lastLocalCheck>
2020-06-13 03:46:49 -04:00
<!--
2020-06-14 00:53:12 -04:00
The file to update with a timestamp with the last time we *synced from our upstream*.
If not provided, don't update a file (NOT recommended!).
It may or may not be optional; check with the spec for mirroring for the specified distro.
If not provided, don't update a file (NOT recommended!).
It takes the same optional attribute "timeFormat" as above, with the same behaviour.
2020-06-13 03:46:49 -04:00
-->
2020-06-14 00:53:12 -04:00
<lastLocalSync timeFormat="UNIX_EPOCH">/srv/repos/arch/lastsync</lastLocalSync>
2020-06-13 03:46:49 -04:00
<!--
The path to a file on the upstream(s) that gives a time when it last updated.
The syntax and options are the same as lastLocalCheck/lastLocalSync.
2020-06-14 00:53:12 -04:00
If neither this nor lastRemoteSync is provided, a sync will be attempted regardless of when the last one was
attempted.
2020-06-13 03:46:49 -04:00
-->
<!--
Remote timestamps take an additional optional boolean attribute, "mtime". If true, the mtime of the remote file
will be checked instead of the content of the file (and thus timeFormat is ignored).
-->
2020-06-14 00:53:12 -04:00
<lastRemoteUpdate timeFormat="UNIX_EPOCH">/lastupdate</lastRemoteUpdate>
2020-06-13 03:46:49 -04:00
<!--
The path to a file on the upstream(s) that gives a time when it last synced from its upstream.
The syntax and options are the same as lastRemoteCheck.
2020-06-14 00:53:12 -04:00
If neither this nor lastRemoteUpdate is provided, a sync will be attempted regardless of when the last one was
attempted. It follows the same rules as lastRemoteUpdate for syntax.
2020-06-13 03:46:49 -04:00
-->
<lastRemoteSync mtime="true" timeFormat="UNIX_EPOCH">/lastsync</lastRemoteSync>
2020-06-13 03:46:49 -04:00
<!--
The path that must be currently mounted for sync to proceed.
2020-06-14 00:53:12 -04:00
This is required.
2020-06-13 03:46:49 -04:00
-->
<mountCheck>/</mountCheck>
<!--
2020-06-14 00:53:12 -04:00
You cannot reliably use two dashes in XML strings, so this is a workaround.
The following is only used for rsync upstreams and is optional. The default is the following:
<rsyncArgs>
<long>recursive</long>
<long>times</long>
<long>links</long>
<long>hard-links</long>
<long>delete-after</long>
<long>perms</long>
<long>delay-updates</long>
<long>safe-links</long>
2020-06-16 15:44:50 -04:00
<long>delete-excluded</long>
2020-06-17 01:18:16 -04:00
</rsyncArgs>
These arguments should be sane for most, if not all, rsync-driven repository mirroring.
2020-06-14 00:53:12 -04:00
If arguments are provided, the defaults are overwritten so if you need the above, be sure to specify them.
See the rsync man page (rsync(1)) for more details and a listing of supported flags on your system
(§ "OPTION SUMMARY", § "OPTIONS").
2020-06-13 03:46:49 -04:00
-->
2020-06-14 00:53:12 -04:00
<rsyncArgs>
<!--
A "long" option (two hyphens).
-->
<long>archive</long>
<long>delete-after</long>
<!--
2020-06-16 15:44:50 -04:00
An argument with a value (info=progress2).
2020-06-14 00:53:12 -04:00
-->
2020-06-16 15:44:50 -04:00
<long value="progress2">info</long>
2020-06-14 00:53:12 -04:00
<!--
A "short" option (single hyphen).
-->
<short>c</short><!-- checksum -->
<!--
An option that requires to be enclosed in quotes. (This one excludes hidden files/directories.)
-->
<long value="&quot;.*&quot;">exclude</long>
2020-06-14 00:53:12 -04:00
</rsyncArgs>
<!--
rsyncIgnore is an optional element that ignores certain return codes/exit statuses of rsync (otherwise they are
raised as warnings). It consists of a space-separated list of return codes that warnings should be suppressed for.
(Return code 0 never raises a warning, as it is success.)
See the rsync man page (rsync(1)) for a list of error codes and what they mean (§ "EXIT VALUES"), or refer to:
repomirror/fetcher/rsync_returns.py
-->
<rsyncIgnore returns="23 24"/>
<!--
Upstreams have an optional attribute, "delayCheck", which is an ISO 8601 duration type.
https://en.wikipedia.org/wiki/ISO_8601#Durations
e.g. 5 minutes would be P0Y0M0DT0H5M0S or just PT5M.
It is used to determine if your upstream is "out of date" (e.g. will be skipped if its last check date is older
than the specified amount of time). Obviously this is only checked if you have a specified lastRemoteUpdate value.
-->
<!--
You can optionally specify an offset via the "offset" attribute in the same format as "delayCheck" if your
upstream's remote files are using a different timezone instead of UTC.
e.g.:
2020-07-24 22:52:15 -04:00
* If your upstream uses UTC-4 for its timestamp files, you would use "-PT4H".
* If your upstream uses UTC+6 for its timestamp files, you would use either "+PT6H" or just "PT6H".
-->
<upstream delayCheck="P0Y0M2DT0H0M0S" offset="-PT0S">
2020-06-13 03:46:49 -04:00
<!--
The following example uses "rsync://arch.mirror.constant.com/archlinux/"
(https://www.archlinux.org/mirrors/constant.com/1008/)
2020-06-14 03:46:29 -04:00
If you need to find a mirror, you may be interested in the utils/find_fastest_upstream/ scripts. They will
automatically find (and sort based on connection speed) all mirrors in your country for a given distro.
They can even generate stubbed configuration files using those upstreams.
Currently only Arch Linux and CentOS are supported.
2020-06-13 03:46:49 -04:00
-->
<!--
2020-06-14 00:53:12 -04:00
Required; one of:
2020-06-13 03:46:49 -04:00
* rsync
* ftp
-->
<syncType>rsync</syncType>
<!--
Required; ONLY the domain (or IP) goes here.
2020-06-13 03:46:49 -04:00
-->
<domain>arch.mirror.constant.com</domain>
<!--
2020-06-14 00:53:12 -04:00
Optional; if not specified,the protocol's default port will be used.
2020-06-13 03:46:49 -04:00
-->
<port>873</port>
<!--
2020-06-14 00:53:12 -04:00
Required; the *remote* path part of the URI. The leading / is necessary. A trailing one will be assumed.
2020-06-13 03:46:49 -04:00
-->
<path>/archlinux/</path>
</upstream>
<!--
Multiple upstreams can be specified. They are tried in order specified and if connection fails or times out,
the next one will be tried until no more specified upstreams exist.
-->
<upstream>
<syncType>rsync</syncType>
<domain>arch.mirror.square-r00t.net</domain>
<path>/arch/</path>
</upstream>
<upstream>
<!--
Only passive (PASV) mode for FTP is supported.
-->
<syncType>ftp</syncType>
<domain>sub.domain.tld</domain>
<port>21</port>
<path>/distros/archlinux/</path>
</upstream>
</distro>
2020-06-14 00:53:12 -04:00
<distro name="centos">
<upstream>
<syncType>rsync</syncType>
<domain>mirrors.rit.edu</domain>
<path>/centos/</path>
</upstream>
2020-06-17 01:18:16 -04:00
<dest>/srv/repos/centos/.</dest>
2020-06-16 15:44:50 -04:00
<lastLocalCheck timeFormat="MICROSECOND_EPOCH">/srv/repos/centos/CHECKED</lastLocalCheck>
<lastLocalSync timeFormat="UNIX_EPOCH">/srv/repos/centos/TIME</lastLocalSync>
<lastRemoteUpdate timeFormat="%a %d %b %H:%M:%S UTC %Y">/timestamp.txt</lastRemoteUpdate>
<lastRemoteSync timeFormat="UNIX_EPOCH">/TIME</lastRemoteSync>
2020-06-17 01:18:16 -04:00
<mountCheck>/</mountCheck>
2020-06-14 00:53:12 -04:00
</distro>
2020-06-13 03:46:49 -04:00
</mirror>