Commit Graph

14 Commits

Author SHA1 Message Date
evazion
fc122cbc5a tests: fix broken tests. 2022-09-24 03:49:10 -05:00
evazion
e3af738371 tests: fix broken tests. 2022-08-24 02:03:37 -05:00
evazion
0fe9356bf6 tests: fix broken tests. 2022-05-20 22:51:02 -05:00
evazion
2bb5ad78fb tests: fix broken tests.
* Fix a bug where creating posts failed if IQDB wasn't configured.
* Fix broken Skeb test caused by changed URL.
* Fix broken IP geolocation tests caused by API returning different data.
* Fix broken post regeneration tests.
2022-01-31 14:17:14 -06:00
evazion
c455c08b2c tests: fix broken tests.
Fixups for c3c4f5a2a.
2022-01-15 22:02:47 -06:00
evazion
edd0656b73 tests: fix broken tests. 2022-01-06 00:41:18 -06:00
evazion
dccc2edb75 tests: fix broken tests.
* Fix a Twitter test broken by a privated tweet.
* Fix an IP geolocation test broken by the ipregistry.co API returning new data.
2021-11-02 04:42:07 -05:00
evazion
eddff747d6 Fix certain IPs not being recognized as proxies.
Fix certain IPs (namely Digital Ocean IPs) no longer being recognized as
proxy IPs by the Ipregistry.co API. Caused by some sudden change in the
API.
2021-10-27 00:05:44 -05:00
evazion
ac12efb636 tests: fix test failures when running without API keys.
Fix the test suite failing when trying to run it in the default state
with no config file or API keys configured. Most source sites require
API keys or login credentials to be set in order to work. Skip these
tests when credentials aren't configured.
2021-09-22 04:33:36 -05:00
evazion
ffbf7f1ccf tests: fix broken tests. 2021-05-15 02:48:13 -05:00
evazion
d478d72e0b tests: fix ip geolocation test. 2021-03-08 01:30:02 -06:00
evazion
206ff2b836 tests: fix ip geolocation test. 2021-02-15 00:38:59 -06:00
evazion
410a37ec80 tests: fix ip geolocation test. 2021-02-04 00:20:52 -06:00
evazion
65adcd09c2 users: track logins, signups, and other user events.
Add tracking of certain important user actions. These events include:

* Logins
* Logouts
* Failed login attempts
* Account creations
* Account deletions
* Password reset requests
* Password changes
* Email address changes

This is similar to the mod actions log, except for account activity
related to a single user.

The information tracked includes the user, the event type (login,
logout, etc), the timestamp, the user's IP address, IP geolocation
information, the user's browser user agent, and the user's session ID
from their session cookie. This information is visible to mods only.

This is done with three models. The UserEvent model tracks the event
type (login, logout, password change, etc) and the user. The UserEvent
is tied to a UserSession, which contains the user's IP address and
browser metadata. Finally, the IpGeolocation model contains the
geolocation information for IPs, including the city, country, ISP, and
whether the IP is a proxy.

This tracking will be used for a few purposes:

* Letting users view their account history, to detect things like logins
  from unrecognized IPs, failed logins attempts, password changes, etc.
* Rate limiting failed login attempts.
* Detecting sockpuppet accounts using their login history.
* Detecting unauthorized account sharing.
2021-01-08 22:34:37 -06:00