@@ -7,7 +7,62 @@ title: Overview
77
88### Generating a Cookie Secret
99
10−To generate a strong cookie secret use `python -c 'import os,base64; print(base64.urlsafe_b64encode(os.urandom(16)).decode())'`
10+To generate a strong cookie secret use one of the below commands:
11+
12+import Tabs from '@theme/Tabs';
13+import TabItem from '@theme/TabItem';
14+
15+<Tabs
16+ defaultValue="python"
17+ values={[
18+ {label: 'Python', value: 'python'},
19+ {label: 'Bash', value: 'bash'},
20+ {label: 'OpenSSL', value: 'openssl'},
21+ {label: 'PowerShell', value: 'powershell'},
22+ {label: 'Terraform', value: 'terraform'},
23+ ]}>
24+ <TabItem value="python">
25+
26+ ```shell
27+ python -c 'import os,base64; print(base64.urlsafe_b64encode(os.urandom(32)).decode())'
28+ ```
29+
30+ </TabItem>
31+ <TabItem value="bash">
32+
33+ ```shell
34+ cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 | base64
35+ ```
36+
37+ </TabItem>
38+ <TabItem value="openssl">
39+
40+ ```shell
41+ openssl rand -base64 32 | tr -- '+/' '-_'
42+ ```
43+
44+ </TabItem>
45+ <TabItem value="powershell">
46+
47+ ```shell
48+ # Add System.Web assembly to session, just in case
49+ Add-Type -AssemblyName System.Web
50+ [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes([System.Web.Security.Membership]::GeneratePassword(32,4))).Replace("+","-").Replace("/","_")
51+ ```
52+
53+ </TabItem>
54+ <TabItem value="terraform">
55+
56+ ```shell
57+ # Valid 32 Byte Base64 URL encoding set that will decode to 24 []byte AES-192 secret
58+ resource "random_password" "cookie_secret" {
59+ length = 32
60+ override_special = "-_"
61+ }
62+ ```
63+
64+ </TabItem>
65+</Tabs>
1166
1267### Config File
1368