Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sender column in cache.db shows invalid IP #503

Closed
binwiederhier opened this issue Nov 16, 2022 · 9 comments
Closed

Sender column in cache.db shows invalid IP #503

binwiederhier opened this issue Nov 16, 2022 · 9 comments
Labels
🪲 bug Something isn't working server Relates to the main binary (server or client)

Comments

@binwiederhier
Copy link
Owner

sqlite> select * from messages limit 10
   ...> ;
247|OIvQ1dqYzCYP|1668540105|aa|triggered||0||||||0|0||invalid IP||1|
248|yRmpGNK6Rtnr|1668540105|aa|triggered||0||||||0|0||invalid IP||1|
249|CYfstoAzWhx6|1668540105|aa|triggered||0||||||0|0||invalid IP||1|
250|9bqeSW4eQwL2|1668540105|aa|triggered||0||||||0|0||invalid IP||1|
251|M6jJkh3UpIWo|1668540105|aa|triggered||0||||||0|0||invalid IP||1|
252|EI39IZaXIH3Z|1668540105|aa|triggered||0||||||0|0||invalid IP||1|
253|h8lqfzT4xtrx|1668540106|aa|triggered||0||||||0|0||invalid IP||1|
254|vDrRlh3DdiJx|1668540155|aa|triggered||0||||||0|0||invalid IP||1|
255|SoomY2DjlmXU|1668540155|aa|triggered||0||||||0|0||invalid IP||1|
256|oueH0BOGr0tm|1668540155|aa|triggered||0||||||0|0||invalid IP||1|
@binwiederhier binwiederhier added 🪲 bug Something isn't working server Relates to the main binary (server or client) labels Nov 16, 2022
@binwiederhier
Copy link
Owner Author

Likely related to the work in #429
/cc @karmanyaahm

@karmanyaahm
Copy link
Contributor

I'll see what I can find

@karmanyaahm
Copy link
Contributor

Are there any patterns (to help me reproduce this)? Is it happening often or rarely; for any content or just "triggered"; with no attachments?

@binwiederhier
Copy link
Owner Author

sqlite> select count(*) from messages where sender='invalid IP';
count(*)  
----------
137932    
       
sqlite> select count(*) from messages where sender<>'invalid IP';
count(*)  
----------
1239    

Pretty much all messages have this. I may have time to look tonight a little.

@binwiederhier
Copy link
Owner Author

binwiederhier commented Nov 17, 2022

It is worth noting that I'm behind nginx with the config mentioned here: https://docs.ntfy.sh/config/#nginxapache2caddy
Maybe an issue with X-Forwarded-For parsing?

@karmanyaahm
Copy link
Contributor

I only ever tested with Caddy, so that might be it, I"ll try setting up nginx.

@binwiederhier
Copy link
Owner Author

Don't worry about it. I can probably figure it out. Unless you're eager to learn nginx hehe

@binwiederhier
Copy link
Owner Author

https://pkg.go.dev/net/netip#Addr.String

String returns the string form of the IP address ip. It returns one of 5 forms:

  • "invalid IP", if ip is the zero Addr
    ...

@karmanyaahm
Copy link
Contributor

Interesting ... so I should've set the 'invalid IP's to empty strings, and validated them at parse time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working server Relates to the main binary (server or client)
Projects
None yet
Development

No branches or pull requests

2 participants