Bitcoin HD wallet forwarder without depending on a 3rd party? I want to setup a REST API service that does 3 simple things.  


Ask it to generate a new address (ideally from a BIP32 xpub key tree)
Notify my server application when a deposit and confirmation X happens.
Once the deposit is confirmed, forward the funds to another address and invoke a script in PHP or node.


I was originally going down the bitcoind walletnotify route but a few issues popped up (namely no HD support, scalability of having 10000's of addresses being monitored on a bitcoind is apparently a bad idea??  Is this true?).

I've therefore been setting up Ubuntu as a server and looking at bitcore + bitcoind with node.js to solve this which is painful on v14.04 for some reason... am I barking up the wrong tree and/or is there an easier approach?  I can't believe I'm the only one who's needing this so feel like I'm missing an obvious trick here as it's like pulling teeth.

I don't want to rely on a 3rd party server because if they disappeared I don't want to risk my business collapsing overnight.  I am happy using 3rd party code base or servers if they are open source though.  I've used blockchain.info's API previously which was excellent but really want an in house solution.
I don't know of a solution that works out-of-the-box with the requirements you've set. However, you can do some of what you need using some command-line tools available on github.

Pycoin has a key utility which can be used to derive bip0032 addresses given a root. Here's a quick primer on how to use it:

$ git clone http://github.com/richardkiss/pycoin
$ cd pycoin
$ sudo make
$ ku &lt;your xpub or xprv key&gt; -s 0/1/2/3/4


This will show you the data on the bip0032 key at the path m/0/1/2/3/4. If you add the -a argument, you can get the address at this path. If you add the -W argument instead (using an xprv key), you get the WIF format. This WIF format can be imported to bitcoind and that in turn can be used to notify you and do what you need afterwards. You can delete that key after payment, which should generally leave the number of addresses being watched lower than it might be (though you'll want to purge every once in a while). This could work, but I would NOT recommend it as it's horrible security. Of course, that's probably why you're forwarding funds to another address right away, so that makes sense.

You're going to have to write some code regardless. bitcore is a fine library for doing HD wallet stuff, but the notification is always the tricky bit.