Jump to content

Setting licensed public IP inside configuration.php


Recommended Posts

Hi!

 

I'm running WHMCS inside a container and passing the license key, db connection and all the other necessary info via environment variables. However, since upgrading the container image to use WHMCS v7.x.x I can no longer set licensed public ip in configuration.php.

 

Here's a workaround that I've been using in whmcs v6:

 

... (configuration.php) ...

if(getenv('LICENSED_PUBLIC_IP'))
{
       $_SERVER['SERVER_ADDR'] = getenv('LICENSED_PUBLIC_IP');
}

 

In v7 this results in an "INVALID LICENSE" error whenever I upgrade the container. It's because WHMCS uses container's internal IP address instead of the public IP given in the file above.

I'd be grateful for any clues on how to solve this problem.

 

Cheers :)

Link to comment
Share on other sites

Why should that even work? Wouldn't something like this allow the possibility of faking the actual installation is licensed (not saying you are)? I mean, if you can tell it what IP to use, what's to stop you doing that for more than one installation using a licensed IP...

Link to comment
Share on other sites

Running it inside a container is the main thing here. WHMCS takes the internal ip of the container that it is running in and treats it like the public address that would be used for accessing the panel from the Internet. The workaround for the containerized IP address that I posted worked fine on whmcs v6, and as far as I remember, whmcs support gave us this solution when we asked them about it.

 

I mean, if you can tell it what IP to use, what's to stop you doing that for more than one installation using a licensed IP...

 

Doesn't the address have to match with the license number? I assume (the obvious) that you cannot use a license for more than one installation, so I don't understand your concerns here.

Link to comment
Share on other sites

as far as I remember, whmcs support gave us this solution when we asked them about it.

If they provided it, they must know about it so I withdraw the concern.

Doesn't the address have to match with the license number? I assume (the obvious) that you cannot use a license for more than one installation, so I don't understand your concerns here.

Just playing devil's advocate here, but let's say I create 5 containers. In each, I use a WHMCS installation with that same IP listed along with the key, etc. Unless there is some mechanism at their licensing server that would pick up on it, license A on IP A would work on *every* instance of that IP and license...

Maybe.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated