侧边栏壁纸
  • 累计撰写 81 篇文章
  • 累计创建 50 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

emby伪站搭建

shawn
2023-09-02 / 0 评论 / 0 点赞 / 4 阅读 / 2763 字

emby伪站搭建

宝塔中新增域名为 mb3admin.com 的站点

伪静态代码:

location /admin/service/registration/validateDevice {
        default_type application/json;
      return 200 '{"cacheExpirationDays": 3650,"message": "Device Valid","resultCode": "GOOD"}';
    }
    location /admin/service/registration/validate {
        default_type application/json;
      return 200 '{"featId":"","registered":true,"expDate":"2099-01-01","key":""}';
    }
    location /admin/service/registration/getStatus {
        default_type application/json;
      return 200 '{"deviceStatus":"","planType":"Lifetime","subscriptions":{}}';
    }

3. 配置文件新增

    add_header Access-Control-Allow-Origin *;
    add_header Access-Control-Allow-Headers *;
    add_header Access-Control-Allow-Method *;
    add_header Access-Control-Allow-Credentials true;

4. SSL

mkdir -p zhuangzhuang && cd zhuangzhuang

# 生成 CA 密钥
openssl genrsa -out ca.key 2048 
# 生成 CA 证书
openssl req -x509 -new -nodes -key ca.key -subj "/C=CN/ST=Beijing/L=Beijing/O=ZHUANGZHUANG/OU=ZHUANGZHUANG/CN=ZHUANGZHUANG/emailAddress=mail@zhuangzhuang.ml" -days 36500 -out ca.crt
# 将 CA 转换成 p12 格式,并指定密码 (ZHUANGZHUANG)
openssl pkcs12 -export -clcerts -in ./ca.crt -inkey ca.key -out ca.p12 -password pass:ZHUANGZHUANG
# 将 p12 格式的证书 Base64 编码
base64 ca.p12
# Base64 一行不能超过 76 字符,超过则添加回车换行符。如果因为换行的原因,不能安装证书,可以使用 -w 参数
base64 -w 0 ca.p12
# 将 CA 转换成 pem 格式
openssl x509 -outform pem -in ca.crt -out ca.pem

# 生成服务端私钥 server.key
openssl genrsa -out server.key 2048
# 生成服务端证书请求 server.csr
openssl req -new -sha256 -key server.key -out server.csr -subj "/C=CN/L=Beijing/O=ZHUANGZHUANG/OU=ZHUANGZHUANG/CN=mb3admin.com/CN=*.mb3admin.com"
# 生成服务端证书 server.crt
openssl x509 -req -extfile <(printf "subjectAltName=DNS:mb3admin.com,DNS:*.mb3admin.com") -days 3650 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt

0

评论区