gemlikes icon indicating copy to clipboard operation
gemlikes copied to clipboard

Use salt when generating ids from ips

Open jdpage opened this issue 3 years ago • 5 comments

Implemented salting for IP addresses, per #6

jdpage avatar Feb 28 '21 21:02 jdpage

I made the default behavior to create a new salt file, but that means that old installations which upgrade need to set the setting to "disabled" to retain the old behavior, which might not be what you want.

jdpage avatar Feb 28 '21 21:02 jdpage

Thanks for adding this! Two things: As I told someone in #7, please make the salt config option a global variable rather than parsing the config file again. Secondly, don't ready from the salt file every time the function is called, that's inefficient. Just do all the salting logic in the Init and have a global salt variable.

makew0rld avatar Mar 01 '21 17:03 makew0rld

Okay, yeah, I don't have a good excuse for why I implemented it that way. I'm gonna chalk it up to having an off day :sweat:

It now sets up a slice during init, leaving it empty if salting is disabled.

Oh, and I changed the permissions on the salt file to 0644, to match the permissions used elsewhere.

jdpage avatar Mar 02 '21 08:03 jdpage

Sorry for leaving this for so long. This project is not a top priority for me, as it's more of toy. But anyway I'm happy to merge this, just have one comment, see above.

makew0rld avatar Jun 25 '21 17:06 makew0rld

@jdpage any interest in finishing this up?

makew0rld avatar Sep 21 '21 00:09 makew0rld