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: .env.example
+1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# YOU MIGHT LIKE TO MODIFY THESE VARIABLES
2
2
SESSION_SECRET=abcdef1234
3
3
MAGIC_LINK_SECRET=abcdef1234
4
+
ENCRYPTION_KEY=ae13021afef0819c3a307ad487071c06# Must be a random 16 byte hex string. You can generate an encryption key by running `openssl rand -hex 16` in your terminal
5. Open the root `.env` file and fill in the required values Magic Link:
44
+
5. Open the root `.env` file and generate a new value for `ENCRYPTION_KEY`:
45
45
46
-
Both of these secrets should be random strings, which you can easily generate (and copy into your pasteboard) with the following command:
46
+
`ENCRYPTION_KEY` is used to two-way encrypt OAuth access tokens and so you'll probably want to actually generate a unique value, and it must be a random 16 byte hex string. You can generate one with the following command:
47
47
48
48
```sh
49
-
openssl rand -hex 16| pbcopy
49
+
openssl rand -hex 16
50
50
```
51
51
52
-
<p>Then set them here:</p>
53
-
54
-
```
55
-
SESSION_SECRET=<string>
56
-
MAGIC_LINK_SECRET=<string>
57
-
```
52
+
Feel free to update `SESSION_SECRET` and `MAGIC_LINK_SECRET` as well using the same method.
58
53
59
54
6. Start Docker. This starts the required services like Postgres. If this is your first time using Docker, consider going through this [guide](DOCKER_INSTALLATION.md)
60
55
```
@@ -75,6 +70,7 @@ branch are tagged into a release monthly.
75
70
10. Run the app. See the section below.
76
71
77
72
## Running
73
+
78
74
1. You can run the app with:
79
75
80
76
```
@@ -85,14 +81,12 @@ branch are tagged into a release monthly.
85
81
86
82
2. Once the app is running click the magic link button and enter your email.
87
83
3. Check your terminal, the magic link email should have printed out as following:
88
-
``
89
-
webapp:dev: Log in to Trigger.dev
84
+
`webapp:dev: Log in to Trigger.dev
90
85
webapp:dev:
91
86
webapp:dev: Click here to log in with this magic link
webapp:dev: If you didn't try to log in, you can safely ignore this email.
95
-
``
89
+
webapp:dev: If you didn't try to log in, you can safely ignore this email.`
96
90
4. Paste the magic link shown in your terminal into your browser to login.
97
91
98
92
## Adding and running migrations
@@ -120,10 +114,11 @@ webapp:dev: If you didn't try to log in, you can safely ignore this email.
120
114
6. If you're using VSCode you may need to restart the Typescript server in the webapp to get updated type inference. Open a TypeScript file, then open the Command Palette (View > Command Palette) and run `TypeScript: Restart TS server`.
121
115
122
116
## Testing CLI changes
117
+
123
118
To test CLI changes, follow the steps below:
124
119
125
120
1. Build the CLI and watch for changes
126
-
121
+
127
122
```
128
123
cd packages/cli
129
124
pnpm run dev
@@ -148,7 +143,7 @@ To test CLI changes, follow the steps below:
148
143
```
149
144
150
145
5. Open a new terminal window, navigate into the example, and initialize the CLI:
151
-
146
+
152
147
```
153
148
cd examples/your-newly-created-nextjs-project
154
149
pnpm i
@@ -158,19 +153,21 @@ To test CLI changes, follow the steps below:
158
153
6. When prompted, select `self-hosted` and enter `localhost:3030` for your local version of the webapp. When asked for an API key, use the key you copied earlier.
159
154
160
155
7. Run the CLI
156
+
161
157
```
162
158
pnpm exec trigger-cli dev
163
159
```
164
160
165
161
8. After running the CLI, start your newly created Next.js project. You should now be able to see the changes.
166
162
167
163
9. Please remember to delete the temporary project you created after you've tested the changes, and before you raise a PR.
164
+
168
165
## Add sample jobs
169
166
170
167
The [examples/jobs-starter](./examples/jobs-starter/) project defines simple jobs you can get started with.
171
168
172
169
1.`cd` into `examples/jobs-starter`
173
-
2. Create a `.env.local` file with the following content,
170
+
2. Create a `.env.local` file with the following content,
174
171
replacing `[TRIGGER_DEV_API_KEY]` with an actual key:
175
172
176
173
```
@@ -224,9 +221,7 @@ Most of the time the changes you'll make are likely to be categorized as patch r
224
221
### EADDRINUSE: address already in use :::3030
225
222
226
223
When receiving the following error message:
227
-
``
228
-
webapp:dev: Error: listen EADDRINUSE: address already in use :::3030
229
-
``
224
+
`webapp:dev: Error: listen EADDRINUSE: address already in use :::3030`
230
225
231
226
The process running on port `3030` should be destroyed.
0 commit comments