Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/update documentation #23

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 47 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,55 @@

Add an email address for use in your [IRMA app](https://github.com/privacybydesign/irma_mobile).


## Setting up the server

1. Generate JWT keys for the issuer
### Prerequisite

Go, Gradle v4, JDK, Yarn, and an installation of IRMA server:

```bash
go install github.com/privacybydesign/irmago@latest
```

### Install

1. Clone repository
```bash
git clone [email protected]:privacybydesign/irma_email_issuer.git
cd irma_email_issuer/
```
2. Generate JWT keys for the issuer
```bash
./utils/keygen.sh ./src/main/resources/sk ./src/main/resources/pk
```
2. Copy the file `src/main/resources/config.sample.json` to
`build/resources/main/config.json` and modify it.
3. Run `gradle appRun` in the root directory of this project.
4. Navigate to `http://localhost:8080/irma_email_issuer/api/hello`
3. Build the project
```bash
gradle build
```
sanderhollaar marked this conversation as resolved.
Show resolved Hide resolved
4. Copy `src/main/resources/config.sample.json` to `build/resources/main/config.json` and modify it
```bash
cp src/main/resources/config.sample.json build/resources/main/config.json
sed -i 's/"secret_key": "",/"secret_key": "thisisjustavalueandnotarealsecretsomemorecharactersuntilwehave64",/' ./build/resources/main/config.json
```
5. Create front end
```bash
( cd webapp/
yarn install
./build.sh nl
cp webapp/config.example.js build/assets/config.js
sanderhollaar marked this conversation as resolved.
Show resolved Hide resolved
cp -a webapp/ src/main/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that final step is not needed to copy webapp to src/main, because the Java-part does not need it.

Copy link
Contributor Author

@sanderhollaar sanderhollaar Jul 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without the copy:

$ gradle appRun

> Task :appRun
You're running webapp in hard inplaceMode: Overlay and filtering features of gretty will be disabled!

11:21:35 WARN  Web application not found /tmp/irma_email_issuer/src/main/webapp
11:21:35 WARN  Failed startup of context o.a.g.JettyWebAppContext@5a709816{/irma_email_issuer,null,null}{/tmp/irma_email_issuer/src/main/webapp}
java.io.FileNotFoundException: /tmp/irma_email_issuer/src/main/webapp

```
6. Configure mail delivery in `build/resources/main/config.json`

### Run

1. Start IRMA server (in the root directory of this project)
```bash
~/go/bin/irma server --static-path ./webapp/build
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go install should add the binary to your PATH too, at least that's the case with me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to document that step or can we expect either the package manager or the reader to take care of that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you installed Go in a way that the ~/go/bin was not added to your PATH automatically, then it's probably better to either mention this or keep it the way you did it now.

2. Run the application
```bash
gradle appRun
```
3. Navigate to `http://localhost:8088/` with CORS disabled
(for example: `chromium --disable-web-security --user-data-dir=/tmp/chromium-disable-web-security`)
4 changes: 2 additions & 2 deletions webapp/config.example.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var config = {
IRMASERVER: '',
EMAILSERVER: '',
IRMASERVER: 'http://localhost:8088',
EMAILSERVER: 'http://localhost:8080/irma_email_issuer',
};