Delete the old job code now that the tracker runs on its own
Test and deploy / test (push) Successful in 1m9s
Test and deploy / deploy (push) Successful in 1m33s

The job tracker has run from its own image at /jobs/ since 931b02c, so its
old copy here goes: the GraphQL schema, resolvers and models for
applications, references, sources, leads and the search profile; the
capture and email handlers and services; the Python posting reader, lead
scorer and email classifier; the Vue pages, stores and the capture-token
card on the Environment tab; and the userscript (nginx already redirects
its old URL to /jobs/).

The six old tables stay in the stp database: AutoMigrate never drops
anything, and dropping them is a manual step. The env variables stay in
the registry, where they already belong to the jobs service.

Docs (CLAUDE.md, DEPLOYMENT.md and the three READMEs) now describe the
site without the tracker, and DEPLOYMENT.md lists the jobs service and
./jobs-data.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-14 17:35:18 +01:00
co-authored by Claude Opus 5.5
parent 931b02c9e4
commit 99fe175ebf
72 changed files with 123 additions and 16046 deletions
-127
View File
@@ -1,127 +0,0 @@
<script setup>
/**
* The job capture token card on the admin Environment tab.
*
* The token is the credential the job capture userscript
* (public/job-capture.user.js) sends. It is not a .env variable: the server
* keeps only a hash in backend/token/, so it can be shown exactly once, in
* the response to generating it, and replacing it needs no restart.
*/
import { ref, onMounted } from "vue";
import { api } from "@/api";
import Button from "@/components/input/Button.vue";
import SecretReveal from "@/components/admin/SecretReveal.vue";
import "./env.css";
// `newToken` holds a just-generated token and lives only in this component's
// memory: leaving the tab is the end of it.
const capture = ref(null);
const error = ref("");
const busy = ref(false);
const newToken = ref("");
async function fetchCaptureToken() {
try {
capture.value = await api.get("/admin/capture-token", {
fallback: "Failed to load the capture token state",
});
error.value = "";
} catch (err) {
error.value = err.message;
}
}
async function generate() {
// Generating replaces: an installed script stops working until it is
// given the new token, which is worth a pause when one already exists.
if (
capture.value?.set &&
!confirm(
"Replace the existing capture token? The installed userscript will stop working until you paste the new one into it.",
)
)
return;
busy.value = true;
try {
const res = await api.post("/admin/capture-token", undefined, {
fallback: "Failed to generate a token",
});
newToken.value = res.token;
capture.value = { set: true, createdAt: res.createdAt };
error.value = "";
} catch (err) {
error.value = err.message;
} finally {
busy.value = false;
}
}
async function revoke() {
if (!confirm("Revoke the capture token? The userscript will stop working."))
return;
busy.value = true;
try {
capture.value = await api.delete("/admin/capture-token", {
fallback: "Failed to revoke the token",
});
newToken.value = "";
error.value = "";
} catch (err) {
error.value = err.message;
} finally {
busy.value = false;
}
}
onMounted(fetchCaptureToken);
</script>
<template>
<section class="env-card">
<header class="env-card-head">
<h2>Job capture</h2>
<span v-if="capture" class="env-pill" :class="capture.set ? 'is-set' : 'is-unset'">
{{ capture.set ? "active" : "no token" }}
</span>
</header>
<div class="capture-body">
<p class="env-hint">
The credential for the
<a href="/job-capture.user.js" target="_blank" rel="noopener"
>job capture userscript</a
>. Generate one, then paste it into the script's
<em>Configure job capture</em> menu command. Only a hash is stored, so
it takes effect at once and cannot be recovered — generate again to
replace it.
</p>
<p v-if="error" class="env-error">{{ error }}</p>
<template v-if="capture">
<p v-if="capture.set" class="env-hint">
Generated {{ new Date(capture.createdAt).toLocaleString() }}.
</p>
<SecretReveal v-if="newToken" :value="newToken" />
<div class="capture-controls">
<Button class="px-2" :disabled="busy" @click="generate">
{{ capture.set ? "Regenerate" : "Generate token" }}
</Button>
<Button v-if="capture.set" class="px-2" :disabled="busy" @click="revoke">
Revoke
</Button>
</div>
</template>
</div>
</section>
</template>
<style scoped>
.capture-body {
display: flex;
flex-direction: column;
gap: 8px;
padding: 8px 10px;
}
.capture-controls {
display: flex;
gap: 12px;
}
</style>
+2 -2
View File
@@ -3,8 +3,8 @@
* Admin panel: tail of the backend log.
*
* GET /api/admin/logs returns JSON read from the filesystem, not GraphQL —
* it is not part of the site's data model. Configuration and the job capture
* token, which used to share this tab, are on the Environment tab.
* it is not part of the site's data model. Configuration, which used to share
* this tab, is on the Environment tab.
*
* An admin who remounts the component via tab switches re-triggers
* onMounted, which is the desired "refresh on tab change" behaviour.
-3
View File
@@ -19,7 +19,6 @@ import { ref, reactive, computed, onMounted, onUnmounted } from "vue";
import { api } from "@/api";
import Button from "@/components/input/Button.vue";
import SecretReveal from "@/components/admin/SecretReveal.vue";
import CaptureToken from "./CaptureToken.vue";
import "./env.css";
const groups = ref([]);
@@ -367,8 +366,6 @@ onUnmounted(stopPolling);
</div>
</section>
<CaptureToken v-if="!loading" />
<footer v-if="changes.length && !applying" class="env-apply-bar">
<p>
<strong>{{ changes.length }}</strong>
+2 -2
View File
@@ -1,6 +1,6 @@
/*
* Card, pill and message styles shared by the admin Environment tab
* (Environment.vue) and the cards it hosts (CaptureToken.vue). A plain
* Card, pill and message styles for the admin Environment tab
* (Environment.vue) and any card it hosts as a child component. A plain
* stylesheet rather than a scoped block because scoped styles stop at a child
* component's root; the env- prefix is what keeps these from leaking.
*/