Add NB_UMASK flag to modify default umask

This commit is contained in:
Iyan Méndez Veiga
2018-08-21 14:52:21 +02:00
parent 177037d091
commit 74da4e07b2
3 changed files with 18 additions and 0 deletions

View File

@@ -37,3 +37,10 @@ if 'GEN_CERT' in os.environ:
# Restrict access to the file
os.chmod(pem_file, stat.S_IRUSR | stat.S_IWUSR)
c.NotebookApp.certfile = pem_file
# Change default umask if set using flag
if 'NB_UMASK' in os.environ:
try:
os.umask(int(os.environ['NB_UMASK'], 8))
except:
raise