All Projects → umputun → updater

umputun / updater

Licence: MIT license
Simple web-hook based receiver executing things via HTTP request

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to updater

PATCH
The PATCH repository for issues tracking, wiki and shared material.
Stars: ✭ 34 (-55.84%)
Mutual labels:  updates, update-service
MacOS-All-In-One-Update-Script
Mac update shell script (Appstore, macOS, Homebrew and others)
Stars: ✭ 39 (-49.35%)
Mutual labels:  updates
Hazel
Lightweight update server for Electron apps
Stars: ✭ 2,597 (+3272.73%)
Mutual labels:  updates
Wesng
Windows Exploit Suggester - Next Generation
Stars: ✭ 2,675 (+3374.03%)
Mutual labels:  updates
Creators.TF-Community-Launcher
The Creators.TF Community Launcher is a launcher created to help install and update mod content for TF2.
Stars: ✭ 49 (-36.36%)
Mutual labels:  updates
AutoSPSourceBuilder
A utility for building / slipstreaming SharePoint 2010 / 2013 / 2016 / 2019 / SE installation sources w/ prerequisites, service packs, language packs & cumulative/public updates. To quickly download and install this script, run 'Install-Script AutoSPSourceBuilder'
Stars: ✭ 65 (-15.58%)
Mutual labels:  updates
coo
Schedule Twitter updates with easy
Stars: ✭ 44 (-42.86%)
Mutual labels:  updates
upkit
UpKit: Software Updates for Internet of Things devices
Stars: ✭ 44 (-42.86%)
Mutual labels:  updates
taze
🥦 A modern cli tool that keeps your deps fresh
Stars: ✭ 682 (+785.71%)
Mutual labels:  updates
apt-update-indicator
Apt Update Indicator
Stars: ✭ 38 (-50.65%)
Mutual labels:  updates
arch-audit-gtk
Arch Linux Security Update Notifications
Stars: ✭ 44 (-42.86%)
Mutual labels:  updates
mihdan-disable-aggressive-updates
Плагин под WordPress для ускорения админки путём отключения агрессивных проверок обновлений
Stars: ✭ 21 (-72.73%)
Mutual labels:  updates
Ouroboros
Automatically update running docker containers with newest available image
Stars: ✭ 1,474 (+1814.29%)
Mutual labels:  update-checker
Watchtower
A process for automating Docker container base image updates.
Stars: ✭ 9,526 (+12271.43%)
Mutual labels:  update-checker
Appupdate
🚀 Android 版本更新 🚀 a library for android version update 🚀
Stars: ✭ 3,375 (+4283.12%)
Mutual labels:  update-checker
Ketarin
Ketarin - application download helper
Stars: ✭ 89 (+15.58%)
Mutual labels:  update-checker
piu
Cross platform package manager wrapper
Stars: ✭ 33 (-57.14%)
Mutual labels:  update-checker
CrowsNest
Watchtower for Git: automatically keep local Git repositories up to date with their remotes
Stars: ✭ 59 (-23.38%)
Mutual labels:  update-checker
SilentUpdate
⤴️基于Kotlin的静默更新应用库 A library silently & automatically download latest apk to update your App
Stars: ✭ 15 (-80.52%)
Mutual labels:  update-service
Updater | Simple Remote Updater

Updater is a simple web-hook-based receiver executing things via HTTP requests and invoking remote updates without exposing any sensitive info, like ssh keys, passwords, etc. The updater is usually called from CI/CD system (i.e., Github action), and the actual http call looks like curl https://<server>/update/<task-name>/<access-key>. Alternatively, the updater can be called with POST method and the payload can be passed as JSON, i.e. curl -X POST -d '{"task":"remark42-site", "secret":"123456"}' https://example.com/update

List of tasks defined in the configuration file, and each task has its custom section for the command.


Build Status  Coverage Status

Example of updater.yml:

tasks:

  - name: remark42-site
    command: |
      echo "update remark42-site"
      docker pull ghcr.io/umputun/remark24-site:master
      docker rm -f remark42-site
      docker run -d --name=remark42-site

  - name: feed-master
    command: |
      echo "update feed-master"
      docker pull umputun/feed-master
      docker restart feed-master

By default the update call synchronous but can be switched to non-blocking mode with async query parameter, i.e. curl https://example.com/update/remark42-site/super-seecret-key?async=1. To request the async update with POST, async=true should be used in the payload, i.e. curl -X POST -d '{"task":"remark42-site", "secret":"123456", "async":true}' https://example.com/update

Install

Updater distributed as multi-arch docker container as well as binary files for multiple platforms. Container has the docker client preinstalled to allow the typical "docker pull & docker restart" update sequence.

Containers available on both github container registry (ghcr) and docker hub

This is an example of updater usage inside of the docker compose. It uses reproxy as the reversed proxy, but any other (nginx, apache, haproxy, etc) can be used as well.

services:
  
  reproxy:
    image: ghcr.io/umputun/reproxy:master
    restart: always
    hostname: reproxy
    container_name: reproxy
    logging: &default_logging
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
    ports:
      - "80:8080"
      - "443:8443"
    environment:
      - TZ=America/Chicago
      - DOCKER_ENABLED=true
      - SSL_TYPE=auto
      - [email protected]
      - SSL_ACME_FQDN=jess.umputun.com,echo.umputun.com
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./var/ssl:/srv/var/ssl

  echo:
    image: ghcr.io/umputun/echo-http
    hostname: echo
    container_name: echo
    command: --message="echo echo 123"
    logging: *default_logging
    labels:
      reproxy.server: 'echo.umputun.com'
      reproxy.route: '^/(.*)'

  updater:
    image: ghcr.io/umputun/updater:master
    container_name: "updater"
    hostname: "updater"
    restart: always
    logging: *default_logging
    environment:
      - LISTEN=0.0.0.0:8080
      - KEY=super-secret-password
      - CONF=/srv/etc/updater.yml
    ports:
      - "8080"
    volumes:
      - ./etc:/srv/etc
      - /var/run/docker.sock:/var/run/docker.sock
    labels:
      reproxy.server: 'jess.umputun.com'
      reproxy.route: '^/(.*)'

Working with docker-compose

For a simple container, started with all the parameters manually, the typical update sequence can be as simple as "kill container and recreate it", however docker compose-based container can be a little trickier. If user runs updater directly on the host (not from a container) the update command can be as trivial as "docker-compose pull && docker-compose up -d ". In case if updater runs from a container the simplest way to do the same is "ssh user@bridge-ip docker-compose ...". To simplify the process the openssh-client already preinstalled.

This is an example of ssh-based updater.yml

tasks:

  - name: remark42-site
    command: |
      echo "update remark42-site with compose"
      ssh [email protected] "cd /srv && docker-compose pull remark42-site && docker-compose up -d remark42-site"

  - name: reproxy-site
    command: |
      echo "update reproxy-site"
      ssh [email protected] "cd /srv && docker-compose pull reproxy-site && docker-compose up -d reproxy-site"

Creating user for SSH connection from updater

# updater container uses user app so it would be convinient to connect using the same name
sudo useradd -m -d /home/app -s /bin/bash app
sudo usermod -a -G docker app
sudo su - app
ssh-keygen -t ed25519 -N '' -f ~/.ssh/id_rsa -C updater
mv .ssh/id_rsa.pub .ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
# proper user and group for private key to be used inside the container
chown 1001:1001 ~/.ssh/id_rsa
logout
# then attach /home/app/.ssh/id_rsa to a /home/app/.ssh/id_rsa on the container where updater runs if necessary

Other use cases

The main goal of this utility is to update containers; however, all it does is the remote activation of predefined commands. Such command can do anything user like, not just "docker pull && docker restart." For instance, it can be used to schedule remote jobs from some central orchestrator, run remote cleanup jobs, etc.

All parameters

  -f, --file=         config file (default: updater.yml) [$CONF]
  -l, --listen=       listen on host:port (default: localhost:8080) [$LISTEN]
  -k, --key=          secret key [$KEY]
  -b, --batch         batch mode for multi-line scripts
      --limit=        limit how many concurrent update can be running (default: 10)
      --timeout=      for how long update task can be running (default: 1m)
      --update-delay= delay between updates (default: 1s)
      --dbg           show debug info [$DEBUG]

Help Options:
  -h, --help    Show this help message

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].