Skip to content

Commit

Permalink
- Add canvas db server parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
frankyrumple committed Jan 2, 2019
1 parent a9c96e3 commit 0644ad6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions web2py/applications/smc/controllers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def config_canvas_settings():
rows = db().select(db.my_app_settings.ALL)
form = SQLFORM(db.my_app_settings, rows[0], showid=False, _name="canvas_config",
fields=["canvas_import_enabled", "canvas_access_token", "canvas_secret",
"canvas_database_server_url",
"canvas_database_password", "canvas_server_url",
"canvas_student_quota", "canvas_faculty_quota",
"canvas_auto_create_courses"]).process(formname="canvas_config")
Expand Down
1 change: 1 addition & 0 deletions web2py/applications/smc/models/x_app_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
Field("canvas_access_token", 'string', default=""),
Field("canvas_secret", 'string', default="<ENV>"),
Field("canvas_database_password", 'password', default='<ENV>'),
Field("canvas_database_server_url", default='postgresql'),
Field("canvas_server_url", default="https://canvas.ed"),
Field("canvas_student_quota", "bigint", default="1048576",
requires=IS_IN_DB(db, db.quota_sizes.int_size, '%(display_size)s',
Expand Down
2 changes: 1 addition & 1 deletion web2py/applications/smc/modules/ednet/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def ConnectDB():
# Grab the environ pw firs, if that isn't set, then grab the admin pw
canvas_db_pw = AppSettings.GetValue('canvas_database_password', "<ENV>")
# canvas.ed, postgresql will also work in docker
pg_hostname = AppSettings.GetValue('canvas_server_url', 'https://canvas.ed')
pg_hostname = AppSettings.GetValue('canvas_database_server_url', 'postgresql')
try:
if canvas_db_pw == "" or canvas_db_pw == "<ENV>":
canvas_db_pw = str(os.environ["IT_PW"]) + ""
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{extend 'layout.html'}}<div> <a style="font-size: 10px;" href="{{=URL('admin','config')}}">&lt;-- Back</a></div><h1>Change Canvas Settings</h1><div> <div style="float: left; width: 600px; overflow: initial;"> {{=msg}} {{=auto_config_form}} {{=form}} </div> <div class="well" style="float: left; width: 400px; "> <h3> Help </h3> <p> Allow connecting to Canvas server so that students and faculty can be imported. </p> <div> <b>OPE Auto Configuration: </b> If you are running the OPE Docker system, you can use the auto config button to generate a dev key. If this isn't from the OPE project setup auto config will not work. </div> <div> <b>Canvas Import Enabled: </b> Turn Canvas importing on/off </div> <div> <b>Canvas Access Token: </b> The access token (NOT DEV KEY) used to access the canvas server as the admin user. To get a new dev key, login as the admin canvas account, go to Settings, then scroll down to "Approved Integrations". Hit the button "New Access Token" and copy the key and paste it into this box. </div> <div> <b>Canvas Secret: </b> The canvas secret key stored in the config/security.yml file - used to generate new access tokens for users. You can use <b>&lt;ENV&gt;</b> here to automatically pull from the docker environment variables in the OPE project (recommended). </div> <div> <b>Canvas Database Password: </b> The password used to access the canvas database server. Default should be <b>&lt;ENV&gt;</b> which will auto detect in the OPE Docker App system. </div> <div> <b>Canvas Server URL: </b> The website url for canvas. E.g. https://canvas.ed </div> <div> <b>Canvas Quota: </b> How much space should the student have to upload files into canvas? This is for personal files, and does not pertain to the class quota. In a secure environment, it is recommended to turn this down to 0 Meg to prevent users from trying to hide files. </div> <div> <b>Canvas Auto Create Courses: </b> The import tool can create courses and enroll students in them if they don't exist. If you turn this off, students will only be enrolled in specified courses if they already exist and have the SIS ID that matches the course id listed in the spread sheet. </div> </div></div>
{{extend 'layout.html'}}<div> <a style="font-size: 10px;" href="{{=URL('admin','config')}}">&lt;-- Back</a></div><h1>Change Canvas Settings</h1><div> <div style="float: left; width: 600px; overflow: initial;"> {{=msg}} {{=auto_config_form}} {{=form}} </div> <div class="well" style="float: left; width: 400px; "> <h3> Help </h3> <p> Allow connecting to Canvas server so that students and faculty can be imported. </p> <div> <b>OPE Auto Configuration: </b> If you are running the OPE Docker system, you can use the auto config button to generate a dev key. If this isn't from the OPE project setup auto config will not work. </div> <div> <b>Canvas Import Enabled: </b> Turn Canvas importing on/off </div> <div> <b>Canvas Access Token: </b> The access token (NOT DEV KEY) used to access the canvas server as the admin user. To get a new dev key, login as the admin canvas account, go to Settings, then scroll down to "Approved Integrations". Hit the button "New Access Token" and copy the key and paste it into this box. </div> <div> <b>Canvas Secret: </b> The canvas secret key stored in the config/security.yml file - used to generate new access tokens for users. You can use <b>&lt;ENV&gt;</b> here to automatically pull from the docker environment variables in the OPE project (recommended). </div> <div> <b>Canvas Database URL: </b> The hostname used to access the canvas database server. Default <b>postgresql</b>. </div> <div> <b>Canvas Database Password: </b> The password used to access the canvas database server. Default should be <b>&lt;ENV&gt;</b> which will auto detect in the OPE Docker App system. </div> <div> <b>Canvas Server URL: </b> The website url for canvas. E.g. https://canvas.ed </div> <div> <b>Canvas Quota: </b> How much space should the student have to upload files into canvas? This is for personal files, and does not pertain to the class quota. In a secure environment, it is recommended to turn this down to 0 Meg to prevent users from trying to hide files. </div> <div> <b>Canvas Auto Create Courses: </b> The import tool can create courses and enroll students in them if they don't exist. If you turn this off, students will only be enrolled in specified courses if they already exist and have the SIS ID that matches the course id listed in the spread sheet. </div> </div></div>
Expand Down

0 comments on commit 0644ad6

Please sign in to comment.