Commit 5e4046b3 authored by Aral Balkan's avatar Aral Balkan
Browse files

Remove fs-extra dependency

parent 7d433687
......@@ -14,7 +14,7 @@
//
////////////////////////////////////////////////////////////////////////////////
import fs from 'fs-extra'
import fs from 'fs'
import Throws from './util/Throws.js'
import NewAccountRequest from './acme-requests/NewAccountRequest.js'
......
......@@ -6,7 +6,7 @@
* @license AGPLv3 or later.
*/
import fs from 'fs-extra'
import fs from 'fs'
import tls from 'tls'
import util from 'util'
import moment from 'moment'
......@@ -174,13 +174,13 @@ export default class Certificate {
// written but before we had a chance to clean up the old files.)
if (fs.existsSync(certificateIdentityPath) && fs.existsSync(certificatePath)) {
log(' 🚑 ❨auto-encrypt❩ A new certificate was also found. Going to delete the old one and use that.')
fs.removeSync(oldCertificateIdentityPath)
fs.removeSync(oldCertificatePath)
fs.rmSync(oldCertificateIdentityPath, {recursive: true, force: true})
fs.rmSync(oldCertificatePath, {recursive: true, force: true})
} else {
// The renewal process must have failed. Delete any previous state and restore the old certificate.
log(' 🚑 ❨auto-encrypt❩ Cleaning up previous state and restoring old certificate…')
fs.removeSync(certificateIdentityPath)
fs.removeSync(certificatePath)
fs.rmSync(certificateIdentityPath, {recursive: true, force: true})
fs.rmSync(certificatePath, {recursive: true, force: true})
fs.renameSync(oldCertificateIdentityPath, certificateIdentityPath)
fs.renameSync(oldCertificatePath, certificatePath)
}
......@@ -278,15 +278,15 @@ export default class Certificate {
//
// In case old files were left behind, remove them first and then rename the current files.
// (If the directory doesn’t exist, fs.removeSync() will silently do nothing.)
// (If the directory doesn’t exist, will silently do nothing.)
//
const certificateIdentityPath = this.#configuration.certificateIdentityPath
const oldCertificateIdentityPath = `${certificateIdentityPath}.old`
const certificatePath = this.#configuration.certificatePath
const oldCertificatePath = `${certificatePath}.old`
fs.removeSync(oldCertificateIdentityPath)
fs.removeSync(oldCertificatePath)
fs.rmSync(oldCertificateIdentityPath, {recursive: true, force: true})
fs.rmSync(oldCertificatePath, {recursive: true, force: true})
fs.renameSync(certificateIdentityPath, oldCertificateIdentityPath)
fs.renameSync(certificatePath, oldCertificatePath)
......@@ -296,8 +296,8 @@ export default class Certificate {
await this.createSecureContext(/* renewCertificate = */ true)
// Delete the backup of the old certificate.
fs.removeSync(oldCertificateIdentityPath)
fs.removeSync(oldCertificatePath)
fs.rmSync(oldCertificateIdentityPath, {recursive: true, force: true})
fs.rmSync(oldCertificatePath, {recursive: true, force: true})
}
......
......@@ -8,7 +8,7 @@
*/
import os from 'os'
import fs from 'fs-extra'
import fs from 'fs'
import path from 'path'
import util from 'util'
import crypto from 'crypto'
......@@ -26,6 +26,12 @@ function isAnArrayOfStrings (object) {
return Array.isArray(object) && containsOnlyStrings(object)
}
function ensureDirSync (directory) {
if (!fs.existsSync(directory)) {
fs.mkdirSync(directory, { recursive: true })
}
}
/**
* @alias module:lib/Configuration
* @hideconstructor
......@@ -73,7 +79,7 @@ export default class Configuration {
}
// And ensure that the settings path exists in the file system.
fs.ensureDirSync(this.#settingsPath)
ensureDirSync(this.#settingsPath)
//
// Create account paths.
......@@ -106,7 +112,7 @@ export default class Configuration {
this.#certificateDirectoryPath = path.join(this.#settingsPath, certificateDirectoryName)
// And ensure that the certificate directory path exists in the file system.
fs.ensureDirSync(this.#certificateDirectoryPath)
ensureDirSync(this.#certificateDirectoryPath)
this.#certificatePath = path.join(this.#certificateDirectoryPath, 'certificate.pem')
this.#certificateIdentityPath = path.join(this.#certificateDirectoryPath, 'certificate-identity.pem')
......
......@@ -15,7 +15,7 @@
////////////////////////////////////////////////////////////////////////////////
import util from 'util'
import fs from 'fs-extra'
import fs from 'fs'
import jose from 'jose'
import Throws from './util/Throws.js'
import log from './util/log.js'
......
......@@ -12,7 +12,7 @@
//
////////////////////////////////////////////////////////////////////////////////
import fs from 'fs-extra'
import fsPromises from 'fs/promises'
import Authorisation from './Authorisation.js'
import HttpServer from './HttpServer.js'
import CertificateIdentity from './identities/CertificateIdentity.js'
......@@ -193,7 +193,7 @@ export default class Order {
// Save the certificate.
try {
await fs.writeFile(this.configuration.certificatePath, this.certificate, 'utf-8')
await fsPromises.writeFile(this.configuration.certificatePath, this.certificate, 'utf-8')
} catch (error) {
throw new Error(error)
}
......
......@@ -4,7 +4,7 @@
//
//////////////////////////////////////////////////////////////////////
import fs from 'fs-extra'
import fs from 'fs'
import os from 'os'
import path from 'path'
import http from 'http'
......@@ -154,7 +154,7 @@ export function dehydrate (string) {
export function createTestSettingsPath () {
const testSettingsPath = path.join(os.homedir(), '.small-tech.org', 'auto-encrypt', 'test')
fs.removeSync(testSettingsPath)
fs.rmSync(testSettingsPath, { recursive: true, force: true })
return testSettingsPath
}
......
......@@ -11,10 +11,7 @@
//
////////////////////////////////////////////////////////////////////////////////
import fs from 'fs-extra'
import path from 'path'
const __dirname = new URL('.', import.meta.url).pathname
import fs from 'fs'
class SymbolicError extends Error {
symbol = null
......
{
"name": "@small-tech/auto-encrypt",
"version": "2.0.6",
"version": "2.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@small-tech/auto-encrypt",
"version": "2.0.6",
"version": "2.1.0",
"license": "AGPL-3.0-or-later",
"dependencies": {
"bent": "aral/bent#errors-with-response-headers",
"encodeurl": "^1.0.2",
"fs-extra": "^8.1.0",
"jose": "^1.24.0",
"moment": "^2.24.0",
"node-forge": "^0.10.0",
......@@ -19,9 +18,9 @@
"server-destroy": "^1.0.1"
},
"devDependencies": {
"@small-tech/esm-tape-runner": "^1.0.1",
"@small-tech/esm-tape-runner": "^1.0.3",
"@small-tech/node-pebble": "^4.2.4",
"@small-tech/tap-monkey": "^1.1.1",
"@small-tech/tap-monkey": "^1.3.0",
"c8": "^7.6.0",
"dependency-cruiser": "^9.15.1",
"esbuild": "^0.8.53",
......@@ -106,9 +105,9 @@
}
},
"node_modules/@small-tech/esm-tape-runner": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@small-tech/esm-tape-runner/-/esm-tape-runner-1.0.1.tgz",
"integrity": "sha512-FKS8Cj536El7j2eCqr5AN1I5kNNJRqSlkTBiKwnCjxJOhc4DRy4jYgqAuEzmN1/O5Yiw2SA2uGKcGAIzUWhhJQ==",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@small-tech/esm-tape-runner/-/esm-tape-runner-1.0.3.tgz",
"integrity": "sha512-2r8pC/Yqda/m9md/fXhCD4d+2gZ3euAfl5FSHJJodWmIOZT+sgDrL+c1SYPX3GIK6TZshK3TZvcPkOEr5pE/7A==",
"dev": true,
"dependencies": {
"fast-glob": "^3.2.5"
......@@ -189,12 +188,12 @@
}
},
"node_modules/@small-tech/tap-monkey": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@small-tech/tap-monkey/-/tap-monkey-1.1.1.tgz",
"integrity": "sha512-vD7CQ9nbrvHjUfMk+QXmCpSiDqcOX8wmsgIY0vHQ7z6Wf0YDSrOTVLhtntyNajGLPO9Ty0vgTdwPX2qPgxFG2g==",
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@small-tech/tap-monkey/-/tap-monkey-1.3.0.tgz",
"integrity": "sha512-R9D+7nKvyPKCFEATXDfzJjYW1IR1sXWcDm55bUWU9BOfFG58ZAkPOhyNcFsJYoq3vU471EK381Y5qv7hlChKww==",
"dev": true,
"dependencies": {
"@small-tech/tap-out": "^3.1.0",
"@small-tech/tap-out": "^3.2.0",
"chalk": "^4.1.0",
"ora": "^5.3.0"
},
......@@ -203,9 +202,9 @@
}
},
"node_modules/@small-tech/tap-out": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@small-tech/tap-out/-/tap-out-3.1.0.tgz",
"integrity": "sha512-5OBCzROhnDSTFxtFBT33H7mDGieQ4p6mJzZWY4V9Atvfdeyo+Bwhzb6zBaIj3Q8AO4UhNURmJZXSYhrw4OTllQ==",
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@small-tech/tap-out/-/tap-out-3.2.0.tgz",
"integrity": "sha512-2B35YwIogdOeurPJlMg9GxEmGS2gxRJjEZduCr2FPJEwGotPpSOEk0wJ2co1n1iEw3Q6kSSfHLEEES4hLe7wlA==",
"dev": true,
"dependencies": {
"re-emitter": "1.1.4",
......@@ -1631,19 +1630,6 @@
"node": ">=8.0.0"
}
},
"node_modules/fs-extra": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
"integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
"dependencies": {
"graceful-fs": "^4.2.0",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
},
"engines": {
"node": ">=6 <7 || >=8"
}
},
"node_modules/fs-then-native": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fs-then-native/-/fs-then-native-2.0.0.tgz",
......@@ -1736,7 +1722,8 @@
"node_modules/graceful-fs": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz",
"integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ=="
"integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==",
"dev": true
},
"node_modules/handlebars": {
"version": "4.7.6",
......@@ -2479,14 +2466,6 @@
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"dev": true
},
"node_modules/jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"dependencies": {
"graceful-fs": "^4.1.6"
}
},
"node_modules/klaw": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz",
......@@ -3889,14 +3868,6 @@
"integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==",
"dev": true
},
"node_modules/universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"engines": {
"node": ">= 4.0.0"
}
},
"node_modules/uri-js": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz",
......@@ -4112,9 +4083,9 @@
"integrity": "sha512-UdkG3mLEqXgnlKsWanWcgb6dOjUzJ+XC5f+aWw30qrtjxeNUSfKX1cd5FBzOaXQumoe9nIqeZUvrRJS03HCCtw=="
},
"@small-tech/esm-tape-runner": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@small-tech/esm-tape-runner/-/esm-tape-runner-1.0.1.tgz",
"integrity": "sha512-FKS8Cj536El7j2eCqr5AN1I5kNNJRqSlkTBiKwnCjxJOhc4DRy4jYgqAuEzmN1/O5Yiw2SA2uGKcGAIzUWhhJQ==",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@small-tech/esm-tape-runner/-/esm-tape-runner-1.0.3.tgz",
"integrity": "sha512-2r8pC/Yqda/m9md/fXhCD4d+2gZ3euAfl5FSHJJodWmIOZT+sgDrL+c1SYPX3GIK6TZshK3TZvcPkOEr5pE/7A==",
"dev": true,
"requires": {
"fast-glob": "^3.2.5"
......@@ -4178,20 +4149,20 @@
}
},
"@small-tech/tap-monkey": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@small-tech/tap-monkey/-/tap-monkey-1.1.1.tgz",
"integrity": "sha512-vD7CQ9nbrvHjUfMk+QXmCpSiDqcOX8wmsgIY0vHQ7z6Wf0YDSrOTVLhtntyNajGLPO9Ty0vgTdwPX2qPgxFG2g==",
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@small-tech/tap-monkey/-/tap-monkey-1.3.0.tgz",
"integrity": "sha512-R9D+7nKvyPKCFEATXDfzJjYW1IR1sXWcDm55bUWU9BOfFG58ZAkPOhyNcFsJYoq3vU471EK381Y5qv7hlChKww==",
"dev": true,
"requires": {
"@small-tech/tap-out": "^3.1.0",
"@small-tech/tap-out": "^3.2.0",
"chalk": "^4.1.0",
"ora": "^5.3.0"
}
},
"@small-tech/tap-out": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@small-tech/tap-out/-/tap-out-3.1.0.tgz",
"integrity": "sha512-5OBCzROhnDSTFxtFBT33H7mDGieQ4p6mJzZWY4V9Atvfdeyo+Bwhzb6zBaIj3Q8AO4UhNURmJZXSYhrw4OTllQ==",
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@small-tech/tap-out/-/tap-out-3.2.0.tgz",
"integrity": "sha512-2B35YwIogdOeurPJlMg9GxEmGS2gxRJjEZduCr2FPJEwGotPpSOEk0wJ2co1n1iEw3Q6kSSfHLEEES4hLe7wlA==",
"dev": true,
"requires": {
"re-emitter": "1.1.4",
......@@ -5377,16 +5348,6 @@
"signal-exit": "^3.0.2"
}
},
"fs-extra": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
"integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
"requires": {
"graceful-fs": "^4.2.0",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
},
"fs-then-native": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fs-then-native/-/fs-then-native-2.0.0.tgz",
......@@ -5464,7 +5425,8 @@
"graceful-fs": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz",
"integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ=="
"integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==",
"dev": true
},
"handlebars": {
"version": "4.7.6",
......@@ -6058,14 +6020,6 @@
}
}
},
"jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"requires": {
"graceful-fs": "^4.1.6"
}
},
"klaw": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz",
......@@ -7233,11 +7187,6 @@
"integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==",
"dev": true
},
"universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
},
"uri-js": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz",
......
import os from 'os'
import fs from 'fs-extra'
import fs from 'fs'
import path from 'path'
import test from 'tape'
import { throwsErrorOfType } from '../../lib/test-helpers/index.js'
......@@ -27,7 +27,7 @@ async function setup() {
})
const customSettingsPath = path.join(os.homedir(), '.small-tech.org', 'auto-encrypt', 'test')
fs.removeSync(customSettingsPath)
fs.rmSync(customSettingsPath, { recursive: true, force: true })
const configuration = new Configuration({
domains: process.env.STAGING ? [os.hostname()] : ['localhost'],
......
import os from 'os'
import fs from 'fs-extra'
import fs from 'fs'
import path from 'path'
import test from 'tape'
import jose from 'jose'
......@@ -24,7 +24,7 @@ async function setup() {
}
const customSettingsPath = path.join(os.homedir(), '.small-tech.org', 'auto-encrypt', 'test')
fs.removeSync(customSettingsPath)
fs.rmSync(customSettingsPath, { recursive: true, force: true })
const configuration = new Configuration({
domains: ['dev.ar.al'],
......
import os from 'os'
import fs from 'fs-extra'
import fs from 'fs'
import path from 'path'
import util from 'util'
import tls from 'tls'
......@@ -12,6 +12,12 @@ import { dehydrate, timeItAsync, symbolOfErrorThrownBy } from '../../lib/test-he
import Pebble from '@small-tech/node-pebble'
import HttpServer from '../../lib/HttpServer.js'
function ensureDirSync (directory) {
if (!fs.existsSync(directory)) {
fs.mkdirSync(directory, { recursive: true })
}
}
async function setup() {
// Run the tests using either a local Pebble server (default) or the Let’s Encrypt Staging server
// (which is subject to rate limits) if the STAGING environment variable is set.
......@@ -28,7 +34,7 @@ async function setup() {
}
const customSettingsPath = path.join(os.homedir(), '.small-tech.org', 'auto-encrypt', 'test')
fs.removeSync(customSettingsPath)
fs.rmSync(customSettingsPath, {recursive: true, force: true})
test.onFinish(async () => {
await Pebble.shutdown()
......@@ -145,10 +151,10 @@ test('Certificate', async t => {
// restored and used instead.
//
fs.moveSync(certificateIdentityPath, oldCertificateIdentityPath)
fs.moveSync(certificatePath, oldCertificatePath)
fs.removeSync(certificatePath)
fs.removeSync(certificateIdentityPath)
fs.renameSync(certificateIdentityPath, oldCertificateIdentityPath)
fs.renameSync(certificatePath, oldCertificatePath)
fs.rmSync(certificatePath, {recursive: true, force: true})
fs.rmSync(certificateIdentityPath, {recursive: true, force: true})
certificate2.attemptToRecoverFromFailedRenewalAttemptIfNecessary()
......@@ -162,8 +168,8 @@ test('Certificate', async t => {
// to be restored and used.
//
fs.copySync(certificatePath, oldCertificatePath)
fs.moveSync(certificateIdentityPath, oldCertificateIdentityPath)
fs.copyFileSync(certificatePath, oldCertificatePath)
fs.renameSync(certificateIdentityPath, oldCertificateIdentityPath)
certificate2.attemptToRecoverFromFailedRenewalAttemptIfNecessary()
......@@ -177,8 +183,8 @@ test('Certificate', async t => {
// to be restored and used.
//
fs.copySync(certificateIdentityPath, oldCertificateIdentityPath)
fs.moveSync(certificatePath, oldCertificatePath)
fs.copyFileSync(certificateIdentityPath, oldCertificateIdentityPath)
fs.renameSync(certificatePath, oldCertificatePath)
certificate2.attemptToRecoverFromFailedRenewalAttemptIfNecessary()
......
import os from 'os'
import fs from 'fs-extra'
import fs from 'fs'
import path from 'path'
import util from 'util'
import test from 'tape'
......@@ -55,7 +55,7 @@ test('Configuration', async t => {
let configuration
const customSettingsPath = path.join(os.homedir(), '.small-tech.org', 'auto-encrypt', 'test')
fs.removeSync(customSettingsPath)
fs.rmSync(customSettingsPath, { recursive: true, force: true })
configuration = new Configuration({ domains: ['dev.ar.al'], server: letsEncryptStagingServer, settingsPath: customSettingsPath })
......
import os from 'os'
import fs from 'fs-extra'
import fs from 'fs'
import path from 'path'
import util from 'util'
import test from 'tape'
......@@ -26,7 +26,7 @@ async function setup() {
}
const customSettingsPath = path.join(os.homedir(), '.small-tech.org', 'auto-encrypt', 'test')
fs.removeSync(customSettingsPath)
fs.rmSync(customSettingsPath, { recursive: true, force: true })
test.onFinish(async () => {
await Pebble.shutdown()
......
import os from 'os'
import path from 'path'
import fs from 'fs-extra'
import fs from 'fs'
import test from 'tape'
import Identity from '../../lib/Identity.js'
import Configuration from '../../lib/Configuration.js'
......@@ -19,7 +19,7 @@ function setup() {
}
const customSettingsPath = path.join(os.homedir(), '.small-tech.org', 'auto-encrypt', 'test')
fs.removeSync(customSettingsPath)
fs.rmSync(customSettingsPath, { recursive: true, force: true })
return new Configuration({
domains: domains[letsEncryptServerType],
server: new LetsEncryptServer(letsEncryptServerType),
......
import os from 'os'
import fs from 'fs-extra'
import fs from 'fs'
import path from 'path'
import util from 'util'
import test from 'tape'
import Nonce from '../../lib/Nonce.js'
import Directory from '../../lib/Directory.js'
import Configuration from '../../lib/Configuration.js'
import LetsEncryptServer from '../../lib/LetsEncryptServer.js'
import { dehydrate, symbolOfErrorThrownBy } from '../../lib/test-helpers/index.js'
import { symbolOfErrorThrownBy } from '../../lib/test-helpers/index.js'
import Pebble from '@small-tech/node-pebble'
async function setup() {
......@@ -26,7 +25,7 @@ async function setup() {
}
const customSettingsPath = path.join(os.homedir(), '.small-tech.org', 'auto-encrypt', 'test')
fs.removeSync(customSettingsPath)
fs.rmSync(customSettingsPath, { recursive: true, force: true })
return new Configuration({
domains: domains[letsEncryptServerType],
server: new LetsEncryptServer(letsEncryptServerType),
......
import os from 'os'
import fs from 'fs-extra'
import fs from 'fs'
import path from 'path'
import test from 'tape'
import Order from '../../lib/Order.js'
......@@ -36,7 +36,7 @@ async function setup() {
})
const customSettingsPath = path.join(os.homedir(), '.small-tech.org', 'auto-encrypt', 'test')
fs.removeSync(customSettingsPath)
fs.rmSync(customSettingsPath, { recursive: true, force: true })
const configuration = new Configuration({
domains,
......
import os from 'os'
import fs from 'fs-extra'
import fs from 'fs'
import path from 'path'
import test from 'tape'
import Directory from '../../../lib/Directory.js'
......@@ -29,7 +29,7 @@ async function setup() {
}
const customSettingsPath = path.join(os.homedir(), '.small-tech.org', 'auto-encrypt', 'test')
fs.removeSync(customSettingsPath)
fs.rmSync(customSettingsPath, { recursive: true, force: true })
const configuration = new Configuration({
domains: domains[letsEncryptServerType],
......