Giter VIP home page Giter VIP logo

dhis2-tools's Introduction

DHIS2 logo

DHIS2 tools package

Contains scripts and documentation for installing and managing DHIS2 in production settings.

The traditional dhis2-tools ubuntu package. Only suitable for small installations where security and scalability are not paramount.

Next generation tools. Recommended for use in most settings. With an emphasis on security, monitoring and scaling.

dhis2-tools's People

Contributors

bobjolliffe avatar ebichete avatar janhenrikoverland avatar jason-p-pickering avatar simjes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dhis2-tools's Issues

Building manual pages on Ubuntu 16.04

When running make for the manual pages on Ubuntu 16.04 the generated pages will have indents that should not be there. This will make the man pages look bad.

This is not a problem when building the package on 14.04 for the 16.04 distro.
The PPA version for 16.04 is not affected.

Problem with xsltproc and docbook-xsl on 16.04?

support dhis.conf

By default tools generate hibernate.properties. Need to upgrade support for dhis.conf, including database encryption target

phppgadmin

recipe for phppgadmin

users generally want to maintain or have access to the database backend.
what I have done is allow apt-get install phppgadmin to do what it naturally does (install Apache2)
then set Apache2 to a 808x port, then proxy the apache instance via nginx, but warning there are all kinds of URL path problems that may result if users go beyond simple /foo directory proxy.
having this set up allows users to also add any other ubuntu native programs they might like, and, assuming the program is not in / but /foo URL space it should just work.
automate something like this into dhis2-pgadmin-install ??
default php.ini is poorly configured for phppgadmin. It needs to have timeouts and session transfer data size adjusted upwards for things to work.

unique name for /tmp/dhis2.war download.

For training scenarios, on one server, you may want to deploy more than one DHIS2 instance at the same time

currently the dhis2-deploy-war uses the SAME /tmp/dhis2.war filename. therefore if the deploy script is run more than once, the download will step on one another. fix the file name in /tmp so that it is unique.
keep the war file somewhere and before downloaded compare md5 keys. only download if necessary

instance pid process not removed/killed

When you issue dhis2-shutdown instancename followed by dhis2-startup instancename, the instance fails sometimes since the process is not removed.It shows that the pid XXXX process is still running.

The quick fix is to kill the process manually and then issue dhis2-startup again

copyright notice is wrong

Copyright notice under /usr/share/doc/dhis2-tools/copyright needs to be changed. It apears to have been copied from tomcat7-user

dhis2-instance-restore

from #2

dhis2-instance-restore

allows for restoration of a full working DHIS2 instance file (created by dhis2-instance-backup) to be restored and turned on
allows for one-step re-deployment of instance.
optionally allow instance to be renamed on re-deployment

dhis2-remove-instance

from #2

dhis2-remove-instance
cleans up user, data bases, /var/lib/dhis2/xx files, crontabs etc
the rm -rf of the dhis2-tools world

Allow dhis2-admins to access backup files without using sudu

Use case 1:
A dhis2-admin user wants to download the backup files located in /var/lib/dhis2/dhis/backups, or generate and download an ad-hoc db backup generated by the dhis () user.

Problem. Currently the dhis2-admins don't have access to files in the backups/ folder, so the only way right now is to use sudo. And ad-hoc backup can be taken using "sudo -u dhis pg_dump XXX", but this file must be written to a folder where the dhis user has access (not possible to write the backup to /home/), and the dhis2-admin user will not have access to that location.

dhis2-instance-backup

from #2

dhis2-instance-backup

creates a FULL backup (database, tomcat files etc) for a running DHIS2 instance.
package this up into a tar.gz with meta data files, datetimestamp etc.
optional password encrypt file?

dhis2-list-instances

from: #2
dhis2-list-instances
similar to ps command
returns all instances, the tcp port they are running on, their running state have a flag in each directory letting dhis2-tools know if an instance is managed by dhis2-tools, or not. thereby allowing foreign, custom-configured instances to be installed.

problems with instance names with dashes

There are problems with dhis2-instance-create when instance name contains dashes with postgreSQL 9.5. These are not properly escaped and script generates an error.

dhis2-tools, observations after use with Sudan

Bob,
Bob -reposting here on your suggestion from email:

I've made a laundry list of potential/suggested additions to the dhis2tools. I wonder your thoughts on these and if you have considered them before.

dhis2-list-instances
similar to ps command
returns all instances, the tcp port they are running on, their running state have a flag in each directory letting dhis2-tools know if an instance is managed by dhis2-tools, or not. thereby allowing foreign, custom-configured instances to be installed.

dhis2-remove-instance
cleans up user, data bases, /var/lib/dhis2/xx files, crontabs etc
the rm -rf of the dhis2-tools world

nginx auto config for instances

  • improve nginx setup so that creating an instance optionally adds appropriate lines to the /etc/nginx/sites-enabled/dhis2 script to automatically enable proxying
  • implement this using a nginx template file, which can further be customised. concat together a new conf file on each run.

nginx http behaviour

  • install ssi module for nginx by default
  • install gz module for nginx by default
  • create a default index.html file for the HTTP requests
  • create a default directory in HTTP space for option splash screens welcome pages. e.g. see http://www.his.gov.sd
  • dhis2-instance-* scripts should maintain ssi snip for inclusion into the index.html listing all DHIS2 instances on the system with appropriate links (html to have named
    tags for CSS)
  • (optionally) also make a link to the log files and allow the catalina.out for each instance to be quickly seen on the web (good for training, testing)
  • (optionally) allow a directory for static files (as emailed earlier) to have a consistent way to deal with the logos, images

dhis2-instance-backup

  • creates a FULL backup (database, tomcat files etc) for a running DHIS2 instance.
  • package this up into a tar.gz with meta data files, datetimestamp etc.
  • optional password encrypt file?

dhis2-instance-restore

  • allows for restoration of a full working DHIS2 instance file (created by dhis2-instance-backup) to be restored and turned on
  • allows for one-step re-deployment of instance.
  • optionally allow instance to be renamed on re-deployment

dhis2-instance-rename

  • allows a DHIS2 instance to be renamed. changes the name of the associated user, database and web application location

recipe for phppgadmin

  • users generally want to maintain or have access to the database backend.
  • what I have done is allow apt-get install phppgadmin to do what it naturally does (install Apache2)
    then set Apache2 to a 808x port, then proxy the apache instance via nginx, but warning there are all kinds of URL path problems that may result if users go beyond simple /foo directory proxy.
  • having this set up allows users to also add any other ubuntu native programs they might like, and, assuming the program is not in / but /foo URL space it should just work.
  • automate something like this into dhis2-pgadmin-install ??
  • default php.ini is poorly configured for phppgadmin. It needs to have timeouts and session transfer data size adjusted upwards for things to work.

Set up a consistent way to manage the http_proxy, https_proxy and ftp_proxy environment variables so that wget and git work properly

  • implies fixing up install.sh
  • war file deployment script

For training scenarios, on one server, you may want to deploy more than one DHIS2 instance at the same time

  • currently the dhis2-deploy-war uses the SAME /tmp/dhis2.war filename. therefore if the deploy script is run more than once, the download will step on one another. fix the file name in /tmp so that it is unique.
  • keep the war file somewhere and before downloaded compare md5 keys. only download if necessary

sudoers file is too liberal

In order to allow dhis2-create-instance and dhis2-delete-instance to "work" %dhis2admin users are currently allowed to create and delete users and kill processes as root. This is unecessary privilege.

nginx improvements

from #2

nginx http behaviour

install ssi module for nginx by default
install gz module for nginx by default
create a default index.html file for the HTTP requests
create a default directory in HTTP space for option splash screens welcome pages. e.g. see http://www.his.gov.sd
dhis2-instance-* scripts should maintain ssi snip for inclusion into the index.html listing all DHIS2 instances on the system with appropriate links (html to have named
tags for CSS)
(optionally) also make a link to the log files and allow the catalina.out for each instance to be quickly seen on the web (good for training, testing)
(optionally) allow a directory for static files (as emailed earlier) to have a consistent way to deal with the logos, images

Some manpages are missing

W: dhis2-tools: binary-without-manpage usr/bin/dhis2-backup
W: dhis2-tools: binary-without-manpage usr/bin/dhis2-integrity
W: dhis2-tools: binary-without-manpage usr/bin/dhis2-nginx
W: dhis2-tools: binary-without-manpage usr/bin/dhis2-restoredb

proxy env variables

Set up a consistent way to manage the http_proxy, https_proxy and ftp_proxy environment variables so that wget and git work properly

implies fixing up install.sh
war file deployment script

Stop bundling snakeoil certs, possibly replace with 'Let's encrypt' integration.

We aren't doing anyone any favours by bundling the snakeoil certs on install: they are useless for production and https is unnecessary for dev/training, especially since browsers complain pretty loudly about fake certs.

If we need to bundle an HTTPS setup we could (optionally) include a setup for Let's encrypt which issues free 3 month certificates and comes with client software to enable pain free auto-renewal. This solution provides free and painless LEGIT certificates for the DHIS2 instance.

Of course, the cert needs to be configured for an actual domain, which makes the whole ordeal a bit more complicated... Maybe writing a short guide setup with dhis2/nginx would suffice?

dhis2-instance-rename

from #2

dhis2-instance-rename

allows a DHIS2 instance to be renamed. changes the name of the associated user, database and web application location

dhis2-deploywar - default is dangerous

To suggestions to make dhis2-deploywar a bit safer:

  • specifying instance should be required
  • provide warning if the number or order of parameters are wrong

Example:
dhis2-deploywar staging -l https://www.dhis2.org/download/releases/2.25/dhis.war

This would deploy the latest stable build, not 2.25 (because option is before instance). Note that for dhis2-restoredb instance name is expected to come first, before file name.

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.