Canvas网络教学平台安装RCE富文本编辑插件(Rich Content Editor)

Rich Content Editor

Canvas includes a new rich content editor component to support a consistent editor experience across multiple applications in the Canvas ecosystem. To make use of this component you need to run a supporting API server. See the Canvas RCE API Documentation for information on running the service and configuring Canvas to make use of it. Starting July 14, 2018, the stable branch of canvas-lms will require this service to be running and configured for full rich content editing functionality.

目前最新版的Canvas LMS已经要求必须装RCE增强工具了,但是官网的文档,渣渣都不如。。。

设置里说明:

富内容编辑器侧栏增强 hidden 启用功能:富内容编辑器侧栏增强
在任何地方使用新的带有增强侧栏的富内容编辑器

原始效果图:
在这里插入图片描述
安装RCE插件后:
在这里插入图片描述
不开启增强工具是这样,开启之后看最后一个图,样式还是很大差距的。

安装:

网址:https://github.com/instructure/canvas-rce-api

0. 克隆代码

cd /var
git clone https://github.com/instructure/canvas-rce-api.git

1. 安装依赖

cd canvas-rce-api
npm install --production

如果提示无权限Permission denied,加了sudo也没用的话,执行下一句安装

npm install --unsafe-perm=true --allow-root

2. 添加配置文件

复制配置文件:cp .env.example .env
修改配置文件:vi .env

PORT=3000
NODE_ENV=production
STATSD_HOST=127.0.0.1
STATSD_PORT=8125
ECOSYSTEM_SECRET="astringthatisactually32byteslong"
ECOSYSTEM_KEY="astringthatisactually32byteslong"
#CIPHER_PASSWORD=TEMP_PASSWORD

其中,port代表api服务使用的端口,访问即为localhost:port。
ECOSYSTEM_SECRET和ECOSYSTEM_KEY即为Canvas配置文件中dynamic_settings.yml配置的。
需配置dynamic_settings.ymlrich-content-service下的app-host。(貌似需要用域名,因为是前端访问的,不是主机访问,故不能使用localhost或内网ip地址)

production:
  config:
    canvas:
      canvas:
        encryption-secret: "astringthatisactually32byteslong"
        signing-secret: "astringthatisactually32byteslong"
      rich-content-service:
        app-host: "https://你的域名/rce"

参数数明:

Configuration options are set via the following environment variables:

ECOSYSTEM_KEY: Required The encryption secret shared with Canvas.
ECOSYSTEM_SECRET: Required The signing secret shared with Canvas.
FLICKR_API_KEY: Required to support Flickr image search.
YOUTUBE_API_KEY: Required for querying titles of YouTube embeds.
NODE_ENV: This should always be set to production when running in production.
PORT: Defaults to port 3000. This is not used when running with Docker since Node Passenger monkey patches node http to control the port each node process is listening on.
STATSD_HOST: If you would like to collect metrics with statsd, this should be set to the host of your statsd server.
STATSD_PORT: If you would like to collect metrics with statsd, this should be set to the port of your statsd server.

3. 启动

cd canvas-rce-api
npm run start:dev

4. 修改APache配置文件

/etc/apache2/sites-available/canvas.conf中80和443节点,末尾添加转发。

ProxyPass /rce/ http://127.0.0.1:3000/

就是可以通过https://域名/rce访问到这个插件。
然后执行这几个命令。(不知道什么用,但貌似很重要)

sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_balancer
sudo a2enmod lbmethod_byrequests
sudo service apache2 restart

/etc/apache2/apache2.conf末尾增加ServerName localhost

5. Canvas后台开启

设置,功能选项,富内容编辑器侧栏增强,打开
在这里插入图片描述

6. 开机自启动

  1. 安装 PM2 随机启动 sudo npm i -g pm2
  2. 启动项目 pm2 start /rce目录/app.js
  3. 保存当前进程状态 pm2 save
  4. 生成开机自启动服务 pm2 startup
  5. 开机服务 systemctl enable pm2-root
  6. 重启测试 sudo reboot

此部分参考:https://www.tonylabs.com/support/canvas-lms/install-rich-content-editor-rce-for-canvas

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值