diff --git a/docker/tle-captcha-data/Dockerfile b/docker/tle-captcha-data/Dockerfile index f94f6465..d2ac0919 100644 --- a/docker/tle-captcha-data/Dockerfile +++ b/docker/tle-captcha-data/Dockerfile @@ -1,6 +1,6 @@ # we will reuse the mysql container to save space FROM arungupta/mysql-data-container -RUN mkdir -p /data/captcha +RUN mkdir -p /data/Lacuna-Captcha/public diff --git a/docker_1.8/README.md b/docker_1.8/README.md deleted file mode 100644 index 656510be..00000000 --- a/docker_1.8/README.md +++ /dev/null @@ -1,14 +0,0 @@ -## Docker 1.8 - -Check what version of docker you are using. At the time of writing this the latest -version of docker running on Fedora/Centos is 1.8 (if installed using yum or dnf). - -There are differences in using a network between these two versions. - -If you are running docker 1.8 then use the commands in this directory. - -If you are using docker 1.9 or above then use the commands in the ./docker -directory. - - - diff --git a/docker_1.8/connect_tle_mysql_server.sh b/docker_1.8/connect_tle_mysql_server.sh deleted file mode 100755 index 9d085fec..00000000 --- a/docker_1.8/connect_tle_mysql_server.sh +++ /dev/null @@ -1,3 +0,0 @@ -docker exec -it tle-mysql-server mysql -uroot -placuna lacuna - - diff --git a/docker_1.8/connect_tle_server.sh b/docker_1.8/connect_tle_server.sh deleted file mode 100755 index 334c81f4..00000000 --- a/docker_1.8/connect_tle_server.sh +++ /dev/null @@ -1,4 +0,0 @@ -docker exec -it tle-server bash - - - diff --git a/docker_1.8/create_tle_data.sh b/docker_1.8/create_tle_data.sh deleted file mode 100755 index d13256da..00000000 --- a/docker_1.8/create_tle_data.sh +++ /dev/null @@ -1,21 +0,0 @@ - -# This is a data-only container which holds the mysql database. -# -# This means that the mysql data will persist even if you stop or -# even delete the running TLE server. -# -# If for any reason you do want to delete the container be sure -# to first stop and remove all containers with a reference to -# the data container (run_app.sh for example) and then do -# the following command. -# -# $ docker rm -v tle-mysql-data -# -# This will ensure that you don't leave a 'dangling container' which -# will be difficult to remove and use up disk space. -# -# You only need to create a data-only container, you don't need to -# run it. This script will create it for you. -# -docker create --name tle-mysql-data arungupta/mysql-data-container - diff --git a/docker_1.8/create_tle_network.sh b/docker_1.8/create_tle_network.sh deleted file mode 100755 index 215b6cae..00000000 --- a/docker_1.8/create_tle_network.sh +++ /dev/null @@ -1 +0,0 @@ -echo "This is not really required on Docker 1.8, it uses the default network" diff --git a/docker_1.8/run_tle_beanstalk.sh b/docker_1.8/run_tle_beanstalk.sh deleted file mode 100755 index aa9c66ec..00000000 --- a/docker_1.8/run_tle_beanstalk.sh +++ /dev/null @@ -1,2 +0,0 @@ -docker run --name=tle-beanstalkd -d -p 11300:11300 schickling/beanstalkd - diff --git a/docker_1.8/run_tle_memcached.sh b/docker_1.8/run_tle_memcached.sh deleted file mode 100755 index e033017c..00000000 --- a/docker_1.8/run_tle_memcached.sh +++ /dev/null @@ -1,2 +0,0 @@ -docker run --name=tle-memcached -d memcached - diff --git a/docker_1.8/run_tle_mysql_server.sh b/docker_1.8/run_tle_mysql_server.sh deleted file mode 100755 index 2eb62f2e..00000000 --- a/docker_1.8/run_tle_mysql_server.sh +++ /dev/null @@ -1,2 +0,0 @@ -docker run --name tle-mysql-server --volumes-from tle-mysql-data -e MYSQL_ROOT_PASSWORD=lacuna -d mysql:5.5 - diff --git a/docker_1.8/run_tle_nginx.sh b/docker_1.8/run_tle_nginx.sh deleted file mode 100755 index 85b73d90..00000000 --- a/docker_1.8/run_tle_nginx.sh +++ /dev/null @@ -1 +0,0 @@ -docker run -it -p ${TLE_SERVER_LISTEN:-127.0.0.1}:${TLE_SERVER_PORT:-8000}:80 --name=tle-nginx -v ${PWD}/../etc/nginx.conf:/etc/nginx/nginx.conf:ro -v ${PWD}/../captcha:/data/captcha -v ${PWD}/../etc:/data/Lacuna-Server/etc -v ${PWD}/../var:/data/Lacuna-Server/var -d plainblack/tle-nginx diff --git a/docker_1.8/run_tle_server.sh b/docker_1.8/run_tle_server.sh deleted file mode 100755 index e0811595..00000000 --- a/docker_1.8/run_tle_server.sh +++ /dev/null @@ -1 +0,0 @@ -docker run --rm -it --name=tle-server -v ${PWD}/../captcha:/data/captcha -v ${PWD}/..:/data/Lacuna-Server plainblack/tle-server /bin/bash diff --git a/etc/lacuna.conf.docker b/etc/lacuna.conf.docker index 66cdf940..ea2ffa44 100755 --- a/etc/lacuna.conf.docker +++ b/etc/lacuna.conf.docker @@ -19,9 +19,9 @@ }, "captcha" : { # path to the fonts being used. - "fontpath" : "/Library/Fonts", + "fontpath" : "/usr/share/fonts", # .ttf fonts in above path - "fonts" : [ "Ayuthaya", "Chalkduster", "HeadlineA", "Kai" ], + "fonts" : ["dejavu/DejaVuSans"], }, "db" : { "dsn" : "DBI:mysql:host=tle-mysql-server;database=lacuna", diff --git a/etc/lacuna.conf.template b/etc/lacuna.conf.template index c830ca9c..994878cd 100755 --- a/etc/lacuna.conf.template +++ b/etc/lacuna.conf.template @@ -18,9 +18,9 @@ }, "captcha" : { # path to the fonts being used. - "fontpath" : "/Library/Fonts", + "fontpath" : "/usr/share/fonts", # .ttf fonts in above path - "fonts" : [ "Ayuthaya", "Chalkduster", "HeadlineA", "Kai" ], + "fonts" : ["dejavu/DejaVuSans"], }, "db" : { "dsn" : "DBI:mysql:XXXX", diff --git a/lib/Lacuna/CaptchaFactory.pm b/lib/Lacuna/CaptchaFactory.pm index 03e05af8..bee39faf 100644 --- a/lib/Lacuna/CaptchaFactory.pm +++ b/lib/Lacuna/CaptchaFactory.pm @@ -230,13 +230,14 @@ sub construct { lines => 10, thickness => 1, font => $self->font_path.'/'.$self->font.'.ttf', - bg_color => '#'.$self->bg_color, + bgcolor => '#'.$self->bg_color, ptsize => 32, rndmax => 3, - angle => 3, + send_ctobg => 1, + angle => int(rand(20) - 10), ) ->random($self->riddle->[0]) - ->create( ttf => $self->style, $self->fg_color, '#'.($self->bg_color+10) ) + ->create( ttf => $self->style, $self->fg_color, $self->fg_color ) ->particle; } @@ -255,7 +256,7 @@ sub construct { ); my $prefix = substr($self->guid, 0,2); - my $dir = '/data/captcha/'.$prefix; + my $dir = '/data/Lacuna-Captcha/public/'.$prefix; unless (-d $dir) { mkdir $dir; }