Skip to content

Setup your own A.R.M Service

Phoenix Nemo edited this page Aug 25, 2013 · 11 revisions

Setup environment

System requirement

  • Linux OS server with 250GB of storage(1yr packages)
  • Bash & Rsync
  • Python 3.3+, distribute
  • Node.js 0.10.13+ with NPM
  • NGINX 0.7+

Setup Service

Package sync

A simple package sync script using rsync can be found here, change UPSTREAM and REPOS to fit your location and environment.

Note: Dont setup cronjob so hurry, leave it there and continue with next step.

Package management database

Make sure you have Python 3.3+ and distribute installed. setup will need setuptool package.

  1. Download archrepo2 0.3.1 at https://github.com/lilydjwg/archrepo2/archive/v0.3.1.tar.gz and extract to a temp directory.

  2. cd archrepo2, execute sudo python setup.py install as superuser. Note: you may have to use python3 instead of python in some distros.

  3. After setup archrepo2, archreposrv command should be available. Now edit archrepo.ini.example for your need, and move to /etc/repo-arm/archrepo.ini. If you just want a pre-written configuration, use this one.

A.R.M Package search service

Make sure you have Node.js 0.10.13+ with NPM support.

  1. Clone the app: git clone https://github.com/phoenixlzx/repo-arm-server.git

  2. Install dependencies: cd repo-arm-server && npm install

  3. Edit config.js.example, and rename to config.js.

NGINX

  1. Use these two NGINX configurations: https://github.com/archlinuxcn/repo-arm-server/tree/master/NGINX

  2. Edit them for your environment, then restart NGINX.

Note: Daily-repo functionality is awaiting implementation. You may have to update repo-arm-download.nginx.conf after we have made it.

Up and running

For servers, tmux/screen/byobu is recommended as SSH may be reset under some network.

  1. Sync your packages. It may take long time for first sync, so detach the session and have a rest. After it finished first sync, setup your sync schedule using cronjob (or other schedule tool).

  2. Start archrepo2, command archreposrv /etc/repo-arm/archrepo.ini. This may also spend long for first time (too many packages need to be written into database).

  3. Start repo-arm-server, in repo-arm-server directory do node app.js and it should up and running.

Now your A.R.M site is ready for use. If you run into any trouble, please open a new issue containing all your configurations.