Ohm is a minimal app that helps break the cycle of endless scrolling. Ohm works by blocking domain fragments using NextDNS Denylist feature. It works best with websites but may also work with some apps.
Ohm gives you allowances which can be configured by domain. Each allowance can be configured with a session duration and a lockout period once the allowance is exhausted. An optional "cooldown" period can also be provided.
If cooldown
is not provided, Ohm is activated for a domain when you first query the domain (usually visiting the
website). Once it's activated, it starts a timer for that domain. Once the timer expires, it enables the corresponding
Denylist entry.
If cooldown
is provided, Ohm will monitor DNS query logs for the domain. If no requests are made for the time specified
by cooldown
, the block will not be inserted.
Note that browsers maintain very long-lived connections and typically systems have at least 2 layers of DNS caching. You may need to spend some time configuring Ohm for your system, or your system for Ohm.
See example-config.yaml
for an example of how to configure Ohm. You'll need to place a
configuration file at cmd/ohm/config.yaml
for it to be used.
The easiest way to deploy Ohm is with Fly.
- A NextDNS account (free).
- Add a NextDNS configuration profile for yourself.
- Enable query logging (
Settings
->Logs
). Ohm uses these logs to function.- You may disable
Log clients IPs
if you like, and retention can be dropped to 1h.
- You may disable
- Create a
Denylist
entry for each site you wish to block. - Note your profile's ID. This can be found in the URL when configuring your profile or from the
Setup
page. - Retrieve your API token from your
Account
page.
- Enable query logging (
- Configure any device (computer, phone etc.) That you'd like to use Ohm with to use the NextDNS profile created above.
- Add a NextDNS configuration profile for yourself.
- A Fly.io account (also free).
- Create an org for yourself
- Install and configure flyctl
- Clone this repository.
- Create a configuration file. See Configuration for details.
- Deploy Ohm to Fly
cd ohm/ flyctl apps create ohm flyctl secrets set OHM_NEXTDNS_KEY=<API token from above> OHM_NEXTDNS_PROFILE=<your profile ID from above> flyctl deploy
- Monitor logs.
flyctl logs
- Try visiting sites you've configured Ohm to monitor.
Ohm produces some metrics concerning its operation. You can query them by using Fly's built-in metrics stack. See: https://fly.io/docs/reference/metrics/#querying