Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Hi Owen and Pangolins!
I just saw the pull request #2095 and was intrigued to add also a region rule.
I realized that something like that would be useful for regions of the earth with a high country density, it can be extremely tedious to create large amounts of rules.
I had a look around on what regional "classifications" there are and chose the one of the United Nations Statistical Division ("M49 Standard") which apparently also somehow got into Unicode.
This feature aims to add the rule cateogory "Region" based on that.


The numbers in parentheses are the M49 codes according to the UNSD.
Also included are three language localizations that I could do. English, German and Russian. I assume one could use a regular translator for the rest as the localizations are just single words. I however didn't want to mess with any "translation workflow", so I skipped on language I do not speak good enough.
Happy Holidays,
Dennis
How to test?
Testing this should work straight without any modifications to the way you run the container.
It is based on the same principles as the country rules.
I had some issues with integration testing resource accesses locally. If anyone has some time, a nice tutorial would be awesome!
Also, I had some issues with the drizzle.config.ts files in WSL/Windows. I had to exchange the
const schema = [path.join(...)]withconst schema = ["server/db/sqlite/schema/"]. Not sure if this is good or not, but it made me follow the instructions in the docs.I however verified with curl that verifySession responds correctly according to the set rules shown above when messing around with the reported IP:
reports back
while exchanging the IP with an IP outside Europe, the API reports:
Please thoroughly double-check this on a working integration test server.
What could be improved?