I’ve had EMONCMS running since, I think about 2018. Originally it was on an AWS server but about 3 years ago I migrated it to a local Pi4 with a SATA hat to stop crashing SD cards.
Its been great and fulfills my needs. Anyway - I always objected to needing to logon locally but was really too lazy to figure out the PHP code to implement. I also use a CloudFlared tunnel so I can see what’s happening when away from home. Cue Claude Code…
Here is Claude’s implementation to a single file /var/www/emoncms/Modules/user/user_model.php that not only allows me direct (no logon) local access but also recognises a tunnel logon and prompts for the UN/Password. The only gotcha is you will need to stuff your username into $local_autologin_user = ‘xxxx’; line. FYI - this might break any EMONCMS updates but I think the login modules are pretty stable
user_model.zip (7.6 KB)
This might be of use to someone. BTW Claude Code is truly scary. It updated my shit personal webpage in under 15 minutes to something that suits me fine.
/Tony