nuxsmin / docker-syspass

Docker stuff for running sysPass on Docker
GNU General Public License v3.0
39 stars 21 forks source link

deploying sysPass 3.0 behind proxy #16

Closed rhenT closed 5 years ago

rhenT commented 6 years ago

Hello Rubén,

I've tried to deploy sysPass using this file: https://github.com/nuxsmin/docker-syspass/blob/3.0/docker-compose.yml My problem is that the the entrypoint.sh can't deploy composer due to connection issues to https://getcomposer.org/ I've tried to edit the compose file to include the proxy environmental value with include the proxy configuration: http_proxy=http://USER:PASSWD@ADDRESS:PORT and https_proxy=http://USER:PASSWD@ADDRESS:PORT

I'm able to get composer with wget, but not with the PHP command: php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

With this code I can download it with PHP too:

$auth = base64_encode('USER:PASSWD');

$aContext = array(
    'http' => array(
        'proxy' => 'tcp://ADDRESS:PORT',
        'request_fulluri' => true,
        'header' => "Proxy-Authorization: Basic $auth",
    ),
);
$cxContext = stream_context_create($aContext);
copy("https://getcomposer.org/installer", "composer-setup.php", $cxContext);

This code also works:

$auth = base64_encode('USER:PASSWD');

$aContext = array(
    'http' => array(
        'proxy' => 'tcp://ADDRESS:PORT',
        'request_fulluri' => true,
        'header' => "Proxy-Authorization: Basic $auth",
    ),
);
$cxContext = stream_context_set_default($aContext);
copy("https://getcomposer.org/installer", "composer.php");

The username, password, proxy address would be passable to the script via environmental variables.

Can you look into this?

Thank you, Tamas

nuxsmin commented 6 years ago

Hello Tamas,

This is a good hack, I'll take a look to the script in order to get it working through a proxy.

Thanks for the feedback and contribution!

Kind regards

nuxsmin commented 5 years ago

Hello Tamas, latest builds for v3 are built by downloading the dependencies in the image itself, so no need to download them again, and it adds more stability since the built-in dependencies are the ones used for testing.

Regards