mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-04 18:14:53 +02:00
Fixing stuff
This commit is contained in:
parent
0599421975
commit
d3b3667b72
5 changed files with 1765 additions and 382 deletions
2071
server/db/names.json
2071
server/db/names.json
File diff suppressed because it is too large
Load diff
18
server/db/names.ts
Normal file
18
server/db/names.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { fileURLToPath } from 'url';
|
||||
import { dirname, join } from 'path';
|
||||
import { readFileSync } from 'fs';
|
||||
|
||||
// Get the directory name of the current module
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
// Load the names from the names.json file
|
||||
const file = join(__dirname, 'names.json');
|
||||
export const names = JSON.parse(readFileSync(file, 'utf-8'));
|
||||
|
||||
export function getUniqueName(): string {
|
||||
return (
|
||||
names.animals[Math.floor(Math.random() * names.animals.length)] +
|
||||
names.descriptor[Math.floor(Math.random() * names.descriptor.length)]
|
||||
).toLowerCase();
|
||||
}
|
|
@ -12,6 +12,7 @@ export const sites = sqliteTable("sites", {
|
|||
orgId: text("orgId").references(() => orgs.orgId, {
|
||||
onDelete: "cascade",
|
||||
}),
|
||||
niceId: text("niceId"),
|
||||
exitNode: integer("exitNode").references(() => exitNodes.exitNodeId, {
|
||||
onDelete: "set null",
|
||||
}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue