GithubHelp home page GithubHelp logo

cpanelgo's Introduction

cPanel api in Go

GoDoc

About

This is a simple cPanel api written in go.

Currently four intefaces are implemented,

  • CGI cPanel LiveApi - Designed for use in plugins, this interface will work through the preauthenticated CGI LiveApi environment as documented here (UAPI/API2/API1)
  • Authenticated JSON cPanel API (UAPI/API2/API1)
  • WHM (WHMAPI1)
  • WHM Impersonation to call cPanel API (UAPI/API2/API1)

Example

A simple command line example is provided in the example folder.

About

This API forms part of the Let's Encrypt for cPanel plugin which allows cPanel/WHM hosters to provide free Let's Encrypt certificates for their clients.

cpanelgo's People

Contributors

alexzorin avatar drgomesp avatar eggsampler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpanelgo's Issues

export full backup tar.gz file from cPanel

hi,

i am not able to export full backup tar.gz file from cPanel using API2 and UAPI in GO.
actually there is no option export or download backup from cPanel using API2 and UAPI

kindly help thank you!

Create backup on Server (using PuTTY)

Hello, @alexzorin, I am able to access the files on the server using code in PuTTY by uploading the executable file of my code.
Now, Is there any way/function to create a full back-up using the same on the server that I'm using?

Allow for custom *http.Client to be passed to the upper clients

Currently, the *http.Client used for making the API calls are hard-coded inside the client different gateway implementations (e.g.: https://github.com/letsencrypt-cpanel/cpanelgo/blob/eb0532054299c19f6aad2f5445e25ea8ff44bbd2/cpanel/authenticated.go#L115)

I think there should be a way to pass an *http.Client that the user might want to use down to the gateway. An easy approach would be to pass the client into the gateway client constructors:

type JsonApiGateway struct {
	Hostname string
	Username string
	Password string
	Insecure bool
	cl       *http.Client
}

func NewJsonApi(hostname, username, password string, insecure bool, cl *http.Client) (CpanelApi, error) {
	c := &JsonApiGateway{
		Hostname: hostname,
		Username: username,
		Password: password,
		Insecure: insecure,
	}

        if cl != nil {
            c.cl = cl
        }

	return CpanelApi{cpanelgo.NewApi(c)}, nil
}

What do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.