Difference between revisions of "Distribution on download.gnu.org.ua"

From Puszcza Wiki
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
The anonymous FTP server at download.gnu.org.ua offers two main distribution points:
+
The server '''download.gnu.org.ua''' distributes software using the traditional anonymous <tt>ftp</tt> and <tt>https</tt> protocols.  For brevity, in this document all links are shown as <tt>https</tt>.
  
    ftp://download.gnu.org.ua/pub/release, for stable releases.
+
The server offers two main distribution points:
    ftp://download.gnu.org.ua/pub/alpha, for alpha releases.
 
  
Project administrators can upload their projects to any of these using the [ftp://download.gnu.org.ua/pub/tools/gnupload gnupload] tool.
+
    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 [https://download.gnu.org.ua/pub/tools/gnupload gnupload] tool.
  
 
== Basic Syntax ==
 
== Basic Syntax ==
Line 10: Line 12:
 
The basic invocation syntax is:
 
The basic invocation syntax is:
  
   gnupload --to <nowiki>ftp://download.gnu.org.ua:ftp/</nowiki>''project'' ''files''
+
   gnupload --to <nowiki>download.gnu.org.ua:ftp/</nowiki>''project'' ''files''
  
 
or:
 
or:
  
   gnupload --to <nowiki>ftp://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 ftp://download.gnu.org.ua/pub/release/rush, one would run:
+
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>ftp://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>ftp://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
  
 
== Note on Host Keys ==
 
== Note on Host Keys ==
Line 33: Line 35:
 
   Couldn't read packet: Connection reset by peer
 
   Couldn't read packet: Connection reset by peer
  
The recommended way to fix it is to initiate an interactive sftp session by running
+
The recommended way to fix it is to obtain the host key via [http://man.gnu.org.ua/manpage/?1+ssh-keyscan ssh-keyscan] as shown in the example below:
 
 
  sftp download.gnu.org.ua
 
 
 
It will ask you to confirm connecting to the host:
 
 
 
  Connecting to download.gnu.org.ua...
 
  The authenticity of host 'download.gnu.org.ua (193.186.15.45)' can't be established. RSA key fingerprint is bf:14:5d:ae:3d:11:0d:f7:bd:92:2d:6d:25:ae:f7:6f.
 
  Are you sure you want to continue connecting (yes/no)?
 
  
Type '''yes''', hit enter and close the session by typing <tt>Ctrl-D</tt>. This will store the host key in your ssh database.
+
  ssh-keyscan download.gnu.org.ua >> ~/.ssh/known_hosts
 
 
Notice, that this procedure have to be done only once.
 
  
 
== Configuration File ==
 
== Configuration File ==
  
At startup, '''gnupload''' searches the current working directory for a file named <tt>.gnupload</tt>. If found, this file is parsed according to the following rules:
+
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 58: 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 .gnupload file  
+
   # A sample .gnuploadrc file  
   --to <nowiki>ftp://download.gnu.org.ua:ftp/rush</nowiki>  
+
   --to <nowiki>download.gnu.org.ua:ftp/rush</nowiki>  
 
   --user 55D0C732  
 
   --user 55D0C732  
 
   # End of file
 
   # End of file
Line 66: Line 58:
  
 
   gnupload rush-1.2.tar.gz
 
   gnupload rush-1.2.tar.gz
 +
 +
The examples below are written supposing that a '''gnupload''' file is present.
  
 
== Symlinks ==
 
== Symlinks ==
Line 71: Line 65:
 
An often used practice is to have symlink named ''project''<tt>-latest.tar.gz</tt> pointing to the latest tarball for ''project''. '''Gnupload''' provides a special option for that purpose. The command line:
 
An often used practice is to have symlink named ''project''<tt>-latest.tar.gz</tt> pointing to the latest tarball for ''project''. '''Gnupload''' provides a special option for that purpose. The command line:
  
   gnupload --symlink-re rush-1.2.tar.gz
+
   gnupload --symlink-regex rush-1.2.tar.gz
  
 
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 [http://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-re, 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-re='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.|'
  
 
== Advanced Operations ==
 
== Advanced Operations ==
Line 84: 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 from ftp 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.
+
: 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.
Line 106: Line 100:
 
# Removes symbolic links <tt>rush-1.6.tar.gz</tt> and <tt>rush-1-latest.tar.gz</tt>
 
# Removes symbolic links <tt>rush-1.6.tar.gz</tt> and <tt>rush-1-latest.tar.gz</tt>
 
# Links <tt>rush-1.6.tar.gz</tt> to <tt>rush-1-latest.tar.gz</tt>
 
# Links <tt>rush-1.6.tar.gz</tt> to <tt>rush-1-latest.tar.gz</tt>
# Links <tt>rush-1.6.tar.bz2</tt> to> <tt>rush-1-latest.tar.bz2</tt>
+
# Links <tt>rush-1.6.tar.bz2</tt> to <tt>rush-1-latest.tar.bz2</tt>
 
# Uploads files <tt>rush-2.0.tar.gz</tt> and <tt>rush-2.0.tar.bz2</tt>.
 
# Uploads files <tt>rush-2.0.tar.gz</tt> and <tt>rush-2.0.tar.bz2</tt>.
  

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:

  1. Removes symbolic links rush-1.6.tar.gz and rush-1-latest.tar.gz
  2. Links rush-1.6.tar.gz to rush-1-latest.tar.gz
  3. Links rush-1.6.tar.bz2 to rush-1-latest.tar.bz2
  4. 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.