Skip to content

Commit bc90d96

Browse files
committed
README update.
1 parent 6fba6bd commit bc90d96

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,54 @@ Full list found in [requirements.txt](./requirements.txt).
4141

4242
Certificates used are located in the `./security/` folder, taken from the [Cogstack-NiFi](https://github.com/CogStack-NiFi) security folder, [nifi.key](https://raw.githubusercontent.com/CogStack/CogStack-NiFi/refs/heads/main/security/certificates/nifi/nifi.key) and [nifi.pem](https://raw.githubusercontent.com/CogStack/CogStack-NiFi/refs/heads/main/security/certificates/nifi/nifi.pem), read the [security section](https://cogstack-nifi.readthedocs.io/en/latest/security.html) for more info on how to generate them from the main NiFi repository.
4343

44+
### Cookie Secret Management
45+
46+
JupyterHub requires a secure cookie secret file with restrictive permissions.
47+
To keep the repository clean and avoid permission-related issues, the cookie secret file is ignored by Git and generated locally as needed.
48+
49+
### File Location
50+
51+
```bash
52+
config/jupyterhub_cookie_secret
53+
```
54+
55+
This file is intentionally listed in `.gitignore`, so it is never tracked or committed.
56+
57+
### Generating a New Cookie Secret
58+
59+
A helper script is provided to generate a fresh secret.
60+
61+
From the repository root:
62+
63+
```bash
64+
cd scripts
65+
./generate_cookie_secret.sh
66+
```
67+
68+
The script contents are:
69+
70+
```bash
71+
#!/usr/bin/env bash
72+
set -e
73+
openssl rand -hex 32 > ../config/jupyterhub_cookie_secret
74+
```
75+
76+
This command creates (or replaces) a 32-byte hex secret at:
77+
78+
```bash
79+
config/jupyterhub_cookie_secret
80+
```
81+
82+
### Automatic Permission Fix
83+
84+
At container startup, the entrypoint adjusts permissions to ensure the file is protected:
85+
86+
```bash
87+
chmod 600 config/jupyterhub_cookie_secret
88+
```
89+
90+
This guarantees the cookie secret always has the correct permissions regardless of host OS, repo checkout, or user environment.
91+
4492
## Setting up your own hub
4593

4694
This folder contains a modular Docker Compose setup for running the CogStack Jupyter Hub across multiple environments.

0 commit comments

Comments
 (0)