<commit_before># rh-dropwizard-alexa
Alexa with Dropwizard for Java Speechlets

Preperation for Development
===========================

To test your application with the Alexa test environment provided by devlopers.amazon.com, you can redirect all the request to your local machine. Therefore you 
need a ssl certificate, portforwarding from you router to your machine (443 --> 8443) and optionally a dyndns.


Certificate
-----------

Create a new folder ("cert").
> mkdir cert

> cd cert

Generate an RSA private key.
> openssl genrsa -out private-key.pem 2048

Create a new file called configuration.cnf
> touch configuration.cnf

Copy, paste and adjust the following to the configuration.cnf file:
```
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no

[req_distinguished_name]
C = DE
ST = B
L = Berlin
O = MyCompanyIsCool
CN = My Awesome Skill

[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @subject_alternate_names

[subject_alternate_names]
DNS.1 = home.dyndns.example.com
```

> openssl req -new -x509 -days 365 
             -key private-key.pem 
             -config configuration.cnf 
             -out certificate.pem

> openssl pkcs12 -export -in certificate.pem -inkey private-key.pem -out pkcs.p12 -name cert -password <PASSWORD>:<PASSWORD>

Generate the keystore with keytool:

> keytool -deststorepass password1 -importkeystore -destkeypass password1 
  -destkeystore keystore.jks -srckeystore pkcs.p12 -srcstoretype 
  PKCS12 -srcstorepass <PASSWORD> -alias cert


Put the keystore.jks into project root and set password in src/dist/config.yml
> cp keystore.jks ../

> cd ..

> nano src/dist/config.yml

Run the application
> gradle run

Test the server by calling: [https://0.0.0.0:8443/](https://0.0.0.0:8443/)<commit_msg>Updated README gradlew<commit_after># rh-dropwizard-alexa
Alexa with Dropwizard for Java Speechlets

Preperation for Development
===========================

To test your application with the Alexa test environment provided by devlopers.amazon.com, you can redirect all the request to your local machine. Therefore you 
need a ssl certificate, portforwarding from you router to your machine (443 --> 8443) and optionally a dyndns.


Create Certificate
------------------

Create a new folder ("cert").
> mkdir cert

> cd cert

Generate an RSA private key.
> openssl genrsa -out private-key.pem 2048

Create a new file called configuration.cnf
> touch configuration.cnf

Copy, paste and adjust the following to the configuration.cnf file:
```
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no

[req_distinguished_name]
C = DE
ST = B
L = Berlin
O = MyCompanyIsCool
CN = My Awesome Skill

[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @subject_alternate_names

[subject_alternate_names]
DNS.1 = home.dyndns.example.com
```

> openssl req -new -x509 -days 365 
             -key private-key.pem 
             -config configuration.cnf 
             -out certificate.pem

> openssl pkcs12 -export -in certificate.pem -inkey private-key.pem -out pkcs.p12 -name cert -password <PASSWORD>:<PASSWORD>

Generate the keystore with keytool:

> keytool -deststorepass password1 -importkeystore -destkeypass password1 
  -destkeystore keystore.jks -srckeystore pkcs.p12 -srcstoretype 
  PKCS12 -srcstorepass password1 -alias cert


Put the keystore.jks into project root and set password in src/dist/config.yml
> cp keystore.jks ../

> cd ..

> nano src/dist/config.yml


Run the application
-------------------

Run the application
> ./gradlew run

or if you have gradle installed
> gradle run

Test the server by calling: [https://0.0.0.0:8443/](https://0.0.0.0:8443/)
{'fraction_non_alphanumeric': 0.10441448585778483, 'fraction_numerical': 0.026169706582077717, 'mean_word_length': 3.6831683168316833, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 33, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '433825', 'n_tokens_mistral': 1294, 'n_tokens_neox': 1169, 'n_words': 401}