Difference between revisions of "Distribution on download.gnu.org.ua"
(5 intermediate revisions by the same user not shown) | |||
Line 18: | Line 18: | ||
gnupload --to <nowiki>download.gnu.org.ua:alpha/</nowiki>''project'' ''files'' | gnupload --to <nowiki>download.gnu.org.ua:alpha/</nowiki>''project'' ''files'' | ||
− | where ''project'' is the project system name and ''files'' are the files to distribute. For example, to put files <tt>rush-1.2.tar.gz</tt> and <tt>rush-1.2.tar.bz2</tt> on | + | where ''project'' is the project system name and ''files'' are the files to distribute. For example, to put files <tt>rush-1.2.tar.gz</tt> and <tt>rush-1.2.tar.bz2</tt> on https://download.gnu.org.ua/pub/release/rush, one would run: |
gnupload --to <nowiki>download.gnu.org.ua:ftp/rush</nowiki> rush-1.2.tar.gz rush-1.2.tar.bz | gnupload --to <nowiki>download.gnu.org.ua:ftp/rush</nowiki> rush-1.2.tar.gz rush-1.2.tar.bz | ||
− | Before submitting files, '''gnupload''' will sign them using your GPG key. If you have several GPG keys, you can select the right one by supplying its ID via the <tt>--user</tt> command line option, as in: | + | Before submitting files, '''gnupload''' will sign them using your GPG key stored in your [https://puszcza.gnu.org.ua/my/admin/change.php?item=gpgkey account settings]. If you have several GPG keys, you can select the right one by supplying its ID via the <tt>--user</tt> command line option, as in: |
gnupload --to <nowiki>download.gnu.org.ua:ftp/rush</nowiki> --user 55D0C732 rush-1.2.tar.gz | gnupload --to <nowiki>download.gnu.org.ua:ftp/rush</nowiki> --user 55D0C732 rush-1.2.tar.gz | ||
Line 38: | Line 38: | ||
ssh-keyscan download.gnu.org.ua >> ~/.ssh/known_hosts | ssh-keyscan download.gnu.org.ua >> ~/.ssh/known_hosts | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Configuration File == | == Configuration File == | ||
− | At startup, '''gnupload''' searches the current working directory for a file named <tt>. | + | At startup, '''gnupload''' searches the current working directory for a file named <tt>.gnuploadrc</tt>. If found, this file is parsed according to the following rules: |
* Empty lines are removed. | * Empty lines are removed. | ||
Line 64: | Line 50: | ||
You can use this file to supply the default options to '''gnupload'''. For example, consider this configuration file contents: | You can use this file to supply the default options to '''gnupload'''. For example, consider this configuration file contents: | ||
− | # A sample . | + | # A sample .gnuploadrc file |
− | --to <nowiki> | + | --to <nowiki>download.gnu.org.ua:ftp/rush</nowiki> |
--user 55D0C732 | --user 55D0C732 | ||
# End of file | # End of file | ||
Line 83: | Line 69: | ||
uploads the file <tt>rush-1.2.tar.gz</tt> and symlinks it to <tt>rush-latest.tar.gz</tt>. | uploads the file <tt>rush-1.2.tar.gz</tt> and symlinks it to <tt>rush-latest.tar.gz</tt>. | ||
− | This option uses a [https://man.gnu.org.ua/1/sed sed](1) regular expression to locate the version number in the file name. The default regular expression recognizes the usual version numbers (one to three decimal integers, delimited by dots and separated with a single dash from the project name). In case you use another version numbering scheme, you can supply your customized sed expression as an argument to --symlink-regex, e.g. | + | This option uses a [https://man.gnu.org.ua/1/sed sed](1) regular expression to locate the version number in the file name. The default regular expression recognizes the usual version numbers (one to three decimal integers, delimited by dots and separated with a single dash from the project name). In case you use another version numbering scheme, you can supply your customized sed expression as an argument to <tt>--symlink-regex</tt>, e.g. |
--symink-regex='s|-[0-9][0-9a-z\.]*\(-[0-9][0-9a-z]*\)\?\.|-latest.|' | --symink-regex='s|-[0-9][0-9a-z\.]*\(-[0-9][0-9a-z]*\)\?\.|-latest.|' | ||
Line 92: | Line 78: | ||
; --delete files | ; --delete files | ||
− | : Delete files from the directory. When applied to alpha directory, the named files are irrevocably lost. When applied to ftp directory, files are moved | + | : Delete files from the directory. When applied to alpha directory, the named files are irrevocably lost. When applied to ftp (release) directory, files are moved away into a special archive storage. If you make a mistake when applying '''--delete''' to your stable ftp, you can ask [mailto:puszcza-hackers@gnu.org.ua puszcza-hackers@gnu.org.ua] to restore accidentally removed files. |
; --symlink ''oldfile'' ''newfile'' | ; --symlink ''oldfile'' ''newfile'' | ||
: Create a symbolic link from ''oldfile'' to ''newfile''. If ''newfile'' already exists and is a symbolic link, it will be removed. | : Create a symbolic link from ''oldfile'' to ''newfile''. If ''newfile'' already exists and is a symbolic link, it will be removed. |
Latest revision as of 09:59, 2 June 2023
The server download.gnu.org.ua distributes software using the traditional anonymous ftp and https protocols. For brevity, in this document all links are shown as https.
The server offers two main distribution points:
https://download.gnu.org.ua/pub/release, for stable releases. https://download.gnu.org.ua/pub/alpha, for alpha releases.
Project administrators can upload their projects to any of these using the gnupload tool.
Basic Syntax
The basic invocation syntax is:
gnupload --to download.gnu.org.ua:ftp/project files
or:
gnupload --to download.gnu.org.ua:alpha/project files
where project is the project system name and files are the files to distribute. For example, to put files rush-1.2.tar.gz and rush-1.2.tar.bz2 on https://download.gnu.org.ua/pub/release/rush, one would run:
gnupload --to download.gnu.org.ua:ftp/rush rush-1.2.tar.gz rush-1.2.tar.bz
Before submitting files, gnupload will sign them using your GPG key stored in your account settings. If you have several GPG keys, you can select the right one by supplying its ID via the --user command line option, as in:
gnupload --to download.gnu.org.ua:ftp/rush --user 55D0C732 rush-1.2.tar.gz
Note on Host Keys
Gnupload uses sftp in batch mode to upload files to the server. This expects your .ssh/known_hosts file to contain the host key of download.gnu.org.ua. If it does not, sftp will fail and you will get a diagnostic output similar to the following:
Signing project-1.0.tar.gz... Uploading project-1.0.tar.gz to download.gnu.org.ua:ftp/project... Host key verification failed. Couldn't read packet: Connection reset by peer
The recommended way to fix it is to obtain the host key via ssh-keyscan as shown in the example below:
ssh-keyscan download.gnu.org.ua >> ~/.ssh/known_hosts
Configuration File
At startup, gnupload searches the current working directory for a file named .gnuploadrc. If found, this file is parsed according to the following rules:
- Empty lines are removed.
- Lines beginning with a # (comments) are removed.
- Each newline character is replaced with a single space.
- The resulting string is prepended to the actual command line.
You can use this file to supply the default options to gnupload. For example, consider this configuration file contents:
# A sample .gnuploadrc file --to download.gnu.org.ua:ftp/rush --user 55D0C732 # End of file
Given this file and following the example from the previous section, uploading rush-1.2.tar.gz becomes as simple as:
gnupload rush-1.2.tar.gz
The examples below are written supposing that a gnupload file is present.
Symlinks
An often used practice is to have symlink named project-latest.tar.gz pointing to the latest tarball for project. Gnupload provides a special option for that purpose. The command line:
gnupload --symlink-regex rush-1.2.tar.gz
uploads the file rush-1.2.tar.gz and symlinks it to rush-latest.tar.gz.
This option uses a sed(1) regular expression to locate the version number in the file name. The default regular expression recognizes the usual version numbers (one to three decimal integers, delimited by dots and separated with a single dash from the project name). In case you use another version numbering scheme, you can supply your customized sed expression as an argument to --symlink-regex, e.g.
--symink-regex='s|-[0-9][0-9a-z\.]*\(-[0-9][0-9a-z]*\)\?\.|-latest.|'
Advanced Operations
Apart from distributing releases, gnupload can be used to manage the distribution directory contents. Special options for doing so are:
- --delete files
- Delete files from the directory. When applied to alpha directory, the named files are irrevocably lost. When applied to ftp (release) directory, files are moved away into a special archive storage. If you make a mistake when applying --delete to your stable ftp, you can ask puszcza-hackers@gnu.org.ua to restore accidentally removed files.
- --symlink oldfile newfile
- Create a symbolic link from oldfile to newfile. If newfile already exists and is a symbolic link, it will be removed.
- Any number of oldfile newfile pairs can be supplied to this option.
- --rmsymlink files
- Remove symbolic links. Arguments are any number of symbolic link names to remove. Attempting to remove an unexisting symlink is not an error.
- --
- The double-dash marks the end of command line options. It is usually used to separated files to upload from the rest of commands. See the following section for an example.
Complex Requests
Any number of operations can be requested in a single gnupload invocation. Consider this example:
gnupload --delete rush-1.5a.tar.gz rush-1.5a.tar.bz2 \ --symlink rush-1.6.tar.gz rush-1-latest.tar.gz rush-1.6.tar.bz2 rush-1-latest.tar.bz2 \ -- rush-2.0.tar.gz rush-2.0.tar.bz2
It does the following:
- Removes symbolic links rush-1.6.tar.gz and rush-1-latest.tar.gz
- Links rush-1.6.tar.gz to rush-1-latest.tar.gz
- Links rush-1.6.tar.bz2 to rush-1-latest.tar.bz2
- Uploads files rush-2.0.tar.gz and rush-2.0.tar.bz2.
Notice the use of double-dash (--) to separate upload names from the rest of the requests.
Technical Details
The upload procedure conforms to GNU Automated FTP Uploads protocol, version 1.1. Download.gnu.org.ua accepts uploads to /incoming/ftp and /incoming/alpha using any of the following methods: sftp, scp, or rsync via ssh.
Uploads are processed in real time.