Dan Jones @[email protected]

Husband, Father, Software Engineer (PHP, go, etc.). Lover of Star Trek and anime.

Looking for other things to do, such as writing, acting, voice acting, but not really finding the time for it. Maybe when my kids are a little older, I'll get back on stage.

Feeling pretty bleak about the future of the United States. #NeverTrump

Feel free to follow. I may follow back if we seem to have similar interests.

#BlackLivesMatter #TransRightsAreHumanRights #StayWoke

Other interests: #Parenting #StarTrek #Writing #Theater #anime #PHP #golang #Programming #WebDevelopment #genealogy #ScienceFiction #DadJokes

My Links

links.danielrayjones.com

Pronouns

he/him/his

XMPP

[email protected]

Mastodon account

fosstodon.org/@danjones000

LinkedIn

linkedin.com/in/danjones000

Résumé

danielrayjones.com

  • Notes
  • Articles
  • Followers 240
  • Following 344
  • Remote follow
Dan Jones's avatar
Dan Jones
@[email protected]

in reply to this object

I used to self host umami for a while from my own computer. I just left the whole thing accessible, behind Cloudflare. But you can use a proxy to forward only the routes you need.

Let me tell you how I'd do it.

First off, umami is often blocked by ad blockers, based on the path, but luckily, you can change that.

I just checked my old umami installation, and saw that I set two environment variables: TRACKER_SCRIPT_NAME and COLLECT_API_ENDPOINT. These will determine the routes you need to be public.

Whatever values you choose for those, I wouldn't recommend anything including umami, track, or analytics. Those will likely get blocked. I'd recommend something innocuous like fred.

For example, let's say your umami domain is logs.example.com, and you set those two values to log_visits and /api/log, you would need these two routes publicly accessible: logs.example.com/log_visits.js and logs.example.com/api/log. Any other route you can leave private.

How you do this depends on the proxy you use. I use caddy, so I would create a Caddyfile like this:

logs.example.com { @js { method GET path /log_visits.js } @api { method POST path /api/log } handle @js { reverse_proxy localhost:3000 } handle @api { reverse_proxy localhost:3000 } handle * { close } }

I think that will properly forward requests to your js route and your api route and drop all others. From the same computer, you can still go to localhost:3000 to get to the admin screen. Or somewhere else on your home network with the 192.168 address.

I haven't used umami in a while, so some things may have changed, but that should be the basic idea.

You'll also need a domain name with an automatic DNS updater. I use no-ip.com for that. You can get free subdomains that update when your IP address updates. And you'll need to forward ports on your router to your computer. Ports 80 and 443 should be fine, but don't forward port 3000.

@[email protected]

  • permalink
  • interact from your instance
  • 5 months ago
  • 1 like
  • 1 reply
Likes
@thedoctor@polymaths.social
Powered by microblog.pub 2.0.0+9c8693ea and the ActivityPub protocol. Admin.