I have an app, where I need to host a license bound to a specific machine. The way this is done is, that a script is being run on the machine to generate some identifiers, and the license is then created to be valid for only that machine.
The problem is, that when the app is redeployed on Fly, the machine is different, thus invalidating the license.
My question is as follows: Is there a way to have a completely “static” environment on Fly.io? We would need the machine – and probably also the IP – to remain the same after a redeploy.
Most likely we won’t redeploy this intentionally, I’m mostly concerned about outages or hardware upgrades.
I believe Apps V2 are tied to hardware and don’t change hosts. Instance goes down when there is a hardware failure. That’s why they ask to make duplicate instances for higher availability.
“Static” env would exactly be vulnerable to outages and hardware failures
You can get static IPv4 for $2/mo, not sure if it helps
The app is an Apps V2 app in a Docker container. What I’ve seen is, when I run the ID script, the output is different on each deploy.
A duplicate instance is a good practice, but in this case the license would not be valid on that instance as it is not the very same machine/instance it was generated for. I need a different workflow for disaster recovery, but that’s a whole different headache.
In summary, I need the machine to be the same after reboot. Happy to pay for that, of course, I just don’t know if Fly offers this …
How are you deploying / what strategy are you using? Usually flyctl will update machines rather than replace them.
I see you have two machines in your app. Running fly scale count 1 may help.
If you are not already doing this, you probably want to store the generated license information in a volume, so it persists after an update.
Thanks for your reply. I followed your suggestions:
Application scaled down to 1 machine
Added a persistent volume and attached it to the app
Deployed the app in a Docker container with fly deploy
Next, I moved the ID script onto the volume and ran it
As a test, I redeployed the app with no changes
Finally, I verified that the ID script was persisted, and ran it once more
Unfortunately, the output of the script is different between the two deployments. I’m assuming that even if the volume is the same, the machines are different. That means that in case of an real outage, the license will become invalidated …
The way it works, is that I run the script and send the output to a vendor, who in turn sends me a license file. I then a run a tiny server which will verify that the license is located on the same machine for which it is generated. If there’s a mismatch, I can’t use their software.
So the license file need to be persisted, of course, but the challenge is that the original machine remains unchanged.
It’s an archaic setup in our modern world of SaaS, but such is life …
I’ve sent you the executable on email. We can continue the discussion on email or here, as you prefer. Or perhaps just post the outcome here later, for others to enjoy.
I sent you an email with more details, but in short: commercial licensing software like this tends to check as many things as possible, and getting all of those to be persistent across deploys is likely more trouble than it’s worth. Unfortunately, I don’t see a way to get this working on Fly without either custom support from the license provider or a lot of manual effort.