https://github.com/hjfitz/phone-home
Phone home to any given server
https://github.com/hjfitz/phone-home
api ip ipv4 node rest server
Last synced: about 1 month ago
JSON representation
Phone home to any given server
- Host: GitHub
- URL: https://github.com/hjfitz/phone-home
- Owner: hjfitz
- Created: 2018-12-07T11:01:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-07T11:07:42.000Z (over 7 years ago)
- Last Synced: 2025-10-20T02:50:51.103Z (8 months ago)
- Topics: api, ip, ipv4, node, rest, server
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Phone Home
> Have all of your devices call in, and know when they were online last
## Setup
1. Install deps:
```bash
yarn
```
2. Create some certificates. I like self-signing
```bash
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
```
3. Run the server
```bash
node server
```
## Interacting with the server
Do it lazily with cURL!
### Updating
```bash
curl -X POST -H "authorization: secrets don't go on github" https://SERVER_URL:5001/key/laptop -k
```
### Retrieving All Records
```bash
curl -H "authorization: secrets don't go on github" https://SERVER_URL:5001/all -k
```
## Running on Startup
Create a Systemd service unit:
```ini
[Unit]
Description=Phone Home Service
[Service]
ExecStart=/path/to/curl_script
[Install]
WantedBy=multi-user.target
```
* Save it under `/etc/systemd/system/phone-home.service`
* Start the service `sudo systemctl start phone-home.service`
* Enable it! `sudo systemctl enable phone-home.service`