Jump to content
Sign in to follow this  
vane41

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 :)

Share this post


Link to post
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...

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines