[+] Mediasoup
This commit is contained in:
@@ -59,6 +59,8 @@ sysctl -p
|
||||
yum install git
|
||||
```
|
||||
|
||||
## 媒体
|
||||
|
||||
## Java
|
||||
|
||||
安装之前需要卸载旧版,如果旧版已经是`17+`可以忽略安装。
|
||||
@@ -94,7 +96,7 @@ PATH=$PATH:/data/maven/apache-maven-3.8.6/bin
|
||||
mvn -version
|
||||
```
|
||||
|
||||
## Taoyao
|
||||
## 信令
|
||||
|
||||
```
|
||||
# 下载源码
|
||||
@@ -137,10 +139,7 @@ systemctl start taoyao
|
||||
systemctl enable taoyao
|
||||
```
|
||||
|
||||
## KMS(Kurento Media Server)
|
||||
|
||||
```
|
||||
```
|
||||
## 终端
|
||||
|
||||
## 防火墙
|
||||
|
||||
@@ -164,6 +163,8 @@ firewall-cmd --zone=public --remove-port=45535-65535/udp --permanent
|
||||
keytool -genkeypair -keyalg RSA -dname "CN=localhost, OU=acgist, O=taoyao, L=GZ, ST=GD, C=CN" -alias taoyao -validity 3650 -ext ku:c=dig,keyE -ext eku=serverAuth -ext SAN=dns:localhost,ip:127.0.0.1 -keystore taoyao.jks -keypass 123456 -storepass 123456
|
||||
```
|
||||
|
||||
## 资料
|
||||
|
||||
https://www.jianshu.com/p/fa047d7054eb
|
||||
https://www.jianshu.com/p/59da3d350488
|
||||
https://www.jianshu.com/p/fa047d7054eb
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
|
||||
|
||||
<id>dev</id>
|
||||
|
||||
<formats>
|
||||
<format>dir</format>
|
||||
</formats>
|
||||
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${taoyao.maven.basedir}/docs</directory>
|
||||
<outputDirectory>./</outputDirectory>
|
||||
<includes>
|
||||
<include>README.md</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${taoyao.maven.basedir}/docs/bin</directory>
|
||||
<outputDirectory>bin</outputDirectory>
|
||||
<fileMode>0755</fileMode>
|
||||
<filtered>true</filtered>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>src/main/resources</directory>
|
||||
<outputDirectory>config</outputDirectory>
|
||||
<filtered>true</filtered>
|
||||
<includes>
|
||||
<include>*.yml</include>
|
||||
<include>*.properties</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>src/main/resources</directory>
|
||||
<outputDirectory>config</outputDirectory>
|
||||
<includes>
|
||||
<include>*.jks</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>target</directory>
|
||||
<outputDirectory>logs</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>**/*</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>lib</outputDirectory>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
|
||||
</assembly>
|
||||
@@ -1,58 +0,0 @@
|
||||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
|
||||
|
||||
<id>release</id>
|
||||
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${taoyao.maven.basedir}/docs</directory>
|
||||
<outputDirectory>./</outputDirectory>
|
||||
<includes>
|
||||
<include>README.md</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${taoyao.maven.basedir}/docs/bin</directory>
|
||||
<outputDirectory>bin</outputDirectory>
|
||||
<fileMode>0755</fileMode>
|
||||
<filtered>true</filtered>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>src/main/resources</directory>
|
||||
<outputDirectory>config</outputDirectory>
|
||||
<filtered>true</filtered>
|
||||
<includes>
|
||||
<include>*.yml</include>
|
||||
<include>*.properties</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>src/main/resources</directory>
|
||||
<outputDirectory>config</outputDirectory>
|
||||
<includes>
|
||||
<include>*.jks</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>target</directory>
|
||||
<outputDirectory>logs</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>**/*</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>lib</outputDirectory>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
|
||||
</assembly>
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 进入目录
|
||||
base=$(readlink -f $(dirname $0))
|
||||
cd $base
|
||||
echo "环境目录:$base"
|
||||
echo "当前目录:$(pwd)"
|
||||
|
||||
# 更新代码
|
||||
if [ -z $gited ]; then
|
||||
echo "更新代码:${project.artifactId}-${project.version}"
|
||||
git pull
|
||||
fi
|
||||
|
||||
# 编译代码
|
||||
if [ -z $mvned ]; then
|
||||
echo "编译代码:${project.artifactId}-${project.version}"
|
||||
cd $base/taoyao
|
||||
mvn clean package -D skipTests -P ${profile}
|
||||
fi
|
||||
|
||||
# 删除文件:注意不要删除日志
|
||||
rm -rf $base/${project.artifactId}/bin
|
||||
rm -rf $base/${project.artifactId}/lib
|
||||
rm -rf $base/${project.artifactId}/config
|
||||
# 运行目录
|
||||
echo "拷贝文件:${project.artifactId}-${project.version}"
|
||||
if [ ! -d "$base/${project.artifactId}" ]; then
|
||||
mkdir -p $base/${project.artifactId}
|
||||
fi
|
||||
# 拷贝文件
|
||||
cp -rf ${project.basedir}/target/${project.artifactId}-${project.version}/* $base/${project.artifactId}
|
||||
|
||||
# 启动服务
|
||||
#cd $base/${project.artifactId}
|
||||
#sh bin/startup.sh
|
||||
systemctl restart taoyao
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 启动目录
|
||||
bin=$(readlink -f $(dirname $0))
|
||||
base=${bin%/*}
|
||||
cd $base
|
||||
echo "启动目录:$base"
|
||||
|
||||
# Java运行环境
|
||||
JAVA=$(which java)
|
||||
if [ -z "$JAVA" ] ; then
|
||||
echo "必须安装${java.version}+JDK"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 结束任务
|
||||
if [ ! -f "/.dockerenv" ]; then
|
||||
sh bin/stop.sh
|
||||
fi
|
||||
|
||||
# 启动参数
|
||||
JAVA_OPTS_GC="-XX:+UseG1GC -Xlog:gc:./logs/gc.log:time,level"
|
||||
JAVA_OPTS_MEM="-server ${taoyao.maven.jvm.mem}"
|
||||
JAVA_OPTS_EXT="-Dfile.encoding=${taoyao.maven.encoding} -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true"
|
||||
JAVA_OPTS_APP="-Dspring.profiles.active=${profile}"
|
||||
JAVA_OPTS="$JAVA_OPTS_MEM $JAVA_OPTS_EXT $JAVA_OPTS_APP ${taoyao.maven.jvm.arg}"
|
||||
echo "启动参数:$JAVA_OPTS"
|
||||
|
||||
# 启动应用
|
||||
echo "启动应用:${project.artifactId}-${project.version}"
|
||||
if [ ! -f "/.dockerenv" ]; then
|
||||
# 其他启动
|
||||
nohup $JAVA $JAVA_OPTS -jar $base/lib/${project.artifactId}-${project.version}.jar > /dev/null 2>&1 &
|
||||
else
|
||||
# 使用docker启动:后台启动不能查看控制台的信息
|
||||
$JAVA $JAVA_OPTS -jar $base/lib/${project.artifactId}-${project.version}.jar
|
||||
fi
|
||||
|
||||
# 等待任务
|
||||
if [ ! -f "/.dockerenv" ]; then
|
||||
sh bin/wait.sh
|
||||
else
|
||||
echo -e "\033[32m启动成功:${project.artifactId}-${project.version}\033[0m"
|
||||
fi
|
||||
|
||||
echo "--------------------------------"
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 结束任务
|
||||
killIndex=0
|
||||
processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}')
|
||||
if [ ! -z "$processId" ]; then
|
||||
echo "关闭应用:${project.artifactId}-${project.version} - $processId"
|
||||
while [ ! -z "$processId" ]
|
||||
do
|
||||
echo -n "."
|
||||
if [ $killIndex -le 0 ]; then
|
||||
# 优雅关机
|
||||
kill -15 $processId
|
||||
elif [ $killIndex -ge 10 ]; then
|
||||
echo -n '强制关闭'
|
||||
# 强制关机
|
||||
kill -9 $processId
|
||||
fi
|
||||
sleep 1
|
||||
killIndex=$((killIndex+1))
|
||||
processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}')
|
||||
done
|
||||
echo ""
|
||||
fi
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 等待任务
|
||||
startTime=$(date +%s)
|
||||
processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}')
|
||||
if [ ! -z "$processId" ]; then
|
||||
waitIndex=0
|
||||
processPortNumber=$(netstat -anop | grep $processId | grep LISTEN | wc -l)
|
||||
while [ $waitIndex -le 120 ] && [ ! -z "$processId" ] && [ $processPortNumber -lt 1 ]
|
||||
do
|
||||
sleep 1
|
||||
waitIndex=$((waitIndex+1))
|
||||
processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}')
|
||||
if [ ! -z "$processId" ]; then
|
||||
processPortNumber=$(netstat -anop | grep $processId | grep LISTEN | wc -l)
|
||||
else
|
||||
processPortNumber=0
|
||||
fi
|
||||
echo -n "."
|
||||
done
|
||||
echo ""
|
||||
fi
|
||||
if [ $processPortNumber -lt 1 ]; then
|
||||
echo -e "\033[31m启动失败:${project.artifactId}-${project.version}\033[0m"
|
||||
sh bin/stop.sh
|
||||
exit 0
|
||||
else
|
||||
finishTime=$(date +%s)
|
||||
processTime=$((finishTime-startTime))
|
||||
echo -e "\033[32m启动成功:${project.artifactId}-${project.version} - $processId\033[0m"
|
||||
echo "启动端口:$(netstat -anop | grep $processId | grep LISTEN | awk '{print $4}')"
|
||||
echo "启动耗时:$processTime S"
|
||||
fi
|
||||
@@ -1,91 +0,0 @@
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
pid /var/run/nginx.pid;
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
|
||||
events {
|
||||
use epoll;
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main buffer=32k flush=10s;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
default_type application/octet-stream;
|
||||
|
||||
gzip on;
|
||||
gzip_types text/xml text/css text/plain text/javascript image/gif image/png image/jpg image/webp image/jpeg image/x-icon image/svg+xml application/json application/javascript font/woff application/octet-stream application/vnd.ms-fontobject;
|
||||
gzip_min_length 1k;
|
||||
|
||||
sendfile on;
|
||||
# tcp_nopush on;
|
||||
server_tokens off;
|
||||
keepalive_timeout 60;
|
||||
client_max_body_size 16m;
|
||||
fastcgi_intercept_errors on;
|
||||
|
||||
upstream taoyao {
|
||||
server https://localhost:8888;
|
||||
keepalive 60;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen 443 ssl default_server;
|
||||
ssl_certificate /data/ssl/taoyao.acgist.pem;
|
||||
ssl_certificate_key /data/ssl/taoyao.acgist.key;
|
||||
error_page 497 https://$host:$server_port$request_uri;
|
||||
return 301 https://taoyao.acgist.com$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name taoyao.acgist.com;
|
||||
|
||||
access_log /var/log/nginx/taoyao.acgist.com.log main buffer=32k flush=10s;
|
||||
|
||||
ssl_certificate /data/ssl/taoyao.acgist.com.pem;
|
||||
ssl_certificate_key /data/ssl/taoyao.acgist.com.key;
|
||||
ssl_ciphers TLS13-AES-128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-CBC-SHA256:ECDHE-ECDSA-AES128-CBC-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_session_timeout 30m;
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
# proxy_http_version 1.1;
|
||||
proxy_http_version 2.0;
|
||||
|
||||
# proxy_set_header Connection close;
|
||||
proxy_set_header Connection keep-alive;
|
||||
proxy_set_header Host $host;
|
||||
# proxy_set_header Host $host:$server_port;
|
||||
# proxy_set_header X-Scheme $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
# proxy_set_header X-Http-scheme $scheme;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Server $host;
|
||||
|
||||
add_header Strict-Transport-Security "max-age=15552000; includeSubdomains; preload";
|
||||
|
||||
location = /websocket.signal {
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
keepalive_timeout 1200s;
|
||||
proxy_read_timeout 1200s;
|
||||
proxy_send_timeout 1200s;
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_pass taoyao;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass taoyao;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user