Skip to content

beehexacorp/sql-account-cli

Repository files navigation

SQL Account CLI

The SQL Account CLI is a command-line tool designed to streamline the deployment, management, and exposure of the SQL Account Rest API application on Windows IIS. This tool automates common tasks such as deploying the application, setting up Cloudflare tunnels, and authenticating with SQL Account via REST API.


Table of Contents


Features

  • Install: Deploy the SQL Account Rest API application to IIS effortlessly.
  • Expose: Set up Cloudflare tunnels for secure remote access.
  • Manage: Control SQL Account integration services through a simple interface.
  • Automate: Simplify routine tasks such as authentication and application updates.

Prerequisites

Before using this project, ensure the following are installed on your system:

  1. Node.js (v18+)

  2. .NET 8 Hosting Bundle

  3. SQL Account

  4. IIS (Internet Information Services)

    • To enable IIS on Windows:
      1. Open Control Panel > Programs > Programs and Features.
      2. Click Turn Windows features on or off.
      3. Check the box for Internet Information Services and click OK.

Usage

Installation Steps

For usage, install the CLI globally using npm:

npm install -g sql-account

PowerShell Note

⚠️ Note: Ensure you run PowerShell as Administrator for the following installation steps.

This is essential to ensure the CLI has sufficient permissions to configure IIS and other system settings.

Key Commands

Below are the key commands available in the sql-account CLI:

  1. Install
    Deploy the SQL Account Rest API to IIS:

    sql-account install --app-dir <path-to-app-directory> --app-name <application-name>
    • --app-dir: Directory containing the application to deploy.
    • --app-name: Name of the application to set up in IIS.
  2. Expose
    Create a secure Cloudflare tunnel for exposing the application:

    sql-account expose --provider <hostname> --secret <cloudflare-key>
    • --provider: Hostname to use for the Cloudflare tunnel.
    • --secret: API key for authenticating with Cloudflare.
  3. Login
    Authenticate with SQL Account:

    sql-account login --username <your-username> --password <your-password>
    • --username: SQL Account username.
    • --password: SQL Account password.
  4. Help
    View all available commands and options:

    sql-account --help

Troubleshooting

If you encounter issues while using SQL Account CLI, below is a list of common errors and solutions:

  1. System script blocking

Description: When running the command npm install -g sql-account, an error occurs related to script execution policy.

Cause: The current ExecutionPolicy does not allow running untrusted scripts.

Solution:

Check the current policy

Get-ExecutionPolicy

Update the policy

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

Retry the installation command.

  1. Command 'cloudflared' not found

Description: When running the command to connect to a Cloudflare Tunnel, the CLI reports that the cloudflared command cannot be found.

Cause: Cloudflare Tunnel is not installed or is not in the system's PATH.

Solution:

Download Cloudflare Tunnel from here.

Ensure the cloudflared executable is accessible by adding its directory to the PATH environment variable.

Development & Contribution

For local development:

  1. Clone or download the project.
  2. Navigate to the project directory using a terminal.
  3. Install the required dependencies:
    npm install
  4. Build and link the package for local usage:
    npm run build
    npm link

This project is implemented and maintained by the HexaSync Team.

  • Fork and Contribute: You are welcome to fork the repository, implement your features, and submit a pull request for review.
  • File a Ticket: If you encounter any issues, please file a ticket on the GitHub repository.
  • Contact Support: Reach out to our team at support@hexasync.com.

License

This project is open-source. Contributions are highly encouraged!

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •