openvidu-test-browsers: CustomWebhook own properties file

pull/370/head
pabloFuente 2019-10-14 12:10:30 +02:00
parent 7224ac8968
commit 7468e4d73d
4 changed files with 23 additions and 6 deletions

View File

@ -67,6 +67,11 @@
<artifactId>spring-boot-starter-web</artifactId>
<version>${version.spring-boot}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>${version.spring-boot}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>

View File

@ -17,7 +17,6 @@
package io.openvidu.test.browsers.utils;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
@ -27,11 +26,14 @@ import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -52,9 +54,8 @@ public class CustomWebhook {
public static void main(String[] args, CountDownLatch initLatch) {
CustomWebhook.initLatch = initLatch;
SpringApplication app = new SpringApplication(CustomWebhook.class);
app.setDefaultProperties(Collections.singletonMap("server.port", "7777"));
CustomWebhook.context = app.run(args);
CustomWebhook.context = new SpringApplicationBuilder(CustomWebhook.class)
.properties("spring.config.location:classpath:aplication-pro-webhook.properties").build().run(args);
}
public static void shutDown() {
@ -92,4 +93,13 @@ public class CustomWebhook {
CustomWebhook.initLatch.countDown();
}
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.requiresChannel().antMatchers("/webhook").requiresInsecure();
http.csrf().disable().authorizeRequests().antMatchers("/webhook").permitAll();
}
}
}

View File

@ -0,0 +1,2 @@
server.port=7777
server.ssl.enabled=false

View File

@ -61,7 +61,7 @@ node('container') {
sh(script: '''#!/bin/bash
if [ "$DOCKER_RECORDING_VERSION" != "default" ]; then
echo "Using custom openvidu-recording tag: $DOCKER_RECORDING_VERSION"
cd openvidu/openvidu-server/target && java -jar -Dopenvidu.publicurl=https://172.17.0.1:4443/ -Dopenvidu.recording=true -Dopenvidu.recording.version=$DOCKER_RECORDING_VERSION -Dopenvidu.webhook=true -Dopenvidu.webhook.endpoint=http://172.17.0.1:7777/webhook/ openvidu-server-*.jar &> /openvidu-server.log &
cd openvidu/openvidu-server/target && java -jar -Dopenvidu.publicurl=https://172.17.0.1:4443/ -Dopenvidu.recording=true -Dopenvidu.recording.version=$DOCKER_RECORDING_VERSION -Dopenvidu.webhook=true -Dopenvidu.webhook.endpoint=http://localhost:7777/webhook/ openvidu-server-*.jar &> /openvidu-server.log &
else
echo "Using default openvidu-recording tag"
cd openvidu/openvidu-server/target && java -jar -Dopenvidu.publicurl=https://172.17.0.1:4443/ -Dopenvidu.recording=true -Dopenvidu.webhook=true -Dopenvidu.webhook.endpoint=http://localhost:7777/webhook/ openvidu-server-*.jar &> /openvidu-server.log &