I’m interested in creating an app that would use a command line executable (it’s available for Linux, Windows and OSX, so it’s reasonably portable). What is the recommended way to do this? Some ideas that come to mind are:
Use exec or shell_exec but I’m not sure if most NextCloud installations have those enabled. Do they?
Call the executable remotely via ssh but that would make installation more complicated and make it harder for the executable to access files stored in NextCloud.
Are there other/better ways to do it?
Are there any existing apps that use command line executables I could use as a model? I can certainly find a way to make it work but the goal of this question is to learn how to do it so installation is easiest on admins. Ideally they could just install the NC app and not have to do any external setup. If they have to do external setup, the easier the better.
Perhaps no better way …
But your “app” can put the command e.g. in a “text-file” and CRON execute it.
Then you do not have the problems with php and exec.
But there could be some security risks
I think you can program it outside nextcloud with a 10 lines php script.
I would have to call the exe on demand when the page loads, not periodically. I use hledger for personal finance/accounting and I keep the journal/ledger files in NextCloud. I’d like to make a NextCloud app that provides a web interface to this.