1
0
Fork 0

various fixes

refactor/models
Matthew 2020-05-08 19:27:45 -04:00
parent 331afd449a
commit 60a65f3709
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import fs, { writeFile, unlink } from 'fs-extra'; import fs, { writeFile, unlink } from 'fs-extra';
import axios from 'axios'; import axios from 'axios';
import { randomBytes } from 'crypto';
import { Message } from 'eris'; import { Message } from 'eris';
import { AccountInterface } from '../models'; import { AccountInterface } from '../models';
import { Command, RichEmbed } from '../class'; import { Command, RichEmbed } from '../class';
@ -87,7 +88,9 @@ export default class CWG_Create extends Command {
.addField('Domain', domain.domain, true) .addField('Domain', domain.domain, true)
.addField('Port', String(domain.port), true); .addField('Port', String(domain.port), true);
const cert = await parseCertificate(this.client, domain.x509.cert); const certPath = `/opt/CloudServices/temp/${randomBytes(5).toString('hex')}`;
await writeFile(certPath, certs.cert, { encoding: 'utf8' });
const cert = await parseCertificate(this.client, certPath);
embed.addField('Certificate Issuer', cert.issuer.organizationName, true) embed.addField('Certificate Issuer', cert.issuer.organizationName, true)
.addField('Certificate Subject', cert.subject.commonName, true) .addField('Certificate Subject', cert.subject.commonName, true)