[3.3][RC] Filter by country - version 1.0.10

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
</Solidjeuh>
Registered User
Posts: 1779
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [3.3][RC] Filter by country - version 1.0.10

Post by </Solidjeuh> »

MarkDHamill wrote:
Wed Jan 22, 2020 4:57 pm
The cron logic hasn't changed. Since today is Wednesday, presumably it will refresh the database today, as long as at least seven days have elapsed since the database was last fetched.
Cron needs to run for the first time. Ext installed 4 days ago.
So normally today.... :roll:

Image
Forum for NL Extension translations ---> https://www.supportforum.be
----------------------------------------------------------------------------

User avatar
MarkDHamill
Registered User
Posts: 4101
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [3.3][RC] Filter by country - version 1.0.10

Post by MarkDHamill »

Probably next Wednesday then.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
</Solidjeuh>
Registered User
Posts: 1779
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [3.3][RC] Filter by country - version 1.0.10

Post by </Solidjeuh> »

MarkDHamill wrote:
Wed Jan 22, 2020 5:43 pm
Probably next Wednesday then.
Okay I'll check it :D
Forum for NL Extension translations ---> https://www.supportforum.be
----------------------------------------------------------------------------

BF79
Registered User
Posts: 344
Joined: Fri Feb 13, 2015 1:28 pm

Re: [3.3][RC] Filter by country - version 1.0.10

Post by BF79 »

my friend no chance to see another ext for vpn and proxies :(
even if I ban country or ip range the banned members can also register again with proxy !!

thanks in advance to take my request into consideration ;)

User avatar
MarkDHamill
Registered User
Posts: 4101
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [3.3][RC] Filter by country - version 1.0.10

Post by MarkDHamill »

We previously determined that an IP assigned to a country could also be assigned to a VPN, i.e. the MaxMind country code database does not distinguish between those that are used by VPNs are not.

MaxMind does have an anonymous IP database, but it's not free:

https://www.maxmind.com/en/solutions/ge ... ctFeatures

Not sure what it costs, but I'm dubious the phpBB group would approve an extension that requires a paid product for some part of its functionality. I doubt they would pay for the service to validate the extension.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
MarkDHamill
Registered User
Posts: 4101
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [3.3][RC] Filter by country - version 1.0.10

Post by MarkDHamill »

Thanks for all your testing. As I don't have an active production phpBB board anymore, I depend on you to test the extension. So I need your opinion on whether you think it is ready for submission for review.

Is it correctly blocking or allowing the countries you specify?

Is the database being refreshed automatically on Wednesdays? Since it's attached to a phpBB cron, if there isn't any board traffic it may not refresh on a Wednesday, but when the board next gets traffic. You can check the date/time stamp of the database in the /store/phpbbservices/filterbycountry folder, and/or look at the timestamp in the database and convert it into something readable:

Code: Select all

SELECT from_unixtime(config_value) FROM `phpbb_config` WHERE config_name = 'phpbbservices_filterbycountry_cron_task_last_gc' 
Are there any missing features you think are needed?
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
bubbathegimp
Registered User
Posts: 125
Joined: Tue Sep 25, 2018 8:02 pm
Location: Off Plumb
Name: Bubba
Contact:

Re: [3.3][RC] Filter by country - version 1.0.10

Post by bubbathegimp »

Never seen this before

"Anonymous 51.158.123.35 Tue Feb 18, 2020 11:38 am Filter by country: An invalid IP of 1.1 scw-par1-node14 (squid) was detected in the HTTP header “HTTP_VIA“ for username “Anonymous“.
Anonymous 51.158.123.35 Tue Feb 18, 2020 11:38 am Filter by country: An invalid IP of 1.1 scw-par1-node14 (squid) was detected in the HTTP header “HTTP_VIA“ for username “Anonymous“.
Anonymous 51.158.123.35 Tue Feb 18, 2020 11:37 am Filter by country: An invalid IP of 1.1 scw-par1-node14 (squid) was detected in the HTTP header “HTTP_VIA“ for username “Anonymous“.
Anonymous 51.158.123.35 Tue Feb 18, 2020 11:37 am Filter by country: An invalid IP of 1.0 scw-par1-node14 (squid) was detected in the HTTP header “HTTP_VIA“ for username “Anonymous“."

Anything to worry about??!!
looking up the IP, It came from France...
Old enough to remember when Water was free, and you had to pay for Porn :o

User avatar
MarkDHamill
Registered User
Posts: 4101
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [3.3][RC] Filter by country - version 1.0.10

Post by MarkDHamill »

Nothing to worry about. The IP is not valid so it can't be used for determining access. The real IP should be in the REMOTE_ADDR HTTP header. It was suggested that the extension scan additional headers that could be present and the logging feature captures these if it is enabled. All valid IPs must be associated with the country codes allowed.

Not sure these particular log entries should get created, but they seemed useful for tracking issues with odd IPs so I decided to log them.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
janus_zonstraal
Registered User
Posts: 4187
Joined: Sat Aug 30, 2014 1:30 pm

Re: [3.3][RC] Filter by country - version 1.0.10

Post by janus_zonstraal »

Not sure these particular log entries should get created, but they seemed useful for tracking issues with odd IPs so I decided to log them.
But the logs are growing fast, there for I disable your extension :(
Sorry! My English is bat ;) !!!

User avatar
MarkDHamill
Registered User
Posts: 4101
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [3.3][RC] Filter by country - version 1.0.10

Post by MarkDHamill »

The logging can be turned off on the extension's settings page. You might want to do this rather than disable the extension. It's also easy to clear the log.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
janus_zonstraal
Registered User
Posts: 4187
Joined: Sat Aug 30, 2014 1:30 pm

Re: [3.3][RC] Filter by country - version 1.0.10

Post by janus_zonstraal »

OK, I will try it again but login is off, and I see a lot of errors in the admin logs.
Screenshot_2020-02-20 Beheerderslog.png
Sorry! My English is bat ;) !!!

User avatar
MarkDHamill
Registered User
Posts: 4101
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [3.3][RC] Filter by country - version 1.0.10

Post by MarkDHamill »

Lines 211-219 in /ext/phpbbservices/filterbycountry/event/main_listener.php should be:

Code: Select all

						// IP is not valid
						if ($this->config['phpbbservices_filterbycountry_allow_out_of_country_logins'])
						{
							if (!$test_mode)
							{
								$this->log->add(LOG_ADMIN, $this->user->data['user_id'], $this->user->ip, 'LOG_ACP_FBC_BAD_IP', false, array($ip, $ip_key, $this->user->data['username']));
							}
							else
							{
								$this->log->add(LOG_ADMIN, $this->user->data['user_id'], $this->user->ip, 'LOG_ACP_FBC_BAD_IP', false, array($ip, 'HTTP_TEST_HEADER', $this->user->data['username']));
							}
						}
This will ensure they don't end up in the log if logging is disabled.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
MarkDHamill
Registered User
Posts: 4101
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [3.3][RC] Filter by country - version 1.0.10

Post by MarkDHamill »

Sorry, that should be:

Code: Select all

						// IP is not valid
						if ($this->config['phpbbservices_filterbycountry_log_access_errors'])
						{
							if (!$test_mode)
							{
								$this->log->add(LOG_ADMIN, $this->user->data['user_id'], $this->user->ip, 'LOG_ACP_FBC_BAD_IP', false, array($ip, $ip_key, $this->user->data['username']));
							}
							else
							{
								$this->log->add(LOG_ADMIN, $this->user->data['user_id'], $this->user->ip, 'LOG_ACP_FBC_BAD_IP', false, array($ip, 'HTTP_TEST_HEADER', $this->user->data['username']));
							}
						}
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
janus_zonstraal
Registered User
Posts: 4187
Joined: Sat Aug 30, 2014 1:30 pm

Re: [3.3][RC] Filter by country - version 1.0.10

Post by janus_zonstraal »

Thanks
Sorry! My English is bat ;) !!!

User avatar
janus_zonstraal
Registered User
Posts: 4187
Joined: Sat Aug 30, 2014 1:30 pm

Re: [3.3][RC] Filter by country - version 1.0.10

Post by janus_zonstraal »

Sorry blank page with that change. :(
Sorry! My English is bat ;) !!!

Post Reply

Return to “Extensions in Development”