Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
3151829f85 | |||
eca63e588c | |||
9d23e205d8 | |||
5ecdf7c9fd |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartacme",
|
"name": "@pushrocks/smartacme",
|
||||||
"version": "2.0.29",
|
"version": "2.0.31",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartacme",
|
"name": "@pushrocks/smartacme",
|
||||||
"version": "2.0.29",
|
"version": "2.0.31",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "acme implementation in TypeScript",
|
"description": "acme implementation in TypeScript",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
export type TCertStatus = 'existing' | 'nonexisting' | 'pending' | 'failed';
|
export type TCertStatus = 'existing' | 'nonexisting' | 'pending' | 'failed';
|
||||||
|
|
||||||
export interface ICert {
|
export interface ICert {
|
||||||
|
id: string;
|
||||||
domainName: string;
|
domainName: string;
|
||||||
created: number;
|
created: number;
|
||||||
privateKey: string;
|
privateKey: string;
|
||||||
|
@ -12,7 +12,7 @@ import { ICert } from './interfaces';
|
|||||||
})
|
})
|
||||||
export class Cert extends plugins.smartdata.SmartDataDbDoc<Cert> implements interfaces.ICert {
|
export class Cert extends plugins.smartdata.SmartDataDbDoc<Cert> implements interfaces.ICert {
|
||||||
@unI()
|
@unI()
|
||||||
public index: string;
|
public id: string;
|
||||||
|
|
||||||
@svDb()
|
@svDb()
|
||||||
public domainName: string;
|
public domainName: string;
|
||||||
|
@ -86,7 +86,7 @@ export class CertManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// otherwise lets continue
|
// otherwise lets continue
|
||||||
const existingCertificate = this.retrieveCertificate(certDomainArg);
|
const existingCertificate = await this.retrieveCertificate(certDomainArg);
|
||||||
if (existingCertificate) {
|
if (existingCertificate) {
|
||||||
return 'existing';
|
return 'existing';
|
||||||
}
|
}
|
||||||
|
@ -194,6 +194,7 @@ export class SmartAcme {
|
|||||||
console.log(`Certificate:\n${cert.toString()}`);
|
console.log(`Certificate:\n${cert.toString()}`);
|
||||||
|
|
||||||
await this.certmanager.storeCertificate({
|
await this.certmanager.storeCertificate({
|
||||||
|
id: plugins.smartunique.shortId(),
|
||||||
domainName: certDomain,
|
domainName: certDomain,
|
||||||
privateKey: key.toString(),
|
privateKey: key.toString(),
|
||||||
publicKey: cert.toString(),
|
publicKey: cert.toString(),
|
||||||
|
Reference in New Issue
Block a user