5月
08
https://docs.unity3d.com/cn/2021.3/Manual/webgl-interactingwithbrowserscripting.html
unity 调用 js
请使用 .jslib 扩展名将包含 JavaScript 代码的文件放置在 Assets 文件夹中的“Plugins”子文件夹下。格式如下。
mergeInto(LibraryManager.library, {
Hello: function () {
window.alert("Hello, world!");
},
HelloString: function (str) {
window.alert(UTF8ToString(str));
}
});
5月
08
如果不需要泛域名证书,可以不用安装对应域名运营商的 cli 工具
nginx 镜像
仅安装 certbot 的 Dockerfile
ARG NGINX_IMAGE
FROM ${NGINX_IMAGE}
# 安装 certbot https://certbot.eff.org/instructions?ws=nginx&os=snap
# 也可以在 nginx 之外使用 certbot 镜像 https://hub.docker.com/r/certbot/certbot
RUN apt-get update && \
apt-get install -y python3-venv && \
python3 -m venv /opt/certbot && \
/opt/certbot/bin/pip install certbot certbot-nginx && \
ln -s /opt/certbot/bin/certbot /usr/local/bin/certbot && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
安装 certbot 和 aliyun cli 的Dockerfile
ARG NGINX_IMAGE
FROM ${NGINX_IMAGE}
# 安装 certbot https://certbot.eff.org/instructions?ws=nginx&os=snap
# 也可以在 nginx 之外使用 certbot 镜像 https://hub.docker.com/r/certbot/certbot
RUN apt-get update && \
apt-get install -y wget python3-venv && \
python3 -m venv /opt/certbot && \
/opt/certbot/bin/pip install certbot certbot-nginx && \
ln -s /opt/certbot/bin/certbot /usr/local/bin/certbot && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# 安装阿里云 cli https://help.aliyun.com/zh/cli/install-cli-on-linux?spm=a2c4g.11174283.0.0.5df9478dHNZ4T9
# https://help.aliyun.com/zh/cli/run-alibaba-cloud-cli-in-a-docker-container
RUN mkdir -p /soft && \
cd /soft && \
wget -q https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz && \
tar -xzvf aliyun-cli-linux-latest-amd64.tgz && \
cp aliyun /usr/local/bin/ && \
rm -rf /soft/aliyun-cli-linux-latest-amd64.tgz
# 验证阿里云 CLI 是否安装成功
RUN aliyun version
构建镜像,当前 nginx 最新版本是 1.28.0
docker build --build-arg NGINX_IMAGE=nginx:1.28.0 -t nginx-certbot .
手动生成证书
假设服务器上已经使用了该 nginx 镜像。并且配置文件目录是 /etc/nginx/。假如某个 .conf 文件使用了 vini123.com 的证书。就可以通过一下命令生成。
# 找到容器的名字或 id 前三位
docker ps
# 生成证书
docker exec -i nginx1.28.0 certbot --nginx --nginx-server-root=/etc/nginx -d vini123.com -d www.vini123.com
docker exec 常用 option 说明。
常用选项
-d:在后台运行命令。
-i:保持 STDIN 打开,即使没有附加。
-t:分配一个伪终端。
-u:指定在容器内执行命令的用户。
--workdir:指定容器内的工作目录。