Commit 763a9f9a authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by clairehurst
Browse files

fixup! TB 40933: Add tor-launcher functionality

Update types to be compatible with future RR eslint settings.
parent f670da22
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -973,7 +973,7 @@ export class TorController {
        throw new Error(`Unsupported type ${typeof value} (key ${key})`);
      })
      .join(" ");
    return this.#sendCommandSimple(`SETCONF ${args}`);
    await this.#sendCommandSimple(`SETCONF ${args}`);
  }

  /**
@@ -984,14 +984,14 @@ export class TorController {
   * @param {boolean} enabled Tell whether the network should be enabled
   */
  async setNetworkEnabled(enabled) {
    return this.setConf([["DisableNetwork", !enabled]]);
    await this.setConf([["DisableNetwork", !enabled]]);
  }

  /**
   * Ask Tor to write out its config options into its torrc.
   */
  async flushSettings() {
    return this.#sendCommandSimple("SAVECONF");
    await this.#sendCommandSimple("SAVECONF");
  }

  // Onion service authentication
@@ -1075,7 +1075,7 @@ export class TorController {
   * them is closed.
   */
  async takeOwnership() {
    return this.#sendCommandSimple("TAKEOWNERSHIP");
    await this.#sendCommandSimple("TAKEOWNERSHIP");
  }

  /**
@@ -1085,7 +1085,7 @@ export class TorController {
   * should be stopped by calling this function.
   */
  async resetOwningControllerProcess() {
    return this.#sendCommandSimple("RESETCONF __OwningControllerProcess");
    await this.#sendCommandSimple("RESETCONF __OwningControllerProcess");
  }

  // Signals
@@ -1094,7 +1094,7 @@ export class TorController {
   * Ask Tor to swtich to new circuits and clear the DNS cache.
   */
  async newnym() {
    return this.#sendCommandSimple("SIGNAL NEWNYM");
    await this.#sendCommandSimple("SIGNAL NEWNYM");
  }

  // Events monitoring
+2 −2
Original line number Diff line number Diff line
@@ -489,7 +489,7 @@ export class TorProvider {
   * @param {boolean} isPermanent Tell whether the key should be saved forever
   */
  async onionAuthAdd(address, b64PrivateKey, isPermanent) {
    return this.#controller.onionAuthAdd(address, b64PrivateKey, isPermanent);
    await this.#controller.onionAuthAdd(address, b64PrivateKey, isPermanent);
  }

  /**
@@ -498,7 +498,7 @@ export class TorProvider {
   * @param {string} address The address of the onion service
   */
  async onionAuthRemove(address) {
    return this.#controller.onionAuthRemove(address);
    await this.#controller.onionAuthRemove(address);
  }

  /**
+2 −0
Original line number Diff line number Diff line
@@ -142,6 +142,8 @@ export class TorProviderBuilder {
   * Build a provider.
   * This method will wait for the system to be initialized, and allows you to
   * catch also any initialization errors.
   *
   * @returns {TorProvider} A TorProvider instance
   */
  static async build() {
    if (!this.#provider && this.providerType === TorProviders.none) {