Skip to main content

Cloudflare for local server

 


Use skiff for email.  Copy DNS setting from skiff to cloudflare.

See: https://www.youtube.com/watch?v=hrwoKO7LMzk
https://raidowl.hostyboi.com/2022/08/22/Cloudflare-Tunnel/

install 
wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && dpkg -i cloudflared-linux-amd64.deb

run a local host server

cd ~/www/nodeserver/
node hello.js


CLOUDFLARE

https://cyberhost.uk/cloudflare-argo-tunnel/#adding-more-services

https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-local-tunnel/

1.) login to cloudflare dashboard

2.) create a new domain name

3.) open terminal and login via cmd

  cloudflared tunnel login

select the domain name.  a new pem file will be saved to local

3.) create the tunnel:

 cloudflared tunnel create impressto.camysite.com

if it exists delete it by checking with cloudflared tunnel list then cloudflared tunnel delete impressto.ca

 a new credential json file will be saved to your local

4.) create the config file  /home/annie/webdev/.cloudflared/config.yml

url: http://localhost:5000
tunnel: 63f68dbe-785c-585c-4c30-bdd9-980c39aa23e1
credentials-file: /home/annie/.cloudflared/63f68dbe-785c-4c30-4520-bdd9-980c39aa23e1.json

 

5.)
setup the dns:

cloudflared tunnel route dns impressto.camysite.com impressto.ca mysite.com

note you may need to delete the existing DNS CNAME record in the cloudflare website first

6.)
finally run it:

cloudflared tunnel run impressto.ca

 

change the local server address by editing ~/.cloudflared/config.yml


SERVING LOCAL SERVICES 


sudo crontab -e 

@reboot /home/annie/work/impressto/new_server/startup.sh

make sure to add local addresses to  /etc/hosts otherwise they will not be available for the tunnel on local