1
0
Fork
You've already forked this-computer
0
No description
  • HTML 69.8%
  • JavaScript 30.2%
2024年11月16日 09:37:56 +02:00
pong Systemd thing 2024年11月02日 22:02:34 +02:00
template Probably better systemd config 2024年11月16日 09:37:56 +02:00
.gitignore Use an actual config, systemd template, minor fixes 2024年11月03日 20:24:06 +02:00
build.js Dumbass 2024年11月03日 20:30:40 +02:00
config.example.js Lol oof 2024年11月03日 20:28:04 +02:00
LICENSE Initial commit 2023年12月19日 12:24:51 +02:00
package.json Add a silly pinger thing 2024年11月02日 21:58:56 +02:00
pnpm-lock.yaml Add a silly pinger thing 2024年11月02日 21:58:56 +02:00
README.md Use an actual config, systemd template, minor fixes 2024年11月03日 20:24:06 +02:00

This Computer

Shows your IP address(es). Powered by a single static file and a Nginx config.

Available at this.computer.

Make your own

  • Install Nginx, Certbot and Node.js (for the "build script").
  • Have a hostname for the website.
  • Have two hostnames for the IP checks, one with just an A record, one with just AAAA.

Copy config.example.js to config.js and edit as needed.

# install the few dependencies (pnpm is preferred but npm will work too)
pnpm install
# this generates `dist/index.html` and nginx configs in conf/
node build.js
# LetsEncrypt setup (skip and edit the main config if you prefer handling it yourself)
# If target does not exist, try /etc/nginx/sites or /etc/nginx/conf.d 
sudo mkdir -p /srv/tmp
sudo cp conf/this-computer-certbot.conf /etc/nginx/sites-enabled/
sudo systemctl reload nginx
sudo certbot certonly --webroot -w /srv/tmp -d this.computer -d 4.this.computer -d 6.this.computer
# Assuming the above worked!
echo 'systemctl reload nginx' | sudo tee /etc/letsencrypt/renewal-hooks/deploy/nginx.sh
sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/nginx.sh
# After certificates are ready:
sudo cp conf/this-computer.conf /etc/nginx/sites-enabled/
sudo systemctl reload nginx
# Enable the pinger service
sudo systemctl enable --now $PWD/conf/this-computer-pong.service

License

MIT