Pinto::Remote and Pinto::Server

Today I was glad to read that the successful merge of Pinto::Remote and Pinto::Server into its main Pinto repository made Pinto::Remote work again.

I wanted to know how difficult a setup of a Pinto server could become. The requirement behind was to access a single cpan-like repository for deploying server machines. The repository should contain company-provided distributions optionally combined with a collection of cpan-available distributions.

Installing perl-modules on a server should be as simple as

cpanm --mirror http://myrepo-server.de:port --installdeps .

If we had a cpan-like repository (possibly created using Pinto) somewhere we could run a simple PSGI application on the repo server

plackup -M Plack::App::File \
    -e 'Plack::App::File->new(root => "/path/to/repo")->to_app'

and we are ready to go, if we had the repository filled.

Filling a repository sitting in a given directory on a certain machine using remote shell commands is not very comfortable but this is where pintod comes into play. Accessing our repository for reading without authentication is OK, but adding distributions to the repository should be password-protected. Not really a problem.

First, a repository has to get created on the remote machine.

pinto -r /path/to/repo init

Then, we need a way to authenticate. I chose the option to use simple password authentication. The preparation of passwords could look like this:

htpasswd -c /path/to/htpasswd user

Now we are ready to launch the pinto daemon (for demonstration purpose not deamonized)

pintod --root=/path/to/repo --port 5555 --auth backend=Passwd --auth path=/path/to/htpasswd

Back on the developer's machine, we can now query or fill the remote repository. Setting the PINTOREPOSITORYROOT environment makes things easier, otherwise the "-r" option is required at every pinto command.

export PINTO_REPOSITORY_ROOT=http://user:secret@myrepo-server.de:5555
pinto list
pinto add --author SOMEBODY /path/to/dist-0.01.tar.gz

Dear admin at $work, I would like to get a VM for our pinto-server tomorrow :-)

Leave a comment

About Wolfgang Kinkeldei

user-pic I blog about Perl.