i3detroit / homeassistant-config

home assistant configuration files
https://www.i3detroit.org/wiki/Category:IoT
1 stars 1 forks source link

Copy spaceapi json to frontpage server #18

Closed mtfurlan closed 6 years ago

mtfurlan commented 6 years ago

Need to make an account on the i3 server and figure out how to make that account only able to do the one thing.

curl http://10.13.0.22:8123/api/spaceapi | ssh i3 "cat - > /var/www/spaceapi.json"

UnixMonky commented 6 years ago

easiest way is probably to create the "do one thing" as a script, then make that script the defined shell of the user.

Just for curiosity, why does this need a separate user instead of a cron job? And is this sshing to itself?

mkfink commented 6 years ago

https://www.i3detroit.org/spaceapi/status.json Did: https://www.howtoforge.com/restricting-users-to-sftp-plus-setting-up-chrooted-ssh-sftp-debian-squeeze and spaceapi is chroot jailed in /home/spaceapi with write access to /home/spaceapi/json, and symlinked /home/spaceapi/json to /var/www/spaceapi