File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,16 @@ import { join } from "path";
44const scriptPath = join ( process . cwd ( ) , "scripts" , "install.sh" ) ;
55
66export async function GET ( request : Request ) {
7- const script = readFileSync ( scriptPath , "utf-8" ) ;
7+ const url = new URL ( request . url ) ;
8+ const rawTag = url . searchParams . get ( "tag" ) ?? "latest" ;
9+ const tag = / ^ [ a - z A - Z 0 - 9 . _ - ] + $ / . test ( rawTag ) ? rawTag : "latest" ;
10+ const source = url . searchParams . get ( "source" ) ?? "direct" ;
11+
12+ let script = readFileSync ( scriptPath , "utf-8" ) ;
13+ script = script . replace (
14+ 'IMAGE="paradedb/paradedb:latest"' ,
15+ `IMAGE="paradedb/paradedb:${ tag } "` ,
16+ ) ;
817
918 // Fire GA4 Measurement Protocol event (fire-and-forget)
1019 const measurementId = process . env . GA4_MEASUREMENT_ID ;
@@ -22,7 +31,8 @@ export async function GET(request: Request) {
2231 {
2332 name : "install_script_download" ,
2433 params : {
25- source : "curlbash" ,
34+ source : source . slice ( 0 , 50 ) ,
35+ image_tag : tag ,
2636 user_agent : ua . slice ( 0 , 100 ) ,
2737 } ,
2838 } ,
You can’t perform that action at this time.
0 commit comments