#go build limiter

10 messages · Page 1 of 1 (latest)

candid sentinel
#

Quick explaination ...
Now let's say you are using for example go build main.go and then you get your build , how can you limit this build?. Like i want this build to be able to run for only 1 month, after that you get an error of some sort that prevents running it, what is the best way to do that maybe with a date?🤔🤔🤔

velvet perch
#

date wont do it. you can change date on the computer.

raven steeple
#

This is not a feature which comes standard in any compiler I am aware of -- Go or otherwise.
May I ask why you want to do this?

#

Oh. I misunderstood. You'd like to make the binary unusable after that time?

#

Hrm. This isn't quite what you want but it gets part way there. Maybe you can build on it.

  1. Build your binary.
  2. Encrypt it.
  3. go:embed the encrypted binary into the binary which you will distribute.
  4. Host a server which provides a server-side decryption mechanism. Buy or rent a static IP for the allotted time. The server, when contacted, will decrypt the binary and return it to the client.
  5. Host the binary in memory and run it as Go code... somehow 🤷. Don't write it to disk or you'll leak your binary.

Maybe there isn't a solution... If anyone can improve on this or knows a way to run a Go binary from in memory (maybe via an in-memory file system)... That ought to do it. A cracker could swipe the contents from memory but that's... Always possible.

candid sentinel
#

Well your idea is pretty cool actually but can i maybe link that binary to an api and control it with the api to make it easyier? 🤔🤔🤔

stone forge
#

there is not a good way to do this at all

#

the real solution is just don’t give them the binary

raven steeple
#

This is true. If you can build a client which talks to a server where you run your code -- that's the only way to have actual security