|
|
| Line 85: |
Line 85: |
| systemctl status cloudflared | | systemctl status cloudflared |
| </syntaxhighlight> | | </syntaxhighlight> |
|
| |
| ==Argo Tunnel==
| |
| {|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| sudo su
| |
| cd /root/.cloudflared/
| |
| cloudflared tunnel login
| |
| mv cert.pem ./certs/chorke-com.pem
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| sudo su
| |
| cd /root/.cloudflared/
| |
| cloudflared tunnel login
| |
| mv cert.pem ./certs/chorke-org.pem
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| sudo su
| |
| cd /root/.cloudflared/
| |
| cloudflared tunnel login
| |
| mv cert.pem ./certs/shahed-biz.pem
| |
| </syntaxhighlight>
| |
|
| |
| |-
| |
| | colspan="3" |
| |
| ----
| |
| |-
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| cloudflared --origincert=\
| |
| /root/.cloudflared/certs/chorke-com.pem \
| |
| tunnel create aa-chorke-com
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| cloudflared --origincert=\
| |
| /root/.cloudflared/certs/chorke-org.pem \
| |
| tunnel create aa-chorke-org
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| cloudflared --origincert=\
| |
| /root/.cloudflared/certs/shahed-biz.pem \
| |
| tunnel create aa-shahed-biz
| |
| </syntaxhighlight>
| |
|
| |
| |-
| |
| | colspan="3" |
| |
| ----
| |
| |-
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| mv certs/ccc2684a-*.json \
| |
| ./auths/chorke-com.json
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| mv certs/621edb67-*.json \
| |
| ./auths/chorke-org.json
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| mv certs/249a5a7c-*.json \
| |
| ./auths/shahed-biz.json
| |
| </syntaxhighlight>
| |
|
| |
| |-
| |
| | colspan="3" |
| |
| ----
| |
| |-
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| cloudflared --origincert=\
| |
| /root/.cloudflared/certs/chorke-com.pem \
| |
| tunnel list --output=json|jq -r '.[].name'
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| cloudflared --origincert=\
| |
| /root/.cloudflared/certs/chorke-org.pem \
| |
| tunnel list --output=json|jq -r '.[].name'
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| cloudflared --origincert=\
| |
| /root/.cloudflared/certs/shahed-biz.pem \
| |
| tunnel list --output=json|jq -r '.[].name'
| |
| </syntaxhighlight>
| |
|
| |
| |-
| |
| | colspan="3" |
| |
| ----
| |
| |-
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| cloudflared --origincert=\
| |
| /root/.cloudflared/certs/chorke-com.pem \
| |
| tunnel route dns aa-chorke-com aa
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| cloudflared --origincert=\
| |
| /root/.cloudflared/certs/chorke-org.pem \
| |
| tunnel route dns aa-chorke-org aa
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| cloudflared --origincert=\
| |
| /root/.cloudflared/certs/shahed-biz.pem \
| |
| tunnel route dns aa-shahed-biz aa
| |
| </syntaxhighlight>
| |
|
| |
| |-
| |
| | colspan="3" |
| |
| ----
| |
| |-
| |
| | colspan="3" |
| |
| <syntaxhighlight lang="bash">
| |
| CONFIG_BASE=/etc/cloudflared
| |
| LOGGER_BASE=/var/log/cloudflared
| |
| AUTHNZ_BASE=/root/.cloudflared/auths
| |
|
| |
| cat << EXE | sudo bash
| |
| mkdir -p ${CONFIG_BASE}/
| |
| mkdir -p ${LOGGER_BASE}/
| |
| mkdir -p /root/.cloudflared/{cert,auth}s/
| |
| EXE
| |
| </syntaxhighlight>
| |
|
| |
| |-
| |
| | colspan="3" |
| |
| ----
| |
| |-
| |
| | valign="top" |
| |
| <syntaxhighlight lang="yaml">
| |
| LOGGER_FILE=${LOGGER_BASE}/chorke-com.log
| |
| AUTHNZ_FILE=${AUTHNZ_BASE}/chorke-com.json
| |
| CONFIG_FILE=${CONFIG_BASE}/chorke-com-config.yml
| |
|
| |
| cat << YML | sudo tee ${CONFIG_FILE} >/dev/null
| |
| tunnel: aa-chorke-com
| |
| credentials-file: ${AUTHNZ_FILE}
| |
|
| |
| ingress:
| |
| - service: http://localhost
| |
| hostname: aa.chorke.com
| |
| path: /*
| |
| - service: ssh://localhost:22
| |
| hostname: aa.chorke.com
| |
| - service: tcp://localhost:3306
| |
| hostname: aa.chorke.com
| |
| - service: tcp://localhost:5432
| |
| hostname: aa.chorke.com
| |
| - service: http_status:404
| |
|
| |
| warp-routing:
| |
| enabled: true
| |
|
| |
| private_network:
| |
| - 10.19.83.0/24
| |
|
| |
| dns:
| |
| - 1.1.1.1
| |
| - 8.8.8.8
| |
| - 10.19.83.100
| |
|
| |
| loglevel: info
| |
| logfile: ${LOGGER_FILE}
| |
|
| |
| heartbeat:
| |
| interval: 10s
| |
| max_retries: 3
| |
|
| |
| restart: true
| |
| YML
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="yaml">
| |
| LOGGER_FILE=${LOGGER_BASE}/chorke-org.log
| |
| AUTHNZ_FILE=${AUTHNZ_BASE}/chorke-org.json
| |
| CONFIG_FILE=${CONFIG_BASE}/chorke-org-config.yml
| |
|
| |
| cat << YML | sudo tee ${CONFIG_FILE} >/dev/null
| |
| tunnel: aa-chorke-org
| |
| credentials-file: ${AUTHNZ_FILE}
| |
|
| |
| ingress:
| |
| - service: http://localhost
| |
| hostname: aa.chorke.org
| |
| path: /*
| |
| - service: ssh://localhost:22
| |
| hostname: aa.chorke.org
| |
| - service: tcp://localhost:3306
| |
| hostname: aa.chorke.org
| |
| - service: tcp://localhost:5432
| |
| hostname: aa.chorke.org
| |
| - service: http_status:404
| |
|
| |
| warp-routing:
| |
| enabled: true
| |
|
| |
| private_network:
| |
| - 10.19.83.0/24
| |
|
| |
| dns:
| |
| - 1.1.1.1
| |
| - 8.8.8.8
| |
| - 10.19.83.100
| |
|
| |
| loglevel: info
| |
| logfile: ${LOGGER_FILE}
| |
|
| |
| heartbeat:
| |
| interval: 10s
| |
| max_retries: 3
| |
|
| |
| restart: true
| |
| YML
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="yaml">
| |
| LOGGER_FILE=${LOGGER_BASE}/shahed-biz.log
| |
| AUTHNZ_FILE=${AUTHNZ_BASE}/shahed-biz.json
| |
| CONFIG_FILE=${CONFIG_BASE}/shahed-biz-config.yml
| |
|
| |
| cat << YML | sudo tee ${CONFIG_FILE} >/dev/null
| |
| tunnel: aa-shahed-biz
| |
| credentials-file: ${AUTHNZ_FILE}
| |
|
| |
| ingress:
| |
| - service: http://localhost
| |
| hostname: aa.shahed.biz
| |
| path: /*
| |
| - service: ssh://localhost:22
| |
| hostname: aa.shahed.biz
| |
| - service: tcp://localhost:3306
| |
| hostname: aa.shahed.biz
| |
| - service: tcp://localhost:5432
| |
| hostname: aa.shahed.biz
| |
| - service: http_status:404
| |
|
| |
| warp-routing:
| |
| enabled: true
| |
|
| |
| private_network:
| |
| - 10.19.83.0/24
| |
|
| |
| dns:
| |
| - 1.1.1.1
| |
| - 8.8.8.8
| |
| - 10.19.83.100
| |
|
| |
| loglevel: info
| |
| logfile: ${LOGGER_FILE}
| |
|
| |
| heartbeat:
| |
| interval: 10s
| |
| max_retries: 3
| |
|
| |
| restart: true
| |
| YML
| |
| </syntaxhighlight>
| |
|
| |
| |-
| |
| | colspan="3" |
| |
| ----
| |
| |-
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| sudo cloudflared tunnel \
| |
| --config /etc/cloudflared/chorke-com-config.yml \
| |
| run aa-chorke-com
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| sudo cloudflared tunnel \
| |
| --config /etc/cloudflared/chorke-org-config.yml \
| |
| run aa-chorke-org
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| sudo cloudflared tunnel \
| |
| --config /etc/cloudflared/shahed-biz-config.yml \
| |
| run aa-shahed-biz
| |
| </syntaxhighlight>
| |
|
| |
| |-
| |
| | colspan="3" |
| |
| ----
| |
| |-
| |
| | valign="top" |
| |
| <syntaxhighlight lang="ini">
| |
| SYSTEM_FILE=cloudflared@chorke-com.service
| |
| SYSTEM_PATH=/etc/systemd/system/${SYSTEM_FILE}
| |
|
| |
| cat << INI | sudo tee ${SYSTEM_PATH} >/dev/null
| |
| [Unit]
| |
| Description=cloudflared
| |
| After=network-online.target
| |
| Wants=network-online.target
| |
|
| |
| [Service]
| |
| TimeoutStartSec=0
| |
| Type=notify
| |
| ExecStart=/usr/bin/cloudflared --no-autoupdate \
| |
| --config /etc/cloudflared/chorke-com-config.yml \
| |
| tunnel run
| |
| Restart=on-failure
| |
| RestartSec=5s
| |
|
| |
| [Install]
| |
| WantedBy=multi-user.target
| |
| INI
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="ini">
| |
| SYSTEM_FILE=cloudflared@chorke-org.service
| |
| SYSTEM_PATH=/etc/systemd/system/${SYSTEM_FILE}
| |
|
| |
| cat << INI | sudo tee ${SYSTEM_PATH} >/dev/null
| |
| [Unit]
| |
| Description=cloudflared
| |
| After=network-online.target
| |
| Wants=network-online.target
| |
|
| |
| [Service]
| |
| TimeoutStartSec=0
| |
| Type=notify
| |
| ExecStart=/usr/bin/cloudflared --no-autoupdate \
| |
| --config /etc/cloudflared/chorke-org-config.yml \
| |
| tunnel run
| |
| Restart=on-failure
| |
| RestartSec=5s
| |
|
| |
| [Install]
| |
| WantedBy=multi-user.target
| |
| INI
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="ini">
| |
| SYSTEM_FILE=cloudflared@shahed-biz.service
| |
| SYSTEM_PATH=/etc/systemd/system/${SYSTEM_FILE}
| |
|
| |
| cat << INI | sudo tee ${SYSTEM_PATH} >/dev/null
| |
| [Unit]
| |
| Description=cloudflared
| |
| After=network-online.target
| |
| Wants=network-online.target
| |
|
| |
| [Service]
| |
| TimeoutStartSec=0
| |
| Type=notify
| |
| ExecStart=/usr/bin/cloudflared --no-autoupdate \
| |
| --config /etc/cloudflared/shahed-biz-config.yml \
| |
| tunnel run
| |
| Restart=on-failure
| |
| RestartSec=5s
| |
|
| |
| [Install]
| |
| WantedBy=multi-user.target
| |
| INI
| |
| </syntaxhighlight>
| |
|
| |
| |-
| |
| | colspan="3" |
| |
| ----
| |
| |-
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| cat << EXE | sudo bash
| |
| systemctl daemon-reload
| |
| systemctl enable cloudflared@chorke-com.service
| |
| systemctl start cloudflared@chorke-com.service
| |
| systemctl status cloudflared@chorke-com.service
| |
| EXE
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| cat << EXE | sudo bash
| |
| systemctl daemon-reload
| |
| systemctl enable cloudflared@chorke-org.service
| |
| systemctl start cloudflared@chorke-org.service
| |
| systemctl status cloudflared@chorke-org.service
| |
| EXE
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| cat << EXE | sudo bash
| |
| systemctl daemon-reload
| |
| systemctl enable cloudflared@shahed-biz.service
| |
| systemctl start cloudflared@shahed-biz.service
| |
| systemctl status cloudflared@shahed-biz.service
| |
| EXE
| |
| </syntaxhighlight>
| |
|
| |
| |-
| |
| | colspan="3" |
| |
| ----
| |
| |-
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| tail -n100 \
| |
| -f /var/log/cloudflared/chorke-com.log
| |
| journalctl -xeu cloudflared@chorke-com.service
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| tail -n100 \
| |
| -f /var/log/cloudflared/chorke-org.log
| |
| journalctl -xeu cloudflared@chorke-org.service
| |
| </syntaxhighlight>
| |
|
| |
| | valign="top" |
| |
| <syntaxhighlight lang="bash">
| |
| tail -n100 \
| |
| -f /var/log/cloudflared/shahed-biz.log
| |
| journalctl -xeu cloudflared@shahed-biz.service
| |
| </syntaxhighlight>
| |
|
| |
| |-
| |
| | colspan="3" |
| |
| ----
| |
| |-
| |
| | valign="top" |
| |
|
| |
| | valign="top" |
| |
|
| |
| | valign="top" |
| |
|
| |
| |}
| |
|
| |
|
| ==Playground== | | ==Playground== |
| Line 652: |
Line 201: |
| * [https://developers.cloudflare.com/email-routing/ Cloudflare » Email Routing] | | * [https://developers.cloudflare.com/email-routing/ Cloudflare » Email Routing] |
| * [https://developers.cloudflare.com/support/account-management-billing/billing-cloudflare-plans/ Cloudflare » Billing Plans] | | * [https://developers.cloudflare.com/support/account-management-billing/billing-cloudflare-plans/ Cloudflare » Billing Plans] |
| * [https://www.cloudflare.com/learning/access-management/what-is-ssh/ Cloudflare » SSH] | | * [[Cloudflare/Argo Tunnel|Cloudflare » Argo Tunnel]] |
| * [https://www.cloudflare.com/ Cloudflare] | | * [https://www.cloudflare.com/ Cloudflare] |
|
| |
|
| Line 677: |
Line 226: |
| * [https://developers.cloudflare.com/rules/url-forwarding/ Cloudflare » Rules » Redirects] | | * [https://developers.cloudflare.com/rules/url-forwarding/ Cloudflare » Rules » Redirects] |
| * [https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/ Cloudflare » Tunnel] | | * [https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/ Cloudflare » Tunnel] |
| | * [https://www.cloudflare.com/learning/access-management/what-is-ssh/ Cloudflare » SSH] |
|
| |
|
| |- | | |- |