GithubHelp home page GithubHelp logo

envato-archive / lumberg Goto Github PK

View Code? Open in Web Editor NEW
56.0 56.0 26.0 1.09 MB

Ruby library for the WHM & cPanel API; It's not a half day or anything like that.

Home Page: http://www.site5.com

License: MIT License

Ruby 100.00%

lumberg's People

Contributors

boone avatar colnpanic avatar drichert avatar fabiokr avatar gmcmillan avatar itspriddle avatar jmazzi avatar marcelocajueiro avatar mzahir avatar newx avatar ranaldobowker avatar rubemz avatar sanjithckin avatar tei1988 avatar tfwright 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lumberg's Issues

Cpanel modules and structure proposal

Please take this module as an example: http://docs.cpanel.net/twiki/bin/view/ApiDocs/Api2/ApiMime

Seems that it could be divided into two other modules, and many other modules could be broken:

  • a Redirect module, inside Domain or Account, to show and create other redirects
  • an Apache module, to show mime_types and handers

So, what is better here: stick with Cpanel's current functionality, or create concise and readable modules nor methods?

What if we need to call different Cpanel's modules inside the same module? E.g: a Password module would aggregate Passwd and PasswdStrength modules.

lumberg gem does't working

Hi Sir,

I am trying to use this lumberg gem inside my User model,

require 'lumberg'
  def self.create_cpanel_acct
    server = Lumberg::Whm::Server.new(
      :host => 'connecttheory.com',
      :user => 'connectt',
      :hash => 'secretpassword'
    )

    result = server.account.create(
      :username => 'newuser',
      :domain   => 'newuser.com',
      :password => 'password'
    )

    if result[:success]
      return result[:message]
    else
      return "not created"
    end
  end

and yet when I call the

User.create_cpanel_acct

I got the message "not created"

I have no Idea how to troubleshoot it.

Any help will be much appriciated.
Regards,
Amul

lumberg create

May I know how to set a package when creating a new cpanel user?

result = server.account.create(
  :username => 'sample',
  :domain   => 'sample.com',
  :password => 'samplesamplesample',
  :savepkg => false,
  :reseller => false,
  :language => 'en',
  :pkgname => 'package_name',
  :contactemail => '[email protected]'
)

I have an error

{:message=>"Sorry, you must choose a package", :params=>{:status=>0, :options=>nil, :statusmsg=>"Sorry, you must choose a package", :rawout=>nil}, :success=>false}

Thank you In advance :)

Account Create: Ignore Local Nameservers

I often find when creating new accounts, there is no option to specify cPanels "Use the nameservers specified by the Domain's Registrar" functionality.

screenshot 2015-10-31 22 11 13

Defaulting to the domains current set nameservers is often needed as accounts being created are frequently are using our legacy nameservers.

Can you add this option?

Lumberg::Whm::Server.new(...).account.create(
  :ignore_local_ns => true
)

Still active?

Hi there. Wondering if this project is still maintained. I'm going to be extending the WHM aspect of this gem for my own use, and if the project's still active I'll take a bit more care (and write tests correctly) for PRs down the track.

Things I'm going to add:

  • WHM API 1 support
    • Biggest focus being on package management
  • One-click cPanel login link generation

Excon errors when invoking tissue on lumberg 1.0.3

Heya,

Noticed that this error occurs on version 1.0.3 only of Lumberg where the excon gem was added into the mix. Reverting back to 1.0.1 alleviates the excon dependency and allows tissue to work without any problems. Here's the error being output below:

Excon#ssl_verify_peer is deprecated, use Excon.defaults[:ssl_verify_peer] instead (/usr/lib/ruby/gems/1.8/gems/faraday-0.8.1/lib/faraday/adapter/excon.rb:11:in call') /usr/lib/ruby/gems/1.8/gems/excon-0.14.3/lib/excon/ssl_socket.rb:74:inconnect': Unable to verify certificate, please set Excon.defaults[:ssl_ca_path] = path_to_certs, Excon.defaults[:ssl_ca_file] = path_to_file, or Excon.defaults[:ssl_verify_peer] = false (less secure). (Faraday::Error::ConnectionFailed)
from /usr/lib/ruby/gems/1.8/gems/excon-0.14.3/lib/excon/ssl_socket.rb:74:in initialize' from /usr/lib/ruby/gems/1.8/gems/excon-0.14.3/lib/excon/connection.rb:344:innew'
from /usr/lib/ruby/gems/1.8/gems/excon-0.14.3/lib/excon/connection.rb:344:in socket' from /usr/lib/ruby/gems/1.8/gems/excon-0.14.3/lib/excon/connection.rb:175:inrequest_kernel'
from /usr/lib/ruby/gems/1.8/gems/excon-0.14.3/lib/excon/connection.rb:101:in request' from /usr/lib/ruby/gems/1.8/gems/faraday-0.8.1/lib/faraday/adapter/excon.rb:15:incall'
from /usr/lib/ruby/gems/1.8/gems/faraday_middleware-0.8.8/lib/faraday_middleware/response_middleware.rb:30:in call' from /usr/lib/ruby/gems/1.8/gems/faraday-0.8.1/lib/faraday/response.rb:8:incall'
from /usr/lib/ruby/gems/1.8/gems/faraday-0.8.1/lib/faraday/response/logger.rb:20:in call' from /usr/lib/ruby/gems/1.8/gems/faraday-0.8.1/lib/faraday/response.rb:8:incall'
from /usr/lib/ruby/gems/1.8/gems/faraday-0.8.1/lib/faraday/request/url_encoded.rb:14:in call' from /usr/lib/ruby/gems/1.8/gems/faraday-0.8.1/lib/faraday/connection.rb:226:inrun_request'
from /usr/lib/ruby/gems/1.8/gems/faraday-0.8.1/lib/faraday/connection.rb:87:in get' from /usr/lib/ruby/gems/1.8/gems/lumberg-1.0.3/lib/lumberg/whm/server.rb:176:indo_request'
from /usr/lib/ruby/gems/1.8/gems/lumberg-1.0.3/lib/lumberg/whm/server.rb:74:in perform_request' from /usr/lib/ruby/gems/1.8/gems/lumberg-1.0.3/lib/lumberg/whm/account.rb:109:inlist'
from /usr/lib/ruby/gems/1.8/gems/tissue-1.0.1/lib/tissue/server.rb:45:in get_whm_account_list' from /usr/lib/ruby/gems/1.8/gems/tissue-1.0.1/lib/tissue/server.rb:11:ininitialize'
from /usr/lib/ruby/gems/1.8/gems/tissue-1.0.1/bin/tissue:86:in new' from /usr/lib/ruby/gems/1.8/gems/tissue-1.0.1/bin/tissue:86 from /usr/bin/tissue:19:inload'
from /usr/bin/tissue:19

Can this be looked into?

Updates for Ruby >= 1.9

We are no longer testing against Ruby 1.8.7.

  • Update code syntax to use 1.9 style.
  • Update Readme to indicate currently supported Rubies and show 1.9-style syntax in examples.

Deprecation warning with faraday 0.8.1 excon 0.14.0

Howdy, it looks like faraday (0.8.1) is calling a deprecated method in excon (0.14.0).

Excon#ssl_verify_peer is deprecated, use Excon.defaults[:ssl_verify_peer] instead (/Users/andrew/.rvm/gems/ruby-1.9.2-p136@whm-gem/gems/faraday-0.8.1/lib/faraday/adapter/excon.rb:11:in `call')

`gem build` warnings

These warnings appear when you build the gem. They aren't causing any issues, but we should refactor the gemspec to eliminate them:

gem build lumberg.gemspec

WARNING:  no homepage specified
WARNING:  open-ended dependency on json (>= 1.8.2) is not recommended
  if json is semantically versioned, use:
    add_runtime_dependency 'json', '~> 1.8', '>= 1.8.2'
WARNING:  pessimistic dependency on faraday (~> 0.9.0) may be overly strict
  if faraday is semantically versioned, use:
    add_runtime_dependency 'faraday', '~> 0.9', '>= 0.9.0'
WARNING:  pessimistic dependency on faraday_middleware (~> 0.9.0) may be overly strict
  if faraday_middleware is semantically versioned, use:
    add_runtime_dependency 'faraday_middleware', '~> 0.9', '>= 0.9.0'
WARNING:  pessimistic dependency on rspec (~> 2.10.0, development) may be overly strict
  if rspec is semantically versioned, use:
    add_development_dependency 'rspec', '~> 2.10', '>= 2.10.0'
WARNING:  pessimistic dependency on webmock (~> 1.18.0, development) may be overly strict
  if webmock is semantically versioned, use:
    add_development_dependency 'webmock', '~> 1.18', '>= 1.18.0'
WARNING:  pessimistic dependency on vcr (~> 2.9.2, development) may be overly strict
  if vcr is semantically versioned, use:
    add_development_dependency 'vcr', '~> 2.9', '>= 2.9.2'
WARNING:  pessimistic dependency on rake (~> 0.9.2.2, development) may be overly strict
  if rake is semantically versioned, use:
    add_development_dependency 'rake', '~> 0.9', '>= 0.9.2.2'
WARNING:  See http://guides.rubygems.org/specification-reference/ for help

Normalize parameters

Cpanel parameters are case sensitive - like FOO and foo are completely different things. The crazy part here is that you can make an API or function call with both params versions and only one will succeed, e.g:

  • call modifyacct with rs param to change an account's theme. Request will succeed but the account won't be modified
  • make the same call but use RS instead of rs. Request will succeed and account's theme will be changed

What if we normalize parameters? Lumberg should make the right request regardless of params' case.

Unable to create account

When i am creating an account related to server it is throwing me error i.e
756: unexpected token at '{"cpanelresult":{"apiversion":"2","error":,"Access denied","data":{"reason":"Access denied","result":"0"},"type":"text"}}

I have provided the correct credentials. Please help me.

Switch to Tomdoc

It would be great to have the whole lib documented with Tomdoc.

gem install error on development branch

I need development version for me to login using username/password instead of the apikey.

do you know why I get this error when install my bundle?

It only appears when I am install the delvelopment brunch.

Inside my Gemfile

gem "lumberg", :git => "git://github.com/site5/lumberg.git", :branch => "develop"

bundle install --path vendor/bundle

Updating git://github.com/site5/lumberg.git

fatal: Not a git repository (or any of the parent directories): .git
Git error: command git fetch --force --quiet --tags 'git://github.com/site5/lumberg.git' "refs/heads/*:refs/heads/*" in directory /home/kingpang/activedesigns/vendor/bundle/ruby/1.8/cache/bundler/git/lumberg-210a3279a50739ab4f2375f5e7d709dbce7509a4 has failed.
If this error persists you could try removing the cache directory '/home/kingpang/activedesigns/vendor/bundle/ruby/1.8/cache/bundler/git/lumberg-210a3279a50739ab4f2375f5e7d709dbce7509a4'

manage2 API error handling

When an IP is delicensed around billing time, and then attempted to relicense, the manage2 api returns status:0. I have to log into manage2 to manually accept charges to relicense the IP. Can that be automated please? This only happens around billing date, but it's a pain having to manually "fix".

New 11.32 API request

Hi,

Would it possible to have the new API's for 11.32+ added as well? Namely the get/set_tweaksettings routines?

Note, that there is an extra argument required that is un-documented to make this work. api.version=1 is needed. It has been verified by cPanel that this is needed, and that their documentation is just not complete.

Example:

https://server.cpanelconfigtest.test:2087/json-api/set_tweaksetting?api.version=1&key=php_upload_max_filesize&value=196

http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/GetTweakSetting
http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/SetTweakSetting

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.