forked from engineering/cloudservices
Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Matthew | 88c7b83cfe |
2
LICENSE
2
LICENSE
|
@ -630,7 +630,7 @@ state the exclusion of warranty; and each file should have at least
|
|||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
Cloud Services
|
||||
Copyright (C) 2019 Library of Code sp-us Engineering Team
|
||||
Copyright (C) 2019 Library of Code Inc
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"build": "make",
|
||||
"lint-find": "eslint ./ --ext ts"
|
||||
},
|
||||
"author": "Library of Code sp-us Engineering Team",
|
||||
"author": "Library of Code, Inc. | Dept. of Engineering",
|
||||
"license": "AGPL-3.0-only",
|
||||
"private": false,
|
||||
"dependencies": {
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="text-center font-weight-light">Library of Code sp-us</footer>
|
||||
<footer class="text-center font-weight-light">Library of Code, Inc.</footer>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -36,7 +36,7 @@ export default class AccountUtil {
|
|||
|
||||
this.client.util.transport.sendMail({
|
||||
to: data.emailAddress,
|
||||
from: 'Library of Code sp-us | Cloud Services <help@libraryofcode.org>',
|
||||
from: 'Library of Code Inc | Cloud Services <help@libraryofcode.org>',
|
||||
replyTo: 'cloud-help@libraryofcode.org',
|
||||
subject: 'Approval for CS Account',
|
||||
html: `
|
||||
|
@ -68,7 +68,7 @@ export default class AccountUtil {
|
|||
</ul>
|
||||
<h3>Want to support us?</h3>
|
||||
<p>You can support us by purchasing a Tier 3 subscription! <a target="_blank" href="https://canary.discord.com/channels/446067825673633794/620355063088414769/774938174001774592">this site</a> for more information.</p>
|
||||
<b><i>Library of Code sp-us | Support Team</i></b>
|
||||
<b><i>Library of Code Inc | Support Team</i></b>
|
||||
</body>
|
||||
`,
|
||||
});
|
||||
|
@ -101,7 +101,7 @@ export default class AccountUtil {
|
|||
|
||||
this.client.util.transport.sendMail({
|
||||
to: account.emailAddress,
|
||||
from: 'Library of Code sp-us | Cloud Services <help@libraryofcode.org>',
|
||||
from: 'Library of Code Inc | Cloud Services <help@libraryofcode.org>',
|
||||
replyTo: 'cloud-help@libraryofcode.org',
|
||||
subject: 'Your account has been locked',
|
||||
html: `
|
||||
|
@ -111,7 +111,7 @@ export default class AccountUtil {
|
|||
<p><b>Technician:</b> ${moderatorID !== this.client.user.id ? (this.client.users.cache.get(moderatorID).username) : 'SYSTEM'}</p>
|
||||
<p><b>Expiration:</b> ${data?.time ? moment(data?.time).format('dddd, MMMM Do YYYY, h:mm:ss A') : 'N/A'}</p>
|
||||
|
||||
<b><i>Library of Code sp-us | Support Team</i></b>
|
||||
<b><i>Library of Code Inc | Support Team</i></b>
|
||||
`,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ export default class Security {
|
|||
public async createBearer(_id: string): Promise<string> {
|
||||
const account = await this.client.db.Account.findOne({ _id });
|
||||
if (!account) throw new Error(`Account [${_id}] cannot be found.`);
|
||||
return jwt.sign({ id: account.id }, this.keys.key, { issuer: 'Library of Code sp-us | CSD' });
|
||||
return jwt.sign({ id: account.id }, this.keys.key, { issuer: 'Library of Code Inc | CSD' });
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,7 +38,7 @@ export default class Security {
|
|||
*/
|
||||
public async checkBearer(bearer: string): Promise<null | AccountInterface> {
|
||||
try {
|
||||
const res: any = jwt.verify(bearer, this.keys.key, { issuer: 'Library of Code sp-us | CSD' });
|
||||
const res: any = jwt.verify(bearer, this.keys.key, { issuer: 'Library of Code Inc | CSD' });
|
||||
const account = await this.client.db.Account.findOne({ _id: res.id });
|
||||
if (!account) return null;
|
||||
if (account.locked) return null;
|
||||
|
|
|
@ -16,8 +16,8 @@ export default class Announce extends Command {
|
|||
try {
|
||||
if (!args.length) return this.client.commands.get('help').run(message, [this.name]);
|
||||
const notification = await this.loading(message.channel, 'Sending announcement, please wait...');
|
||||
if (args[0] === '-e') await this.client.util.exec(`echo "\n\n**************************************************************************\nEMERGENCY SYSTEM BROADCAST MESSAGE | Library of Code sp-us (root enforced)\n--------------------------------------------------------------------------\n\n\n${args.slice(1).join(' ').trim()}\n\n\n\n\n\n\n\n\n\n\n\n\n" | wall -n`);
|
||||
else await this.client.util.exec(`echo "\nSYSTEM BROADCAST MESSAGE | Library of Code sp-us (root enforced)\n\n\n${args.join(' ').trim()}" | wall -n`);
|
||||
if (args[0] === '-e') await this.client.util.exec(`echo "\n\n**************************************************************************\nEMERGENCY SYSTEM BROADCAST MESSAGE | Library of Code Inc (root enforced)\n--------------------------------------------------------------------------\n\n\n${args.slice(1).join(' ').trim()}\n\n\n\n\n\n\n\n\n\n\n\n\n" | wall -n`);
|
||||
else await this.client.util.exec(`echo "\nSYSTEM BROADCAST MESSAGE | Library of Code Inc (root enforced)\n\n\n${args.join(' ').trim()}" | wall -n`);
|
||||
message.delete();
|
||||
return notification.edit(`${this.client.stores.emojis.success} ***Sent${args[0] === '-e' ? ' emergency' : ''} announcement to all active terminals***`);
|
||||
} catch (error) {
|
||||
|
|
|
@ -28,7 +28,7 @@ export default class AuthReferral extends Command {
|
|||
referrerUsername: referrer.username,
|
||||
referredUserID: referred.id,
|
||||
referredUserAndDiscrim: `${referred.user.username}#${referred.user.discriminator}` },
|
||||
this.client.config.keyPair.privateKey, { expiresIn: '24 hours', issuer: 'Library of Code sp-us | Cloud Services Daemon' },
|
||||
this.client.config.keyPair.privateKey, { expiresIn: '24 hours', issuer: 'Library of Code Inc | Cloud Services Daemon' },
|
||||
);
|
||||
this.client.users.fetch(referrer.userID).then(async (user) => {
|
||||
await user.send('__**Referral Request Authorization**__\n'
|
||||
|
|
|
@ -20,7 +20,7 @@ export default class Bearer extends Command {
|
|||
// eslint-disable-next-line no-underscore-dangle
|
||||
const bearer = await this.client.server.security.createBearer(account._id);
|
||||
const dm = await this.client.users.fetch(message.author.id);
|
||||
const msg = await dm.send(`__**Library of Code sp-us | Cloud Services [API]**__\n*This message will automatically be deleted in 60 seconds, copy the token and save it. You cannot recover it.*\n\n${bearer}`);
|
||||
const msg = await dm.send(`__**Library of Code Inc | Cloud Services [API]**__\n*This message will automatically be deleted in 60 seconds, copy the token and save it. You cannot recover it.*\n\n${bearer}`);
|
||||
this.success(message.channel, 'Bearer token sent to direct messages.');
|
||||
return setTimeout(() => {
|
||||
msg.delete();
|
||||
|
|
|
@ -103,10 +103,10 @@ export default class CWG_Create extends Command {
|
|||
this.client.users.fetch(account.userID).then((r) => r.send({ embeds: [embed] })),
|
||||
this.client.util.transport.sendMail({
|
||||
to: account.emailAddress,
|
||||
from: 'Library of Code sp-us | Support Team <help@libraryofcode.org>',
|
||||
from: 'Library of Code Inc | Support Team <help@libraryofcode.org>',
|
||||
subject: 'Your domain has been bound',
|
||||
html: `
|
||||
<h1>Library of Code sp-us | Cloud Services</h1>
|
||||
<h1>Library of Code Inc | Cloud Services</h1>
|
||||
<p>Hello, this is an email informing you that a new domain under your account has been bound.
|
||||
Information is below.</p>
|
||||
<b>Domain:</b> ${domain.domain}<br>
|
||||
|
@ -117,13 +117,13 @@ export default class CWG_Create extends Command {
|
|||
|
||||
If you have any questions about additional setup, you can reply to this email or send a message in #cloud-support in our Discord server.<br>
|
||||
|
||||
<b><i>Library of Code sp-us | Support Team</i></b>
|
||||
<b><i>Library of Code Inc | Support Team</i></b>
|
||||
`,
|
||||
}),
|
||||
];
|
||||
|
||||
if (!domain.domain.includes('cloud.libraryofcode.org')) {
|
||||
const content = `__**DNS Record Setup**__\nYou recently a bound a custom domain to your Library of Code sp-us Account. You'll have to update your DNS records. We've provided the records below.\n\n\`${domain.domain} IN CNAME cloud.libraryofcode.org AUTO/500\`\nThis basically means you need to make a CNAME record with the key/host of ${domain.domain} and the value/point to cloud.libraryofcode.org. If you have any questions, don't hesitate to ask us.`;
|
||||
const content = `__**DNS Record Setup**__\nYou recently a bound a custom domain to your Library of Code Inc Account. You'll have to update your DNS records. We've provided the records below.\n\n\`${domain.domain} IN CNAME cloud.libraryofcode.org AUTO/500\`\nThis basically means you need to make a CNAME record with the key/host of ${domain.domain} and the value/point to cloud.libraryofcode.org. If you have any questions, don't hesitate to ask us.`;
|
||||
completed.push(this.client.users.fetch(account.userID).then((r) => r.send(content)));
|
||||
}
|
||||
|
||||
|
|
|
@ -77,11 +77,11 @@ export default class CWG_SelfService extends Command {
|
|||
this.client.users.fetch(account.userID).then((r) => r.send({ embeds: [embed] })),
|
||||
this.client.util.transport.sendMail({
|
||||
to: account.emailAddress,
|
||||
from: 'Library of Code sp-us | Support Team <help@libraryofcode.org>',
|
||||
replyTo: 'Dept of Engineering <engineering@libraryofcode.org>',
|
||||
from: 'Library of Code Inc | Support Team <help@libraryofcode.org>',
|
||||
replyTo: 'LOC Dept of Engineering <engineering@libraryofcode.org>',
|
||||
subject: 'Your domain has been created',
|
||||
html: `
|
||||
<h1>Library of Code sp-us | Cloud Services</h1>
|
||||
<h1>Library of Code Inc | Cloud Services</h1>
|
||||
<p>Hello, this is an email informing you that a new domain under your account has been bound.
|
||||
Information is below.</p>
|
||||
<b>Domain:</b> ${domain.domain}<br>
|
||||
|
@ -92,7 +92,7 @@ export default class CWG_SelfService extends Command {
|
|||
|
||||
If you have any questions about additional setup, you can reply to this email or send a message in #cloud-support in our Discord server.<br>
|
||||
|
||||
<b><i>Library of Code sp-us | Support Team</i></b>
|
||||
<b><i>Library of Code Inc | Support Team</i></b>
|
||||
`,
|
||||
}),
|
||||
];
|
||||
|
|
|
@ -44,7 +44,7 @@ export default class DeleteAccount extends Command {
|
|||
|
||||
this.client.util.transport.sendMail({
|
||||
to: account.emailAddress,
|
||||
from: 'Library of Code sp-us | Cloud Services <help@libraryofcode.org>',
|
||||
from: 'Library of Code Inc | Cloud Services <help@libraryofcode.org>',
|
||||
replyTo: 'cloud-help@libraryofcode.org',
|
||||
subject: 'Your account has been deleted',
|
||||
html: `
|
||||
|
@ -53,7 +53,7 @@ export default class DeleteAccount extends Command {
|
|||
<p><b>Reason:</b> ${reason}</p>
|
||||
<p><b>Director:</b> ${message.author.username}</p>
|
||||
|
||||
<b><i>Library of Code sp-us | Support Team</i></b>
|
||||
<b><i>Library of Code Inc | Support Team</i></b>
|
||||
`,
|
||||
});
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ export default class EmailCode extends Command {
|
|||
if (!this.client.util.isValidEmail(args[0])) return this.error(message.channel, 'The email address provided is invalid.');
|
||||
this.client.util.transport.sendMail({
|
||||
to: args[0],
|
||||
from: 'Library of Code sp-us | Cloud Services <help@libraryofcode.org>',
|
||||
from: 'Library of Code Inc | Cloud Services <help@libraryofcode.org>',
|
||||
subject: 'Email Verification Code',
|
||||
html: `
|
||||
<body>
|
||||
|
@ -30,7 +30,7 @@ export default class EmailCode extends Command {
|
|||
<h2>${code}</h2>
|
||||
<h3>Want to support us?</h3>
|
||||
<p>You can support us on Patreon! Head to <a target="_blank" href="https://www.patreon.com/libraryofcode">our Patreon page</a> and feel free to donate as much or as little as you want!<br>Donating $5 or more will grant you Tier 3, which means we will manage your account at your request, longer certificates, increased Tier limits as well as some roles in the server!</p>
|
||||
<b><i>Library of Code sp-us | Support Team</i></b>
|
||||
<b><i>Library of Code Inc | Support Team</i></b>
|
||||
</body>
|
||||
`,
|
||||
});
|
||||
|
|
|
@ -35,7 +35,7 @@ export default class Lock extends Command {
|
|||
|
||||
this.client.util.transport.sendMail({
|
||||
to: account.emailAddress,
|
||||
from: 'Library of Code sp-us | Cloud Services <help@libraryofcode.org>',
|
||||
from: 'Library of Code Inc | Cloud Services <help@libraryofcode.org>',
|
||||
replyTo: 'cloud-help@libraryofcode.org',
|
||||
subject: 'Your account has been locked',
|
||||
html: `
|
||||
|
@ -45,7 +45,7 @@ export default class Lock extends Command {
|
|||
<p><b>Technician:</b> ${message.author.username}</p>
|
||||
<p><b>Expiration:</b> ${momentMilliseconds ? moment(expiry).format('dddd, MMMM Do YYYY, h:mm:ss A') : 'N/A'}</p>
|
||||
|
||||
<b><i>Library of Code sp-us | Support Team</i></b>
|
||||
<b><i>Library of Code Inc | Support Team</i></b>
|
||||
`,
|
||||
});
|
||||
} catch (error) {
|
||||
|
|
|
@ -35,15 +35,15 @@ export default class Notify extends Command {
|
|||
ch.send({ embeds: [embed] });
|
||||
this.client.util.transport.sendMail({
|
||||
to: account.emailAddress,
|
||||
from: 'Library of Code sp-us | Cloud Services <help@libraryofcode.org>',
|
||||
from: 'Library of Code Inc | Cloud Services <help@libraryofcode.org>',
|
||||
replyTo: 'cloud-help@libraryofcode.org',
|
||||
subject: 'Notification',
|
||||
html: `
|
||||
<h1>Library of Code sp-us | Cloud Services</h1>
|
||||
<h1>Library of Code Inc | Cloud Services</h1>
|
||||
<p>${new Converter().makeHtml(args.slice(1).join(' '))}</p>
|
||||
<p><strong>Technician:</strong> ${message.author.username}</p>
|
||||
|
||||
<b><i>Library of Code sp-us | Support Team</i></b>
|
||||
<b><i>Library of Code Inc | Support Team</i></b>
|
||||
`,
|
||||
});
|
||||
message.delete();
|
||||
|
|
|
@ -25,16 +25,16 @@ export default class Warn extends Command {
|
|||
await this.client.util.sendMessageToUserTerminal(account.username, `WARNING FROM TECHNICIAN: ${args.slice(1).join(' ')}`).catch(() => { });
|
||||
return this.client.util.transport.sendMail({
|
||||
to: account.emailAddress,
|
||||
from: 'Library of Code sp-us | Cloud Services <help@libraryofcode.org>',
|
||||
from: 'Library of Code Inc | Cloud Services <help@libraryofcode.org>',
|
||||
replyTo: 'cloud-help@libraryofcode.org',
|
||||
subject: 'Your account has been warned',
|
||||
html: `
|
||||
<h1>Library of Code sp-us | Cloud Services</h1>
|
||||
<h1>Library of Code Inc | Cloud Services</h1>
|
||||
<p>Your account has received an official warning from a Moderator. Please get the underlying issue resolved to avoid <i>possible</i> moderative action.</p>
|
||||
<p><strong>Reason:</strong> ${args.slice(1).length ? new Converter().makeHtml(args.slice(1).join(' ')) : 'Not Specified'}</p>
|
||||
<p><strong>Technician:</strong> ${message.author.username}</p>
|
||||
|
||||
<b><i>Library of Code sp-us | Support Team</i></b>
|
||||
<b><i>Library of Code Inc | Support Team</i></b>
|
||||
`,
|
||||
});
|
||||
} catch (error) {
|
||||
|
|
|
@ -45,15 +45,15 @@ export default function memory(client: Client) {
|
|||
client.util.createModerationLog(acc.userID, (await (await client.guilds.fetch('446067825673633794')).members.fetch(client.user.id)).user, 1, `You have exceeded your resource limit of '${String(userLimits.hard)} MB'. Any process running on your user account has been sent a STOP/KILL signal. If you have any questions, please contact a Technician. DN/C`);
|
||||
client.util.transport.sendMail({
|
||||
to: acc.emailAddress,
|
||||
from: 'Library of Code sp-us | Cloud Services <help@libraryofcode.org>',
|
||||
from: 'Library of Code Inc | Cloud Services <help@libraryofcode.org>',
|
||||
subject: 'Your account has been warned',
|
||||
html: `
|
||||
<h1>Library of Code sp-us | Cloud Services</h1>
|
||||
<h1>Library of Code Inc | Cloud Services</h1>
|
||||
<p>Your account has received an official warning from a Technician. Please get the underlying issue resolved to avoid <i>possible</i> moderative action.</p>
|
||||
<p><strong>Reason:</strong> You have exceeded your resource limit of '${String(userLimits.hard)} MB'. Any process running on your user account has been sent a STOP/KILL signal. If you have any questions, please contact a Technician.</p>
|
||||
<p><strong>Moderator:</strong> SYSTEM</p>
|
||||
|
||||
<b><i>Library of Code sp-us | Support Team</i></b>
|
||||
<b><i>Library of Code Inc | Support Team</i></b>
|
||||
`,
|
||||
});
|
||||
ch.send({ embeds: [embed] });
|
||||
|
@ -90,14 +90,14 @@ export default function memory(client: Client) {
|
|||
await client.util.sendMessageToUserTerminal(acc.username, `You are about to reach your RAM resource limits, you are currently using '${String(Math.round(memoryConversion))} MB' and your limit is '${String(userLimits.hard)} MB'. Please correct your usage to avoid further action.`).catch(() => { });
|
||||
client.util.transport.sendMail({
|
||||
to: acc.emailAddress,
|
||||
from: 'Library of Code sp-us | Cloud Services <help@libraryofcode.org>',
|
||||
from: 'Library of Code Inc | Cloud Services <help@libraryofcode.org>',
|
||||
subject: 'Account Notification',
|
||||
html: `
|
||||
<h1>Library of Code sp-us | Cloud Services</h1>
|
||||
<h1>Library of Code Inc | Cloud Services</h1>
|
||||
<p>You are about to reach your RAM resource limits, you are currently using '${String(memoryConversion)} MB' and your limit is '${String(userLimits.hard)} MB'. Please correct your usage to avoid further action.</p>
|
||||
<p><strong>Technician:</strong> SYSTEM</p>
|
||||
|
||||
<b><i>Library of Code sp-us | Support Team</i></b>
|
||||
<b><i>Library of Code Inc | Support Team</i></b>
|
||||
`,
|
||||
});
|
||||
const channel = client.channels.cache.get('580950455581147146') as TextChannel;
|
||||
|
|
Loading…
Reference in New Issue