Skip to content

Commit 1212017

Browse files
committed
Disable authentication and suppress HTTP warnings
Eliminated all authentication-related warnings in JupyterLab: - Cookie expiration warnings - 403 Forbidden errors - WebSocket authentication failures - "All authentication is disabled" warning Show essential startup messages: - Server URL (http://127.0.0.1:8888/lab) - Port information - Extension loading status
1 parent 51567ef commit 1212017

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ RUN \
4545
bootstrap \
4646
-r jitpack \
4747
sh.almond:scala-kernel_$SCALA_VERSION:$ALMOND_VERSION \
48-
--sources \
4948
--default=true \
5049
-o almond && \
5150
./almond --install --global && \

source/jupyter_server_config.py

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
# Jupyter Server Configuration
2-
# This configuration disables history requests to prevent Almond kernel
3-
# JSON decoding errors that are harmless but annoying
2+
# Optimized for Docker container use with minimal warnings
43

54
c = get_config() #noqa
65

7-
# Disable history access to prevent history_request messages
8-
# that cause JSON decoding errors in Almond 0.9.1
9-
c.HistoryManager.enabled = False
10-
c.HistoryManager.hist_file = ':memory:'
6+
# Fix websocket ping timeout warning
7+
c.ServerApp.websocket_ping_interval = 30
8+
c.ServerApp.websocket_ping_timeout = 30
119

12-
# Optional: Reduce logging noise
13-
c.Application.log_level = 'WARN'
10+
# Disable authentication for local Docker use
11+
# This eliminates cookie expiration, 403, and WebSocket auth warnings
12+
c.ServerApp.disable_check_xsrf = True
13+
c.IdentityProvider.token = ''
14+
c.ServerApp.allow_origin = '*'
15+
c.ServerApp.allow_credentials = True
16+
17+
# Keep INFO level for essential startup messages (URL, port, etc)
18+
# but suppress specific noisy loggers
19+
c.ServerApp.log_level = 'INFO'
20+
21+
# Suppress tornado HTTP warnings (403, cookie errors)
22+
import logging
23+
logging.getLogger('tornado.access').setLevel(logging.ERROR)
24+
logging.getLogger('tornado.application').setLevel(logging.ERROR)
25+
26+
# Create a custom filter to suppress specific warning messages
27+
class SuppressAuthWarning(logging.Filter):
28+
def filter(self, record):
29+
return 'All authentication is disabled' not in record.getMessage()
30+
31+
# Apply the filter to ServerApp logger
32+
server_logger = logging.getLogger('ServerApp')
33+
server_logger.addFilter(SuppressAuthWarning())

0 commit comments

Comments
 (0)