I need to upgrade the metadata in post install script, for instance, upgrade the picklist values for some fields, as those values are not updatable for the existing orgs. Not matter I tried to use ToolingAPI or Metadata API, I was asked to specified the instance url in the remote site settings, otherwise, the endpoint is invalid. Do I have to add the instance url in each of the orgs, or is there any way to bypass this limit? Ideally, I don't want to add that in the remote site settings, as the instance url could be changed in case Salesforce does split in the future.
One method an evangelist told me about was to use a proxy, e.g. on heroku. So you callout goes every time to the same endpoint. Add the instance where your org is located to the request and the proxy is doing the final callout to the appropriate endpoint at salesforce again.
So you would only need one remote site which is the same for all orgs.
For my taste not good, because it won't make things faster and in all my scenarios I am counting each second to save...
As I said above, you can never add all possible endpoint for the all users, because of the myDomains.
What we did in the end is to add a couple of common endpoints to the package (like naXX,euXX,csXX) - but be even careful with that, because if you add to many, the confirm button will slide outside visible screen - and there are no scrollbars to reach it...