mirror of
https://github.com/jantic/DeOldify.git
synced 2026-08-29 02:10:55 +08:00
Check if an argument is given
If NOTEBOOK_PASSWORD env var is not set this script would fail. I also changed to use notebook.auth as is the one in Jupyter docs for hashing passwords. This fix #138.
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
jupyter notebook --port=8888 --no-browser --allow-root --ip=0.0.0.0 --NotebookApp.token="" --NotebookApp.password="$(python set_password.py $NOTEBOOK_PASSWORD)"
|
||||
jupyter notebook --port=8888 --no-browser --allow-root --ip=0.0.0.0 --NotebookApp.token="" --NotebookApp.password="$(./set_password.py $NOTEBOOK_PASSWORD)"
|
||||
|
||||
+18
-3
@@ -1,4 +1,19 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
from IPython.lib import passwd
|
||||
password = passwd(sys.argv[1])
|
||||
print(password)
|
||||
|
||||
from notebook.auth import passwd
|
||||
|
||||
|
||||
def run():
|
||||
password = sys.argv[1:].pop()
|
||||
|
||||
if not password:
|
||||
print('Error: Missing or empty password.', file=sys.stderr)
|
||||
else:
|
||||
encoded = passwd(password)
|
||||
print(encoded)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
|
||||
Reference in New Issue
Block a user