Coder Social home page Coder Social logo

infonova / infocmdb Goto Github PK

View Code? Open in Web Editor NEW
10.0 5.0 5.0 33.4 MB

CMDB Solution based on PHP and MySQL, using a Workflow Engine based on GoLang and Perl

License: Apache License 2.0

PHP 60.85% HTML 1.58% Perl 1.18% Batchfile 0.01% Shell 0.08% Dockerfile 0.01% Roff 0.01% JavaScript 35.01% Hack 0.01% Ruby 0.01% TSQL 0.01% PowerShell 0.01% CSS 1.25% Haxe 0.01% Makefile 0.01% Nix 0.01% OpenSCAD 0.01% ABAP 0.01% ActionScript 0.03% Ada 0.01%
php7 golang cmdb zend-framework mysql phinx-migrations jquery docker docker-compose

infocmdb's Introduction

InfoCMDB

Build Status

Highly Customizable Configuration Management Database

InfoCMDB Slideshow

Screenshots

Overview

  • Granular AccessControl (RBAC)
  • Custom Configuration Items (CI)
  • Different Attribute Datatypes
  • Automation with Workflows using GoLang, Perl SDKs

Getting Started

To setup a new instance follow these steps for either production or development.

Prerequisites

  • linux x86
  • minimum hardware required of 2 cores and 4 gb ram
  • docker
  • docker-compose

Installing

Clone the infocmdb repository

git clone https://github.com/infonova/infocmdb

Start the infocmdb using the provided run command

./run up

This will perform all setup steps required to configure the Docker-Environment.

Running setup_env...
Create .env file...
Choose an IMAGE_TAG you want to use [Env: IMAGE_TAG][latest]: 
.env.example -> .env
Setting image tag: latest
Generating random Root Password
Generating random 'infocmdb' User Password
Running setup_nginx...
Choose hostname for nginx vhost [localhost]: infocmdb.prod.local
Set 'infocmdb.prod.local' as DOCKER_WEB_HOSTNAME in .env file
Running setup_docker...
Setting up docker override per environment.
Choose Environment [Env: COMPOSE_ENV] (prod/dev/test) [prod]: prod
  Creating symlink: docker-compose-prod.yml --> docker-compose.override.yml

Use this command to start application:
 ./run up 

Login at: http://infocmdb.prod.local || https://infocmdb.prod.local

SSL Certificate

Inside the web container you can add additional configuration in the /bootstrap/custom-conf directory.

Using the docker-compose for example:

    volumes:
      - "./docker/nginx/custom-conf:/bootstrap/custom-conf:ro"

Generate dhparams

To use ssl we generate a dhparam file to enable forward secrecy.

./run generate_dhparam                             
Running generate_dhparam...
Create Diffie Hellman param for nginx
Sending build context to Docker daemon  2.048kB
Step 1/2 : FROM alpine
 ---> b7b28af77ffe
Step 2/2 : RUN apk update &&   apk add --no-cache openssl &&   rm -rf /var/cache/apk/*
 ---> Using cache
 ---> ac67e96cd7fb
Successfully built ac67e96cd7fb
Successfully tagged openssl:latest
Generating DH parameters, 4096 bit long safe prime, generator 2
This is going to take a long time
.......... <this takes a long time> ...........

Generate self-signed-certificate and vhost configuration

./run gencert infocmdb.local                                    
Running generate_dhparam...
  Already exists 'docker/nginx/custom-conf/conf.d/ssl/dhparam.pem'.
Generating certificate for infocmdb.local
Generating a RSA private key
....................................++++
..........................................................................................................................++++
writing new private key to '/app/docker/nginx/custom-conf/conf.d/ssl/infocmdb_local.key'
-----
Saved certificate to docker/nginx/custom-conf/conf.d/ssl/infocmdb_local... key/crt
Created docker/nginx/custom-conf/conf.d/ssl_infocmdb_local.conf

RUN Commands

To automate tasks the ./run command can be used

####################
# infoCMDB Console #
####################

Utility for handling an infoCMDB installation

Usage:
  run <command> [--non-interactive] [--command-options] [<arguments>]
  run -h | --help

Options:
  -h --help           Display this help information.
  --non-interactive   Run without asking questions and apply configuration defaults

Help:
  run help [<command>]

Available commands:
  bash
  build
  clean_cache
  commands
  container_name
  cron
  data_backup
  data_import
  destroy
  down
  edit
  gencert
  help
  mysql
  mysql_backup
  mysql_dump
  mysql_import
  restart
  setup
  setup_all
  setup_docker
  setup_env
  setup_lib
  setup_nginx
  setup_nginx_ssl
  up
  update_run
  version

Backup

For creating backups of a running infoCMDB instance mysql and data can be dumped

Database (mysql)

THIS WILL DESTROY ALL EXISTING DATA!

./run mysql_backup
Completed mysqldump: dump-2019-10-30_152732.sql.gz
./run mysql_import dump-2019-10-30_152732.sql.gz

Volume Data (/app/data)

THIS WILL DESTROY ALL EXISTING DATA!

./run data_backup
Completed databackup: data-2019-10-30_152819.tar.gz
./run data_import data-2019-10-30_152819.tar.gz

Optional

Mountpoints / Directories

  • /app/data all working files are stored in this directory.
  • /app/data/configs is used to store all configuration files.

In case you want to directly interact with the cmdb data, for development or testing you can modify the mount point.

docker-compose.yml:

services:
...
  php:
    ...
    volumes:
      ...
      - "./<bind_directory_data>:/app/data:cached"
...

This is not recommended for productive environments and often leads to permission or performance issues on windows.

MySQL Database Port

If required it is possible to add an export for the mysql ports.

Either enable the option in the docker-compose.yml or add it to the docker-compose.override.yml:

version: "3.4"

services:
  mariadb:
    ports:
      - '${DOCKER_DB_PORT}:3306'

Set the DB_PORT in the .env file:

DB_PORT=3306

License

This project is licensed under the Apache License 2.0 - see LICENSE file for details.

Contact / Support

If you have any questions and prefer email, feel free to contact us at: [email protected]

infocmdb's People

Contributors

markooslaj avatar mmitteregger-bearingpoint avatar rwese avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

infocmdb's Issues

Installing Both latest tag and one tag lower is failing on a centos image

Step1: Cloned the repo - git clone -b v4.0.13 https://github.com/infonova/infocmdb.git (Tried with both latest and this version)
Step2: sudo ./run up
Running setup_env...
Create .env file...
Choose an IMAGE_TAG you want to use [Env: IMAGE_TAG][latest]: v4.0.13
‘.env.example’ -> ‘.env’
Setting image tag: v4.0.13
Generating random Root Password
Generating random 'infocmdb' User Password
Running setup_nginx...
Choose hostname for nginx vhost [Env: DOCKER_WEB_HOSTNAME][localhost]: localhost
Set 'localhost' as DOCKER_WEB_HOSTNAME in .env file
Running setup_docker....
Setting up docker override per environment.
Choose Environment [Env: COMPOSE_ENV] (prod/dev/test) [prod]: dev
Creating symlink: docker-compose-dev.yml --> docker-compose.override.yml

Use this command to start application:
./run up

starting up...
Building web
Step 1/10 : ARG COMPOSE_ENV_NGINX_VERSION
ERROR: Service 'web' failed to build: Please provide a source image with from prior to commit
Aborting due to errexit on line 954. Exit code: 1

Go workflow names cannot end with "_test"

When creating a go workflow that ends with "_test" the code can't be compiled.

The workflows are currently stored as <workflow_name>/<workflow_name>.go along with a test file <workflow_name>/<workflow_name>_test.go.
But because the files end _test go treats it as a test file:
go build <build_directory>: no non-test Go files in <build_directory>.

Suggestion:
The workflow name is already present in the directory name and the workflow file already contains a package main declaration, so the files should be named main.go and main_test.go.

Validation for a valid regex not done when creating/editing attribute

There does not seem to be a validation for a valid attribute regex.
Instead an error is shown while trying to create a CI with an attribute that has a invalid regex pattern.

Internal error while using the pattern '([A-Z]{1,10}))'
Exception information:

Message: Internal error while using the pattern '([A-Z]{1,10}))'
Stack trace:

#0 /app/library/composer/diablomedia/zendframework1-validate/src/Zend/Validate/Regex.php(77): Zend_Validate_Regex->setPattern('([A-Z]{1,10}))')
#1 [internal function]: Zend_Validate_Regex->__construct('([A-Z]{1,10}))')
#2 /app/library/composer/diablomedia/zendframework1-form/src/Zend/Form/Element.php(2155): ReflectionClass->newInstanceArgs(Array)
#3 /app/library/composer/diablomedia/zendframework1-form/src/Zend/Form/Element.php(1284): Zend_Form_Element->_loadValidator(Array)
#4 /app/library/composer/diablomedia/zendframework1-form/src/Zend/Form/Element.php(1356): Zend_Form_Element->getValidators()
#5 /app/library/composer/diablomedia/zendframework1-form/src/Zend/Form.php(2289): Zend_Form_Element->isValid('BP', Array)
#6 /app/application/modules/cmdb/controllers/CiController.php(776): Zend_Form->isValid(Array)
#7 /app/library/composer/diablomedia/zendframework1-controller/src/Zend/Controller/Action.php(495): CiController->createAction()
#8 /app/library/composer/diablomedia/zendframework1-controller/src/Zend/Controller/Dispatcher/Standard.php(297): Zend_Controller_Action->dispatch('createAction')
#9 /app/library/composer/diablomedia/zendframework1-controller/src/Zend/Controller/Front.php(931): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#10 /app/library/composer/diablomedia/zendframework1-application/src/Zend/Application/Bootstrap/Bootstrap.php(99): Zend_Controller_Front->dispatch()
#11 /app/library/composer/diablomedia/zendframework1-application/src/Zend/Application.php(385): Zend_Application_Bootstrap_Bootstrap->run()
#12 /app/public/index.php(139): Zend_Application->run()
#13 {main}

Request Parameters:

array (
  'controller' => 'ci',
  'action' => 'create',
  'formFinished' => '1',
  'sessionID' => 'CiController08dd7753ca202c90ed8509e0beb9e03770f35d3cef7ba35d6c8f3608b79f60bf',
  'module' => 'cmdb',
  'parentCiType' => '1',
  'child_1' => '4',
  'child_2' => '5',
  'project' => '1',
  'MAX_FILE_SIZE' => '209715200',
  'ciicon_delete' => '',
  'res_jira_project_key1' => 'BP',
  'res_jira_project_name2' => 'Bearing Point',
)

Ideally the regex pattern is validated when the attribute is saved.

Button and leave-alerts are inconsistent

Displayed buttons are inconsistent in their visibility and order.

Additionally the "Are you sure?"-type leave alerts are sometimes shown and other times not.
In my opinion they should always been shown if there were some edits or simply always be sown if the edited condition is hard to check. This prevents losing important work.

The following describes the current display:

Menu:

  • Create CI inside browsed CI Type
    • Buttons: [Save] [Cancel]
    • Cancel button alert: yes
  • Create CI from outer menu
    • Buttons: [Save] [Cancel]
    • Cancel button alert: yes
  • Create CI Type
    • Buttons: [Back] [Cancel] [Save] [Next]
    • Cancel button alert: no
  • Create Attribute
    • Buttons: [Back] [Cancel] [Save] [Next]
    • Cancel button alert: no
  • Create Relation Type
    • Buttons: [Cancel] [Save]
    • Cancel button alert: no
  • Create Attribute Group
    • Buttons: [Save]
    • Cancel button alert: not possible
  • Create Announcement
    • Buttons: [Save] [Cancel]
    • Cancel button alert: no
  • Create User
    • Buttons: [Back] [Cancel] [Save] [Next]
    • Cancel button alert: no
  • Create Role
    • Buttons: [Back] [Cancel] [Save] [Next]
    • Cancel button alert: no
  • Create Theme
    • Buttons: [Cancel] [Save]
    • Cancel button alert: no
  • Create Project
    • Buttons: [Cancel] [Save]
    • Cancel button alert: no
  • Create Workflow
    • Buttons: [Back] [Cancel] [Save] [Next]
    • Cancel button alert: no
  • Create Report
    • Buttons: [Back] [Cancel] [Save] [Next]
    • Cancel button alert: no
  • File Import
    • Buttons: [Abort] [Back] [Next] [Start]
    • Cancel button alert: no
  • Create Mailimport
    • Buttons: [Save]
    • Cancel button alert: not possible
  • Create Notification Template
    • Buttons: [Save]
    • Cancel button alert: not possible
  • Create Webservice
    • Buttons: [Save] [Cancel]
    • Cancel button alert: no
  • Edit Menu
    • Buttons: [Save] LINEBREAK [Cancel]
    • Cancel button alert: no

Some buttons are shown conditionally (f.e. [Next] only if there is a next tab), the list above states a button if it can be shown at the page at all. For example the "Create CI inside browsed CI Type" form could have tabs, but no [Back] or [Next] buttons are shown there ever.

What are other websites doing?

  • Github (New issue)
    [Submit new issue] button without any cancel button.
    Button is floating on the right.

  • Jira (Create Issue)
    [Create] on the left side. [Cancel] on the right.
    The [Cancel] button displays a alert.
    Buttons are displayed very differently with a strong focus on [Create].
    The buttongroup is floating on the right.

Error when clicking on history entry

Reproduce:
Go to the "History" menu.
Click on a CI ID.

Error:
image

Text:
exceptionInvalidParameter

Stacktrace:

WARN (4): Exception thrown while requesting /history/ci/historyId/68/: Exception_InvalidParameter in /app/application/modules/cmdb/controllers/HistoryController.php:138
Stack trace:
#0 /app/library/composer/diablomedia/zendframework1-controller/src/Zend/Controller/Action.php(495): HistoryController->ciAction()
#1 /app/library/composer/diablomedia/zendframework1-controller/src/Zend/Controller/Dispatcher/Standard.php(297): Zend_Controller_Action->dispatch('ciAction')
#2 /app/library/composer/diablomedia/zendframework1-controller/src/Zend/Controller/Front.php(931): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#3 /app/library/composer/diablomedia/zendframework1-application/src/Zend/Application/Bootstrap/Bootstrap.php(99): Zend_Controller_Front->dispatch()
#4 /app/library/composer/diablomedia/zendframework1-application/src/Zend/Application.php(385): Zend_Application_Bootstrap_Bootstrap->run()
#5 /app/public/index.php(139): Zend_Application->run()
#6 {main}

Cannot cancel creation of CI Type from 3rd tab onwards

Reproduce:

  • Go to the "Create CI Type" form
  • Select any tab starting from the 3rd one:
    • Add Attributes
    • Listview
    • Add Relations
  • Click on the cancel button while still on this tab

Interestingly this does not occur while on one of the first two tabs.

Actual:
Validation errors for missing values are displayed.

Expected:
"Create CI Type" form is closed.

CIs with attribute groups cannot be edited

Clicking on the edit button of a CI with attribute groups opens a blank page.

The following exception is logged:

NOTICE: PHP message: PHP Fatal error:  Uncaught TypeError: Argument 4 passed to Service_Ci_Update::getUpdateCiForm() must be of the type int or null, string given, called in /app/application/modules/cmdb/controllers/CiController.php on line 955 and defined in /app/application/services/Ci/Update.php:222
Stack trace:
#0 /app/application/modules/cmdb/controllers/CiController.php(955): Service_Ci_Update->getUpdateCiForm(11356, false, 'CiController113...', 'fragment-projec...', '0', '1')
#1 /app/library/composer/diablomedia/zendframework1-controller/src/Zend/Controller/Action.php(495): CiController->editAction()
#2 /app/library/composer/diablomedia/zendframework1-controller/src/Zend/Controller/Dispatcher/Standard.php(297): Zend_Controller_Action->dispatch('editAction')
#3 /app/library/composer/diablomedia/zendframework1-controller/src/Zend/Controller/Front.php(931): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#4 /app/library/composer/diablomedia/zendframework1-application/sr in /app/application/services/Ci/Update.php on line 222

The link is created here:

tab_selector.find("ul.ui-tabs-nav li a").click(function () {
var tab_index = $(this).attr("href").substr(1, $(this).attr("href").length);
$("#tab_index").text(tab_index);
var edit_link = $("#edit_link").attr("href");
edit_link = edit_link.substr(0, edit_link.indexOf("tab_index"));//complete url without everything after beginning of tab_index
$("#edit_link").attr("href", edit_link + "tab_index/" + tab_index);
});

Which produces in my case: http://infocmdb.local/ci/edit/ciid/11325/tab_index/fragment-project.
So the tab_index is the string fragment-project.

When clicking on the edit link the CiController then executes

$form = $ciServiceUpdate->getUpdateCiForm($ciId, $validate, $sessionID, $tabIndex, $ciTypeDto[Db_CiType::IS_ATTRIBUTE_ATTACH], parent::getUserInformation()->getId());

which is defined here:
public function getUpdateCiForm(int $ciId, bool $isValidate, string $sessionID, int $tabIndex = null, int $attributeAttach = null, int $userId = null)

and expects the $tabIndex to be a int instead of a string.

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.