This is the summary of steps I've taken when migrating my Plausible 2.0 instance to a new server and then upgrading it to 2.1.
- Shutdown Postgres & Clickhouse before backup
docker compose down plausible_db
docker compose down plausible_events_db
This is the summary of steps I've taken when migrating my Plausible 2.0 instance to a new server and then upgrading it to 2.1.
docker compose down plausible_db
docker compose down plausible_events_db
// debugging element to see data | |
const filesEl = document.createElement("pre"); | |
filesEl.textContent = "waiting for files..."; | |
filesEl.setAttribute("style", "z-index: 9999;background-color: #fff;") | |
document.body.prepend(filesEl); | |
const popup = window.open("https://fileserver.com/shared/handshake-files", 'popupWindowName', 'width=200,height=200'); | |
setTimeout(() => { | |
console.log("fileserver is ready, sending request for files"); |
const { exec } = require("child_process"); | |
const { statSync, existsSync, readFileSync } = require("fs"); | |
const path = require("path"); | |
const { sync: glob } = require("glob"); | |
const DEPENDENCY = "axios"; | |
const reinstall = (pth) => { | |
return new Promise((resolve, reject) => { | |
const packageJsonPath = path.join(pth, "package.json"); |
const TOKEN = ""; | |
const PLAUSIBLE_URL = "https://plausible.acme.com"; | |
const SITES = [ | |
{ | |
col: "C", | |
siteId: "acme.com" | |
}, | |
{ | |
col: "D", | |
siteId: "softwarebyacme.com" |
(() => { | |
const OPENAI_TOKEN = ""; | |
const MODEL = "gpt-4-1106-preview"; | |
//const MODEL = "gpt-3.5-turbo" | |
const ADDITIONAL_QUERY = "These questions are asked within the context of the Czech Republic and it's law."; | |
const QUERY_TASK = `Task: Identify the correct option (or options in case of a multiple-answer question) that best answers the provided question and provide your answer in the format: {"letters": ["Letter(s) to the correct options"], "explanation": "[Few words explaining why the choice is correct]", "certainty": "[How certain, in %, are you that the answer is correct]"}. ${ADDITIONAL_QUERY}`.trimEnd(); |
// const fetch = require("node-fetch") | |
let createPlaceholderAnswer = (letter, description) => ({ | |
value: `${letter}. ${description}`, | |
letter, | |
select: () => { | |
console.log("debug: called select() in answer", letter); | |
}, | |
}); |
const map = new Map(); | |
const directory = document.querySelector(".directory"); | |
const container = document.createElement("div"); | |
let currentIndex = -1; | |
const getNext = () => { currentIndex++; return map.get(currentIndex)?.href ?? null; } | |
directory.prepend(container); |
import { PrismaModule } from "@infra/prisma/PrismaModule"; | |
import { Module } from "@nestjs/common"; | |
import { UserRepository } from "./UserRepository"; | |
import { PrismaRepository } from "@infra/prisma/PrismaRepository"; | |
@Module({ | |
imports: [ | |
PrismaModule.forRoot( | |
UserRepository, | |
"user", // base repository, can be injected with @InjectRepository("user") |
const axios = require("axios"); | |
const { createWriteStream, existsSync, mkdirSync } = require("fs"); | |
const path = require("path"); | |
const client = axios.create({ | |
baseURL: 'https://api.apparyllis.com:8443', | |
headers: { | |
Accept: 'application/json', | |
Authorization: '<TOKEN HERE>', | |
}, |
<?php declare(strict_types=1); | |
require __DIR__ . "/vendor/autoload.php"; | |
const BaseOldNamespace = "Ublaboo\\DataGrid"; | |
const BaseNewNamespace = "Contributte\\Datagrid"; | |
const Replace = true; | |
const Test = false; |