envato-archive / lumberg Goto Github PK
View Code? Open in Web Editor NEWRuby 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 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
Please add agnostic logging support similar in fashion to what was used in https://github.com/site5/solusvm/blob/master/lib/solusvm/base.rb#L90-100
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:
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.
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
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 :)
I often find when creating new accounts, there is no option to specify cPanels "Use the nameservers specified by the Domain's Registrar" functionality.
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
)
Lumberg::WhmConnectionError: xxxxxxxxxxxx.com is either unavailable or is not currently accepting requests. Please try again in a few minutes.
I'd like to validate on initialize a Cpanel/WHM server, e.g: make an attempt to connect to Cpanel/WHM port in the @host (probably near https://github.com/site5/lumberg/blob/master/lib/lumberg/whm/server.rb#L63), so we'll raise another Lumberg::WhmArgumentError if we cannot connect to the specified server
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:
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:in
connect': 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:in
new'
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:in
request_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:in
call'
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:in
call'
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:in
call'
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:in
run_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:in
do_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:in
list'
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:in
initialize'
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:in
load'
from /usr/bin/tissue:19
Can this be looked into?
We are no longer testing against Ruby 1.8.7.
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')
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
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:
modifyacct
with rs
param to change an account's theme. Request will succeed but the account won't be modifiedRS
instead of rs
. Request will succeed and account's theme will be changedWhat if we normalize parameters? Lumberg should make the right request regardless of params' case.
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.
It would be great to have the whole lib documented with Tomdoc.
Hi,
Would it be possible to support this feature? Or, can I get an API Key via cPanel?
Hi there,
Is it possible to use the cPanel APIs with only a regular cpanel account username a password?
I haven't dug into the API protocols but this post (http://forums.cpanel.net/f42/cpanel-client-api-without-root-level-whm-267842.html#post1252832) seems to indicate it's technically possible.
Thanks & cheers
https://github.com/site5/lumberg/blob/master/lib/lumberg/whm/server.rb#L204 needs middleware so if the user configures the server with a bad host it returns a helpful error rather than generic faraday error, including the host that failed.
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'
Hey guys, good to integrate UAPI into Lumberg(h)?
Please update faraday
Have a look at https://github.com/intridea/hashie
Can I create database and define a User's Privileges using this gem?
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".
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:
http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/GetTweakSetting
http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/SetTweakSetting
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.