Giter Club home page Giter Club logo

turtl-docker's Introduction

THIS IMAGE IS DEPRECATED. IT DOESN'T USE THE NEW API (NodeJS)

turtl-docker

Docker file to run turtl (turtl.it) api server

How to build ?

sudo docker build -t turtl_docker .

How to run ?

sudo docker run -d -p 8181:8181 -v $(pwd)/volume:/var/lib/rethinkdb/instance1 -t turtl_docker

Configuration

The image supports the following environment variables that will be injected in the configuration at each restart of the container :

  • PIDFILE: defaults to 'nil'
  • BINDADDR: defaults to '0.0.0.0'
  • BINDPORT: defaults to '8181'
  • PROD_ERR_HANDLING: defaults to 't'
  • FQDN: defaults to 'turtl.local'
  • SITE_URL: defaults to 'http://turtl.local'
  • ADMIN_EMAIL: defaults to '[email protected]'
  • EMAIL_FROM: defaults to '[email protected]'
  • SMTP_USER: defaults to empty
  • SMTP_PASS: defaults to empty
  • DISPLAY_ERRORS: defaults to 't'
  • DEFAULT_STORAGE_LIMIT: defaults to 100
  • STORAGE_INVITE_CREDIT: defaults to 25
  • LOCAL_UPLOAD_URL: defaults to http://turtl.local
  • LOCAL_UPLOAD_PATH: defaults to "/opt/api/uploads"
  • AWS_S3_TOKEN: defaults to "(:token '' :secret '' :bucket '' :endpoint 'https://s3.amazonaws.com')"

How to run behind an Apache proxy ? (safer)

First, listen only on localhost :

sudo docker run -d --name turtl -p 127.0.0.1:8181:8181 -v $(pwd)/volume:/var/lib/rethinkdb/instance1 -t turtl_docker

Secondly add your reverse proxy in Apache conf :

<VirtualHost *:443>
ServerName turtl.MYDOMAIN.com

SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
SSLHonorCipherOrder     on
SSLCompression          off
SSLOptions +StrictRequire
#If you're using let's encrypt
SSLCertificateFile /etc/letsencrypt/live/turtl.MYDOMAIN.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/turtl.MYDOMAIN.com/privkey.pem
SSLCertificateChainFile	/etc/letsencrypt/live/turtl.MYDOMAIN.com/chain.pem


ProxyPreserveHost On
ProxyRequests off
ProxyPass / http://127.0.0.1:8181/ Keepalive=On timeout=1600
ProxyPassReverse / http://127.0.0.1:8181/

	LogLevel info

	CustomLog ${APACHE_LOG_DIR}/turtl.log combined

</VirtualHost>

turtl-docker's People

Contributors

dengarcia avatar fredleger avatar jamietanna avatar tyrelsouza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

turtl-docker's Issues

trurtl -run command instaling on ubuntu server-

I have a server running Ubuntu - 17.10. I am trying to install webofmars/turtl-docker. I was able to pull the install. But when I try to run with the command that I have [sudo docker build -t turtl_docker .] I get a error: sudo docker build -t turtl_docker .
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/eredwood/Dockerfile: no such file or directory
selection_012
turtldocker

no connection to server

Hi,

tried to connect from my ubuntu 18.04 host to your docker container, but it isn't working. It is my first time using docker, hope its not something stupid. Tried following links in the desktop turtl application or in the browser to see same as on https://api.turl.it/v2/ or on https://api.framanotes.org/ but nothing shows up except of "couldn't connect to server".
http://0.0.0.0:8181/
http://0.0.0.0/
http://turtl.local:8181/
http://turtl.local/
http://172.17.0.2:8181/
http://172.17.0.2/

$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9041ea8902ab turtl_docker "/bin/sh -c /opt/tur…" About an hour ago Up About an hour 0.0.0.0:8181->8181/tcp hardcore_mclean

$ nmap -Pn 0.0.0.0
Starting Nmap 7.60 ( https://nmap.org ) at 2018-08-17 21:05 CEST
PORT STATE SERVICE REASON VERSION
139/tcp open netbios-ssn syn-ack Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp open netbios-ssn syn-ack Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
631/tcp open ipp syn-ack CUPS 2.2
8181/tcp open tcpwrapped syn-ack

$ sudo docker exec -i -t 9041ea8902ab /bin/bash
root@754d59014d74:/opt/api# ifconfig
eth0 Link encap:Ethernet HWaddr 02:42:ac:11:00:02
inet addr:172.17.0.2 Bcast:172.17.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18279 errors:0 dropped:0 overruns:0 frame:0
TX packets:9460 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:27177605 (27.1 MB) TX bytes:631788 (631.7 KB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

root@754d59014d74:/opt/api# nano /opt/turtl-setup
#!/bin/bash
default values
PIDFILE=${PIDFILE:-nil}
BINDADDR=${BINDADDR:-0.0.0.0}
BINDPORT=${BINDPORT:-8181}
PROD_ERR_HANDLING=${PROD_ERR_HANDLING:-t}
FQDN=${FQDN:-turtl.local}
SITE_URL=${SITE_URL:-http://turtl.local}
ADMIN_EMAIL=${ADMIN_EMAIL:[email protected]}
EMAIL_FROM=${EMAIL_FROM:[email protected]}
SMTP_USER=${SMTP_USER:-}
SMTP_PASS=${SMTP_PASS:-}
DISPLAY_ERRORS=${DISPLAY_ERRORS:-t}
DEFAULT_STORAGE_LIMIT=${DEFAULT_STORAGE_LIMIT:-100}
STORAGE_INVITE_CREDIT=${STORAGE_INVITE_CREDIT:-25}
LOCAL_UPLOAD_URL=${LOCAL_UPLOAD_URL:-http://turtl.local}
LOCAL_UPLOAD_PATH=${LOCAL_UPLOAD_PATH:-"/opt/api/uploads"}
AWS_S3_TOKEN=${AWS_S3_TOKEN:-(:token ''

Thought it is a basic connect from host to "server within docker" question, but haven't found anything helpful online.

Thank you very much!

"Authentication failed."

Hi,

I built the image on a Fedora 24 machine and when I start a container, trying to connect to localhost:8181 gives me "authentication failed".

Here's the log, below.

% docker logs big_goldstine
rethinkdb: instance1: The instance is not running (there is no pid file)
rethinkdb: instance1: Starting instance. (logging to `/var/lib/rethinkdb/instance1/data/log_file')
To load "turtl":
  Load 1 ASDF system:
    turtl
; Loading "turtl"
..................................................
[package cl-hash-util]............................
[package cl-rethinkdb-util].......................
[package cl-rethinkdb-reql].......................
[package cl-rethinkdb]............................
..................................................
[package turtl]...................................
..................................................
..................................................
..................................................
..................................................
..................................................
..................................................
..................................................
..................................................
..................................................
..................................................
.........
..................................................
[package turtl-thread]
  <INFO> [1481897087] turtl - Applying DB schema...
  <INFO> [1481897087] turtl - Schema applied: (:TABLES-ADD NIL :INDEXES NIL)
<NOTICE> [1481897087] wookie - (start) Starting Wookie  0.0.0.0:8181
  <INFO> [1481897087] wookie - "GET /" 401 24
 <ERROR> [1481897087] wookie - (hook) Error running hooks: PRE-ROUTE: (socket #<TCP-SOCKET #x302003072E8D>): Authentication failed.
  <INFO> [1481897087] wookie - "GET NIL" 500 66
 <DEBUG> [1481897087] turtl - turtl error: #<SOCKET-EOF #<TCP-SOCKET #x302003072E8D>: 0: NIL #x30200308CADD>
  <INFO> [1481897088] wookie - "GET /favicon.ico" 401 24
 <ERROR> [1481897088] wookie - (hook) Error running hooks: PRE-ROUTE: (socket #<TCP-SOCKET #x30200308BBCD>): Authentication failed.

"Autentication Failed"

Hello,

I followed this steps but only get a blank page with only ""Authentication failed." text on it.

sudo docker build -t turtl_docker . sudo docker run -d -p 8181:8181 -v $(pwd)/volume:/var/lib/rethinkdb/instance1 -t turtl_docker
I am missing something obvious? its installed on ubuntu 14.04

Thanks!
Rodo

How to disable registration?

Hi,

The container works well but by default anyone can register an account. Is it possible to disable this feature somehow? Thanks

Cannot Start

Hi there,

Got an issue trying to start a fresh docker image. The following comes up when attached to the console:

:: -> [steve@marslip] ~/docker/turtl-docker [git:master]
$ docker start turtl; docker attach turtl
turtl
To load turtl:
  Load 1 ASDF system:
    turtl
; Loading turtl
..................................................
.................................................
; Fetching #<URL http://beta.quicklisp.org/archive/yason/2016-02-08/yason-v0.7.6.tgz\>
; 25.96KB
....
..................................................
[package turtl-thread]
  <INFO> [1467335180] turtl - Applying DB schema...
  <INFO> [1467335187] turtl - Schema applied: (:TABLES-ADD (users boards notes personas boards_personas_link invites keychain sync log promo) :INDEXES (:PROMO (:ADD (:CODE)) :LOG (:ADD (:HASH)) :SYNC (:ADD (:REL :USER_SEARCH :SCAN_USER)) :KEYCHAIN (:ADD
 (:ITEM_ID :USER_ID)) :INVITES (:ADD (:FROM :TO :OBJ_TO)) :BOARDS_PERSONAS_LINK (:ADD (:FROM :TO :BOARD_ID)) :PERSONAS (:ADD (:USER_ID :EMAIL)) :NOTES (:ADD (:USER_ID :BOARDS :BOARD_ID)) :BOARDS (:ADD (:PARENT_ID :USER_ID :ID)) :USERS (:ADD (:INVITE_CODE :A))))
<NOTICE> [1467335187] wookie - (start) Starting Wookie  0.0.0.0:NIL
 <ERROR> [1467335187] turtl - Error initializing: The value NIL is not of the expected type (SIGNED-BYTE 32).
; Warning: an uv handle without corresponding object detected (:TCP)
; While executing: #<STANDARD-METHOD CL-ASYNC::HANDLE-CLEANUP ((EQL :ASYNC-SOCKET) T)>, in process listener(1).
Welcome to Clozure Common Lisp Version 1.11-r16635  (LinuxX8664)!

CCL is developed and maintained by Clozure Associates. For more information
about CCL visit http://ccl.clozure.com.  To enquire about Clozure's Common Lisp
consulting services e-mail [email protected] or visit http://www.clozure.com.

? ^C

If I were to guess, I'd say that it's related to:
[1467335187] wookie - (start) Starting Wookie 0.0.0.0:NIL
[1467335187] turtl - Error initializing: The value NIL is not of the expected type (SIGNED-BYTE 32).

However, I cannot find a config file for this. Any idea where this would reside?

Authentication Failing After Upgrade

Hello. I upgraded my Turtl client to version 0.70 and updated my docker instance at the same time. I am no longer able to login to my server as I keep getting the following message:

Login failed -- Error: Authentication failed.

In addition, if I try to create a new account I get the following message:

There was a problem saving that account. /users timed out.

Looking at my logs, I have the following:

<DEBUG> [1542023788] turtl - turtl error: #<SOCKET-EOF #<TCP-SOCKET #x30200397AB1D>: 0: NIL #x3020039ABB8D>
  <INFO> [1542023936] wookie - "POST /auth" 401 24
 <ERROR> [1542023936] wookie - (hook) Error running hooks: PRE-ROUTE: (socket #<TCP-SOCKET #x3020039C418D>): Authentication failed.
  <INFO> [1542023947] wookie - "POST /auth" 401 24
 <ERROR> [1542023947] wookie - (hook) Error running hooks: PRE-ROUTE: (socket #<TCP-SOCKET #x302003A397AD>): Authentication failed.
  <INFO> [1542023959] wookie - "POST /auth" 401 24
 <ERROR> [1542023959] wookie - (hook) Error running hooks: PRE-ROUTE: (socket #<TCP-SOCKET #x302003A4192D>): Authentication failed.
 <ERROR> [1542024002] turtl - check-auth: Query runtime error (NIL): Keys cannot be NULL.
---
#<REQL-CMD LIMIT/71 (#<REQL-CMD GET-ALL/78 (#<REQL-CMD TABLE/15 ("users")  #x302003ADB4CD> :NULL)  #x302003ADAB1D> 1)  #x302003ADA23D>
 <DEBUG> [1542024032] turtl - turtl error: #<SOCKET-EOF #<TCP-SOCKET #x302003A89E5D>: 0: NIL #x302003AFB18D>

Any ideas on what the issue could be here? Thanks for your help!

Doesn't start on OSX

Hi, I'm using docker on OSX and I can't get the container to start.

I run docker build -t turtl_docker . successfully, output is Successfully built <id>.
Then docker run -d -p 8181:8181 -v $(pwd)/volume:/var/lib/rethinkdb/instance1 -t turtl_docker returns the image ID, but I don't think it actually runs the container.

I can't get the logs with docker logs turtl_docker, as it just returns:
Error: No such container: turtl_docker

docker ps gives me an empty list.
docker images shows the image has been built though.

So I'm a bit confused and don't know how to debug this.
Note also, that I don't need sudo on docker for OSX, so the commands are all executed without sudo.

Any suggestions?

Thanks!

Container built on Windows fails because or crlf issues

Hello,

I had an issue while buliding the docker container and running it on Windows. because by default the text files checkout on Windows had CRLF lines ending. After we copy those files in the container they cannot be executed.

I see two solutions, either configure the repo to never checkout those files with CRLF, or by adding dos2unix to the container and fixing the crlf after the copy.

I have a preference with the second one because it will always work, and it will not depend on how the repo or the local git is configured.

Here is my Dockerfile, if you want to reuse it or suggest improvements.

`FROM ubuntu:16.04

ENV CCL_VERSION 1.11
ENV DEBIAN_FRONTEND noninteractive

ADD https://download.rethinkdb.com/apt/pubkey.gpg /tmp/rethinkdb-pubkey.gpg

RUN echo "deb http://download.rethinkdb.com/apt xenial main" | tee /etc/apt/sources.list.d/rethinkdb.list &&
apt-key add - < /tmp/rethinkdb-pubkey.gpg &&
apt-get update &&
apt-get upgrade -y &&
apt-get install -y wget libterm-readline-perl-perl gcc libuv1-dev git
rethinkdb dos2unix &&
apt-get clean && rm -rf /var/lib/apt/lists/*

Install ccl

RUN wget -P /opt/ ftp://ftp.clozure.com/pub/release/${CCL_VERSION}/ccl-${CCL_VERSION}-linuxx86.tar.gz &&
mkdir -p /opt/ccl &&
tar xvzf /opt/ccl-${CCL_VERSION}-linuxx86.tar.gz -C /opt/ccl --strip-components=1

install quicklisp

COPY quicklisp_install /quicklisp_install
RUN wget https://beta.quicklisp.org/quicklisp.lisp
RUN cat /quicklisp_install | /opt/ccl/lx86cl64 --load /quicklisp.lisp

install turtl API

RUN cd /opt/ &&
git clone https://github.com/turtl/api.git --depth 1
RUN cd /root/quicklisp/local-projects &&
git clone git://github.com/orthecreedence/cl-hash-util
RUN /opt/ccl/lx86cl64 -l /root/quicklisp/setup.lisp

config

COPY config.footer /opt/api/config/
COPY turtl-setup /opt/
COPY turtl-start /opt/
COPY launch.lisp /opt/api/
COPY rethinkdb.conf /etc/rethinkdb/instances.d/instance1.conf

RUN chmod a+x
/opt/turtl-setup
/opt/turtl-start

RUN dos2unix
/opt/turtl-setup
/opt/turtl-start
/opt/api/config/config.footer
/opt/api/launch.lisp
/etc/rethinkdb/instances.d/instance1.conf

general settings

EXPOSE 8181
WORKDIR /opt/api
VOLUME /var/lib/rethinkdb/instance1
CMD /opt/turtl-setup
#CMD /bin/bash
`

Failed to create endpoint <>

When trying to run the freshly installed container, I get this response when executing sudo docker run -d -p 8181:8181 -v $(pwd)/volume:/var/lib/rethinkdb/instance1 -t turtl_docker :

7579ea6e73f8824fff703d09059eff72d95a87fb8ebfba3d190d470824ab7863
docker: Error response from daemon: failed to create endpoint furious_jones on network bridge: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t nat -A DOCKER -p tcp -d 0/0 --dport 8181 -j DNAT --to-destination 172.17.0.2:8181 ! -i docker0' failed:.

Docker version : 1.10.3
Commit 6a0ed0c

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.