mirror of
https://github.com/fosrl/pangolin.git
synced 2025-09-01 07:20:06 +02:00
Move newt version
This commit is contained in:
parent
825bff5d60
commit
2fea091e1f
1 changed files with 10 additions and 10 deletions
|
@ -64,16 +64,6 @@ export const handleNewtRegisterMessage: MessageHandler = async (context) => {
|
||||||
exitNodeId = bestPingResult.exitNodeId;
|
exitNodeId = bestPingResult.exitNodeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newtVersion) {
|
|
||||||
// update the newt version in the database
|
|
||||||
await db
|
|
||||||
.update(newts)
|
|
||||||
.set({
|
|
||||||
version: newtVersion as string
|
|
||||||
})
|
|
||||||
.where(eq(newts.newtId, newt.newtId));
|
|
||||||
}
|
|
||||||
|
|
||||||
const [oldSite] = await db
|
const [oldSite] = await db
|
||||||
.select()
|
.select()
|
||||||
.from(sites)
|
.from(sites)
|
||||||
|
@ -160,6 +150,16 @@ export const handleNewtRegisterMessage: MessageHandler = async (context) => {
|
||||||
allowedIps: [siteSubnet]
|
allowedIps: [siteSubnet]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (newtVersion && newtVersion !== newt.version) {
|
||||||
|
// update the newt version in the database
|
||||||
|
await db
|
||||||
|
.update(newts)
|
||||||
|
.set({
|
||||||
|
version: newtVersion as string
|
||||||
|
})
|
||||||
|
.where(eq(newts.newtId, newt.newtId));
|
||||||
|
}
|
||||||
|
|
||||||
// Improved version
|
// Improved version
|
||||||
const allResources = await db.transaction(async (tx) => {
|
const allResources = await db.transaction(async (tx) => {
|
||||||
// First get all resources for the site
|
// First get all resources for the site
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue