Other popular web frameworks for other platforms usually include a usually extendable command line tool for handling specific tasks.
Such tasks could be:
Generate random data for manual testing
Export something to csv
Clean up temp data in db or temp files
…
Until now I have managed with writing command functions and triggering them from “meteor shell”,
but that’s not really where I want to be.
I would need such a tool where I could write custom scripts/commands and have them execute in a fully loaded Meteor environment.
Both on development and on production setups built with meteor build.
Is there anything out there for me?
Or is it relatively easy to bootstrap the whole meteor environment in a node.js script so I can write my own cli?
Oh I see. Then your safest bet would be to go a pure node (+ DDP) way so that you can create the workings of your CLI in node all the while speaking to your meteor app in its own language.
Yeah, I guess just using a node DDP client like this and basically creating a management API makes sense.
That would also be convenient for cloud deployments etc.
I would want to limit access to certain IPs though, like 127.0.0.1 or a range of ips in the local network.
Is there any way to do this?
I don’t see a way to get the client IP in a Meteor method.
this.connection returns an object that carries clientAddress and httpHeaders both of which provide you the IP address that the connection is originating from. You can check that and allow/block as necessary.