Add ariadnee (#560)
This commit is contained in:
parent
153d77359f
commit
928f6e7009
@ -1,6 +1,4 @@
|
||||
export default function (context) {
|
||||
// Temporary disable analytics
|
||||
/*
|
||||
if (process.client && context.from.path === context.route.path) {
|
||||
return
|
||||
}
|
||||
@ -11,15 +9,22 @@ export default function (context) {
|
||||
|
||||
setTimeout(() => {
|
||||
context.$axios
|
||||
.post(`${context.$config.analytics.base_url}/register/visit`, {
|
||||
path: context.route.path,
|
||||
domain: process.server ? context.req.headers.host : location.host,
|
||||
consent: false,
|
||||
})
|
||||
.post(
|
||||
`${context.$config.analytics.base_url}view`,
|
||||
{
|
||||
url: process.env.domain + context.route.fullPath,
|
||||
},
|
||||
context.$config.analytics.admin_key
|
||||
? {
|
||||
headers: {
|
||||
'Modrinth-Admin': context.$config.analytics.admin_key,
|
||||
},
|
||||
}
|
||||
: {}
|
||||
)
|
||||
.then(() => {})
|
||||
.catch((e) => {
|
||||
console.error('An error occurred while registering the visit: ', e)
|
||||
})
|
||||
})
|
||||
*/
|
||||
}
|
||||
|
||||
@ -291,7 +291,9 @@ export default {
|
||||
ethicalAds: process.env.ETHICAL_ADS,
|
||||
},
|
||||
analytics: {
|
||||
base_url: process.env.ARIADNE_URL,
|
||||
base_url:
|
||||
process.env.BROWSER_ARIADNE_URL ||
|
||||
'https://staging-ariadne.modrinth.com/v1/',
|
||||
},
|
||||
},
|
||||
privateRuntimeConfig: {
|
||||
@ -299,10 +301,15 @@ export default {
|
||||
baseURL: process.env.BASE_URL,
|
||||
headers: {
|
||||
common: {
|
||||
'x-ratelimit-key': process.env.RATE_LIMIT_IGNORE_KEY,
|
||||
'x-ratelimit-key': process.env.RATE_LIMIT_IGNORE_KEY || '',
|
||||
},
|
||||
},
|
||||
},
|
||||
analytics: {
|
||||
base_url:
|
||||
process.env.ARIADNE_URL || 'https://staging-ariadne.modrinth.com/v1/',
|
||||
admin_key: process.env.ARIADNE_ADMIN_KEY,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ export default ({ store }, inject) => {
|
||||
const obj = { headers: {} }
|
||||
|
||||
if (process.server && process.env.RATE_LIMIT_IGNORE_KEY) {
|
||||
obj.headers['x-ratelimit-key'] = process.env.RATE_LIMIT_IGNORE_KEY
|
||||
obj.headers['x-ratelimit-key'] = process.env.RATE_LIMIT_IGNORE_KEY || ''
|
||||
}
|
||||
|
||||
if (store.state.auth.user) {
|
||||
|
||||
@ -24,7 +24,7 @@ export const actions = {
|
||||
headers: {
|
||||
Authorization: token,
|
||||
'x-ratelimit-key': process.server
|
||||
? process.env.RATE_LIMIT_IGNORE_KEY
|
||||
? process.env.RATE_LIMIT_IGNORE_KEY || ''
|
||||
: '',
|
||||
},
|
||||
})
|
||||
|
||||
@ -29,7 +29,7 @@ export const actions = {
|
||||
const headers = {
|
||||
headers: {
|
||||
'x-ratelimit-key': process.server
|
||||
? process.env.RATE_LIMIT_IGNORE_KEY
|
||||
? process.env.RATE_LIMIT_IGNORE_KEY || ''
|
||||
: '',
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user