dhis2-devs-core team mailing list archive
-
dhis2-devs-core team
-
Mailing list archive
-
Message #00405
Re: dhis.conf
For similar (tangentially related) configuration, I have used json.
See below. Either yaml or json (or even dreaded xml), I agree with
Jason that a bit of structure can be beneficial. Yaml syntax is maybe
the most forgiving for user editing by hand.
{
"dhis2Systems" : {
"hmis" : {
"type" : "dhis2",
"name": "hmis",
"baseUrl": "http://hmis:8080/hmis",
"user": "synch",
"password": "xxxxx"
},
"hietest" : {
"type" : "dhis2",
"name": "hietest",
"baseUrl": "http://dhis:8080/hietest",
"user": "synch",
"password": "xxxxx"
},
"datawarehouse" : {
"type" : "dhis2",
"name": "datawarehouse",
"baseUrl": "http://dhis:8084/datawarehouse",
"user": "synch",
"password": "xxxxx"
},
"healthfinance" : {
"type" : "dhis2",
"name": "healthfinance",
"baseUrl": "http://dhis:8083/healthfinance",
"user": "synch",
"password": "xxxxx"
},
"idsr" : {
"type" : "dhis2",
"name": "idsr",
"baseUrl": "http://idsr:8082/idsr",
"user": "synch",
"password": "xxxxx"
},
"rbc" : {
"type" : "dhis2",
"name": "rbc",
"baseUrl": "http://dhis:8081/rbc",
"user": "synch",
"password": "xxxxx"
}},
"otherSystems" : {
"resourceMapper": {
"type" : "resourceMapper",
"name": "facilityRegistry",
"baseUrl": "http://facilities.moh.gov.rw/collections/424/fred_api/v1",
"user": "rwsynch@xxxxxxxxx",
"password": "xxxxx"
}},
"roles" : {
"orgunitMaster" : "hmis",
"orgunitSlaves" : [ "idsr", "hietest","healthfinance","rbc","datawarehouse" ]
},
"datasetShare" : {
"epi" : {
"datasets": [ "VAC_RETURNS", "MIDWIFE_RETURNS" ],
"orgunitGroup": "epi",
"source": "tracker",
"destination": "dhims"
}
},
"pdo_dsns" : {
"hmis" : "pgsql:host=pgserver port=5432 dbname=hmis user=xxxx password=xxxxx"
}
}
On 11 November 2015 at 13:41, Jason Pickering
<jason.p.pickering@xxxxxxxxx> wrote:
> Hi Lars,
> Great idea, and I am sure it will be useful.
>
> Just to be a bit difficult as I usually am however.
>
> In some scripts (mostly Python) i have used YAML for these sorts of
> configurations. The advantage is it is pretty human readable, and yet more
> structured than plain text files, so it would be perhaps easier to allow
> people to edit the configuration through the UI, or diagnose what is wrong
> with the file. It would also allow for a more complex configuration file, if
> it is ever needed.
>
> This is what your config file would look like in YAML.
>
> ---
> database:
> dialect: org.hibernate.dialect.PostgreSQLDialect
> driver_class: org.postgresql.Driver
> password: xxxxx
> schema: update
> url: "jdbc:postgresql:dhis2"
> username: dhis
> encryptionKey: SomethingVerySecret
> filestore:
> container: dhis2-filestore
> identity: dhis2-id
> location: eu-west-1
> provider: filesystem
> secret: xxxx
> ldap:
> manager.dn: "cn=JohnDoe,ou=Country,ou=Admin,dc=hisp,dc=org"
> password: xxxx
> search.base: "dc=hisp,dc=org"
> search.filter: "(cn={0})"
> url: "ldaps://300.20.300.20:636"
> systemID: www.datim.org
>
> Not that much different really, and should be easily conveted into a Java
> object, maybe with something like https://bitbucket.org/asomov/snakeyaml.
>
> Regards,
> Jason
>
>
> On Wed, Nov 11, 2015 at 1:53 PM, Lars Helge Øverland <larshelge@xxxxxxxxx>
> wrote:
>>
>> A default full config file can be found here:
>>
>> https://github.com/dhis2/dhis2-utils/blob/master/resources/conf/dhis.conf
>>
>>
>>
>>
>> --
>> Mailing list: https://launchpad.net/~dhis2-devs-core
>> Post to : dhis2-devs-core@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs-core
>> More help : https://help.launchpad.net/ListHelp
>>
>
>
>
> --
> Jason P. Pickering
> email: jason.p.pickering@xxxxxxxxx
> tel:+46764147049
>
> --
> Mailing list: https://launchpad.net/~dhis2-devs-core
> Post to : dhis2-devs-core@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs-core
> More help : https://help.launchpad.net/ListHelp
>
Follow ups
References