Compare commits

..
9 Commits
8 changed files with 46 additions and 9 deletions

No files matched your search

@@ -17,9 +17,9 @@
set -euo pipefail
STATION_ID=173994
API_KEY=6bff2f89-84ab-463c-886e-fc0f443da4cf
API_KEY=b29d10d0-6e40-44a5-869d-f7af76072b6b
API_BASE=https://swd.weatherflow.com/swd/rest
BUILD=169
BUILD=181
# Everything below the high/low is an integral, and an integral fails quietly: a
# wrong high looks wrong, a wrong degree-day total looks like a number. So this
@@ -56,6 +56,17 @@ MAX_GAP_SECONDS=3600
ORIGIN=https://tempestwx.com
USER_AGENT='Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0'
# Since build ~181 the API also wants `token`, a Firebase ID token. The web app
# gets one from firebase.auth().signInAnonymously() on public station pages; this
# is the REST form of that call, with the `apiKey` from the Firebase config in the
# tempestwx.com main.js bundle. The key is referrer-restricted, so the Referer is
# required — without it Google answers 403 API_KEY_HTTP_REFERRER_BLOCKED. Tokens
# last an hour, far longer than one run, so a fresh one per run is enough.
#
# Also reaches identitytoolkit.googleapis.com, which needs the same squid.conf
# allowance as swd.weatherflow.com.
FIREBASE_API_KEY=AIzaSyA8aLVHWe7TVmctOXXVXYTl4pnzTgUydG4
if [ $# -gt 1 ]; then
echo 'usage: weather-day [YYYY-MM-DD] (default: yesterday)' >&2
exit 2
@@ -96,6 +107,7 @@ tempest_get() {
-H "Origin: ${ORIGIN}" \
--data-urlencode "api_key=${API_KEY}" \
--data-urlencode "build=${BUILD}" \
--data-urlencode "token=${TOKEN}" \
"${@:2}")
code=${resp##*$'\n'}
json=${resp%$'\n'*}
@@ -108,6 +120,18 @@ tempest_get() {
printf '%s' "$json"
}
signup=$(curl -sS -X POST \
"https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=${FIREBASE_API_KEY}" \
-H 'Content-Type: application/json' \
-H "Referer: ${ORIGIN}/" \
-d '{"returnSecureToken":true}')
TOKEN=$(printf '%s' "$signup" | jq -r '.idToken // empty')
if [ -z "$TOKEN" ]; then
echo "weather-day: anonymous Firebase sign-in failed" >&2
echo " $(printf '%s' "$signup" | jq -c '.error // .' 2>/dev/null || printf '%s' "$signup")" >&2
exit 1
fi
# A station has one ST (Tempest) device and usually an HB (hub) alongside it; only
# the ST reports weather.
locations=$(tempest_get "locations/${STATION_ID}" --data-urlencode 'include_arbitrary_locations=true')
+2 -1
View File
@@ -1,7 +1,8 @@
{
"attribution": {
"commit": "",
"pr": ""
"pr": "",
"sessionUrl": false
},
"permissions": {
"allow": [
+12
View File
@@ -0,0 +1,12 @@
function dev-app -d "Run a checkout's Obsidian dev app on voyager, shown here through waypipe"
# No argument: master's checkout; otherwise the obsidian worktree of that name.
set -l checkout /tachi/code/obsidian/obsidian
if test -n "$argv[1]"
set checkout /tachi/code/obsidian/obsidian.worktrees/$argv[1]
end
# waypipe execs the remote command directly, and ssh flattens it into one
# string for voyager's shell, so a shell builtin like cd or && can't be used.
# env -C sets the working directory instead. ods exec app starts Electron as
# a Wayland client with the checkout's own user data.
waypipe --compress zstd ssh voyager env -C $checkout ods exec app
end
+3
View File
@@ -0,0 +1,3 @@
function voyager -d "SSH into voyager, attaching to its tmux session or starting one"
ssh -t voyager 'tmux attach || tmux new-session -s main'
end
+1 -1
View File
@@ -32,7 +32,7 @@ jq = "1.8.2"
lazygit = "0.64.1"
node = "24.18.1"
opencode = "1.15.11"
pnpm = "11.18.0"
pnpm = "12.8.1"
restic = "0.19.1"
ripgrep = "15.2.0"
tmux = "3.7b"
-3
View File
@@ -10,6 +10,3 @@ vim.g.lazyvim_prettier_needs_config = true
-- Use eslint for formatting.
vim.g.lazyvim_eslint_auto_format = true
-- Only run prettier in directories where there is a config file.
vim.g.lazyvim_prettier_needs_config = false