├── jupyterhub ├── .gitignore ├── cwh-repo2docker │ ├── MANIFEST.in │ ├── README.md │ ├── cwh_repo2docker │ │ ├── templates │ │ │ ├── admin.html │ │ │ └── page.html │ │ ├── custom_templates │ │ │ ├── error.html │ │ │ └── page.html │ │ ├── static │ │ │ ├── css │ │ │ │ └── style.css │ │ │ └── vendor │ │ │ │ ├── xterm-addon-fit.js │ │ │ │ └── xterm.css │ │ ├── images.py │ │ ├── logs.py │ │ ├── base.py │ │ ├── builder.py │ │ └── docker.py │ └── setup.py ├── get_user_id.sh ├── cwh_repo2docker_config.py ├── cwh-authenticator │ ├── setup.py │ └── cwh_authenticator │ │ └── __init__.py ├── resources-schema.json ├── spawner │ ├── setup.py │ └── coursewareuserspawner │ │ └── traitlets.py └── Dockerfile ├── .gitignore ├── auth-proxy ├── resources │ ├── lib │ │ ├── lti │ │ │ ├── configs │ │ │ │ └── .gitignore │ │ │ └── db.php │ │ ├── hub-const.php │ │ ├── functions-fed.php │ │ ├── const.php │ │ └── functions.php │ ├── simplesamlphp │ │ ├── templates │ │ │ ├── selectidp-embedded-wayf-end.twig │ │ │ ├── selectidp-embedded-wayf-start.twig │ │ │ └── selectidp-dropdown.twig │ │ └── bin │ │ │ ├── remove_idp_proxy_metadata.sh │ │ │ └── get_idp_proxy_metadata.sh │ ├── htdocs │ │ └── php │ │ │ ├── logout-fed.php │ │ │ ├── lti │ │ │ ├── login.php │ │ │ └── service.php │ │ │ ├── logout.php │ │ │ ├── sp.php │ │ │ └── login.php │ ├── bin │ │ ├── gen-user-id.php │ │ ├── del-local-user.php │ │ ├── add-local-user.php │ │ ├── change-local-user-password.php │ │ └── reset-local-user-password.php │ ├── scripts │ │ ├── update_idp_proxy_metadata.sh │ │ └── start.sh │ ├── etc │ │ └── templates │ │ │ ├── cron_root.j2 │ │ │ ├── embedded-wayf-loader.js.j2 │ │ │ ├── module_cron.php.j2 │ │ │ ├── module_metarefresh.php.j2 │ │ │ └── federation │ │ │ ├── module_metarefresh-test.php.j2 │ │ │ └── module_metarefresh.php.j2 │ ├── composer.json │ ├── supervisord.conf │ ├── saml │ │ └── www │ │ │ └── sp │ │ │ └── discoresp.php │ ├── html │ │ └── no_author.html │ └── templates │ │ ├── error_page.html │ │ └── missing_logout_redirect_url.html ├── build-auth-proxy.sh ├── run-auth-proxy ├── db │ ├── show_local_user.sh │ ├── del_local_user.sh │ ├── add_local_user.sh │ └── add_local_user_table.sh └── README.md ├── ind-steps ├── kvmsteps │ ├── vmdir-scripts │ │ ├── monitor-process.sh │ │ ├── kvm-kill.sh │ │ ├── ssh-shortcut.sh │ │ ├── kvm-expand-fresh-image.sh │ │ └── kvm-shutdown-via-ssh.sh │ ├── monitor-process.sh │ ├── kvmsteps.sh-new │ └── generate-proxy-dir.sh ├── build-jh-environment │ ├── reset-scripts │ │ ├── bashsteps-bash-utils-jan2017.source │ │ ├── bashsteps-defaults-jan2017-check-and-do.source │ │ ├── reset-jupyterhub-container.sh │ │ ├── reset-jupyterhub-image-distribution.sh │ │ ├── reset-systemuser-image-distribution.sh │ │ ├── reset-jupyterhub-image-build.sh │ │ └── reset-systemuser-image-build.sh │ ├── toplevel-aws-build.sh │ ├── toplevel-kvm-build.sh │ ├── toplevel-kvm-tap-build.sh │ ├── toplevel-generic-build.sh │ ├── shutdown-whole-environment.sh │ ├── toplevel-aws-build.sh-new │ ├── toplevel-kvm-build.sh-new │ ├── snapshot-whole-environment.sh │ ├── setup-larger-kvm-1.sh │ ├── aws-vm-setup.sh │ ├── toplevel-kvm-tap-build.sh-new │ ├── aws-vm-setup.sh-new │ ├── toplevel-generic-build.sh-new │ ├── restore-environment-from-snapshot.sh-new │ ├── build-jh-environment.sh-new │ ├── post-build-for-auth-proxy.dstep │ └── setup-networking-alternative-1.sh ├── aws-vpc-proxy │ ├── instance-scripts │ │ ├── ssh-shortcut.sh~ │ │ └── ssh-shortcut.sh │ ├── aws-vpc-proxy.sh-new │ ├── aws-instance-proxy.sh-new │ └── aws-instance-proxy.sh └── build-ci-environment │ ├── toplevel-kvm-build.sh │ ├── toplevel-kvm-build.sh-new │ ├── build-ci-environment.sh-new │ ├── kvm-vm-setup.sh-new │ ├── notebooks │ ├── 3-Test-Execution.ipynb │ ├── .utilities │ │ └── bashsteps-check-next-step-to-do.sh │ ├── ci-check.ipynb │ └── 2-Test-Build.ipynb │ └── kvm-vm-setup.sh ├── hub-patch-dir-tree ├── opt │ └── conda │ │ └── lib │ │ └── python3.5 │ │ └── site-packages │ │ ├── remote_user │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-35.pyc │ │ │ └── remote_user_auth.cpython-35.pyc │ │ └── remote_user_auth.py │ │ └── remote_user-0.0.1.dev0-py3.5.egg-info │ │ ├── dependency_links.txt │ │ ├── top_level.txt │ │ ├── SOURCES.txt │ │ ├── installed-files.txt │ │ └── PKG-INFO └── srv │ └── jupyterhub_config │ └── docker_oauth.py ├── bin ├── const ├── pwgen.sh ├── send-command-via-nfs.sh └── create_add_user_php.sh ├── manage-tools ├── files │ ├── admin-tools │ │ ├── ssh-node │ │ ├── ssh-auth-proxy │ │ ├── allow-sudo │ │ ├── functions │ │ ├── collect-answer │ │ ├── distribute-image │ │ └── create-image │ └── tools │ │ ├── 12_UpdateMaterials.ipynb │ │ ├── 10_AcquireMaterials.ipynb │ │ └── 00_GuidanceForStudent.ipynb └── tasks │ └── main.yml ├── LICENSE.txt ├── jupyterhub-singleuser └── kernelmanager │ ├── setup.py │ └── coursewarekernelmanager │ └── __init__.py ├── .github └── workflows │ └── docker.yml ├── adapt-notebooks-for-user.sh └── manual-notebooks └── 82_Reference_serverctl.ipynb /jupyterhub/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.egg-info 2 | *.pyc 3 | -------------------------------------------------------------------------------- /auth-proxy/resources/lib/lti/configs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /ind-steps/kvmsteps/vmdir-scripts/monitor-process.sh: -------------------------------------------------------------------------------- 1 | ../monitor-process.sh -------------------------------------------------------------------------------- /hub-patch-dir-tree/opt/conda/lib/python3.5/site-packages/remote_user/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /auth-proxy/build-auth-proxy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OPT=$1 4 | sudo docker build $OPT -t auth-proxy:latest ./ 5 | 6 | -------------------------------------------------------------------------------- /ind-steps/build-jh-environment/reset-scripts/bashsteps-bash-utils-jan2017.source: -------------------------------------------------------------------------------- 1 | ../bashsteps-bash-utils-jan2017.source -------------------------------------------------------------------------------- /hub-patch-dir-tree/opt/conda/lib/python3.5/site-packages/remote_user-0.0.1.dev0-py3.5.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hub-patch-dir-tree/opt/conda/lib/python3.5/site-packages/remote_user-0.0.1.dev0-py3.5.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | remote_user 2 | -------------------------------------------------------------------------------- /auth-proxy/resources/simplesamlphp/templates/selectidp-embedded-wayf-end.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ind-steps/build-jh-environment/reset-scripts/bashsteps-defaults-jan2017-check-and-do.source: -------------------------------------------------------------------------------- 1 | ../bashsteps-defaults-jan2017-check-and-do.source -------------------------------------------------------------------------------- /auth-proxy/resources/htdocs/php/logout-fed.php: -------------------------------------------------------------------------------- 1 | '); 4 | //--> 5 | -------------------------------------------------------------------------------- /jupyterhub/cwh-repo2docker/cwh_repo2docker/templates/admin.html: -------------------------------------------------------------------------------- 1 | {% extends "templates/admin.html" %} 2 | 3 | {% block thead %} 4 | Image 5 | {{ super() }} 6 | {% endblock thead %} 7 | 8 | {% block user_row %} 9 | {{ super() }} 10 | {{ spawner.image }} 11 | {% endblock user_row %} -------------------------------------------------------------------------------- /auth-proxy/resources/lib/hub-const.php: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /bin/pwgen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | source $(dirname $0)/const 5 | 6 | hubdir=$1 7 | 8 | password=$("$hubdir"/jhvmdir-hub/ssh-shortcut.sh -q sudo docker exec -i ${AUTH_PROXY_NAME} bash << EOF 9 | php -r "require_once '/var/www/php/functions.php'; echo generate_password();" 10 | EOF 11 | ) 12 | 13 | echo $password 14 | -------------------------------------------------------------------------------- /hub-patch-dir-tree/opt/conda/lib/python3.5/site-packages/remote_user-0.0.1.dev0-py3.5.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | README.rst 2 | remote_user/__init__.py 3 | remote_user/remote_user_auth.py 4 | remote_user.egg-info/PKG-INFO 5 | remote_user.egg-info/SOURCES.txt 6 | remote_user.egg-info/dependency_links.txt 7 | remote_user.egg-info/top_level.txt -------------------------------------------------------------------------------- /auth-proxy/resources/etc/templates/module_cron.php.j2: -------------------------------------------------------------------------------- 1 | '{{ env("CRON_SECRET") }}', 8 | 'allowed_tags' => ['daily', 'hourly', 'frequent'], 9 | 'debug_message' => TRUE, 10 | 'sendemail' => FALSE, 11 | ]; 12 | -------------------------------------------------------------------------------- /auth-proxy/resources/simplesamlphp/bin/remove_idp_proxy_metadata.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | cd /var/www/simplesamlphp 4 | idp_proxy_metadata_path=metadata/idp-proxy.xml 5 | [ -e "$metadata" ] { 6 | rm -rf "$idp_proxy_metadata_path" 7 | sed -i "s|array('type' => 'xml', 'file' => '$idp_proxy_metadata_path')|#IDP_PROXY_XML#|" config/config.php 8 | } 9 | -------------------------------------------------------------------------------- /hub-patch-dir-tree/opt/conda/lib/python3.5/site-packages/remote_user-0.0.1.dev0-py3.5.egg-info/installed-files.txt: -------------------------------------------------------------------------------- 1 | ../remote_user/__init__.py 2 | ../remote_user/remote_user_auth.py 3 | ../remote_user/__pycache__/__init__.cpython-35.pyc 4 | ../remote_user/__pycache__/remote_user_auth.cpython-35.pyc 5 | top_level.txt 6 | PKG-INFO 7 | dependency_links.txt 8 | SOURCES.txt 9 | -------------------------------------------------------------------------------- /auth-proxy/README.md: -------------------------------------------------------------------------------- 1 | # auth-proxy 2 | Authentication and proxy for JupyterHub 3 | 4 | ## Build 5 | sudo docker build -t auth-proxy:latest ./ 6 | 7 | ## Run 8 | sudo docker run -v /home/ubuntu/auth-proxy/php:/var/www/php -v /home/ubuntu/auth-proxy/nginx/certs:/etc/nginx/certs --privileged --name root_nginx_1 -p 443:443 --link root_jpydb_1:root_jpydb_1 -d auth-proxy:latest /sbin/init 9 | -------------------------------------------------------------------------------- /auth-proxy/db/add_local_user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | hubdir=$1 4 | user_name=$2 5 | hashed_password=$3 6 | mail_addr=$4 7 | 8 | "$hubdir"/jhvmdir-hub/ssh-shortcut.sh -q \ 9 | sudo docker exec -i root_jpydb_1 \ 10 | psql -U postgres -d jupyterhub << EOS 11 | 12 | INSERT INTO local_users VALUES(nextval(local_users_id_seq), $user_name, $hashed_password, $mail_addr); 13 | 14 | EOS 15 | -------------------------------------------------------------------------------- /auth-proxy/resources/lib/functions-fed.php: -------------------------------------------------------------------------------- 1 | isAuthenticated()) { 12 | $as->logout(); 13 | } 14 | } 15 | 16 | ?> 17 | -------------------------------------------------------------------------------- /jupyterhub/cwh-repo2docker/cwh_repo2docker/custom_templates/error.html: -------------------------------------------------------------------------------- 1 | {% extends "templates/error.html" %} 2 | 3 | {% block error_detail %} 4 | {% if exception %}{% if exception.log_message %} 5 | {% if exception.log_message | format(*exception.args) != message %} 6 |

{{ exception.log_message | format(*exception.args) | safe }}

7 | {% endif %} 8 | {% endif %}{% endif %} 9 | {{ super() }} 10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /jupyterhub/cwh-repo2docker/cwh_repo2docker/custom_templates/page.html: -------------------------------------------------------------------------------- 1 | {% extends "templates/page.html" %} 2 | 3 | {% block nav_bar_left_items %} 4 | {{ super() }} 5 | {% if 'access:services!service={{cwh_repo2docker_service_name}}' in expanded_scopes or 'access:services' in expanded_scopes %} 6 | 7 | {% endif %} 8 | {% endblock %} 9 | -------------------------------------------------------------------------------- /ind-steps/build-jh-environment/toplevel-aws-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source "$(dirname $(readlink -f "$0"))/bashsteps-defaults-jan2017-check-and-do.source" || exit 4 | 5 | ( 6 | $starting_group "Setup VMs" 7 | 8 | "$ORGCODEDIR/aws-vm-setup.sh" "$DATADIR" wrapped 9 | ) ; iferr_exit 10 | 11 | ( 12 | $starting_group "Install Jupyterhub Environment" 13 | 14 | "$ORGCODEDIR/build-jh-environment.sh" "$DATADIR" wrapped 15 | ) ; iferr_exit 16 | -------------------------------------------------------------------------------- /ind-steps/build-jh-environment/toplevel-kvm-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source "$(dirname $(readlink -f "$0"))/bashsteps-defaults-jan2017-check-and-do.source" || exit 4 | 5 | ( 6 | $starting_group "Setup VMs" 7 | 8 | "$ORGCODEDIR/kvm-vm-setup.sh" "$DATADIR" wrapped 9 | ) ; iferr_exit 10 | 11 | ( 12 | $starting_group "Install Jupyterhub Environment" 13 | 14 | "$ORGCODEDIR/build-jh-environment.sh" "$DATADIR" wrapped 15 | ) ; iferr_exit 16 | -------------------------------------------------------------------------------- /ind-steps/build-ci-environment/toplevel-kvm-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source "$(dirname $(readlink -f "$0"))/bashsteps-defaults-jan2017-check-and-do.source" || exit 4 | 5 | ( 6 | $starting_group "Setup VMs" 7 | 8 | "$ORGCODEDIR/kvm-vm-setup.sh" "$DATADIR" wrapped 9 | ) ; iferr_exit 10 | 11 | ( 12 | $starting_group "Install Jupyternotebook Environment" 13 | 14 | "$ORGCODEDIR/build-ci-environment.sh" "$DATADIR" wrapped 15 | ) ; iferr_exit 16 | -------------------------------------------------------------------------------- /auth-proxy/db/add_local_user_table.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | hubdir=$1 4 | 5 | "$hubdir"/jhvmdir-hub/ssh-shortcut.sh -q \ 6 | sudo docker exec -i root_jpydb_1 \ 7 | psql -U postgres -d jupyterhub << EOS 8 | CREATE SEQUENCE local_users_id_seq START 1; 9 | CREATE TABLE local_users ( 10 | id integer CONSTRAINT firstkey PRIMARY KEY, 11 | user_name varchar(64) UNIQUE NOT NULL, 12 | password varchar(128) NOT NULL, 13 | mail varchar(64) NOT NULL 14 | ); 15 | EOS 16 | -------------------------------------------------------------------------------- /ind-steps/build-jh-environment/toplevel-kvm-tap-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source "$(dirname $(readlink -f "$0"))/bashsteps-defaults-jan2017-check-and-do.source" || exit 4 | 5 | ( 6 | $starting_group "Setup VMs" 7 | 8 | "$ORGCODEDIR/kvm-tap-vm-setup.sh" "$DATADIR" wrapped 9 | ) ; iferr_exit 10 | 11 | ( 12 | $starting_group "Install Jupyterhub Environment" 13 | 14 | "$ORGCODEDIR/build-jh-environment.sh" "$DATADIR" wrapped 15 | ) ; iferr_exit 16 | -------------------------------------------------------------------------------- /auth-proxy/resources/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "allow-plugins": { 4 | "simplesamlphp/composer-module-installer": true, 5 | "composer/package-versions-deprecated": true 6 | } 7 | } , 8 | "repositories": [ 9 | { 10 | "type": "vcs", 11 | "url": "https://github.com/IMSGlobal/lti-1-3-php-library", 12 | "no-api": true 13 | } 14 | ], 15 | "require": { 16 | "imsglobal/lti-1p3-tool": "dev-master" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ind-steps/aws-vpc-proxy/instance-scripts/ssh-shortcut.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source "$(dirname "$0")/bashsteps-bash-utils-jan2017.source" 4 | 5 | source "$LINKCODEDIR/datadir.conf" || iferr_exit 6 | 7 | extraoptions=( 8 | -o StrictHostKeyChecking=no 9 | -o UserKnownHostsFile=/dev/null 10 | -o GSSAPIAuthentication=no 11 | ) 12 | 13 | ## TODO, better error checking, etc. 14 | 15 | ssh "${extraoptions[@]}" "ubuntu@$publicip" -i "$LINKCODEDIR/vpc-datadir/sshkey" "$@" 16 | 17 | 18 | -------------------------------------------------------------------------------- /jupyterhub/cwh_repo2docker_config.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | registry_host = os.environ['REGISTRY_HOST'] 4 | initial_image = os.environ.get('CONTAINER_IMAGE', 'coursewarehub/initial-course-image:latest') 5 | 6 | c.Registry.initial_course_image = initial_image 7 | c.Registry.default_course_image = os.environ.get('CONTAINER_IMAGE', 'coursewarehub/default-course-image:latest') 8 | c.Registry.host = registry_host 9 | c.Registry.username = os.environ.get('REGISTRY_USER', 'cwh') 10 | c.Registry.password = os.environ['REGISTRY_PASSWORD'] 11 | 12 | -------------------------------------------------------------------------------- /jupyterhub/cwh-repo2docker/cwh_repo2docker/templates/page.html: -------------------------------------------------------------------------------- 1 | {% extends "templates/page.html" %} 2 | 3 | {% block logo %} 4 | {{ super() }} 5 | {{ brand_text }} 6 | {% endblock logo %} 7 | 8 | {% block nav_bar_left_items %} 9 | 12 | {% endblock nav_bar_left_items %} 13 | 14 | {% block login_widget %} 15 | {% endblock login_widget %} 16 | 17 | {% block announcement %} 18 | {% endblock %} 19 | -------------------------------------------------------------------------------- /auth-proxy/resources/bin/del-local-user.php: -------------------------------------------------------------------------------- 1 | getMessage()."\n"; 16 | exit(1); 17 | } 18 | 19 | echo "$mail_addr\n"; 20 | exit; 21 | ?> 22 | -------------------------------------------------------------------------------- /auth-proxy/resources/simplesamlphp/bin/get_idp_proxy_metadata.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | idp_proxy="$1" 4 | 5 | idp_proxy_metadata_path=metadata/idp-proxy.xml 6 | idp_entity_id="https://$idp_proxy/simplesaml/saml2/idp/metadata.php" 7 | cd /var/www/simplesamlphp 8 | curl --insecure --fail -o $idp_proxy_metadata_path https://$idp_proxy/simplesaml/saml2/idp/metadata.php 9 | sed -i "s|#IDP_PROXY_XML#|array('type' => 'xml', 'file' => '$idp_proxy_metadata_path')|" config/config.php 10 | sed -i "s|'idp' => .*|'idp' => '$idp_entity_id',|" config/authsources.php 11 | -------------------------------------------------------------------------------- /jupyterhub/cwh-authenticator/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | from setuptools import setup, find_packages 5 | 6 | setup_args = dict( 7 | name = 'cwh-authenticator', 8 | version = '0.1.0', 9 | platforms = "Linux", 10 | packages = find_packages(), 11 | include_package_data = False, 12 | install_requires = ['jhub_remote_user_authenticator'] 13 | ) 14 | 15 | 16 | def main(): 17 | setup(**setup_args) 18 | 19 | if __name__ == '__main__': 20 | main() 21 | 22 | -------------------------------------------------------------------------------- /auth-proxy/resources/lib/const.php: -------------------------------------------------------------------------------- 1 | "urn:oid:0.9.2342.19200300.100.1.3", 5 | "eduPersonPrincipalName" => "urn:oid:1.3.6.1.4.1.5923.1.1.1.6", 6 | "jaDisplayName" => "urn:oid:1.3.6.1.4.1.32264.1.1.3", 7 | "displayName" => "urn:oid:2.16.840.1.113730.3.1.241", 8 | "isMemberOf" => "urn:oid:1.3.6.1.4.1.5923.1.5.1.1", 9 | ); 10 | 11 | // Path of IdP metadata file 12 | const IDP_METADATA_FILE_PATH = "/var/www/simplesamlphp/metadata/*/saml20-idp-remote.php"; 13 | ?> 14 | -------------------------------------------------------------------------------- /auth-proxy/resources/bin/add-local-user.php: -------------------------------------------------------------------------------- 1 | getMessage()."\n"; 18 | exit(1); 19 | } 20 | 21 | echo "$mail_addr $password"."\n"; 22 | exit; 23 | ?> 24 | -------------------------------------------------------------------------------- /auth-proxy/resources/bin/change-local-user-password.php: -------------------------------------------------------------------------------- 1 | getMessage()."\n"; 17 | exit(1); 18 | } 19 | 20 | exit; 21 | ?> 22 | -------------------------------------------------------------------------------- /jupyterhub/cwh-repo2docker/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding: utf-8 3 | 4 | from setuptools import setup, find_packages 5 | 6 | setup_args = dict( 7 | name = 'cwh-repo2docker', 8 | version = '0.1.0', 9 | platforms = "Linux", 10 | packages = find_packages(), 11 | include_package_data = True, 12 | install_requires = [ 13 | "coursewareuserspawner", 14 | "jupyterhub~=5.0", 15 | "aiodocker", 16 | 'aiohttp'] 17 | ) 18 | 19 | 20 | def main(): 21 | setup(**setup_args) 22 | 23 | if __name__ == '__main__': 24 | main() 25 | -------------------------------------------------------------------------------- /manage-tools/files/admin-tools/allow-sudo: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | SCRIPT_DIR=$(cd $(dirname $0); pwd) 3 | 4 | source ~/.hub-config 5 | source $SCRIPT_DIR/functions 6 | 7 | servername="jupyter-$USER" 8 | node_info="$(find_node "$servername")" || exit 9 | IFS=' ' 10 | set -- $node_info 11 | thenode=$1 12 | thenode_ip=$2 13 | 14 | $SCRIPT_DIR/ssh-node "$thenode_ip" -q sudo docker exec -i "$servername" bash </dev/null; then 17 | echo "Sudo already allowed" 18 | else 19 | echo '$USER ALL=(ALL) NOPASSWD: ALL' >>/etc/sudoers 20 | echo "Sudo is now allowed for $USER." 21 | fi 22 | EOF 23 | 24 | -------------------------------------------------------------------------------- /auth-proxy/resources/bin/reset-local-user-password.php: -------------------------------------------------------------------------------- 1 | getMessage()."\n"; 17 | exit(1); 18 | } 19 | 20 | echo "$mail_addr $password\n"; 21 | exit; 22 | ?> 23 | -------------------------------------------------------------------------------- /auth-proxy/resources/etc/templates/module_metarefresh.php.j2: -------------------------------------------------------------------------------- 1 | [ 5 | 'idp-proxy' => [ 6 | 'cron' => ['daily'], 7 | 'sources' => [ 8 | [ 9 | 'src' => 'https://{{ env("AUTH_FQDN") }}/simplesaml/saml2/idp/metadata.php', 10 | 'certificates' => [ 11 | 'idp-proxy.cer' 12 | ] 13 | ] 14 | ], 15 | 'outputDir' => 'metadata/idp-proxy/', 16 | 'outputFormat' => 'flatfile', 17 | 'expireAfter' => 60*60*24*4 18 | ] 19 | ] 20 | ]; 21 | 22 | -------------------------------------------------------------------------------- /ind-steps/build-jh-environment/toplevel-generic-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source "$(dirname $(readlink -f "$0"))/bashsteps-defaults-jan2017-check-and-do.source" || exit 4 | 5 | ( 6 | $starting_step "Setup Instance Dir Information" 7 | output="$(grep '999\.999' "$DATADIR"/jhvm*/datadir.conf)" 8 | [ "$output" = "" ] 9 | $skip_step_if_already_done 10 | echo "More manual setup is still necessary in the instance directories" 1>&2 11 | echo "$output" 1>&2 12 | exit 1 13 | ) ; iferr_exit 14 | 15 | ( 16 | $starting_group "Install Jupyterhub Environment" 17 | 18 | "$ORGCODEDIR/build-jh-environment.sh" "$DATADIR" wrapped 19 | ) ; iferr_exit 20 | -------------------------------------------------------------------------------- /ind-steps/kvmsteps/vmdir-scripts/kvm-kill.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source "$(dirname $(readlink -f "$0"))/bashsteps-defaults-jan2017-check-and-do.source" || exit 4 | 5 | kvm_is_running() 6 | { 7 | pid="$(cat "$DATADIR/runinfo/kvm.pid" 2>/dev/null)" && 8 | [ -d /proc/"$(< "$DATADIR/runinfo/kvm.pid")" ] 9 | } 10 | 11 | ( 12 | $starting_step "Killing KVM process" 13 | ! kvm_is_running 14 | $skip_step_if_already_done 15 | set -e 16 | thepid="$(cat "$DATADIR/runinfo/kvm.pid" 2>/dev/null)" 17 | marker="$(cat "$DATADIR/runinfo/kvm.marker" 2>/dev/null)" 18 | env="$(cat /proc/$thepid/environ 2>/dev/null)" && [[ "$env" == *${marker}* ]] 19 | kill -TERM "$thepid" 20 | ) ; $iferr_exit 21 | -------------------------------------------------------------------------------- /jupyterhub/cwh-repo2docker/cwh_repo2docker/static/css/style.css: -------------------------------------------------------------------------------- 1 | .images-container { 2 | width: 100%; 3 | } 4 | 5 | .table > tbody > tr > td { 6 | vertical-align: middle; 7 | } 8 | 9 | .table > thead > tr > th { 10 | vertical-align: top; 11 | } 12 | 13 | .table > tbody > tr > td > p { 14 | margin: unset; 15 | } 16 | 17 | #show-logs-dialog .btn-default { 18 | display: none; 19 | } 20 | 21 | details { 22 | padding: 0.5em 0.5em 0; 23 | } 24 | 25 | summary { 26 | font-weight: bold; 27 | margin: -0.5em -0.5em 0; 28 | padding: 0.5em; 29 | cursor: pointer; 30 | } 31 | 32 | details[open] { 33 | padding: 0.5em; 34 | } 35 | 36 | details[open] summary { 37 | margin-bottom: 0.5em; 38 | } 39 | -------------------------------------------------------------------------------- /auth-proxy/resources/htdocs/php/lti/login.php: -------------------------------------------------------------------------------- 1 | do_oidc_login_redirect(TOOL_HOST . "/php/lti/service.php") 13 | ->do_redirect(); 14 | } catch (LTI\OIDC_Exception $e) { 15 | error_log("LTI Login failed: $e"); 16 | error_page( 17 | "Not Authorized", 18 | "This tool provider is not available from the link you clicked."); 19 | http_response_code(403); 20 | } 21 | ?> 22 | -------------------------------------------------------------------------------- /bin/send-command-via-nfs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | send_command_via_nfs() 5 | { 6 | fn=~/.commands/test 7 | { 8 | echo "$*" 9 | echo "EOCommand" 10 | } >$fn-queued 11 | 12 | lastoutput="" 13 | while [[ "$lastoutput" != *EOResult* ]]; do 14 | sleep 1 15 | 16 | # keep reopening the file because tail on NFS delays quite a bit 17 | contents="$(< "$fn-queued")" 18 | 19 | alloutput="${contents#*EOCommand?}" 20 | if [ "$alloutput" != "$lastoutput" ]; then 21 | newtext="${alloutput#"$lastoutput"}" 22 | lastoutput="$alloutput" 23 | 24 | echo -n "${newtext/EOResult/}" 25 | fi 26 | done 27 | mv "$fn-queued" "$fn-done" 28 | } 29 | 30 | 31 | if [ "$1" != just-source ]; then 32 | send_command_via_nfs "$@" 33 | fi 34 | -------------------------------------------------------------------------------- /jupyterhub/cwh-repo2docker/cwh_repo2docker/images.py: -------------------------------------------------------------------------------- 1 | from jupyterhub.services.auth import HubOAuthenticated 2 | from tornado import web 3 | 4 | from .docker import list_containers 5 | from .registry import get_registry 6 | from .base import BaseHandler 7 | 8 | 9 | class ImagesHandler(HubOAuthenticated, BaseHandler): 10 | """ 11 | Handler to show the list of environments as Docker images 12 | """ 13 | 14 | @web.authenticated 15 | async def get(self): 16 | registry = get_registry(config=self.settings['config']) 17 | images = await registry.list_images() 18 | containers = await list_containers() 19 | result = self.render_template( 20 | "images.html", 21 | images=images + containers 22 | ) 23 | self.write(await result) 24 | -------------------------------------------------------------------------------- /auth-proxy/resources/simplesamlphp/templates/selectidp-embedded-wayf-start.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |