Commit 966bfa98 authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

Disabled token-based auth for contaners created with rep2docker as the proxy...

Disabled token-based auth for contaners created with rep2docker as the proxy is already enforcing authentication.
parent c082bfa4
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -761,11 +761,14 @@ def get_or_create_container_from_repository(user, repository_url, repository_tag
    # If reusing:
    #{"message": "Reusing existing image (r2dhttps-3a-2f-2fgithub-2ecom-2fnorvig-2fpytudes5e745c3), not building."}
    
    appendix = 'CMD ["jupyter", "notebook", "--ip", "0.0.0.0", "--NotebookApp.token", ""]'

    
    # Build the Docker container for this repo
    if repository_tag:
        command = 'sudo jupyter-repo2docker --ref {} --user-id 1000 --user-name jovyan --no-run --json-logs {}'.format(repository_tag, repository_url)
        command = 'sudo jupyter-repo2docker --ref {} --user-id 1000 --user-name jovyan --no-run --appendix \'{}\' --json-logs {}'.format(repository_tag, appendix, repository_url)
    else:
        command = 'sudo jupyter-repo2docker --user-id 1000 --user-name jovyan --no-run --json-logs {}'.format(repository_url)
        command = 'sudo jupyter-repo2docker --user-id 1000 --user-name jovyan --no-run --appendix \'{}\' --json-logs {}'.format(repository_url, appendix)
    out = os_shell(command, capture=True)
    if out.exit_code != 0:
        logger.error(out.stderr)