Coder Social home page Coder Social logo

canvas-docker's Issues

Automatic user registration emails don't work.

Hi there!
I've pulled and run the latest version of canvas-docker from the docker hub, and I noticed that automatic emails don't get sent. This poses a problem when I try to create a new user, as I can't initiate a user with a password (they must confirm their email address by clicking on the link in the email they never received).

The stacktrace I found in the logs is:

Exception: SocketError: getaddrinfo: Name or service not known
...
/usr/lib/ruby/2.1.0/net/smtp.rb:520:in `start'
/opt/canvas-lms/vendor/bundle/ruby/2.1.0/gems/mail-2.5.4/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
/opt/canvas-lms/vendor/bundle/ruby/2.1.0/gems/mail-2.5.4/lib/mail/message.rb:2129:in `do_delivery'
/opt/canvas-lms/vendor/bundle/ruby/2.1.0/gems/mail-2.5.4/lib/mail/message.rb:232:in `block in deliver'
...
script/delayed_job:10:in `<main>'

It looks like the stacktrace is pointing to: https://github.com/instructure/canvas-lms/blob/stable/app/models/message.rb#L690

It looks like canvas uses this ruby gem to send emails: https://github.com/mikel/mail and according to the docs, it defaults to a local smtp server.

I'm not sure if canvas makes this configurable or not (could be verified by someone at instructure), but this could probably be resolved by adding http://www.postfix.org/ to the docker container setup process.

Dockerfile pulls directly from canvas-lms's git master

This makes repeatable builds impossible (the build is broken right now, for example).

Here's a patch which pins the Canvas version (albeit to an older one) and seems to build:

diff --git a/Dockerfile b/Dockerfile
index bdf0776..e27e278 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -10,17 +10,12 @@ RUN apt-get update \
     && apt-get -y install curl software-properties-common \
     && add-apt-repository -y ppa:brightbox/ruby-ng \
     && apt-get update \
-    && apt-get install -y ruby2.1 ruby2.1-dev supervisor redis-server \
+    && apt-get install -y ruby2.3 ruby2.3-dev supervisor redis-server \
         zlib1g-dev libxml2-dev libxslt1-dev libsqlite3-dev postgresql \
         postgresql-contrib libpq-dev libxmlsec1-dev curl make g++ git \
     && apt-get clean \
     && rm -Rf /var/cache/apt
 
-RUN curl -sL https://deb.nodesource.com/setup_6.x | bash \
-    && apt-get install -y nodejs \
-    && apt-get clean \
-    && rm -Rf /var/cache/apt
-
 # Set the locale to avoid active_model_serializers bundler install failure
 RUN locale-gen en_US.UTF-8
 ENV LANG en_US.UTF-8
@@ -32,8 +27,6 @@ RUN groupadd -r canvasuser -g 433 && \
     adduser canvasuser sudo && \
     echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
 
-RUN gem install bundler --version 1.12.5
-
 COPY assets/dbinit.sh /opt/canvas/dbinit.sh
 COPY assets/start.sh /opt/canvas/start.sh
 RUN chmod 755 /opt/canvas/*.sh
@@ -43,7 +36,12 @@ COPY assets/pg_hba.conf /etc/postgresql/9.3/main/pg_hba.conf
 RUN sed -i "/^#listen_addresses/i listen_addresses='*'" /etc/postgresql/9.3/main/postgresql.conf
 
 RUN cd /opt/canvas \
-    && git clone https://github.com/instructure/canvas-lms.git
+    && curl -L https://github.com/instructure/canvas-lms/archive/release/2017-01-28.18.tar.gz -o canvas.tar.gz
+
+RUN cd /opt/canvas \
+    && tar -zxf canvas.tar.gz \
+    && rm canvas.tar.gz \
+    && mv canvas-lms-release-2017-01-28.18 canvas-lms
 
 WORKDIR /opt/canvas/canvas-lms
 
@@ -57,11 +55,19 @@ RUN for config in amazon_s3 delayed_jobs domain file_store security external_mig
        ; do cp config/$config.yml.example config/$config.yml \
        ; done
 
+RUN gem install bundler --version 1.12.5
 RUN $GEM_HOME/bin/bundle install --without="mysql"
 
-RUN npm install --unsafe-perm \
-    && $GEM_HOME/bin/bundle exec rake canvas:compile_assets \
-    && sudo npm install --unsafe-perm -g [email protected]
+RUN curl -sL https://deb.nodesource.com/setup_4.x | bash \
+    && apt-get install -y nodejs \
+    && apt-get clean \
+    && rm -Rf /var/cache/apt
+
+RUN npm install --unsafe-perm
+
+RUN $GEM_HOME/bin/bundle exec rake canvas:compile_assets_dev
+
+RUN sudo npm install --unsafe-perm -g [email protected]
 
 RUN mkdir -p log tmp/pids public/assets public/stylesheets/compiled \
     && touch Gemmfile.lock

Can't get this to run

Seems like there is a very verbose Gems error that is preventing the database from starting? A line:

PG::ConnectionBad: FATAL: the database system is starting up

install error, asking for "workspaces-experimental true" in .yarnrc

I'm running docker build -t canvas-docker . per the first step in the README.

i'm getting:

error The workspace feature is currently experimental and needs to be manually enabled - please add "workspaces-experimental true" to your .yarnrc file.

I'll include a bit more context:

Step 31/40 : RUN yarn install --pure-lockfile
 ---> Running in a8e8ece83d62
yarn install v0.27.5
error The workspace feature is currently experimental and needs to be manually enabled - please add "workspaces-experimental true" to your .yarnrc file.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The command '/bin/sh -c yarn install --pure-lockfile' returned a non-zero code: 1

Here's the full output of the command:
https://pastebin.com/raw/eVNxu9cC

I know that the yarn being used here is inside Docker, because I don't even have yarn on my local machine.

I added RUN yarn config set workspaces-experimental true to the Dockerfile, and that got me past this error -- YAY!

I'll send a pull request; you all can accept if you determine the experimental config to not pose any security risk or whatever. Thanks! (my first PR!)

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.