mirror of https://github.com/OpenVidu/openvidu.git
openvidu-recording Docker image tag as property
parent
13d231b9ab
commit
efbb4e7763
|
@ -172,7 +172,7 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
||||||
|
|
||||||
case "local":
|
case "local":
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "docker-local":
|
case "docker-local":
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -182,13 +182,13 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
||||||
int port = url.getPort();
|
int port = url.getPort();
|
||||||
|
|
||||||
type = "custom";
|
type = "custom";
|
||||||
|
|
||||||
if (publicUrl.startsWith("https://")) {
|
if (publicUrl.startsWith("https://")) {
|
||||||
OpenViduServer.publicUrl = publicUrl.replace("https://", "wss://");
|
OpenViduServer.publicUrl = publicUrl.replace("https://", "wss://");
|
||||||
} else if (publicUrl.startsWith("http://")) {
|
} else if (publicUrl.startsWith("http://")) {
|
||||||
OpenViduServer.publicUrl = publicUrl.replace("http://", "wss://");
|
OpenViduServer.publicUrl = publicUrl.replace("http://", "wss://");
|
||||||
}
|
}
|
||||||
|
|
||||||
openviduConf.setFinalUrl(url.toString());
|
openviduConf.setFinalUrl(url.toString());
|
||||||
|
|
||||||
if (!OpenViduServer.publicUrl.startsWith("wss://")) {
|
if (!OpenViduServer.publicUrl.startsWith("wss://")) {
|
||||||
|
@ -214,8 +214,9 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
||||||
boolean recordingModuleEnabled = openviduConf.isRecordingModuleEnabled();
|
boolean recordingModuleEnabled = openviduConf.isRecordingModuleEnabled();
|
||||||
if (recordingModuleEnabled) {
|
if (recordingModuleEnabled) {
|
||||||
ComposedRecordingService recordingService = context.getBean(ComposedRecordingService.class);
|
ComposedRecordingService recordingService = context.getBean(ComposedRecordingService.class);
|
||||||
System.out.println(
|
recordingService.setRecordingVersion(openviduConf.getOpenViduRecordingVersion());
|
||||||
"Recording module required: Downloading openvidu/openvidu-recording Docker image (800 MB aprox)");
|
System.out.println("Recording module required: Downloading openvidu/openvidu-recording:"
|
||||||
|
+ openviduConf.getOpenViduRecordingVersion() + " Docker image (800 MB aprox)");
|
||||||
|
|
||||||
boolean imageExists = false;
|
boolean imageExists = false;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -27,6 +27,9 @@ public class OpenviduConfig {
|
||||||
@Value("${openvidu.recording.free-access}")
|
@Value("${openvidu.recording.free-access}")
|
||||||
boolean openviduRecordingFreeAccess;
|
boolean openviduRecordingFreeAccess;
|
||||||
|
|
||||||
|
@Value("${openvidu.recording.version}")
|
||||||
|
String openviduRecordingVersion;
|
||||||
|
|
||||||
private String finalUrl;
|
private String finalUrl;
|
||||||
|
|
||||||
public String getOpenViduPublicUrl() {
|
public String getOpenViduPublicUrl() {
|
||||||
|
@ -73,4 +76,8 @@ public class OpenviduConfig {
|
||||||
this.finalUrl = finalUrl.endsWith("/") ? (finalUrl) : (finalUrl + "/");
|
this.finalUrl = finalUrl.endsWith("/") ? (finalUrl) : (finalUrl + "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getOpenViduRecordingVersion() {
|
||||||
|
return this.openviduRecordingVersion;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,7 @@ public class ComposedRecordingService {
|
||||||
private Map<String, Recording> sessionsRecordings = new ConcurrentHashMap<>();
|
private Map<String, Recording> sessionsRecordings = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
private final String IMAGE_NAME = "openvidu/openvidu-recording";
|
private final String IMAGE_NAME = "openvidu/openvidu-recording";
|
||||||
|
private String IMAGE_TAG;
|
||||||
private final String RECORDING_ENTITY_FILE = ".recording.";
|
private final String RECORDING_ENTITY_FILE = ".recording.";
|
||||||
|
|
||||||
private DockerClient dockerClient;
|
private DockerClient dockerClient;
|
||||||
|
@ -192,7 +193,7 @@ public class ComposedRecordingService {
|
||||||
public boolean recordingImageExistsLocally() {
|
public boolean recordingImageExistsLocally() {
|
||||||
boolean imageExists = false;
|
boolean imageExists = false;
|
||||||
try {
|
try {
|
||||||
dockerClient.inspectImageCmd(IMAGE_NAME).exec();
|
dockerClient.inspectImageCmd(IMAGE_NAME + ":" + IMAGE_TAG).exec();
|
||||||
imageExists = true;
|
imageExists = true;
|
||||||
} catch (NotFoundException nfe) {
|
} catch (NotFoundException nfe) {
|
||||||
imageExists = false;
|
imageExists = false;
|
||||||
|
@ -204,15 +205,15 @@ public class ComposedRecordingService {
|
||||||
|
|
||||||
public void downloadRecordingImage() {
|
public void downloadRecordingImage() {
|
||||||
try {
|
try {
|
||||||
dockerClient.pullImageCmd(IMAGE_NAME).exec(new PullImageResultCallback()).awaitSuccess();
|
dockerClient.pullImageCmd(IMAGE_NAME + ":" + IMAGE_TAG).exec(new PullImageResultCallback()).awaitSuccess();
|
||||||
} catch (NotFoundException | InternalServerErrorException e) {
|
} catch (NotFoundException | InternalServerErrorException e) {
|
||||||
if (imageExistsLocally(IMAGE_NAME)) {
|
if (imageExistsLocally(IMAGE_NAME + ":" + IMAGE_TAG)) {
|
||||||
log.info("Docker image '{}' exists locally", IMAGE_NAME);
|
log.info("Docker image '{}' exists locally", IMAGE_NAME + ":" + IMAGE_TAG);
|
||||||
} else {
|
} else {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
} catch (DockerClientException e) {
|
} catch (DockerClientException e) {
|
||||||
log.info("Error on Pulling '{}' image. Probably because the user has stopped the execution", IMAGE_NAME);
|
log.info("Error on Pulling '{}' image. Probably because the user has stopped the execution", IMAGE_NAME + ":" + IMAGE_TAG);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,7 +232,7 @@ public class ComposedRecordingService {
|
||||||
|
|
||||||
private String runRecordingContainer(List<String> envs, String containerName) {
|
private String runRecordingContainer(List<String> envs, String containerName) {
|
||||||
Volume volume1 = new Volume("/recordings");
|
Volume volume1 = new Volume("/recordings");
|
||||||
CreateContainerCmd cmd = dockerClient.createContainerCmd(IMAGE_NAME).withName(containerName).withEnv(envs)
|
CreateContainerCmd cmd = dockerClient.createContainerCmd(IMAGE_NAME + ":" + IMAGE_TAG).withName(containerName).withEnv(envs)
|
||||||
.withNetworkMode("host").withVolumes(volume1)
|
.withNetworkMode("host").withVolumes(volume1)
|
||||||
.withBinds(new Bind(openviduConfig.getOpenViduRecordingPath(), volume1));
|
.withBinds(new Bind(openviduConfig.getOpenViduRecordingPath(), volume1));
|
||||||
CreateContainerResponse container = null;
|
CreateContainerResponse container = null;
|
||||||
|
@ -398,5 +399,9 @@ public class ComposedRecordingService {
|
||||||
this.removeDockerContainer(containerId);
|
this.removeDockerContainer(containerId);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRecordingVersion(String version) {
|
||||||
|
this.IMAGE_TAG = version;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,12 +16,12 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "openvidu.cdr",
|
"name": "openvidu.cdr",
|
||||||
"type": "java.lang.String",
|
"type": "java.lang.Boolean",
|
||||||
"description": "Whether to enable Call Detail Record or not"
|
"description": "Whether to enable Call Detail Record or not"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "openvidu.recording",
|
"name": "openvidu.recording",
|
||||||
"type": "java.lang.String",
|
"type": "java.lang.Boolean",
|
||||||
"description": "Whether to start OpenVidu Server with recording module service available or not (a Docker image will be downloaded during the first execution). Apart from setting this param to true, it is also necessary to explicitly configure sessions to be recorded"
|
"description": "Whether to start OpenVidu Server with recording module service available or not (a Docker image will be downloaded during the first execution). Apart from setting this param to true, it is also necessary to explicitly configure sessions to be recorded"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,12 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "openvidu.recording.free-access",
|
"name": "openvidu.recording.free-access",
|
||||||
"type": "java.lang.String",
|
"type": "java.lang.Boolean",
|
||||||
"description": "'true' to allow free access to the video files specified in 'openviu.recording.path'. 'false' to only allow access to authenticated users"
|
"description": "'true' to allow free access to the video files specified in 'openviu.recording.path'. 'false' to only allow access to authenticated users"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "openvidu.recording.version",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "Tag for openvidu/openvidu-recording Docker image"
|
||||||
}
|
}
|
||||||
]}
|
]}
|
|
@ -10,4 +10,5 @@ openvidu.publicurl: ngrok
|
||||||
openvidu.cdr: false
|
openvidu.cdr: false
|
||||||
openvidu.recording: false
|
openvidu.recording: false
|
||||||
openvidu.recording.path: /opt/openvidu/recordings
|
openvidu.recording.path: /opt/openvidu/recordings
|
||||||
openvidu.recording.free-access: false
|
openvidu.recording.free-access: false
|
||||||
|
openvidu.recording.version: 1.8.0
|
|
@ -1,12 +1,16 @@
|
||||||
server.port: 8443
|
|
||||||
server.address: 0.0.0.0
|
server.address: 0.0.0.0
|
||||||
server.ssl.enabled: true
|
server.ssl.enabled: true
|
||||||
|
openvidu.recording.version: 1.8.0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
server.port: 8443
|
||||||
server.ssl.key-store: classpath:openvidu-selfsigned.jks
|
server.ssl.key-store: classpath:openvidu-selfsigned.jks
|
||||||
server.ssl.key-store-password: openvidu
|
server.ssl.key-store-password: openvidu
|
||||||
server.ssl.key-store-type: JKS
|
server.ssl.key-store-type: JKS
|
||||||
server.ssl.key-alias: openvidu-selfsigned
|
server.ssl.key-alias: openvidu-selfsigned
|
||||||
|
|
||||||
kms.uris=[\"ws://localhost:8888/kurento\"]
|
kms.uris=[\"ws://localhost:8888/kurento\"]
|
||||||
|
|
||||||
openvidu.secret: MY_SECRET
|
openvidu.secret: MY_SECRET
|
||||||
openvidu.publicurl: local
|
openvidu.publicurl: local
|
||||||
openvidu.cdr: false
|
openvidu.cdr: false
|
||||||
|
|
Loading…
Reference in New Issue