<feed xmlns='http://www.w3.org/2005/Atom'>
<title>farside/update.exs, branch main</title>
<subtitle>Farside fork</subtitle>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/farside/'/>
<entry>
<title>Use quantum core for update scheduling</title>
<updated>2021-11-24T16:35:21+00:00</updated>
<author>
<name>Ben Busby</name>
<email>noreply+git@benbusby.com</email>
</author>
<published>2021-11-24T16:35:21+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/farside/commit/?id=ff97d258f0ac2bbd3b89df892ce3aed08b5e0a42'/>
<id>ff97d258f0ac2bbd3b89df892ce3aed08b5e0a42</id>
<content type='text'>
Rather than requiring a traditional crontab install, the app now
leverages quantum-core (link below) to schedule the instance update/sync
task every 5 minutes. Some updates as a result:

  - The new job is scheduled at runtime in server.ex.
  - The update.exs script was refactored to be compiled along with the
    rest of the app as instances.ex.
  - Scheduler and Server modules were added for creating and executing
    the new update task
  - All shell scripts were removed, as they are no longer needed

https://github.com/quantum-elixir/quantum-core
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rather than requiring a traditional crontab install, the app now
leverages quantum-core (link below) to schedule the instance update/sync
task every 5 minutes. Some updates as a result:

  - The new job is scheduled at runtime in server.ex.
  - The update.exs script was refactored to be compiled along with the
    rest of the app as instances.ex.
  - Scheduler and Server modules were added for creating and executing
    the new update task
  - All shell scripts were removed, as they are no longer needed

https://github.com/quantum-elixir/quantum-core
</pre>
</div>
</content>
</entry>
<entry>
<title>Install crontab w/ script</title>
<updated>2021-11-15T23:44:26+00:00</updated>
<author>
<name>Ben Busby</name>
<email>noreply+git@benbusby.com</email>
</author>
<published>2021-11-15T23:44:26+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/farside/commit/?id=8ce5b04f510333b5e8552d30e84276e08c29ecb2'/>
<id>8ce5b04f510333b5e8552d30e84276e08c29ecb2</id>
<content type='text'>
This adds a couple of new scripts: install-crontab.sh and update.sh. The
install-crontab script does exactly that -- it installs a new crontab
that runs the update script every 5 minutes. An update script was added
to simplify the crontab a bit and to ensure the Elixir update script is
executed from the correct directory.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds a couple of new scripts: install-crontab.sh and update.sh. The
install-crontab script does exactly that -- it installs a new crontab
that runs the update script every 5 minutes. An update script was added
to simplify the crontab a bit and to ensure the Elixir update script is
executed from the correct directory.
</pre>
</div>
</content>
</entry>
<entry>
<title>Prevent same instance from being selected twice in a row</title>
<updated>2021-11-10T19:19:37+00:00</updated>
<author>
<name>Ben Busby</name>
<email>noreply+git@benbusby.com</email>
</author>
<published>2021-11-10T19:19:37+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/farside/commit/?id=8ee4f308a47ea613a97493b8afbe1aed02f80036'/>
<id>8ee4f308a47ea613a97493b8afbe1aed02f80036</id>
<content type='text'>
Introduces a new db key "&lt;service&gt;-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 &gt; 2

/:service request #1 -&gt; instance #1
/:service request #2 -&gt; instance #2
/:service request #3 -&gt; instance #1
/:service request #4 -&gt; instance #2

where there are many ignored instances for a particular service. One
possible solution would be to implement the "&lt;service&gt;-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 "&lt;service&gt;-previous" key.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduces a new db key "&lt;service&gt;-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 &gt; 2

/:service request #1 -&gt; instance #1
/:service request #2 -&gt; instance #2
/:service request #3 -&gt; instance #1
/:service request #4 -&gt; instance #2

where there are many ignored instances for a particular service. One
possible solution would be to implement the "&lt;service&gt;-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 "&lt;service&gt;-previous" key.
</pre>
</div>
</content>
</entry>
<entry>
<title>Move Service struct def to its own module</title>
<updated>2021-11-10T18:48:39+00:00</updated>
<author>
<name>Ben Busby</name>
<email>noreply+git@benbusby.com</email>
</author>
<published>2021-11-10T18:48:39+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/farside/commit/?id=d334fc76950b54eb641627d016b28a4824cf2657'/>
<id>d334fc76950b54eb641627d016b28a4824cf2657</id>
<content type='text'>
Service struct now defined in lib/service.ex

This makes a bit more sense now that its a shared resource, rather than
just defining it only in the update.exs script.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Service struct now defined in lib/service.ex

This makes a bit more sense now that its a shared resource, rather than
just defining it only in the update.exs script.
</pre>
</div>
</content>
</entry>
<entry>
<title>Skip querying all instances w/ "test mode"</title>
<updated>2021-11-09T22:12:58+00:00</updated>
<author>
<name>Ben Busby</name>
<email>noreply+git@benbusby.com</email>
</author>
<published>2021-11-09T22:12:58+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/farside/commit/?id=39c244d970d802e6ee2853cfbb5f73b8c06a2fdc'/>
<id>39c244d970d802e6ee2853cfbb5f73b8c06a2fdc</id>
<content type='text'>
Now allows setting FARSIDE_TEST to skip individually fetching each
instance, and instead just adds all of them to redis instantly. This
allows for an easier time in CI builds, for both the sake of speed and
to prevent a scenario where many simultaneous builds have a noticeable
impact on actual instances.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now allows setting FARSIDE_TEST to skip individually fetching each
instance, and instead just adds all of them to redis instantly. This
allows for an easier time in CI builds, for both the sake of speed and
to prevent a scenario where many simultaneous builds have a noticeable
impact on actual instances.
</pre>
</div>
</content>
</entry>
<entry>
<title>Display list of available instances on home page</title>
<updated>2021-11-09T00:08:19+00:00</updated>
<author>
<name>Ben Busby</name>
<email>noreply+git@benbusby.com</email>
</author>
<published>2021-11-09T00:08:19+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/farside/commit/?id=56b9c52528d1e514d4ec15f1da7517cd83bcf5ff'/>
<id>56b9c52528d1e514d4ec15f1da7517cd83bcf5ff</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor project to new name</title>
<updated>2021-11-07T19:29:06+00:00</updated>
<author>
<name>Ben Busby</name>
<email>noreply+git@benbusby.com</email>
</author>
<published>2021-11-07T19:29:06+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/farside/commit/?id=8042dcad0c61110111949a856c935325ca65f8ef'/>
<id>8042dcad0c61110111949a856c935325ca65f8ef</id>
<content type='text'>
The name of the project is being refactored from Privacy Revolver to
Farside. The reasoning behind this is:
1. A shorter name is easier to remember
2. It can stand for "FOSS alternative redirecting service" (which I know
doesn't encapsulate all letters from "farside", but it's close enough).

This commit also includes improvements to the update script for
determining how far along the script is.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The name of the project is being refactored from Privacy Revolver to
Farside. The reasoning behind this is:
1. A shorter name is easier to remember
2. It can stand for "FOSS alternative redirecting service" (which I know
doesn't encapsulate all letters from "farside", but it's close enough).

This commit also includes improvements to the update script for
determining how far along the script is.
</pre>
</div>
</content>
</entry>
<entry>
<title>Move constants to config, update string formatting</title>
<updated>2021-10-23T02:07:07+00:00</updated>
<author>
<name>Ben Busby</name>
<email>noreply+git@benbusby.com</email>
</author>
<published>2021-10-23T02:07:07+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/farside/commit/?id=76faebd234644d77429ddcefaf8ccdb8a1beff0d'/>
<id>76faebd234644d77429ddcefaf8ccdb8a1beff0d</id>
<content type='text'>
Not sure if this is the Elixir-y way to do this, but seems more logical
than hardcoding values such as redis connection.

Also went through and improved how string formatting was performed
throughout the app. Rather than "combining" &lt;&gt; "strings" this way, I'm
now just doing "#${variable}#{formatting}", which looks a lot cleaner.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Not sure if this is the Elixir-y way to do this, but seems more logical
than hardcoding values such as redis connection.

Also went through and improved how string formatting was performed
throughout the app. Rather than "combining" &lt;&gt; "strings" this way, I'm
now just doing "#${variable}#{formatting}", which looks a lot cleaner.
</pre>
</div>
</content>
</entry>
<entry>
<title>Write results of update script to file for debugging</title>
<updated>2021-10-23T00:07:59+00:00</updated>
<author>
<name>Ben Busby</name>
<email>noreply+git@benbusby.com</email>
</author>
<published>2021-10-23T00:07:59+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/farside/commit/?id=edcab37c7d48259c7cf7969f95cb4efdbd728c93'/>
<id>edcab37c7d48259c7cf7969f95cb4efdbd728c93</id>
<content type='text'>
The update script now writes the available instances to a
.update-results* file (where previous runs have "-prev" appended to the
file name). This helps to see how instance availability changes between
runs of the script when debugging overall functionality of the app.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The update script now writes the available instances to a
.update-results* file (where previous runs have "-prev" appended to the
file name). This helps to see how instance availability changes between
runs of the script when debugging overall functionality of the app.
</pre>
</div>
</content>
</entry>
<entry>
<title>Output available instances and fallback URL to redis</title>
<updated>2021-10-22T23:15:40+00:00</updated>
<author>
<name>Ben Busby</name>
<email>noreply+git@benbusby.com</email>
</author>
<published>2021-10-22T23:15:40+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/farside/commit/?id=4949ae22bb2fd1b81cdfbbe21468015fb229b553'/>
<id>4949ae22bb2fd1b81cdfbbe21468015fb229b553</id>
<content type='text'>
Once a list of available URLs has been determined for a particular
service, the list is written as "service -&gt; [list of instances]" to a
local redis connection. These can then be used in the greater routing
logic to pick a random instance from the list, or use a fallback
instance if none are determined to be available.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Once a list of available URLs has been determined for a particular
service, the list is written as "service -&gt; [list of instances]" to a
local redis connection. These can then be used in the greater routing
logic to pick a random instance from the list, or use a fallback
instance if none are determined to be available.
</pre>
</div>
</content>
</entry>
</feed>
