Giter Club home page Giter Club logo

controlcenter's Introduction

Build Status

README

UPD89

upd89 is a system update management for debian based systems. It consists of two components: the control center (https://github.com/upd89/controlcenter) and agents (https://github.com/upd89/agent).

Control Center

Central web appliction for managing the connected agents and creating tasks for the systems.

Agent

Python-based component that runs as a daemon on each managed server and notifies the control center about new updates and receives tasks from the control center to install.

Dependencies

This application is based on "Ruby on Rails" (RoR).

Tested environment:

  • ruby-2.2.3
  • Rails 4.2.4
  • passenger 5.0.27 / Apache/2.4.7 (Ubuntu 14.04)
  • postgresql-9.3

To make sure you have the correct versions of ruby and rails as well as git and postgres installed, run the following:

$ ruby -v
$ rails -v
$ git --version
$ which psql

The result should ideally look like this:

$ ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
$ rails -v
Rails 4.2.4
$ git --version
git version 2.5.0
$ which psql
/usr/bin/psql

If you don't have a recent version of RoR, please have a look at the following installation guides:

Installation

git clone https://github.com/upd89/controlcenter.git
cd controlcenter
bundle install
rake db:create
rake db:migrate
rake db:base_data

Start the Server locally

rails server

You should now be able to visit a local instance on https:\localhost:3000

Control Center after initial setup

The initial rake task created a couple of users, most importantly admin (also doubles as email) with the password RF9wRF9w, with which you can log in.

Deployment on Apache

Setup Certificate authority:

  apt install easy-rsa
  make-cadir ca

Change the following entries (recommended) in ca/vars (with your own settings, of course):

  export KEY_SIZE=4096
  export KEY_COUNTRY="CH"
  export KEY_PROVINCE="ZH"
  export KEY_CITY="Zuerich"
  export KEY_ORG="UPD89"
  export KEY_EMAIL="[email protected]"
  export KEY_OU="Dev"

in ca/openssl-1.0.0.cnf, set the usage to both client and server so it can be used in both directions (there are 2 entries, so do this twice):

  extendedKeyUsage=serverAuth,clientAuth

Afterwards, set up your CA:

  cd ca
  export EASY_RSA="${EASY_RSA:-.}"
  . vars
  ./clean-all
  "$EASY_RSA/pkitool" --initca
  "$EASY_RSA/pkitool" --server cc.upd89.org
  "$EASY_RSA/pkitool" agent1.upd89.org
  "$EASY_RSA/pkitool" agent2.upd89.org
  "$EASY_RSA/pkitool" agent3.upd89.org

Follow this guide https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-passenger-and-apache-on-ubuntu-14-04

But: Use https://raw.githubusercontent.com/upd89/controlcenter/master/apache.conf.sample instead of the suggested content for the conf file and replace the following variables:

  $_HOSTNAME_ with your desired hostname (or localhost),
  $_ROOTDIR_ with the installation directory of the rails application,
  $_RAILSENV_ with the desired rails environment (e.g. development, production),
  $_SSLCERTFILE_ with the SSL certificate file (for the web interface)*,
  $_SSLKEYFILE_ with the SSL key file (for the web interface)*,
  $_SSLCHAINFILE_ with the SSL chain file (for the web interface)*,
  $_UPD89CA_ with the absolute path to ca/keys/ca.crt
  $_SSLAPICERTFILE_ with the SSL certificate file for the API (ca/keys/cc.upd89.org.crt),
  $_SSLAPIKEYFILE_ with the SSL key file for the API (ca/keys/cc.upd89.org.key)

* Recommendation: use letsencrypt ()

  sudo a2enmod rewrite  
  sudo a2enmod ssl
  sudo a2enmod passenger
  apache2ctl configtest
  sudo service apache2 restart

Now you should have a functioning web server, congratulations!

Configuration

To configure some view-related settings, you can change some variables in config/settings.yml. Each setting is commented and should be self-explanatory.

Database-related settings can be changed in config/database.yml

If you want some more example entries, you can run

rake db:sample_data

This will create a number of basic entries for systems, packages and others for testing purposes.

Base Data

Stuck?

If you're stuck, need help, have a problem or need some other assistance, there's always the how-to where some more detailed instructions can be found.

controlcenter's People

Contributors

pikooh avatar uelibo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

controlcenter's Issues

Deleting hosts with updatable packages does not work

If you try to delete a system which has updatable packages it crashes with a PG::ForeignKeyViolation.

Started DELETE "/systems/5" for 10.0.3.1 at 2016-10-28 15:20:05 +0200
Processing by SystemsController#destroy as HTML
  Parameters: {"authenticity_token"=>"Uk1Ypi8sOCKFeI+JQc5l4OM6bMM/RWj3UcnMN7zG7+ZzRsYHb9NcX2q6sZh72va8DbDXqO5UL1LqUyCKRBApeA==", "id"=>"5"}
  User Load (0.3ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1  [["id", 11]]
  System Load (0.2ms)  SELECT  "systems".* FROM "systems" WHERE "systems"."id" = $1 LIMIT 1  [["id", 5]]
  SystemGroup Load (0.3ms)  SELECT  "system_groups".* FROM "system_groups" WHERE "system_groups"."id" = $1 LIMIT 1  [["id", 9]]
  Role Load (0.2ms)  SELECT  "roles".* FROM "roles" WHERE "roles"."id" = $1 LIMIT 1  [["id", 5]]
   (0.1ms)  BEGIN
  SQL (1.7ms)  DELETE FROM "systems" WHERE "systems"."id" = $1  [["id", 5]]
PG::ForeignKeyViolation: ERROR:  update or delete on table "systems" violates foreign key constraint "fk_rails_0e3a405992" on table "concrete_package_versions"
DETAIL:  Key (id)=(5) is still referenced from table "concrete_package_versions".
: DELETE FROM "systems" WHERE "systems"."id" = $1
   (0.1ms)  ROLLBACK
Completed 500 Internal Server Error in 13ms (ActiveRecord: 2.8ms)

ActiveRecord::InvalidForeignKey (PG::ForeignKeyViolation: ERROR:  update or delete on table "systems" violates foreign key constraint "fk_rails_0e3a405992" on table "concrete_package_versions"
DETAIL:  Key (id)=(5) is still referenced from table "concrete_package_versions".
: DELETE FROM "systems" WHERE "systems"."id" = $1):
  app/controllers/systems_controller.rb:56:in `destroy'


  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_source.erb (6.9ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.9ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.0ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (27.1ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/_markup.html.erb (0.4ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.3ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.3ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.3ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/console.js.erb within layouts/javascript (20.0ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/main.js.erb within layouts/javascript (0.4ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.4ms)
  Rendered /var/www/upd89-web/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/web-console-2.3.0/lib/web_console/templates/index.html.erb (44.2ms)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.