mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-26 12:34:32 +00:00
feat: Custom script path for Plausible
This commit is contained in:
@@ -12,15 +12,28 @@ export const post: RequestHandler = async (event) => {
|
||||
name,
|
||||
fqdn,
|
||||
exposePort,
|
||||
plausibleAnalytics: { email, username }
|
||||
plausibleAnalytics: { email, username, scriptName }
|
||||
} = await event.request.json();
|
||||
|
||||
if (fqdn) fqdn = fqdn.toLowerCase();
|
||||
if (email) email = email.toLowerCase();
|
||||
if (exposePort) exposePort = Number(exposePort);
|
||||
|
||||
if (scriptName) {
|
||||
scriptName = scriptName.toLowerCase();
|
||||
if (scriptName.startsWith('/')) {
|
||||
scriptName = scriptName.replaceAll(/\//gi, '');
|
||||
}
|
||||
}
|
||||
try {
|
||||
await db.updatePlausibleAnalyticsService({ id, fqdn, name, email, username, exposePort });
|
||||
await db.updatePlausibleAnalyticsService({
|
||||
id,
|
||||
fqdn,
|
||||
name,
|
||||
email,
|
||||
username,
|
||||
exposePort,
|
||||
scriptName
|
||||
});
|
||||
return { status: 201 };
|
||||
} catch (error) {
|
||||
return ErrorHandler(error);
|
||||
|
||||
Reference in New Issue
Block a user