March 25, 2016

Cubox-i/RPi2 OpenELEC 6.95.1 Beta (Kodi 16 Jarvis) Tvheadend client

I’ve just installed the first beta of OpenELEC 7 a.k.a. 6.95.1 with Kodi v16 Jarvis on my Cubox-i and RPi2. The Tvheadend service was updated and worked straight out of the box, unfortunately the client does not due to mismatching API versions. Following the steps outlined in this thread, i managed to compile an updated version: docker build mkdir -p ~/openelec/builds docker run -it --name imx6 -v ~/openelec/builds/:/builds damonmorgan/openelec-dependencies /bin/bash cd /builds/ git clone -b 6.95.1 https://github.com/OpenELEC/OpenELEC.tv.git cd OpenELEC.tv PROJECT=imx6 ARCH=arm ./scripts/create_addon pvr.hts Go and grab a huge can of as this is going to take a loooooooooooong while: Read more

March 17, 2016

Gitlab: grab the last succesful build artifact from CI

Uo to now, we can’t just download the latest succesful build of a project (see #4768). Therefore, i’m using the API to fetch an ordered list of all project builds in state “success” and filter for the last one. Using this ID, we can download the artifact via API. For more details, check this file. It needs some vars to work: BASE_URL PRIVATE_TOKEN PROJECT, you’ll find more info in the project README.

March 15, 2016

Push DEB packages from CI jobs to aptly repo

Now that we got aptly up and running, we can use it to upload packages. Practical example would be building packages in some CI (Jenkins, Gitlab, Travis, Drone, you-name-it, …), probably add some tests and then upload the package to a repo. Example can be found here in file upload-package.sh. Take notice of some variables being sourced inside .gitlab-ci.yml before ($PACKAGE_FILE, $ARCH, $DIST).

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