Skip to content

n1koo/kansalaisaloite

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WHAT AND WHY

Kansalaisaloite.fi / Medborgarinitiative.fi is a web service for launching citizens’ initiatives and collecting statements of support for these initiatives. If an initiative gets 50000 statements of support the initiative’s organizer may submit the initiative to the Parliament for consideration.

The web service has been implemented by the Ministry of Justice Finland together with Solita Oy. The service went online on December 1st, 2012.

The Ministry of Justice decided to publish the source code for the software together with Solita Oy after the service has been in use for one year. Commit history prior to the source code publication is not provided, but future commits will be viewable.

Solita Oy is responsible for the future development of the software. Any pull-requests or suggestions for improvement to the source code are considered separately between the Ministry of Justice and Solita Oy. Reports for possible issues in the code might be rewarded. The Ministry of Justice will handle all the feedback sent to kansalaisaloite.om@om.fi.

LICENSE

Apache License 2.0, see COPYING and LICENSE

INSTALLATION

  • Download and install "Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7"

    • Overwrite US_export_policy.jar and local_policy.jar in JRE_HOME/lib/security
  • Set configuration password in ~/.initpass for Jetty user with minimal visibility. File should contain only password.

  • Default configuration properties are in src/main/resources/default.properties

    • You can override the parameters by creating src/main/resources/app.properties with the overriding parameters
  • These can be overridden in classpath:app.properties (e.g. src/test/resources/app.properties)

    • For passwords, sharedSecrets etc. you should use encrypt values (see DEVELOPMENT below and Jasypt)!
  • Development vs production dependencies are decided using Spring 3.1's environments/profiles (dev/prod)

    • Default profile prod is defined in web.xml
    • Default profile can be overridden by setting spring.profiles.active e.g. as environment variable or as -D startup parameter
    • dev profile uses dummy authentication
    • prod profile uses VETUMA authentication
  • Use initdb-xxx.sh to create local (unit) test and "production" databases (in Windows use Cygwin)

  • For database creation script, set Postgresql passwords for users "postgres", "initiative" and "initest" in ~/.pgpass, e.g.

    localhost:5432:*:postgres:<superuser password>

    localhost:5432:*:initiative:<application user password>

    localhost:5432:*:initest:1nitest

  • Create production DB in etc-folder using sh ./createdb.sh

    • Note that is system dependent. In Mac it's fi_FI.utf-8.
    • Script creates initiative user with password
  • BoneCP configuration: Add bonecp-config.xml into classpath (an example in etc/bonecp-config-sample.xml).

    • NOTE: Postgresql's max_connections should be > partitionCount + maxConnectionsPerPartition + 3

DEVELOPMENT

  • When DB schema is changed, update Querydsl model by running ExportQTypes (src/test) as application

    • Postgresql enum columns need to be configured in JdbcConfiguration.querydslConfiguration()
    • Querydsl model generated by ExportQTypes is in src/main/java/fi/om/initiative/sql
  • Encrypt your personal settings using EncryptablePropertiesConfigurer.

    • With Eclipse you should use "Run Configurations..." to set Program arguments:

      encrypt "${string_prompt:Message:}"

      with ~/.initpass password or with given password:

      encrypt "${string_prompt:Password:}" "${string_prompt:Message:}"

    • With CLI, use Maven:

    mvn exec:java -Dexec.mainClass="fi.om.initiative.conf.EncryptablePropertiesConfigurer" -Dexec.args="encrypt <message-to-be-encrypted>"

    • Encrypted values are defined in app.properties like this:

      property.key = ENC(Okbz86n6+NnffnKmAPhedp8DIi51zSVZa1Jx88ZthVI=)

  • VETUMA configuration should be encrypted in personal app.properties

About

Kansalaisaloite.fi / Medborgarinitiativ.fi

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE.md
Unknown
COPYING.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 47.9%
  • Java 46.3%
  • CSS 5.5%
  • Shell 0.3%