Repository Management: Difference between revisions

From iPhone Development Wiki
m (formatting)
(tiny copyedit)
Line 5: Line 5:
== Novice ==
== Novice ==


If you have no interest in setting up your own server, you can always use [https://myrepospace.com/ MyRepoSpace].
If you have no interest in setting up your own server, you can always use [https://myrepospace.com/ MyRepoSpace]. It can be a little slow though.


== Advanced ==
== Advanced ==
Line 13: Line 13:
=== saurik's explanation ===
=== saurik's explanation ===


If you have no experience with Debian APT, then you can read saurik's [http://www.saurik.com/id/7 excellent writeup on the subject], which should be more than enough to get you started.
If you have no experience with Debian APT, you can read saurik's [http://www.saurik.com/id/7 excellent writeup on the subject], which is pretty comprehensive.


=== Other explanations ===
=== Other explanations ===
Line 23: Line 23:
=== Quick and dirty summary ===
=== Quick and dirty summary ===


First thing is, obviously, you'll need a web host. Literally it could be anything, like [https://neocities.org/ Neocities] or [https://pages.github.com/ GitHub pages].
First thing is, you'll need a web host. It could be anything, like [https://neocities.org/ Neocities] or [https://pages.github.com/ GitHub pages].


==== Repository structure ====
==== Repository structure ====
Line 29: Line 29:
The basic idea is that you have two files in your server, <tt>Packages</tt> and <tt>Release</tt>. These files can be bzipped to save bandwidth (i.e. <tt>Packages.bz2</tt> and <tt>Release.bz2</tt>). <tt>Packages</tt> contains all of the information related to the different packages on your server (and where to download them, more on that later) and <tt>Release</tt> contains all of the information related to your server (like the name, description, etc).
The basic idea is that you have two files in your server, <tt>Packages</tt> and <tt>Release</tt>. These files can be bzipped to save bandwidth (i.e. <tt>Packages.bz2</tt> and <tt>Release.bz2</tt>). <tt>Packages</tt> contains all of the information related to the different packages on your server (and where to download them, more on that later) and <tt>Release</tt> contains all of the information related to your server (like the name, description, etc).


If you want to see an example of a typical <tt>Packages</tt> and <tt>Release</tt> file, go to your sources in Cydia and find a repository hosted by a 3rd party. Copy-paste the URL in your browser and append <tt>Release.bz2</tt> (or <tt>Release</tt> if you get a 404) to the end. Same thing applies with <tt>Packages</tt>.
If you want to see an example of a <tt>Packages</tt> and <tt>Release</tt> file, go to your sources in Cydia and find a repository hosted by a third party (a non-default source). Copy-paste the URL in your browser and append <tt>Release.bz2</tt> (or <tt>Release</tt> if you get a 404) to the end. Same thing applies with <tt>Packages</tt>.


==== .deb files ====
==== .deb files ====
Line 41: Line 41:
= Private repos =
= Private repos =


The most trivial way to get private repository is to restrict access based on UDID. Cydia sends the user's UDID via the <tt>HTTP_X_UNIQUE_ID</tt> HTTP header, so your server could check that against a database in order to ensure that the user has rightful access.
The easiest way to make your repository "private" is to restrict access based on UDID. Cydia sends the user's UDID via the <tt>HTTP_X_UNIQUE_ID</tt> HTTP header, so your server could check that against a database in order to ensure that the user has rightful access.


<b>NOTE:</b> Static webhosts like Neocities won't work for private repos. You'll need a server that has some way to let you process requests server-side, e.g. PHP, node.js, or Flask.
<b>NOTE:</b> Static webhosts like Neocities won't work for private repos. You'll need a server that has some way to let you process requests server-side, e.g. PHP, node.js, or Flask.

Revision as of 20:04, 16 May 2014

This page contains instructions for getting a personal repository set up, and general tips and tricks.

Setup

Novice

If you have no interest in setting up your own server, you can always use MyRepoSpace. It can be a little slow though.

Advanced

Cydia uses a Debian APT-like implementation to manage packages.

saurik's explanation

If you have no experience with Debian APT, you can read saurik's excellent writeup on the subject, which is pretty comprehensive.

Other explanations

http://patrickmuff.ch/blog/2013/02/15/create-your-own-cydia-repository-on-ubuntu/

https://github.com/WinneonSword/tutorial-repository

Quick and dirty summary

First thing is, you'll need a web host. It could be anything, like Neocities or GitHub pages.

Repository structure

The basic idea is that you have two files in your server, Packages and Release. These files can be bzipped to save bandwidth (i.e. Packages.bz2 and Release.bz2). Packages contains all of the information related to the different packages on your server (and where to download them, more on that later) and Release contains all of the information related to your server (like the name, description, etc).

If you want to see an example of a Packages and Release file, go to your sources in Cydia and find a repository hosted by a third party (a non-default source). Copy-paste the URL in your browser and append Release.bz2 (or Release if you get a 404) to the end. Same thing applies with Packages.

.deb files

The Packages file mentioned earlier points to .deb files in your server that you can download. These are made with dpkg-deb. Manpage here. The idea is that you set up a folder in the way you'd want the files to appear in your filesystem (and the DEBIAN folder, which would contain your control file, and optional preinst and postinst scripts) when it installs in Cydia, and then you'd use dpkg-deb -b folder_name to make the package (which will be named folder_name.deb).

Custom icon

Put the file CydiaIcon.png at the root of your repository.

Private repos

The easiest way to make your repository "private" is to restrict access based on UDID. Cydia sends the user's UDID via the HTTP_X_UNIQUE_ID HTTP header, so your server could check that against a database in order to ensure that the user has rightful access.

NOTE: Static webhosts like Neocities won't work for private repos. You'll need a server that has some way to let you process requests server-side, e.g. PHP, node.js, or Flask.

PHP implementation

A PHP implementation can be found here.