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

Deployment fixes #13

Merged
merged 11 commits into from
Aug 20, 2021
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ out/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/deploy/
/nbdist/
/.nb-gradle/

Expand Down
17 changes: 9 additions & 8 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ All relevant properties may be set via an environment variable.

.Custom property values
|===
|Namespace | Property | Env. Variable | Meaning
1.2+^.^| _upstream.bbb_ | service-url | BBB_UPSTREAM_URL | The base URL of the BBB server to create conferences with.
| shared-secret | BBB_UPSTREAM_SECRET | Shared secret token to compute a checksum of requests against the BBB servers API with. See: https://docs.bigbluebutton.org/dev/api.html#api-security[BBB API Specification]
1.2+^.^| _classroom_ | shared-secret | CLASSROOM_SECRET | Shared secret token a checksum of any request against the classrooms BBB-like API is computed with. Semantics as specified by BBB API linked above.
| url | CLASSROOM_URL | Base URL (including the port if not default protocol port), at which the Digital Classroom application is contacted by users. Default: http://localhost:8085
| _server_ | port | CLASSROOM_PORT | Server port at which this application will listen to HTTP requests Default: 8085
1.2+^.^| _jwt_ | secret | JWT_SECRET | The key JSON Web Tokens issued by the digital classroom are signed with.
| expiration | JWT_EXPIRATION | Number of seconds after which JWTs should expire. Default: 900 (15 minutes)
|Namespace | Property | Env. Variable | Meaning
1.2+^.^| _upstream.bbb_ | service-url | BBB_UPSTREAM_URL | The base URL of the BBB server to create conferences with.
| shared-secret | BBB_UPSTREAM_SECRET | Shared secret token to compute a checksum of requests against the BBB servers API with. See: https://docs.bigbluebutton.org/dev/api.html#api-security[BBB API Specification]
1.3+^.^| _classroom_ | host | CLASSROOM_HOST | Base URL (including the port if not default protocol port), at which the Digital Classroom application is contacted by users. Default: http://localhost:8085
| prefix-path | CLASSROOM_PREFIX_PATH | URI Path added by a proxy or similar applications to contact the digital-classroom from the internet. Default: "" (empty string)
| shared-secret | CLASSROOM_SECRET | Shared secret token a checksum of any request against the classrooms BBB-like API is computed with. Semantics as specified by BBB API linked above.
1.1+^.^| _server_ | port | CLASSROOM_PORT | Server port at which this application will listen to HTTP requests Default: 8085
1.2+^.^| _jwt_ | secret | JWT_SECRET | The key JSON Web Tokens issued by the digital classroom are signed with.
| expiration | JWT_EXPIRATION | Number of seconds after which JWTs should expire. Default: 900 (15 minutes)
|===
=== Jar Build & Deploy
The only requirement is a JDK with version 11 or later.
Expand Down
15 changes: 15 additions & 0 deletions deployment/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3'

services:
digital-classroom:
image: thmmniii/digital-classroom:latest
restart: always
environment:
- BBB_UPSTREAM_URL
- BBB_UPSTREAM_SECRET
- CLASSROOM_SECRET
- CLASSROOM_HOST
- CLASSROOM_PREFIX_PATH
- CLASSROOM_PORT
- JWT_SECRET
- JWT_EXPIRATION
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ services:
- BBB_UPSTREAM_URL
- BBB_UPSTREAM_SECRET
- CLASSROOM_SECRET
- CLASSROOM_URL
- CLASSROOM_HOST
- CLASSROOM_PREFIX_PATH
- CLASSROOM_PORT
- JWT_SECRET
- JWT_SECRET
- JWT_EXPIRATION
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ import javax.validation.constraints.NotBlank
data class ClassroomProperties(

/**
* Service url with protocol, hostname and optional prefix path.
* Service host with protocol and hostname / ip address
*/
@NotBlank val url: String,
@NotBlank val host: String,

/**
* Prefix path appended to the host. May be resolved via reverse proxy.
*/
val prefixPath: String = "",

@NotBlank val sharedSecret: String,

)
)
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ClassroomInstanceService(private val classroomProperties: ClassroomPropert
val joinedUser = classroom.joinUser(password, user)
val sessionToken = RandomStringUtils.randomAlphanumeric(16)
classroomUserDetailsRepository.insertValidToken(sessionToken, joinedUser)
val url = URL("${classroomProperties.url}/classroom/join?sessionToken=$sessionToken").toString()
val url = URL("${classroomProperties.host}${classroomProperties.prefixPath}/classroom/join?sessionToken=$sessionToken").toString()
it.success(
JoinRoomBBBResponse(
success = true,
Expand Down
12 changes: 10 additions & 2 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@ upstream:

classroom:
shared-secret: ${CLASSROOM_SECRET:8Dsupersecurekeydf0}
url: ${CLASSROOM_URL:http://localhost}
host: ${CLASSROOM_HOST:http://localhost}
prefix-path: ${CLASSROOM_PREFIX_PATH:}

server.port: ${CLASSROOM_PORT:8085}

server:
ssl:
enabled: true
key-store: ${KEYSTORE_PATH:classpath:keystore.p12}
key-store-password: passwd
key-store-type: PKCS12
port: ${CLASSROOM_PORT:8085}

jwt:
secret: ${JWT_SECRET:8Dsupersecurekeydf0}
Expand Down
Binary file added src/main/resources/keystore.p12
Binary file not shown.