March 14, 2016

aptly CLI tool

As the Aptly API is well documented, you can implement your own client using curl/python/ruby/go/whatever or just use this one written in Ruby. Installation gem install aptly_cli Simply as that. If you want to read further and use your API with basic authentication, you can check if my pull request has been accepted or just build the gem on your own. Basic Authentication UPDATE 2016-03-16: PR accepted, just pull the official gem git clone -b basic-auth https://github.com/morph027/aptly_cli.git Read more

March 14, 2016

Protect aptly API with basic authentication

You should really protect your aptly API with at least basic authentication. This is easy to achive with a reverse proxy webserver like nginx or Apache. As you are going to transfer credentials then, you should also protect the whole thing with SSL. nginx Example snippet (most of this is misc. nginx and ssl setup, interesting bits tagged with ###): server { listen 80; server_name your.repo.org ; ### rewrite all non https traffic location /api/ { rewrite ^/(.*)$ https://$server_name$request_uri permanent; # enforce https } root /nowhere; } server { server_name your.repo.org; ssl on; listen 443 ssl http2; ssl_certificate /etc/letsencrypt/live/repo.org/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/repo.org/privkey.pem; ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-RC4-SHA:ECDHE-ECDSA-RC4-SHA:AES128:AES256:RC4-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK; ssl_prefer_server_ciphers on; root /nowhere; location ~ /\.ht { deny all; } ### protect /api with basic auth location /api/ { client_max_body_size 100M; auth_basic "Restricted"; auth_basic_user_file /etc/nginx/.htpasswd.aptly; proxy_redirect off; proxy_pass http://localhost:8080/api/; proxy_redirect http://localhost:8080/api/ /api; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header Origin ""; } } You can create a .htpasswd file using Read more

March 13, 2016

Setup aptly on Ubuntu

aptly is a swiss army knife for Debian repository management: it allows you to mirror remote repositories, manage local package repositories, take snapshots, pull new versions of packages along with dependencies, publish as Debian repository. You can try it right now just for free. aptly is available both as CLI tool and HTTP REST service. Nuff said, we want this ☺ Installation Aptly provides a repo (with an outdated key, do not wonder) to install the single binary (written in Go). Read more
#go

March 12, 2016

Lightweight Git Service and CI

In cases, where keeping code private (as in never never let it leave your storage/network) and you don’t want to host a full-blown Gitlab instance, just have a look at Gogs and Drone. Both projects are written in Go, which runs very fast even on low performance systems (i.e. a RPi or something similar).

February 24, 2016

Quick Note: ssh+tar+lzop to quickly copy over network

You need lzop installed ;) from target host ssh $user@$source-host tar --use-compress-program=lzop -cf - /source/folder | tar --use-compress-program=lzop -xf - from source host cd /source/folder tar --use-compress-program=lzop -cf - . | ssh $user@$target-host tar -C /target/folder --use-compress-program=lzop -xf -