使用 acme 工具免费申请 SSL 证书

#curl https://get.acme.sh | sh

#vim ~/.bashrc

export CF_Key=”your_cloudflare_api_key”

export CF_Email=”your_email_address”

#source ~/.bashrc

#acme.sh –register-account -m [email protected] acme.sh –issue –dns dns_cf -d your_domain.com –debug

#acme.sh –install-cert -d your_domain.com –key-file /home/user/.acme.sh/your_domain.com_ecc/your_domain.com.key –fullchain-file /home/user/.acme.sh/your_domain.com_ecc/your_domain.com.cer –reloadcmd “sudo nginx -s reload”

code-server搭建

Ubuntu 使用下面代码安装:

curl -fsSL https://code-server.dev/install.sh | sh
配置守护进程
vim /usr/lib/systemd/system/code-server.service

输入以下配置

[Unit]
Description=code-server
After=network.target
[Service]
Type=exec
Environment=HOME=/root
ExecStart=/usr/bin/code-server
Restart=always
然后就可以通过以下命令来启动和关闭code-server服务了
start code-server
systemctl start code-server
stop code-server
systemctl stop code-server
code-server status
systemctl status code-server

开启SSL:

vim /root/.config/code-server/config.yaml

cert: /xxxx.crt

cert-key: /xxx.key