Skip to content

Commit

Permalink
SPSH-127 default developer keycloak and docs (#45)
Browse files Browse the repository at this point in the history
* copy dev realm

* Add keycloak to compose with default realm

* Auth login service with secret

* Update realm and config

* Update CI

* Pin keycloak version

* Add documentation

* Fix tests

* Fix keycloak-connect config
  • Loading branch information
marode-cap authored Oct 18, 2023
1 parent 7c45f2c commit 8377021
Show file tree
Hide file tree
Showing 13 changed files with 2,416 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reusable_job_nest_test_sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fileName: 'secrets.json'
fileDir: './config/'
# These are placeholder secrets without any significance
encodedString: ewogICAgIkRCIjogewogICAgICAgICJTRUNSRVQiOiAiVmVyeSBoaWRkZW4gc2VjcmV0IgogICAgfSwKICAgICJLRVlDTE9BSyI6IHsKICAgICAgICAiQURNSU5fU0VDUkVUIjogIkNsaWVudCBTZWNyZXQiCiAgICB9Cn0=
encodedString: ewogICAgIkRCIjogewogICAgICAgICJTRUNSRVQiOiAiVmVyeSBoaWRkZW4gc2VjcmV0IgogICAgfSwKICAgICJLRVlDTE9BSyI6IHsKICAgICAgICAiQURNSU5fU0VDUkVUIjogIkFkbWluLUNsaWVudCBTZWNyZXQiLAogICAgICAgICJDTElFTlRfU0VDUkVUIjogIkNsaWVudCBTZWNyZXQiCiAgICB9Cn0=
- name: Setup node
uses: actions/setup-node@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ We have the strategic goal SG-02 "stand-alone system". We want to succeed this g
1. Run `npm ci` to install all dependencies
2. Start the required services from the `compose.yaml` file
* db
* keycloak
3. Create a `.env` file and set the required environment variables from `env.config.ts`
4. run `npm run setup` to initialize the DB
5. Run `npm run start:debug` to start the server
Expand Down Expand Up @@ -59,6 +60,7 @@ We have the strategic goal SG-02 "stand-alone system". We want to succeed this g
* Git conventions can be found [here](./docs/git.md)
* Test conventions can be found [here](./docs/tests.md)
* Configuration conventions can be found [here](./docs/config.md)
* Authentication guides can be found [here](./docs/auth.md)

## Package (Create Docker Image )
If you push a tag upstream a container will be created for you. (Check Github under Packages)
Expand Down
13 changes: 13 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,16 @@ services:
environment:
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=admin
keycloak:
image: quay.io/keycloak/keycloak:22.0.3
environment:
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=admin
command:
- 'start-dev'
- '--import-realm'
ports:
- 8080:8080
- 8443:8443
volumes:
- ./dev-realm-spsh.json:/opt/keycloak/data/import/realm.json
10 changes: 6 additions & 4 deletions config/config.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
},
"KEYCLOAK": {
"BASE_URL": "http://127.0.0.1:8080",
"ADMIN_REALM_NAME": "master",
"ADMIN_CLIENT_ID": "admin-cli",
"REALM_NAME": "schulportal",
"CLIENT_ID": "schulportal"
"ADMIN_REALM_NAME": "SPSH",
"ADMIN_CLIENT_ID": "spsh-admin",
"REALM_NAME": "SPSH",
"CLIENT_ID": "spsh",
"ADMIN_SECRET": "44abDqJk2qgwRbpGfO0VZx7DpXeFsm7R",
"CLIENT_SECRET": "YDp6fYkbUcj4ZkyAOnbAHGQ9O72htc5M"
}
}
8 changes: 4 additions & 4 deletions config/config.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
},
"KEYCLOAK": {
"BASE_URL": "http://127.0.0.1:8080",
"ADMIN_REALM_NAME": "master",
"ADMIN_CLIENT_ID": "admin-cli",
"REALM_NAME": "schulportal",
"CLIENT_ID": "schulportal"
"ADMIN_REALM_NAME": "SPSH",
"ADMIN_CLIENT_ID": "spsh-admin",
"REALM_NAME": "SPSH",
"CLIENT_ID": "spsh"
}
}
Loading

0 comments on commit 8377021

Please sign in to comment.