deployment

Websockets for Clojure Sente in Apache Reverse Proxy

The Clojure library sente allows you to do smooth web-socket work in Clojure. In our case, we wanted the typical “Your Session Expires in N seconds” alert for users of the app. Sente was working smoothly on our local machines, but we were getting obscure errors in the console about 500 responses in our browser console. The Problem As mentioned, our console was showing server errors on the path that was supposed to be doing the Sente channels.

Clojure app setup for Auto-deploy with raw systemd

REPLACED [2022-11-11 Fri] The below is hopefully informative, but it actually only causes a thing to deploy once and then to re-deploy on system restart. For instructions that ACTUALLY auto-deploy, see https://tech.toryanderson.com/2022/11/11/systemd-devops-run-and-restart-services/ Updated [2022-09-19 Mon] Fixed error in deploy script that occurred if trying to restart but nothing was in the docket Updated [2022-07-13 Wed] Enhanced the server-side deploy script to operate more transparently if files are missing.

Should I put my systemd [Install] section in my .path file or my .service file?

Configuring systemd to redeploy my service when I commit a new source .jar file, I have a path file that goes along with the service and uses a PathChanged directive. The [Install] section should be in the path file, not the service file, but I notice this makes “systemctl enable MYAPP” impossible. It turns out that enable MYAPP assumes you mean MYAPP.service, so you actually just do systemctl enable MYAPP.path and you’re set.

Deploying to Clojars with the new tokens

With a recent, well-deserved funding round to the Clojars repository project, the password you log in to the site with is no longer valid as the password with which you publish deployments. See https://github.com/clojars/clojars-web/wiki/Deploy-Tokens and https://clojars.org/tokens . The annoyingly unanswered question is how I adjust my setup to USE the token. So, here it is with Leiningen. Project.clj I have the following in my project.clj, which is the same as I had before switching from my web password to the token: