mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-10-23 19:47:16 +09:00
## Description 1. What is this PR about (link the issue and add a short description) ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
43 lines
1.2 KiB
Markdown
43 lines
1.2 KiB
Markdown
# Admin only
|
|
|
|
Based on this article https://dev.to/istarkov/fast-and-easy-way-to-setup-web-developer-certificates-450e
|
|
|
|
```bash
|
|
sudo rm -rf /tmp/certbot/
|
|
sudo rm -rf /tmp/letsencrypt/
|
|
|
|
mkdir -p /tmp/certbot/
|
|
mkdir -p /tmp/letsencrypt/
|
|
|
|
infisical login
|
|
# When running infisical init, select: Webstudio > webstudio
|
|
infisical init
|
|
|
|
CLOUDFLARE_API_KEY=$(infisical secrets get WSTD_DEV-CLOUDFLARE_ZONE_TOKEN --path='/CLI' --env=staging --plain)
|
|
|
|
# Create cloudflare.ini with proper formatting and permissions
|
|
echo "dns_cloudflare_api_token = ${CLOUDFLARE_API_KEY}" > /tmp/certbot/cloudflare.ini
|
|
chmod 600 /tmp/certbot/cloudflare.ini
|
|
|
|
docker run -it --rm --name certbot \
|
|
-v "/tmp/letsencrypt/data:/etc/letsencrypt" \
|
|
-v "/tmp/certbot:/local/certbot" \
|
|
certbot/dns-cloudflare certonly \
|
|
--dns-cloudflare \
|
|
--dns-cloudflare-credentials /local/certbot/cloudflare.ini \
|
|
--agree-tos \
|
|
--noninteractive \
|
|
-m istarkov@gmail.com \
|
|
-d wstd.dev \
|
|
-d '*.wstd.dev'
|
|
|
|
sudo chown -R $USER:$(id -g) /tmp/letsencrypt
|
|
|
|
cp /tmp/letsencrypt/data/live/wstd.dev/fullchain.pem ./https/fullchain.pem
|
|
cp /tmp/letsencrypt/data/live/wstd.dev/privkey.pem ./https/privkey.pem
|
|
|
|
# Haproxy key
|
|
cd https
|
|
cat ./fullchain.pem ./privkey.pem > ./haproxy.pem
|
|
```
|