cedvan / docker-toran-proxy Goto Github PK
View Code? Open in Web Editor NEWDocker image to launch a toran proxy application self hosted to manage PHP dependencies
Home Page: https://hub.docker.com/r/cedvan/toran-proxy
License: MIT License
Docker image to launch a toran proxy application self hosted to manage PHP dependencies
Home Page: https://hub.docker.com/r/cedvan/toran-proxy
License: MIT License
This happens before running cron, would be nice if docker-toran-proxy ran cron on first boot or something?
Current Workaround: set cron to minute.
Hi
I have problem with no default port.
I use:
docker run --name toran-proxy -d
-p 8081:80
-p 443:443
-v /var/docker/.ssh/:/data/toran-proxy/ssh
-e "TORAN_CRON_TIMER=minutes"
-e "TORAN_HOST=toranproxy.dev.pl"
cedvan/toran-proxy:1.5.4
composer.json:
"repositories": [
{"type": "composer", "url": "http://toranproxy.dev.pl:8081/repo/packagist/"},
{"packagist": false}
],
After "composer install":
...
Installing symfony/polyfill-mbstring (v1.5.0): Downloading (failed)
Failed, trying the next URL (404: The "http://toranproxy.dev.pl/repo/packagist/dists/symfony/polyfill-mbstring/1.5.0.0/7c8fae0ac1d216eb54349e6a8baa57d515fe8803.zip" file could not be downloaded (HTTP/1.1 404 Not Found))Downloading (100%)
Composer should be try download by toranproxy.dev.pl:8081 but It trying download by toranproxy.dev.pl
@cedvan Any plan to upgrade docker image to use the new PHP 7
? (not really new but well current image is using PHP 5.5
)
Another enhancement would be switching to alpine
linux perhaps?
It doesn't seem like the docker registry image has been rebuilt with the latest master changes.
Hi there!
As far as i can see, you are not really adding the custom ssh keys to the ssh agent or even starting the ssh agent properly. Could you just quickly point me into the right direction? I can see that you are symlinking ssh keys, but not where you load them exactly.
Best,
Jeremy
I've tried using 1.2.0 but unfortunately it looks like the SSH package isn't installed, which causes issues when cloning private repos.
Installing SSH stopped that error (apt-get install ssh
) but unfortunately I then got Host key verification failed. fatal: Could not read from remote repository.
during the sync cron, despite my ssh keys being present. I downgraded and it seemed to work again.
First run:
Creating mirrors directories...
Creating logs directories for nginx...
Creating logs directories for cron...
Second run onwards:
ln: failed to create symbolic link '/var/www/web/mirrors/mirrors': File exists
ln: failed to create symbolic link '/logs/toran-proxy': File exists
Hi,
I wanted to use this awesome image in my Swarm, but there is a problem with env variable TORAN_AUTH_PASSWORD. Its better approach to use docker secrets instead of typing password in yml stack file see https://docs.docker.com/engine/swarm/secrets
Maybe you can add new env variable TORAN_AUTH_PASSWORD_FILE=/run/secrets/password
Same for TORAN_TOKEN_GITHUB
Or another more systematic option is just read .env variable from PHP as described here harness/gitness#2223 (comment)
It'd be really nice if I could optionally provide TORAN_HTTP_USERNAME and TORAN_HTTP_PASSWORD environment variables to configure HTTP basic auth automatically.
It appears as there's no way to configure HTTP Basic Auth.
toran_1 | Wed Jun 8 10:10:11 UTC 2016 - Starting synchronization...
toran_1 | Initializing private repositories
toran_1 | Initializing MY_GIT_URI
toran_1 | Synchronizing dist archives in '/var/www/web/repo/private/dists'
toran_1 | Synchronizing clone in ''
toran_1 | Writing /var/www/web/repo/private/p/MY_VENDOR_NAME/amqp-producer.json
toran_1 | Writing packages.json for the private repository
toran_1 | Initializing packagist.org proxy repository
toran_1 |
toran_1 |
toran_1 | [InvalidArgumentException]
toran_1 | The "/var/www/web/repo/packagist/p" directory does not exist.
toran_1 |
toran_1 |
toran_1 | Exception trace:
toran_1 | () at /var/www/vendor/symfony/symfony/src/Symfony/Component/Finder/Finder.php:656
toran_1 | Symfony\Component\Finder\Finder->in() at /var/www/src/Toran/ProxyBundle/Service/Proxy.php:318
toran_1 | Toran\ProxyBundle\Service\Proxy->cleanProviderFiles() at /var/www/src/Toran/ProxyBundle/Command/CronCommand.php:214
toran_1 | Toran\ProxyBundle\Command\CronCommand->syncPublicPackages() at /var/www/src/Toran/ProxyBundle/Command/CronCommand.php:123
toran_1 | Toran\ProxyBundle\Command\CronCommand->execute() at /var/www/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:259
toran_1 | Symfony\Component\Console\Command\Command->run() at /var/www/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:860
toran_1 | Symfony\Component\Console\Application->doRunCommand() at /var/www/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:192
toran_1 | Symfony\Component\Console\Application->doRun() at /var/www/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:92
toran_1 | Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:123
toran_1 | Symfony\Component\Console\Application->run() at /var/www/bin/cron:30
Hi. Since the last update, I get this error on starting the toran-proxy container. I'm not sure whether this is caused by something in the container setup or the update of the toran-proxy version. I'm intending to dig into this a bit more later, but posting here first in case anyone's already made some progress.
My first guess is perhaps toran-proxy changed its cache location in a recent update and this new location needs creating in the Dockerfile.
Command: docker run cedvan/toran-proxy
Result: RuntimeException in log output.
Wed Jun 1 19:44:24 UTC 2016 - Starting synchronization...
[RuntimeException]
Unable to create the cache directory (/var/www/app/cache/prod)
Exception trace:
() at /var/www/app/bootstrap.php.cache:2738
Symfony\Component\HttpKernel\Kernel->buildContainer() at /var/www/app/bootstrap.php.cache:2699
Symfony\Component\HttpKernel\Kernel->initializeContainer() at /var/www/app/bootstrap.php.cache:2478
Symfony\Component\HttpKernel\Kernel->boot() at /var/www/app/AppKernel.php:51
AppKernel->boot() at /var/www/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:70
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:123
Symfony\Component\Console\Application->run() at /var/www/bin/cron:30
Wed Jun 1 19:44:24 UTC 2016 - Synchronization finished
Hi,
I work on company that use proxy for Internet control. So I need to configure the variables http_proxy
/https_proxy
in all servers with Internet access requirement.
The problem (my problem) with this image is the following command:
sudo -u www-data bash -c "cd /var/www && php bin/cron -v"
The command above clear the proxy vars. So, I need to change to:
sudo -E -u www-data bash -c "cd /var/www && php bin/cron -v"
Regards.
Hi,
On deploying this image with TORAN_HOST set, it seems that the internal package URLs are being presented as localhost instead of the value in TORAN_HOST.
The initial HTTP page for toran shows the correct host, but it looks like the JSON being dispatched by toran still think its serving as localhost.
Example:
TORAN_CRON_TIMER fifteen
TORAN_HOST xxxxxxxxx.node.tutum.io
TORAN_PHP_TIMEZONE Europe/London
TORAN_TOKEN_GITHUB xxxxxxxxx
Any ideas?
Can anybody explain about how to set up private repo? Now I want to set up my private repo from bitbucket by using [email protected]:xxx/aaa.git, but it always gives error:
Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
I already add ssh public key id_rsa and id_rsa.pub into the ssh folder.
Thanks!
Base toran-proxy image on alpine instead of ubuntu to create a lighter image
cf. #53
Running the Quick Start (changed the port to 8090
, otherwise same command), when I go to the http://192.168.10.10:8090, it produces a blank page. Note, 192.168.10.10
is my boot2docker
ip and other containers work fine.
docker logs toran-proxy
produces this:
Configure Toran Proxy...
Creating logs directories...
Installing Cron...
Loading Nginx vhosts...
Starting PHP-FPM...
Starting Cron...
Starting Nginx..
I don't have time to debug this, but I figured I'd bring it up.
v1.3 has been released with quite a few fixes! Would be great to get this supported :)
Hi,
I was checking my Toran Proxy setup recently and noticed that /var/log/toran-proxy/cron/cron.log
grows very fast. Container running just 15 days and it's ~200M already.
So the question is why to store this log file in the container? Maybe it's better to redirect cron output to stdout
?
The same question applies to Nginx. It's much more convenient to have all logs redirected to Docker instead of storing them in the container.
I get the following error if I run this container:
Check environment configuration...
Configure Toran Proxy...
cp: failed to access '/data/toran-proxy/toran': Too many levels of symbolic links
cp: failed to access '/data/toran-proxy/toran/config.yml': Too many levels of symbolic links
sed: can't read /data/toran-proxy/toran/config.yml: Too many levels of symbolic links
sed: can't read /data/toran-proxy/toran/config.yml: Too many levels of symbolic links
mkdir: cannot create directory '/data/toran-proxy/toran': Too many levels of symbolic links
cp: failed to access '/data/toran-proxy/toran/composer/auth.json': Too many levels of symbolic links
Installing Token Github...
sed: can't read /data/toran-proxy/toran/composer/auth.json: Too many levels of symbolic links
Installing Cron...
ln: failed to create symbolic link '/var/www/app/logs/downloads.private.log': File exists
Loading permissions...
Configure PHP...
Loading Nginx vhosts...
Loading HTTPS Certificates...
Using provided HTTPS Certificates...
ln: failed to create symbolic link '/usr/local/share/ca-certificates/toran-proxy/certs': File exists
find: File system loop detected; `/usr/local/share/ca-certificates/toran-proxy/certs' is part of the same file system loop as `/usr/local/share/ca-certificates/toran-proxy'.
Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d....done.
Starting Toran Proxy...
2016-10-21 16:21:19,065 CRIT Set uid to user 0
I use this command to start the docker container:
docker create --name="toran-proxy" --net="bridge" -e "TORAN_CRON_TIMER"="minutes" -e "TORAN_TOKEN_GITHUB"="xxxxxxxxxxxxxxxxxxxxxxxxxxx" -e "TORAN_HTTPS"="true" -e "TORAN_HTTPS_PORT"="444" -e "TORAN_HOST"="192.168.1.113" -p 444:444/tcp -v "/mnt/user/appdata/toran-proxy":"/data/toran-proxy":rw cedvan/toran-proxy
I use Unraid so maybe the command is a little bit different then normal.
Thank you
Can you tag a new image that uses toran proxy version 1.5.4 please?
There is a bug fix in this patch release as noted at composer/composer#6383 (comment)
Using this wonderful package, in the vhost of nginx, the servername _ is used.
https://github.com/cedvan/docker-toran-proxy/blob/master/assets/vhosts/toran-proxy-http.conf#L3
Wouldn't it be good to add the TORAN_HOST variable there instead of _?
Shouldn't toran_scheme be http or https vs true/false?
Also we should be able to set this via an ENV in the instance that we are using a reverse proxy for https.
I seems I have to delete auth.json
for it to work, else it just adds the github token at the end of the line even when it is there.
toran_1 | [Seld\JsonLint\ParsingException]
toran_1 | "/var/www/app/toran/composer/auth.json" does not contain valid JSON
toran_1 | Parse error on line 3:
toran_1 | ...7c1c9cb6031de9aa0ad""f2f57bee38b0e6867b5...
toran_1 | ----------------------^
toran_1 | Expected one of: 'EOF', '}', ':', ',', ']'
toran_1 |
toran_1 |
toran_1 | Exception trace:
toran_1 | () at /var/www/vendor/composer/composer/src/Composer/Json/JsonFile.php:295
toran_1 | Composer\Json\JsonFile::validateSyntax() at /var/www/vendor/composer/composer/src/Composer/Json/JsonFile.php:267
toran_1 | Composer\Json\JsonFile::parseJson() at /var/www/vendor/composer/composer/src/Composer/Json/JsonFile.php:100
toran_1 | Composer\Json\JsonFile->read() at /var/www/vendor/composer/composer/src/Composer/Factory.php:191
toran_1 | Composer\Factory::createConfig() at /var/www/src/Toran/ProxyBundle/Service/RepoSyncer.php:50
toran_1 | Toran\ProxyBundle\Service\RepoSyncer->sync() at /var/www/src/Toran/ProxyBundle/Command/CronCommand.php:228
toran_1 | Toran\ProxyBundle\Command\CronCommand->syncPrivateRepositories() at /var/www/src/Toran/ProxyBundle/Command/CronCommand.php:122
toran_1 | Toran\ProxyBundle\Command\CronCommand->execute() at /var/www/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:259
toran_1 | Symfony\Component\Console\Command\Command->run() at /var/www/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:860
toran_1 | Symfony\Component\Console\Application->doRunCommand() at /var/www/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:192
toran_1 | Symfony\Component\Console\Application->doRun() at /var/www/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:92
toran_1 | Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:123
toran_1 | Symfony\Component\Console\Application->run() at /var/www/bin/cron:30
Hi, do you plan to add cron entry for running 'php bin/cron' which download files for proxy on background?
Actually necessary use a volume to add ssh keys. It would be great if the image is able to generate a key pair automatically if they do not exist. To finally display the public key in the docker logs output
We are using private repos in Stash and configured in toran(satis) as 'ssh://[email protected]:7999/grp/repo.git'
When i check cron job - php bin/cron
i see error:
Failed to execute git clone --mirror 'ssh://[email protected]:7999/grp/repo.git '/var/www/app/toran/composer/cache/vcs/ssh---git-stash-grp-repogit'
Cloning into bare repository '/var/www/app/toran/composer/cache/vcs/ssh---git-stash-grp-repogit'...
error: cannot run ssh: No such file or directory
fatal: unable to fork
First issue is that container is missing ssh command and second issue will emerge after that - missing ssh private key enabled in stash:
Found similar issue how to add id_rsa (http://stackoverflow.com/questions/18136389/using-ssh-keys-inside-docker-container) but I'm not sure how to solve missing ssh? Can you point me somewhere?
Hi,
first of all thank you for docker image you built. it is very helpful.
I run into problem: if TORAN_HOST and TORAN_HTTP_PORT are provided toran is not responding by HTTP (http://192.168.1.123:8080) but if I remove both settings it is working though packages.json contains references to localhost instead of my server.
There are no errors in logs.
Here is config I'm using:
sudo docker run --name toran-proxy \
-p 8080:80 \
-e "TORAN_HOST=192.168.1.123" \
-e "TORAN_HTTP_PORT=8080" \
-v /volume1/toran-proxy:/data/toran-proxy \
cedvan/toran-proxy:1.5.4
Any idea how to fix that?
PS: My server is based on Ubuntu 18.04
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.