update tsconfig

This commit is contained in:
Philipp Kunz 2024-04-14 17:18:13 +02:00
parent b5afe8e842
commit 6ea919780c
4 changed files with 127 additions and 55 deletions

View File

@ -5,17 +5,29 @@
"githost": "code.foss.global", "githost": "code.foss.global",
"gitscope": "push.rocks", "gitscope": "push.rocks",
"gitrepo": "smartacme", "gitrepo": "smartacme",
"description": "acme with an easy yet powerful interface in TypeScript", "description": "A TypeScript-based ACME client with an easy yet powerful interface for LetsEncrypt certificate management.",
"npmPackagename": "@push.rocks/smartacme", "npmPackagename": "@push.rocks/smartacme",
"license": "MIT", "license": "MIT",
"projectDomain": "push.rocks" "projectDomain": "push.rocks",
"keywords": [
"ACME",
"LetsEncrypt",
"TypeScript",
"certificate management",
"DNS challenges",
"SSL/TLS",
"secure communication",
"domain validation",
"automation",
"crypto"
]
} }
}, },
"npmci": { "npmci": {
"npmGlobalTools": [], "npmGlobalTools": [],
"npmAccessLevel": "public" "npmAccessLevel": "public"
}, },
"tsdocs": { "tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n" "legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
} }
} }

View File

@ -2,7 +2,7 @@
"name": "@push.rocks/smartacme", "name": "@push.rocks/smartacme",
"version": "4.0.8", "version": "4.0.8",
"private": false, "private": false,
"description": "acme with an easy yet powerful interface in TypeScript", "description": "A TypeScript-based ACME client with an easy yet powerful interface for LetsEncrypt certificate management.",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"type": "module", "type": "module",
@ -16,9 +16,16 @@
"url": "git+ssh://git@gitlab.com/umbrellazone/smartacme.git" "url": "git+ssh://git@gitlab.com/umbrellazone/smartacme.git"
}, },
"keywords": [ "keywords": [
"ACME",
"LetsEncrypt",
"TypeScript", "TypeScript",
"acme", "certificate management",
"letsencrypt" "DNS challenges",
"SSL/TLS",
"secure communication",
"domain validation",
"automation",
"crypto"
], ],
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",

1
readme.hints.md Normal file
View File

@ -0,0 +1 @@

148
readme.md
View File

@ -1,64 +1,116 @@
# @push.rocks/smartacme # @push.rocks/smartacme
acme with an easy yet powerful interface in TypeScript acme with an easy yet powerful interface in TypeScript
## Availabililty and Links ## Install
* [npmjs.org (npm package)](https://www.npmjs.com/package/@push.rocks/smartacme) To install `@push.rocks/smartacme`, you can use npm or yarn. Run one of the following commands in your project directory:
* [gitlab.com (source)](https://gitlab.com/push.rocks/smartacme)
* [github.com (source mirror)](https://github.com/push.rocks/smartacme)
* [docs (typedoc)](https://push.rocks.gitlab.io/smartacme/)
## Status for master ```bash
npm install @push.rocks/smartacme --save
```
or
```bash
yarn add @push.rocks/smartacme
```
Status Category | Status Badge Make sure your project is set up to use TypeScript and supports ECMAScript Modules (ESM).
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/push.rocks/smartacme/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/push.rocks/smartacme/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@push.rocks/smartacme)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/push.rocks/smartacme)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@push.rocks/smartacme)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@push.rocks/smartacme)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@push.rocks/smartacme)](https://lossless.cloud)
## Usage ## Usage
Use TypeScript for best in class instellisense. This guide will walk you through using `@push.rocks/smartacme` to set up and manage ACME (Automated Certificate Management Environment) certificates with a focus on the Let's Encrypt service, which provides free SSL certificates. The library provides an easy yet powerful TypeScript interface to automate the process of obtaining, renewing, and installing your SSL certificates.
```javascript ### Setting Up Your Project
import { SmartAcme } from 'smartacme';
const run = async () => { Ensure your project includes the necessary TypeScript configuration and dependencies. You'll need to have TypeScript installed and configured for ECMAScript Modules. If you are new to TypeScript, review its [documentation](https://www.typescriptlang.org/docs/) to get started.
smartAcmeInstance = new smartacme.SmartAcme({
accountEmail: 'domains@lossless.org',
accountPrivateKey: null,
mongoDescriptor: {
mongoDbName: testQenv.getEnvVarRequired('MONGODB_DATABASE'),
mongoDbPass: testQenv.getEnvVarRequired('MONGODB_PASSWORD'),
mongoDbUrl: testQenv.getEnvVarRequired('MONGODB_URL'),
},
removeChallenge: async (dnsChallenge) => {
// somehow provide a function that is able to remove the dns challenge
},
setChallenge: async (dnsChallenge) => {
// somehow provide a function that is able to the dns challenge
},
environment: 'integration',
});
await smartAcmeInstance.init();
// myCert has properties for public/private keys and csr ;) ### Importing @push.rocks/smartacme
const myCert = await smartAcmeInstance.getCertificateForDomain('bleu.de');
}; Start by importing the `SmartAcme` class from the `@push.rocks/smartacme` package. You'll also need to import or define interfaces for your setup options:
```typescript
import { SmartAcme } from '@push.rocks/smartacme';
``` ```
## Contribution ### Creating a SmartAcme Instance
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :) The `SmartAcme` class is central to interaction with the ACME service. Create an instance of `SmartAcme` with your configuration:
For further information read the linked docs at the top of this readme. ```typescript
const smartAcmeInstance = new SmartAcme({
accountEmail: 'youremail@example.com', // Email used for Let's Encrypt registration and recovery
accountPrivateKey: null, // Private key for the account (optional, if not provided it will be generated)
mongoDescriptor: { // MongoDB connection details for storing your certificates
mongoDbUrl: 'mongodb://yourmongoURL',
mongoDbName: 'yourDbName',
mongoDbPass: 'yourDbPassword',
},
removeChallenge: async (dnsChallenge) => {
// Implement logic here to remove DNS challenge records
},
setChallenge: async (dnsChallenge) => {
// Implement logic here to create DNS challenge records
},
environment: 'integration', // Use 'production' for actual certificates
});
```
## Legal ### Initializing SmartAcme
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) Before proceeding to request certificates, initialize your SmartAcme instance:
```typescript
await smartAcmeInstance.init();
```
### Obtaining a Certificate for a Domain
To obtain a certificate for a specific domain, use the `getCertificateForDomain` method. This function ensures that if a valid certificate is already present, it will be reused; otherwise, a new certificate is obtained:
```typescript
const myDomain = 'example.com';
const myCert = await smartAcmeInstance.getCertificateForDomain(myDomain);
console.log('Certificate:', myCert);
```
### Automating DNS Challenges
Part of the ACME protocol involves responding to DNS challenges issued by the certificate authority to prove control over a domain. Implement the `setChallenge` and `removeChallenge` functions in your SmartAcme configuration to automate this process. These functions receive a `dnsChallenge` argument containing details needed to create or remove the necessary DNS records.
### Managing Certificates
The library automatically handles fetching, renewing, and storing your certificates in a MongoDB database specified in your configuration. Ensure your MongoDB instance is accessible and properly configured for use with SmartAcme.
```typescript
// Example MongoDB configuration
{
mongoDbUrl: 'mongodb://yourmongoURL',
mongoDbName: 'yourDbName',
mongoDbPass: 'yourDbPassword',
}
```
### Environmental Considerations
When creating an instance of `SmartAcme`, you can specify an `environment` option. This is particularly useful for testing, as you can use the `integration` environment to avoid hitting rate limits and for testing your setup without issuing real certificates. Switch to `production` when you are ready to obtain actual certificates.
---
This documentation covers the basic setup and operation of `@push.rocks/smartacme`. The library is designed to simplify interactions with ACME services and automate certificate management tasks, enabling secure communication for your applications with minimal hassle.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.