This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
#!/usr/bin/env node | |
// replace all UTC dates to local dates in pipe | |
// usage: docker logs -t container_name | docker-logs-localtime | |
// install: | |
// curl https://gist.githubusercontent.com/popstas/ffcf282492fd78389d1df2ab7f31052a/raw/505cdf97c6a1edbb10c3b2b64e1836e0627b87a0/docker-logs-localtime > /usr/local/bin/docker-logs-localtime && chmod +x /usr/local/bin/docker-logs-localtime | |
// alternative: https://github.com/HuangYingNing/docker-logs-localtime | |
const pad = d => (d > 9 ? d : '0' + d); |
#source: https://github.com/microsoft/WSL/issues/4150 | |
$remoteport = bash.exe -c "ip addr | grep -Ee 'inet.*eth0'" | |
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; | |
if( $found ){ | |
$remoteport = $matches[0]; | |
} else{ | |
echo "The Script Exited, the ip address of WSL 2 cannot be found"; | |
exit; | |
} |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).