TWiki
>
ISG Web
>
F24WebServerUpgradeNotes
(2024-08-15,
YiLee
)
(raw view)
E
dit
A
ttach
---+ Notes on upgrading scripts for new student.cs.uwaterloo.ca web server To test your website, go to: https://wwwtest.student.cs.uwaterloo.ca/~cs135/ (replace with your course) Be careful that some links may remove the wwwtest, depending on how your web site is set up. Static files (HTML, CSS, JavaScript, PDFs, images) should all work without change. ---++ Scripts used by multiple courses ---+++ displayMarks (Python 2 to 3 upgrade example) On linux.student.cs.uwaterloo.ca, the command <tt>2to3-2.7</tt> can help convert Python 2 code file to Python 3, for example: * <tt>2to3-2.7 displayMarks.py</tt> will display changes to upgrade to Python 3 (but not make them) * <tt>2to3-2.7 --write displayMarks.py</tt> will update the file, and create a backup (.bak file) Other changes: * First line, change <tt>#!/usr/bin/env python</tt> to <tt>#!/usr/bin/env python3</tt> * Delete <tt>FORMAT_USER_PATH</tt> variable and <tt>normalize</tt> function; they're not need. Just use normalize_quick. * You may have to fix space/indenting errors. * Replace file(...) calls with modern Python 3 file opening syntax: <verbatim> with open(MARK_FILE, "r") as fObj: # ... use fObj here ... </verbatim> * ldapsearch and subprocess.Popen calls can be updated: <verbatim> # Replace this: data = subprocess.Popen(['ldapsearch', '-LLLx', '-h', 'uwldap.uwaterloo.ca', '-b', 'dc=uwaterloo,dc=ca', 'uid=' + userId, 'cn'], stdout=subprocess.PIPE ).stdout.readlines() # With this: data = subprocess.run(['ldapsearch', '-LLLx', '-H', 'ldap://uwldap.uwaterloo.ca', '-b', 'dc=uwaterloo,dc=ca', 'uid=' + userId, 'cn'], stdout=subprocess.PIPE ).stdout.decode().splitlines() </verbatim> <verbatim> # Replace this: ROOT_USERS = [user.strip("\n") for user in subprocess.Popen([CL_INFO_PATH, '-r', 'type', '(instructor|isc|tutor)', 'userid'], stdout=subprocess.PIPE).stdout.readlines()] # With this: ROOT_USERS = [user.strip("\n") for user in subprocess.run([CL_INFO_PATH, '-r', 'type', '(instructor|isc|tutor)', 'userid'], stdout=subprocess.PIPE).stdout.decode().splitlines()] </verbatim> <verbatim> # Replace this: ISCid = subprocess.Popen([CL_INFO_PATH, 'type', 'isc', 'userid'],stdout=subprocess.PIPE).stdout.readlines()[0].strip("\n") # With this: ISCid = subprocess.run([CL_INFO_PATH, 'type', 'isc', 'userid'],stdout=subprocess.PIPE).stdout.decode().splitlines()[0].strip("\n") </verbatim> ---+++ Watermarking of assignment solutions, lecture notes, etc. (PHP scripts) * Examples: * https://wwwtest.student.cs.uwaterloo.ca/~cs241/cgi-bin/courseNotes.php * https://wwwtest.student.cs.uwaterloo.ca/~cs240/protect/index.php * After Nick updated get_classlist_info, these are mostly working. * The "last updated" timestamps are wrong, because PHP is using UTC timezone instead of Waterloo time. For now, one way to fix it is to create a hidden <tt>.user.ini</tt> file in the same folder as your index page (ex. ~/public_html/protect/ for cs240 example above) containing one line: <verbatim> date.timezone='America/Toronto' </verbatim> ---+++ IA/ISA/TA evaluation forms * Examples: * https://wwwtest.student.cs.uwaterloo.ca/~cs251/S24/IA_evaluations/index.html * https://wwwtest.student.cs.uwaterloo.ca/~cs246/S24/IA_evaluations/index.html * The action.php script seems to work on new web server. ---++ Course specific stuff ---+++ CS135 Nick has asked Byron to test things out on new web server. ---+++ CS136(L) What scripts in <tt>public_html/cgi-bin</tt> are in use? ---+++ CS240 https://wwwtest.student.cs.uwaterloo.ca/~cs240/s24/ does not show properly because the deprecated <tt>each(...)</tt> PHP function is used in <tt>public_html/s24/shared.php</tt> Info that might help: https://stackoverflow.com/questions/46492621/how-can-i-update-code-that-uses-the-deprecated-each-function ---+++ CS241 * Midterm Remark Request Form: https://student.cs.uwaterloo.ca/~cs241/cgi-bin/midterm_remarking/request.cgi * request.cgi needs to be updated to Python 3 * process.cgi is already in Python3 * MIPS web tools seem to be static HTML/CSS/JavaScript files. No work needed, but please test. * Extensions/Absences request: * https://wwwtest.student.cs.uwaterloo.ca/~cs241/cgi-bin/extension/request.cgi * https://wwwtest.student.cs.uwaterloo.ca/~cs241/cgi-bin/extension/absence.cgi * Needs to be updated to Python 3 ---+++ CS343 The public_html/cgi-bin/requestCompile.cgi and requestNumLates.cgi are in Perl and seem to work still. requestSubmitStatus.cgi uses <tt>submit</tt> command which won't be available on the web servers. Options: 1. Display the file ~/handin/1/.subfiles. 1. Use the commented out "ssh linux.student.cs..." line of code ---+++ SE212 Nick will email Nancy about George (https://student.cs.uwaterloo.ca/~se212/george/ask-george/).
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r2 - 2024-08-15
-
YiLee
ISG
ISG Web
ISG Web Home
Changes
Index
Search
Webs
AIMAS
CERAS
CF
CrySP
External
Faqtest
HCI
Himrod
ISG
Main
Multicore
Sandbox
TWiki
TestNewSandbox
TestWebS
UW
My links
People
CERAS
WatForm
Tetherless lab
Ubuntu Main.HowTo
eDocs
RGG NE notes
RGG
CS infrastructure
Grad images
Edit
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback