diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 95d5fc7ca61d7724d9e46cdaf4e9aa1c995d04f3..47a1efbad0ab7c2ce5cb3728c041a812242b4ce5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ image: docker:19.03.1 variables: DOCKER_TLS_CERTDIR: "/certs" IMAGE_TAG: $CI_REGISTRY_IMAGE - IMAGE_VER: 1.3.0 + IMAGE_VER: 1.4.0 services: - docker:19.03.1-dind diff --git a/lib/CF/Controller/Jitsi.pm b/lib/CF/Controller/Jitsi.pm new file mode 100644 index 0000000000000000000000000000000000000000..9ae967d43ecfaf8874e54fb49419a56547f2b382 --- /dev/null +++ b/lib/CF/Controller/Jitsi.pm @@ -0,0 +1,24 @@ +package CF::Controller::Jitsi; + +use Mojo::Base 'Mojolicious::Controller'; +use feature 'signatures'; +no warnings qw{ experimental::signatures }; + +sub url ($c) { + $c->openapi->valid_input or return; + + my $args = $c->req->json; + + $c->render( + status => 200, + openapi => { + url => $c->jitsi_url( + $args->{room} // $c->cfg->{jitsi_room}, + $args->{token_lifetime} // $c->cfg->{jitsi_token_lifetime}, + %{ $args }, + ) + }, + ); +}; + +1; diff --git a/openapi.yaml b/openapi.yaml index 84bd655669b2d2ae27e116df4cac5410c11c3ee6..1f3a9ea7aa17735a733611027ee384dcaef9b3a8 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: - version: 0.1.0 + version: 1.4.0 title: CF Online description: CF Online license: @@ -588,3 +588,41 @@ paths: 204: description: Status changed + /jitsi/url: + post: + x-mojo-to: jitsi#url + security: + - Bearer: ['chairman'] + tags: + - jitsi + summary: "Vygenerovat odkaz pro jitsi" + operationId: jitsiUrl + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + email: + type: string + avatar: + type: string + room: + type: string + token_lifetime: + type: integer + required: + - name + responses: + 200: + description: Jitsi url + content: + application/json: + schema: + type: object + properties: + url: + type: string + description: Jitsi meet url