summaryrefslogtreecommitdiff
path: root/lib/farside.ex
AgeCommit message (Collapse)Author
2025-01-21Rewrite project, add daily update of services listBen Busby
The project was rewritten from Elixir to Go, primarily because: - I don't write Elixir anymore and don't want to maintain a project in a language I no longer write - I already write Go for other projects, including my day job, so it's a safer bet for a project that I want to maintain long term - Go allows me to build portable executables that will make it easier for others to run farside on their own machines The Go version of Farsside also has a built in task to fetch the latest services{-full}.json file from the repo and ingest it, which makes running a farside server a lot simpler. It also automatically fetches the latest instance state from https://farside.link unless configured as a primary farside node, which will allow others to use farside without increasing traffic to all instances that are queried by farside (just to the farside node itself).
2024-01-08Update reddit + ig frontends, update rate limitingBen Busby
Farside ratelimiting has been updated to return a 429 when a user exceeds 1 request/sec. This should help eliminate a lot of scraping type behavior that instance maintainers have been dealing with from Farside lately. Service changes: - Teddit removed (not maintained) - Bibliogram replaced by Proxigram - Libreddit merged with redlib
2024-01-08Replace bibliogram w/ proxigramBen Busby
Closes #149
2024-01-08Replace libreddit w/ redlib, remove tedditBen Busby
Teddit is no longer maintained Libreddit has been forked to redlib, which seems to be actively trying to work around the changes to Reddit's API. Libreddit instances are now a mirror of redlib instances for the time being.
2023-09-28Redirect x.com links to nitter instancesBen Busby
Closes #136
2023-07-17Add GotHub support (#116)NoPlagiarism
Adds support for GotHub, an alternative frontend for GitHub --------- Co-authored-by: Ben Busby <contact@benbusby.com>
2023-05-19Add support for Anonymous OverflowBen Busby
A Stack Overflow frontend, see: https://github.com/httpjamesm/AnonymousOverflow
2023-05-19Add support for BreezeWikiBen Busby
Includes nightly build support for automatically pulling the most up to date instance list. Closes #104
2023-03-14Fix auto-redirect regex for gtranslate vs gsearchBen Busby
The redirect regex for google search (~r/google.com) would also match for google translate requests. This updates the search regex to also require the "/search" path to be present in the original link.
2023-01-13Add parent relation for whoogle (#84)FriendlyPigeon
2022-12-11Ignore request types in routerBen Busby
Request types don't really matter in Farside, and should be ignored. This updates the router to handle all request types (GET, HEAD, POST, etc) the same as GET requests were handled previously.
2022-10-31Remove Redis dep, replace w/ native Elixir libBen Busby
This removes the dependency on Redis for core app functionality. Rather than using the key/value store provided by Redis, Farside now uses a key/val store provided by [cubdb](https://github.com/lucaong/cubdb) for identical functionality but without reliance on a non-Elixir service. This solution was chosen instead of ets, because storing instance data in memory leads to a period of broken functionality whenever the app restarts and hasn't re-populated instance data yet. It was also chosen instead of dets, because the documentation for dets was pretty hard to understand at first glance. Tests and the CI build were updated to reflect the removed dependency on Redis. New environment variable `FARSIDE_DATA_DIR` can be used to point to a directory where the instance data can be stored by cubdb. Co-authored-by: Jason Clark <mithereal@gmail.com>
2022-07-31Fix spelling of quetre (#55)alvv-z
2022-07-27Support libremdb and querte (imdb and quora alts)Ben Busby
Includes support for redirecting via full url, ie: -> farside.link/https://www.imdb.com/title/tt0133093/ will redirect to a libremdb instance. Closes #48
2022-06-21Add proxitok (TikTok frontend)Ben Busby
Closes #19
2022-06-21Prepend `/u/` for Bibliogram redirects if not presentBen Busby
Bibliogram links require a "/u/" prefix when viewing a user's profile, which does not match Instagram's URL paradigm. This adds a bit of logic for Bibliogram links to prepend this prefix if the user is not visiting a post (indicated by a "/p/" prefix, which Bibliogram and Instagram BOTH use) or the home page of an instance (indicated by an empty path value).
2022-06-21Redirect youtu.be links to the correct instanceBen Busby
Farside was previously only looking for links containing "youtube.com" when performing the redirect for full URLs to youtube, which obviously doesn't work for youtu.be shortened links. This updates the matching logic to use a regex element for every key in the services map in order to match against multiple possible domains for each parent service. Fixes #40
2022-06-09Auto select frontend for links to "parent" serviceBen Busby
Farside now supports redirecting based on a provided link to a "parent" service, if such a parent service is supported. For example, a link such as: farside.link/https://www.youtube.com/watch?v=dQw4w9WgXcQ will now redirect to any of the available YouTube related frontends. This works by matching against a mapping of "parent" service domains ("youtube.com", "reddit.com", etc) to a list of their respective frontend alternatives (["invidious", "piped"], ["libreddit", "teddit"], etc). A random element is chosen from this list, and the remainder of Farside's routing logic proceeds as if the user had chosen the service directly to begin with. Closes #37
2022-03-18Reuse previous instance within rate-limit intervalBen Busby
Rather than blocking <1s back-to-back queries from the same IP, Farside will now re-use the previously selected instance. Fixes #20
2021-11-10Prevent same instance from being selected twice in a rowBen Busby
Introduces a new db key "<service>-previous" to track which instance was last selected for a particular service. This allows for filtering the list of available instances to exclude the instance that was last picked, to ensure a (slightly) more even distribution of traffic. There's still the possiblity of the following scenario, however: :service instances > 2 /:service request #1 -> instance #1 /:service request #2 -> instance #2 /:service request #3 -> instance #1 /:service request #4 -> instance #2 where there are many ignored instances for a particular service. One possible solution would be to implement the "<service>-previous" value to be a list, rather than a single value, and push to that list until only one element is left in the original "instance" array after filtering, and then delete the "<service>-previous" key.
2021-11-10Move instance selection logic out of routerBen Busby
The process of selecting a random (working) instance for a specified service has been moved out of the router and into lib/farside.ex. Moving forward, the router itself should have very simple and easy to follow logic for all paths.
2021-11-10Simplify retrieval of service keys from redisBen Busby
Can just use a wildcard in the initial keys query, rather than grabbing all keys and filtering by service prefix.
2021-11-08Display list of available instances on home pageBen Busby
This introduces a number of new changes: - Services are now inserted into redis with a prefix prepended to the key name. This allows for easier filtering to get only live instances. - The home page now uses an eex template for displaying all live instances for every service, determined by the last update - A "last_updated" field was added - farside.ex was added to contain all functionality related to querying for instances (WIP) - Other improvements