Commit df7b0491 authored by Hugo "ThePooN" Denizart's avatar Hugo "ThePooN" Denizart
Browse files

Merge branch 'production-2022' into 'master'

Kubernetes-based production deploy for Open 2022

See merge request !11
parents 9b98fad0 b67e50bb
Pipeline #4827 passed with stages
in 3 minutes and 38 seconds
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import * as _ from "lodash";
import { IUser, User, IUserInfos } from "./User";
import { ITeamInvite, TeamInvite } from "./TeamInvite";
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { ITeam, ITeamInfos, Team } from "./Team";
import { IUser, IUserInfos, User } from "./User";
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import * as Discord from "discord.js";
import { Logger } from "../Logger";
import { ITeam, ITeamInfos, Team } from "./Team";
......
......@@ -9,14 +9,14 @@ export class OsuApiV2 {
private currentClientAccessToken: AccessToken;
private clientAccessTokenFetchPromise: Promise<AccessToken>;
constructor(clientId: string, clientSecret: string) {
constructor(clientId: string, clientSecret: string, private proxyUrl?: string) {
this.options = {
client: {
id: clientId,
secret: clientSecret,
},
auth: {
tokenHost: "https://osu.ppy.sh",
tokenHost: proxyUrl ?? "https://osu.ppy.sh",
},
};
this.clientCredentials = new ClientCredentials(this.options);
......@@ -41,7 +41,7 @@ export class OsuApiV2 {
accessToken = (await this.getClientAccessToken()).token.access_token;
return (await axios(endpoint, {
baseURL: "https://osu.ppy.sh/api/v2",
baseURL: `${this.proxyUrl ?? "https://osu.ppy.sh"}/api/v2`,
headers: {
Authorization: `Bearer ${accessToken}`,
},
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -8,7 +8,6 @@ export default class FixTeamsMembersAmount implements IScript {
private static logger = Logger.getLogger("scripts/fix-teams-membersamount");
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
FixTeamsMembersAmount.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -9,7 +9,6 @@ export default class PurgeTeams implements IScript {
private static logger = Logger.getLogger("scripts/purge-teams");
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
PurgeTeams.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -8,7 +8,6 @@ export default class PurgeUsers implements IScript {
private static logger = Logger.getLogger("scripts/purge-users");
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
PurgeUsers.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -10,7 +10,6 @@ export default class RefreshAllUserData implements IScript {
private static readonly CONCURRENCY = 20;
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
RefreshAllUserData.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -11,7 +11,6 @@ export default class DiscordRolesRefresh implements IScript {
private static readonly CONCURRENCY = 20;
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
DiscordRolesRefresh.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -10,7 +10,6 @@ export default class RefreshOsuUsernames implements IScript {
private static readonly CONCURRENCY = 20;
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
RefreshOsuUsernames.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -8,7 +8,6 @@ export default class RefreshRanks implements IScript {
private static logger = Logger.getLogger("scripts/refresh-ranks");
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
RefreshRanks.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -8,7 +8,6 @@ export default class RefreshUserData implements IScript {
private static logger = Logger.getLogger("scripts/refresh-user-data");
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
RefreshUserData.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
import * as mongoose from "mongoose";
import mongoose from "mongoose";
import { App } from "../App";
import { Logger } from "../Logger";
import { IScript } from "../misc-models/IScript";
......@@ -11,7 +11,6 @@ export default class RestoreTeams implements IScript {
private static readonly CONCURRENCY = 20;
public async run() {
// @ts-ignore mongoose typings don't have autoIndex
if(mongoose.connection.readyState === 0) {
RestoreTeams.logger.info("Connecting to database...");
await mongoose.connect(App.instance.config.mongo.uri);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment