Skip to content

Instantly share code, notes, and snippets.

View Aervyon's full-sized avatar

Aervy Aervyon

View GitHub Profile
@Aervyon
Aervyon / reload-certs.sh
Last active January 16, 2024 09:33
A script to reload certificates for databases and other services
#! /bin/bash
# Expects running as root
# DO NOT UNDER ANY CIRCUMSTANCE INCLUDE A TRAILING SLASH
ACME_HOME=/root/.acme.sh
BASE=example.com
DIRECTORY="$BASE"_ecc
MONGODB_SSL_DIR=/etc/ssl/mongodb
@Aervyon
Aervyon / folderr-compose.yaml
Created May 9, 2023 02:46
This is the compose file for Folderr's main compose. Folderr has a dev compose file too but thats unrelated.
services:
folderr:
build:
context: .
environment:
- PRIVATE_KEY
- PORT
- URL
- TRUST_PROXIES
- SIGNUPS
@Aervyon
Aervyon / folderr-init-path-dynamic.ts
Created March 28, 2023 07:24
This is the potential new way Folderr loads API endpoints by loading every version nearly at once.
// `this.app` is `Fastify`, https://fastify.io
// `this.logger` is a modified `pino` logger, https://github.com/pinojs/pino
// `Path` is a custom class currently used by Folderr. Might be abandoned in the future in favor of functional programming.
// this is an excerp from Folderr backend/core.ts
findPaths(dir: string): Array<Promise<{default: typeof Path}>> {
if (!require.main?.path) {
return [];
}
const paths: Array<Promise<{default: typeof Path}>> = [];
@Aervyon
Aervyon / sentry.ts
Created March 15, 2023 09:44
The Sentry plugin built for Folderr
import process from 'process';
import type {Transaction} from '@sentry/types';
import type {FastifyPluginAsync} from 'fastify';
import fp from 'fastify-plugin';
import * as Sentry from '@sentry/node';
declare module 'fastify' {
/* eslint-disable @typescript-eslint/consistent-type-definitions */
interface FastifyRequest {
transaction: Transaction;

Keybase proof

I hereby claim:

  • I am aervyon on github.
  • I am aervyon (https://keybase.io/aervyon) on keybase.
  • I have a public key ASAfjP7PeASz09XcxqH5wg59fv-yO3QS7QNOnd3FmvfEcwo

To claim this, I am signing this object:

@Aervyon
Aervyon / Databaseless.js
Created December 15, 2019 02:30
A databaseless schema for AxonCore, requires version 2.0 or higher to be used. Nothing is stored, nothing in memory either.
import DBService from '../src/Database/DBProvider';
import AxonConfig from '../src/Structures/DataStructure/AxonConfig';
import GuildConfig from '../src/Structures/DataStructure/GuildConfig';
/**
* A schema designed to remove databases from AxonCore
*
* @author VoidNulll
*
* @class DatabaselessService