-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canvas RCE API is not working #6
Comments
Hi @qq7, are you using a self hosted installation of Canvas + RCE API? |
Hi @diegotejadav, I am using self hosted Canvas and RCE API through Apache Passenger. |
@qq7 What URL is calling the |
@qq7 how are you running the RCE service? Also we needed to include manually the changes shown here in this pending pull request #5 |
Hi @diegotejadav
sudo docker run -d --name rce -p 3000:80 -e NODE_ENV=production -e VIRTUAL_HOST=127.0.0.1 -e ECOSYSTEM_KEY=astringthatisactually32byteslong -e ECOSYSTEM_SECRET=astringthatisactually32byteslong -e STATSD_PORT=8125 -e STATSD_HOST=127.0.0.1 instructure/canvas-rce-api
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Request URL:https://<my_canvas_host>/api/session Request URL:https://<my_canvas_host>/api/folders?contextType=course&contextId=1 What am I doing wrong, any suggestion would be appreciated. |
are there any updates on this?? |
Still struggling :) |
Has anybody here managed to get this working? I'm running a standalone Canvas instance as per the 'Production Start' (not Docker container). So far I've got the canvas-rce-api service up and running via node.js and use Apache to proxy requests to it from Canvas. All seems to be set up correctly but I'm getting a 401 Unauthorised error when opening the images/files tabs. If I visit Here are the steps I've taken so far:
|
I've managed to get this working, it turns out my keys were the wrong way around. For anyone who may have the same trouble:
I'm not sure if this was clear in the docs or not, it may have just been me overlooking / reading the docs wrong. If you have a similar setup to me and can't get this working let me know and I'll send you all of my config. |
@mesutaydemir, we're using the our selfhosted standalone Canvas deployment, we're not using Docker, so I haven't much to advice. PORT=3000
NODE_ENV=production
RCE_API_HOST=https://<our_domain>/rce/api
STATSD_HOST=127.0.0.1
HOST=128.0.0.1
STATSD_PORT=8125
STATS_PREFIX=rceapi
ECOSYSTEM_SECRET="<A_SECRET_KEY>"
ECOSYSTEM_KEY="<A_SECRET_KEY>"
FLICKR_API_KEY="<A_SECRET_KEY>" Our Canvas apache conf: <VirtualHost *:80>
ServerName <SERVER_DOMAIN>
ServerAlias <SERVER_DOMAIN>
ServerAdmin <A_COOL_EMAIL>
DocumentRoot /var/canvas/public
ErrorLog /var/log/apache2/canvas_errors.log
LogLevel warn
CustomLog /var/log/apache2/canvas_access.log combined
SetEnv RAILS_ENV production
XSendFile On
XSendFilePath /var/canvas
<Directory /var/canvas/public>
Options All
AllowOverride All
Require all granted
</Directory>
ProxyPass /rce/ http://127.0.0.1:3000/
</VirtualHost>
<VirtualHost *:443>
ServerName <SERVER_DOMAIN>
ServerAlias <SERVER_DOMAIN>
ServerAdmin <A_COOL_EMAIL>
DocumentRoot /var/canvas/public
ErrorLog /var/log/apache2/canvas_errors.log
LogLevel warn
CustomLog /var/log/apache2/canvas_ssl_access.log combined
SSLEngine on
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
# the following ssl certificate files are generated for you from the ssl-cert package.
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
SetEnv RAILS_ENV production
XSendFile On
XSendFilePath /var/canvas
<Directory /var/canvas/public>
Options All
AllowOverride All
Require all granted
</Directory>
ProxyPass /rce/ http://127.0.0.1:3000/
</VirtualHost> And to enable ProxyPass on Apache: sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_balancer
sudo a2enmod lbmethod_byrequests
sudo service apache2 restart |
I agree with @DRiversVoyage . The documentation definitely needs improvement. |
The following is simpler solution for single server installation (without having to patch RCE): Added to Apache2 conf:
/var/canvas/config/dynamic_settings.yml
/var/canvas-rce-api/.env
|
well .. same problem.
when try to do something with RCE 196 TypeError_ Cannot read property 'length' of undefined And in browser: my setup:
/etc/apache2/sites-enabled/canvas.conf
dynamic _settings.yml
/canvas/canvas-rce-api/.env
|
@daeynasvistas i think this is the issue I had, try switching the key and secret values round. I’ll look at your code vs my code tomorrow and see if I can spot anything obvious. |
thanks @DRiversVoyage .. i was able to pass that problem!! I didnt replace development: by production: (sorry about that) the examples above did work has expected Ok now i have https://canvas.domkain.com/rce that kick on but.. another problem with SSSL certificate my new error I have a reverse proxy with my site certificate on it .. i dont have certificate on the actual server, thats probably the problem |
Just for the record .. i was able to bypass the Certificate error with this env setting in /canvas/canvas-rce-api/.env probably not good in production .. i will rebuild server and add certificate. But for testing, all good now |
May I ask how did you solve the rce problem in the end, can you specifically describe your configuration? |
@sjnhnp What's the issue you are having? |
well .. same problem.
when try to do something with RCE |
I solved this in my setup by switching the ECOSYSTEM_SECRET and ECOSYSTEM_KEY values. Have you tried this? It looks like everything else is setup correctly if you are getting 'Hello, from RCE service'. ECOSYSTEM_SECRET = signing-secret |
/canvas/canvas-rce-api/.env what isyour configuration
|
var/canvas-rce-api/.env
/var/canvas/config/dynamic_settings.yml
/etc/apache2/sites-enabled/canvas.conf (added to bottom of file, after last VirtualHost)
|
Is there any modification to the rce file? in #5 and need? sudo a2enmod proxy |
my packageBookmark.js file
Loaded Modules
|
thank you and what is your app/api/folders.js |
display: We're sorry, but something went wrong. We've been notified about this issue and we'll take a look at it shortly. |
I don’t think I changed folders.js but will check for you next time I’m on the server. Did you receive an email with more details about this error? Does anything show up in error_reports? |
I want to ask you a question, I want to change the port 80 to 8080 where apache2 listens, I modified canvas.conf But can't open the webpage |
Why port 8080? In our school port 8080 is where all web traffic is sent to be filtered. We set up custom firewall rules to allow incoming and outgoing traffic to our server IP on ports 80 and 443. All other ports we use for canvas (3000,3001 etc) are proxied so don’t need opening on our firewall. |
yes, but i change listen 80 to listen 8080, i cant open my website |
Could be your firewall is blocking port 8080, are you behind a firewall by any chance? |
ufw disable |
Can you access by going to http://localhost:8080 on the server itself? (Make sure localhost is in the VirtualHost as a ServerAlias) |
This will only disable the firewall on the machine. If you’re on a corporate or school network you’ll most likely have a firewall on the router. Who’s your ISP? |
I can know your email or other communication tools? |
I’ve set up a workspace over on Slack, you can use the link below to join. https://join.slack.com/t/canvasdevelopers/shared_invite/zt-ds5n7px2-4QsENKWbOod8OJv6wCc7KA |
Also getting Since I am running this locally, both my secrets are identical and the default |
That’s the expected result as you are not providing a token. What do you get when opening the rce in Canvas? Feel free join the slack workspace above, trying to build a community of Canvas devs where we can help each other out. |
I had similar problem, i.e. Cannot read property 'length' of undefined" I was using nginx with puma, and puma was running at 3000 port, Later once i install the rce node app under 3001 port and updated the dynamic_settings.yml and rce .env file, it started to show 401 unauth error, I was struggling in this error for 2 entire days, later it got fixed adding secret and encrypted keys to dynamic_settings.yml file Thanks |
Bitnami Canvas LMS > Apache Reverse SSL Proxy > Legacy & Enhanced RCE-API (Port 3001) Found the following combination to work for Let's Encrypt SSL with Public NAT. /opt/bitnami/apps/canvaslms/canvas-rce-api/.env
/opt/bitnami/apps/canvaslms/htdocs/config/dynamic_settings.yml
/opt/bitnami/apache2/conf/bitnami/bitnami-apps-vhosts.conf
|
I applied all of these settings but I keep getting api/session 404 error |
Hi kerimcalik, if you join the slack workspace above we’ll see if we can help :-) |
what is slack address |
https://join.slack.com/t/canvasdevelopers/shared_invite/zt-f2ktnk4w-P30p203kMdmOtIvUJS8yZA |
Sharing here because I found this thread while googling. We have Canvas + RCE running on an Ubuntu instance proxied by nginx running behind a load balancer, with the load balancer handling SSL. This is what is working for us:
Key config that I see most people missing is |
Has anyone achieved anything? I have this problem too. |
I am facing the same problem guys, is there a clear documentation to get the current version of canvas-rce-api to work with canvas? |
@juniorojha @D2Online has outline above the most detailed explanation I have ever seen anywhere. @clapman has almost an identical solution but modified for Vhost because that is what Bitnami uses instead of . (I have never gotten @clapman solution to work, I always encounter a CORs issue) My problem with @clapman solution is there are details missing associated with Bitnami configuration. I am not sure I am the right person to give you all the information you need, but first you need to outline what Ball Park and row you sit in. |
Cheers for the mention @DocStem! @juniorojha join our slack channel #rce-api here https://join.slack.com/t/canvasdevelopers/shared_invite/zt-f2ktnk4w-P30p203kMdmOtIvUJS8yZA you may find some answers in the previous threads, or ask other members for some help. Pretty sure everyone who has joined for assistance getting rce set up now has it working thanks to the members there. |
Since RCE API has proved to be working I am closing this issue in favor of the newer one regarding configuration: #12 |
Thank you very much, I have finally made it works based on your configuration. |
This is the Golden answer |
This was helpful it resolved the RCE issues on my install. Thanks! |
As described in these forum threads:
https://community.bitnami.com/t/rich-content-editor-and-passenger/70780/4
https://community.canvaslms.com/thread/35404-files-tab-inactive-in-rich-content-editor-while-editing-pages
The text was updated successfully, but these errors were encountered: