Skip to content

rwelin/BokBytarAppenServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

112 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BokBytarAppen Server

This project provides the server functionality of the BokBytarAppen app.

Follow these steps to get started:

  1. Git-clone this repository.

     $ git clone git://github.com/nilewapp/BokBytarAppenServer
    
  2. cd into the project directory

     $ cd BokBytarAppenServer
    
  3. Copy application.conf.example to /src/main/resources/application.conf

     $ cp ./src/main/resources/application.conf.example ./src/main/resources/application.conf
    
  4. Launch SBT:

     $ sbt
    
  5. Launch the scala console and initialize the database:

     > console
     scala> com.mooo.nilewapps.bokbytarappen.server.DBManager.init
     scala> :quit
    
  6. Start the application:

     > re-start
    
  7. Access the application at https://localhost:8443/<service from Service.scala> in any web browser.

  8. Stop the application:

     > re-stop
    

Running tests

Some tests are dependent on a test database. The instructions below explains how to do this.

  1. Copy application.conf.example to /src/test/resources/application.conf

     $ cp ./src/main/resources/application.conf.example ./src/main/resources/application.conf
    
  2. Launch SBT

     $ sbt
    
  3. Launch the scala test console and initialize the database:

     > test:console
     scala> com.mooo.nilewapps.bokbytarappen.server.DBManager.init
     scala> :quit
    
  4. After this initial setup is done, the tests can be executed:

     > test
    

Using the Server with the app

  1. Follow the instructions listed in the app repository README

  2. cd into the server project directory

  3. Download the following jar in order to be able to generate the truststores: bcprov-jdk16-146.jar

  4. Generate trust stores and certificates

     $ ./tools/gentruststores "<your password>" <path to bcprov jar>/bcprov-jdk16-146.jar
    
  5. Copy the generated file keystore.jks to /src/main/resources/ or the location of your choice

  6. Update application.conf to contain correct path to keystore.jks and the password that you choose for it (Note: if you copied the keystore into /src/main/resources/ the default path is correct)

     ...
     truststore {
       path = <path to keystore.jks>
       pass = <your password>
     }
     ...
    
  7. Copy the file generated by gentruststores called public_truststore.bks to <app directory>/res/raw/

  8. Add the password in <app directory>/res/values/strings.xml or the file of your choosing (e.g. /res/values/secret.xml)

     ...
     <string name="truststore_password">your password</string>
     ...
    
  9. Update the url to the server in <app directory>/res/values/server.xml

     ...
     <string name="server_url">https://yourdomain.com:8443/</string>
     ...
    

Copyright and license

Copyright 2013 Robert Welin

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages