-
Notifications
You must be signed in to change notification settings - Fork 12
SFU CS Server Install
These directions will guide you through setting up Grav Skeleton Open Matter Course Hub on /cs/websites/opencoursehub.cs.sfu.ca/
Grav Open Course Hub Skeleton created by Paul Hibbitts, directions written by Brian Fraser.
Please remember that since no student data is stored on the Grav Open Course Hub itself, it can be installed on any Webserver running at least PHP 7.3.6.
Connect to SFU CS's linux server:
$ ssh [email protected]
Create a folder for yourself
$ cd /cs/websites/opencoursehub.cs.sfu.ca/
$ mkdir yourSfuId
(change yourSfuId to your actual SFU ID)
$ cd yourSfuId
Find your preferred Grav Open Matter Course Hub template option from Grav Open Course Hub releases. For more information, see the Grav Open Course Hub documentation.
For a simple single course install, the grav-skeleton-open-matter-course-hub-site.zip
is suggested, while for either multiple terms and/or courses the grav-skeleton-open-matter-multicourse-hub-site.zip
is suggested. Brian's choice (2020) is grav-skeleton-open-matter-multicourse-hub-site.zip
Verify you are in the desired folder (i.e. /cs/websites/opencoursehub.cs.sfu.ca/yourSfuId
) and then download the Grav skeleton of your choice. For example, it might look like:
$ wget https://github.com/hibbitts-design/grav-skeleton-course-hub/releases/latest/download/grav-skeleton-open-matter-course-hub-site.zip
for a single course site or
$ wget https://github.com/hibbitts-design/grav-skeleton-course-hub/releases/latest/download/grav-skeleton-open-matter-multicourse-hub-site.zip
for a multicourse site
Extract Paul template's ZIP (may need to use sudo for each command if doing this on a home machine). Change grav
to another name if you prefer.
$ unzip grav-skeleton-open-matter-multicourse-hub-site.zip
$ mv grav-skeleton-open-matter-multicourse-hub-site grav
$ chmod -R 777 grav
View your website
https://opencoursehub.cs.sfu.ca/yourSfuId/grav/
(change yourSfuId to your actual SFU ID)
If you are getting a blank page then double check the chmod
command
To browse to the server, use the URL:
https://opencoursehub.cs.sfu.ca/yourSfuId/grav/
(change yourSfuId to your actual SFU ID)
To access the admin panel, use the URL:
https://opencoursehub.cs.sfu.ca/yourSfuId/grav/admin/
(change yourSfuId to your actual SFU ID)
The content of your website can be pulled automatically from a GitLab repo.
- Create GitLab repo with an initial commit (for example, chose the
Initialize repository with a README
option when creating repo) - Access the admin panel, use the URL:
https://opencoursehub.cs.sfu.ca/yourSfuId/grav/admin/
(change yourSfuId to your actual SFU ID) - Set a new user name and password for yourself. Don't use your SFU password.
- In the Grav admin panel, browse to Plugins --> Git Sync
- Configure with:
- Hosting Service: Other
- Git User: yourSfuId (change yourSfuId to your actual SFU ID)
- Git Password or Token:
- Go to your GitLab repository
- Go to Settings --> Access Tokens
- Name it, such as "Grav Website Access Token"
- Check the scopes "API" button
- Create the project access token and copy to Grav
Git Password or Token
field
- Git Repository:
- Go to your GitLab repository
- On repo home page, click Clone and then copy the HTTPS address shown (for example, https://csil-git1.cs.surrey.sfu.ca/bfraser/grav-course-websites.git)
- Paste this URL into the Git Sync plugin field "Git Repository (HTTPS only)"
- In GitLab, setup a webhook to notify Grav on repo changes
- Setup in GitLab at
https://csil-git1.cs.surrey.sfu.ca/yourUserId/yourRepo/settings/hooks
(change yourSfuId to your actual SFU ID) - Integration URL:
https://opencoursehub.cs.sfu.ca/yourUserId/grav/_git-sync-xxxxxxxxxxxxxxxxxxxx
(copy the actual URL from the Grav Git Sync Plugin page) - Secret Token: copy "Web Hook Secret" from grav git plugin page
- Trigger: Select "Push Events" and "Enable SSL verification"
- Setup in GitLab at
- In Grav Admin's Git Plugin page, setup folders to Sync: just
Pages
is recommended to begin with.
If you want to use SFU's authentication to lock access to some course solutions (via .htaccess files), you can
create a sym-link to a folder which will be served by Apache instead of Grav. Grav is unable to connect to
SFU's authentication; however, we can link a solutions/
folder in with our Grav setup (change yourSfuId):
$ ssh linux.cs.sfu.ca
$ cd /cs/websites/opencoursehub.cs.sfu.ca/yourSfuId
$ mkdir grav/user/solutions
$ touch grav/user/solutions/placeholder.txt
$ chmod -R 777 grav/user/solutions/
$ ln -s grav/user/solutions solutions
Now, from your website, you can use an HTML link to link to the solutions page. Note that
standard markdown links won't work, so you'll need something like:
<a href="../../solutions/placeholder.txt">Solutions folder</a>
If you are hosting multiple courses, I suggest creating folders for each class in the solutions/
folder, such as for CMPT 101:
$ mkdir grav/user/solutions/101
To lock a folder to only registered users in the course, place the following in a .htaccess
file in that folder, such as in grav/user/solutions/101/.htaccess
AuthType CAS
# Allow view folder listing
Options +Indexes
<Files *>
#---- this line allows students/TAs
# COMMENT OUT when maillists flip to next semester
require cas-attribute member:cmpt-433
require cas-attribute member:cmpt-433-help
require user yourSfuId # Change yourSfuId to your actual SFU ID
require local # Access to home repo (local user)
require cas-attribute member:cmpt-cas-operator # CSIL Admin
</Files>
```e to the grav-skeleton-course-hub wiki!