You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/nextjs.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,12 +53,13 @@ inject: |
53
53
}
54
54
---
55
55
56
-
<pclass="design-list-title">Troubleshooting</p>
57
-
<pclass="design-paragraph">Not taking effect? NPM can be inconsistent with overrides. Delete <codeclass="design-code">package-lock.json</code>, <codeclass="design-code">node_modules</code>, and reinstall.</p>
58
-
59
-
{% capture nextjs_reinstall %}
56
+
<divclass="design-list">
57
+
<pclass="design-list-title">Troubleshooting</p>
58
+
<pclass="design-paragraph">Not taking effect? NPM can be inconsistent with overrides. Delete <codeclass="design-code">package-lock.json</code>, <codeclass="design-code">node_modules</code>, and reinstall.</p>
59
+
{% capture nextjs_reinstall %}
60
60
rm -rf node_modules package-lock.json
61
61
npm install
62
-
{% endcapture %}
63
-
{% include components/design-codeblock.html value=nextjs_reinstall copy_text="rm -rf node_modules package-lock.json
62
+
{% endcapture %}
63
+
{% include components/design-codeblock.html value=nextjs_reinstall copy_text="rm -rf node_modules package-lock.json
<p class="design-paragraph">Your public encryption key <code class="design-code">DOTENV_PUBLIC_KEY</code> lands at the top of <code class="design-code">.env</code> so anyone on your team can encrypt secrets.</p>
{% include components/design-codeblock.html value=encrypt_env copy=false %}
58
-
59
-
<p class="design-paragraph">The public encryption key <code class="design-code">DOTENV_PUBLIC_KEY</code> is placed at the top of your <code class="design-code">.env</code> file. This allows anyone on your team to encrypt secrets.</p>
60
-
61
-
<p class="design-paragraph">The private decryption key <code class="design-code">DOTENV_PRIVATE_KEY</code> is placed in your <code class="design-code">.env.keys</code> file. Only those holding this key can decrypt secrets.</p>
62
-
63
-
<p class="design-paragraph">We recommend <a class="design-link" href="/docs/cli/lock/">locking</a>, <a class="design-link" href="/docs/cli/native/">keychaining</a>, or most seriously <a class="design-link" href="/docs/cli/armor/introduction/">armoring</a> your private key.</p>
64
55
{% endcapture %}
65
56
{% include components/design-step.html content=step_content %}
<p class="design-paragraph">Your private decryption key lives in <code class="design-code">.env.keys</code>. Do not commit it — only holders of this key can decrypt secrets.</p>
<p class="design-paragraph">In development the <code class="design-code">dotenvx run</code> command reads from your <code class="design-code">.env.keys</code> file to decrypt and inject your secrets at runtime.</p>
92
-
70
+
<h2 class="design-page-title design-page-title--flush">4. Run locally</h2>
71
+
<p class="design-paragraph">In development, <code class="design-code">dotenvx run</code> reads <code class="design-code">.env.keys</code> to decrypt and inject secrets at runtime.</p>
93
72
{% capture encrypt_dev %}
94
73
$ dotenvx run -- node index.js
95
74
⟐ injected env (2) from .env
96
75
Hello World
97
76
{% endcapture %}
98
77
{% include components/design-codeblock.html value=encrypt_dev copy_text="dotenvx run -- node index.js" %}
78
+
{% endcapture %}
79
+
{% include components/design-step.html content=step_content %}
99
80
100
-
<p class="design-paragraph">In production, do NOT include your <code class="design-code">.env.keys</code> file. Instead, set your <code class="design-code">DOTENV_PRIVATE_KEY</code> ahead of your <code class="design-code">dotenvx run</code> command and it will smartly run the associated <code class="design-code">.env</code> file — decrypting and injecting your secrets at runtime.</p>
101
-
81
+
{% capture step_content %}
82
+
<h2 class="design-page-title design-page-title--flush">5. Run in production</h2>
83
+
<p class="design-paragraph">Do not ship <code class="design-code">.env.keys</code>. Set <code class="design-code">DOTENV_PRIVATE_KEY</code> in the environment instead — dotenvx decrypts and injects at runtime.</p>
102
84
{% capture encrypt_prod %}
103
-
$ dotenvx set HELLO production -f .env.production
104
-
$ DOTENV_PRIVATE_KEY_PRODUCTION="4a650a4159790e2341a388ebcd7526036fd33cc6240667c7cd940cde7b11cfaf" dotenvx run -- node index.js
105
-
⟐ injected env (2) from .env.production
106
-
Hello production
107
-
> :-D
85
+
$ DOTENV_PRIVATE_KEY="…" dotenvx run -- node index.js
108
86
{% endcapture %}
109
87
{% include components/design-codeblock.html value=encrypt_prod copy=false %}
88
+
<pclass="design-paragraph">No more scattering secrets across third-party platforms where they <aclass="design-link"href="https://techcrunch.com/2023/01/05/circleci-breach/">could leak</a>.</p>
89
+
{% endcapture %}
90
+
{% include components/design-step.html content=step_content %}
110
91
111
-
<p class="design-paragraph">No more scattering your secrets across multiple third-parties platforms where they <a class="design-link" href="https://techcrunch.com/2023/01/05/circleci-breach/">could leak</a>!</p>
0 commit comments