Skip to content

Commit 13a650f

Browse files
committed
2 parents d2c2ca8 + fd6b3e9 commit 13a650f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2608
-1335
lines changed

.env.example

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
# Keys
2-
# Required keys for platform encryption/decryption ops
3-
PRIVATE_KEY=replace_with_nacl_sk
4-
PUBLIC_KEY=replace_with_nacl_pk
2+
# Required key for platform encryption/decryption ops
53
ENCRYPTION_KEY=replace_with_lengthy_secure_hex
64

75
# JWT
86
# Required secrets to sign JWT tokens
97
JWT_SIGNUP_SECRET=replace_with_lengthy_secure_hex
108
JWT_REFRESH_SECRET=replace_with_lengthy_secure_hex
119
JWT_AUTH_SECRET=replace_with_lengthy_secure_hex
10+
JWT_SERVICE_SECRET=replace_with_lengthy_secure_hex
1211

1312
# JWT lifetime
1413
# Optional lifetimes for JWT tokens expressed in seconds or a string
1514
# describing a time span (e.g. 60, "2 days", "10h", "7d")
1615
JWT_AUTH_LIFETIME=
1716
JWT_REFRESH_LIFETIME=
18-
JWT_SERVICE_SECRET=
1917
JWT_SIGNUP_LIFETIME=
2018

2119
# Optional lifetimes for OTP expressed in seconds
@@ -33,26 +31,31 @@ MONGO_PASSWORD=example
3331

3432
# Website URL
3533
# Required
36-
3734
SITE_URL=http://localhost:8080
3835

3936
# Mail/SMTP
4037
# Required to send emails
41-
# By default, SMTP_HOST is set to smtp.gmail.com
38+
# By default, SMTP_HOST is set to smtp.gmail.com, SMTP_PORT is set to 587, SMTP_TLS is set to false, and SMTP_FROM_NAME is set to Infisical
4239
SMTP_HOST=smtp.gmail.com
40+
# If STARTTLS is supported, the connection will be upgraded to TLS when SMTP_SECURE is set to false
41+
SMTP_SECURE=false
4342
SMTP_PORT=587
44-
SMTP_NAME=Team
45-
SMTP_USERNAME=[email protected]
43+
SMTP_USERNAME=
4644
SMTP_PASSWORD=
45+
SMTP_FROM_ADDRESS=
46+
SMTP_FROM_NAME=Infisical
4747

4848
# Integration
4949
# Optional only if integration is used
5050
CLIENT_ID_HEROKU=
5151
CLIENT_ID_VERCEL=
5252
CLIENT_ID_NETLIFY=
53+
CLIENT_ID_GITHUB=
5354
CLIENT_SECRET_HEROKU=
5455
CLIENT_SECRET_VERCEL=
5556
CLIENT_SECRET_NETLIFY=
57+
CLIENT_SECRET_GITHUB=
58+
CLIENT_SLUG_VERCEL=
5659

5760
# Sentry (optional) for monitoring errors
5861
SENTRY_DSN=

.github/workflows/be-test-report.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Backend Test Report"
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Check Backend Pull Request"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
be-report:
11+
name: Backend test report
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: 📁 Download test results
17+
id: download-artifact
18+
uses: dawidd6/action-download-artifact@v2
19+
with:
20+
name: be-test-results
21+
path: backend
22+
workflow: check-be-pull-request.yml
23+
workflow_conclusion: success
24+
- name: 📋 Publish test results
25+
uses: dorny/test-reporter@v1
26+
with:
27+
name: Test Results
28+
path: reports/jest-*.xml
29+
reporter: jest-junit
30+
working-directory: backend
31+
- name: 📋 Publish coverage
32+
uses: ArtiomTr/jest-coverage-report-action@v2
33+
id: coverage
34+
with:
35+
output: comment, report-markdown
36+
coverage-file: coverage/report.json
37+
github-token: ${{ secrets.GITHUB_TOKEN }}
38+
working-directory: backend
39+
- uses: marocchino/sticky-pull-request-comment@v2
40+
with:
41+
message: ${{ steps.coverage.outputs.report }}
+23-22
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
1-
name: Check Backend Pull Request
1+
name: "Check Backend Pull Request"
22

33
on:
44
pull_request:
5-
types: [ opened, synchronize ]
5+
types: [opened, synchronize]
66
paths:
7-
- 'backend/**'
8-
- '!backend/README.md'
9-
- '!backend/.*'
10-
- 'backend/.eslintrc.js'
11-
7+
- "backend/**"
8+
- "!backend/README.md"
9+
- "!backend/.*"
10+
- "backend/.eslintrc.js"
1211

1312
jobs:
14-
1513
check-be-pr:
1614
name: Check
1715
runs-on: ubuntu-latest
1816

1917
steps:
20-
-
21-
name: ☁️ Checkout source
18+
- name: ☁️ Checkout source
2219
uses: actions/checkout@v3
23-
-
24-
name: 🔧 Setup Node 16
20+
- name: 🔧 Setup Node 16
2521
uses: actions/setup-node@v3
2622
with:
27-
node-version: '16'
28-
cache: 'npm'
23+
node-version: "16"
24+
cache: "npm"
2925
cache-dependency-path: backend/package-lock.json
30-
-
31-
name: 📦 Install dependencies
26+
- name: 📦 Install dependencies
3227
run: npm ci --only-production --ignore-scripts
3328
working-directory: backend
34-
# -
35-
# name: 🧪 Run tests
36-
# run: npm run test:ci
37-
# working-directory: backend
38-
-
39-
name: 🏗️ Run build
29+
- name: 🧪 Run tests
30+
run: npm run test:ci
31+
working-directory: backend
32+
- name: 📁 Upload test results
33+
uses: actions/upload-artifact@v3
34+
if: always()
35+
with:
36+
name: be-test-results
37+
path: |
38+
./backend/reports
39+
./backend/coverage
40+
- name: 🏗️ Run build
4041
run: npm run build
4142
working-directory: backend

.github/workflows/close_inactive_issues.yml

-22
This file was deleted.

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ node_modules
2525
.env
2626

2727
# testing
28-
/coverage
28+
coverage
29+
reports
30+
junit.xml
2931

3032
# next.js
3133
/.next/

.goreleaser.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ nfpms:
8181
- rpm
8282
- deb
8383
- apk
84+
- archlinux
8485
bindir: /usr/bin
8586
scoop:
8687
bucket:

README.md

+13-7
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ We're currently setting the foundation and building [integrations](https://infis
128128
</tr>
129129
<tr>
130130
<td align="left" valign="middle">
131-
🔜 Vercel (https://github.com/Infisical/infisical/issues/60)
131+
<a href="https://infisical.com/docs/integrations/cloud/vercel?ref=github.com">
132+
✔️ Vercel
133+
</a>
132134
</td>
133135
<td align="left" valign="middle">
134136
<a href="https://infisical.com/docs/integrations/platforms/kubernetes?ref=github.com">
@@ -144,7 +146,9 @@ We're currently setting the foundation and building [integrations](https://infis
144146
🔜 AWS
145147
</td>
146148
<td align="left" valign="middle">
147-
🔜 GitHub Actions (https://github.com/Infisical/infisical/issues/54)
149+
<a href="https://infisical.com/docs/integrations/cicd/githubactions">
150+
✔️ GitHub Actions
151+
</a>
148152
</td>
149153
<td align="left" valign="middle">
150154
🔜 Railway
@@ -155,10 +159,10 @@ We're currently setting the foundation and building [integrations](https://infis
155159
🔜 GCP
156160
</td>
157161
<td align="left" valign="middle">
158-
🔜 GitLab CI/CD
162+
🔜 GitLab CI/CD (https://github.com/Infisical/infisical/issues/134)
159163
</td>
160164
<td align="left" valign="middle">
161-
🔜 CircleCI
165+
🔜 CircleCI (https://github.com/Infisical/infisical/issues/91)
162166
</td>
163167
</tr>
164168
<tr>
@@ -177,7 +181,9 @@ We're currently setting the foundation and building [integrations](https://infis
177181
🔜 TravisCI
178182
</td>
179183
<td align="left" valign="middle">
180-
🔜 Netlify (https://github.com/Infisical/infisical/issues/55)
184+
<a href="https://infisical.com/docs/integrations/cloud/netlify">
185+
✔️ Netlify
186+
</a>
181187
</td>
182188
<td align="left" valign="middle">
183189
🔜 Railway
@@ -191,7 +197,7 @@ We're currently setting the foundation and building [integrations](https://infis
191197
🔜 Supabase
192198
</td>
193199
<td align="left" valign="middle">
194-
🔜 Serverless
200+
🔜 Render (https://github.com/Infisical/infisical/issues/132)
195201
</td>
196202
</tr>
197203
</tbody>
@@ -315,4 +321,4 @@ Infisical officially launched as v.1.0 on November 21st, 2022. However, a lot of
315321
<!-- prettier-ignore-start -->
316322
<!-- markdownlint-disable -->
317323

318-
<a href="https://github.com/dangtony98"><img src="https://avatars.githubusercontent.com/u/25857006?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/mv-turtle"><img src="https://avatars.githubusercontent.com/u/78047717?s=96&v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/maidul98"><img src="https://avatars.githubusercontent.com/u/9300960?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/gangjun06"><img src="https://avatars.githubusercontent.com/u/50910815?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/reginaldbondoc"><img src="https://avatars.githubusercontent.com/u/7693108?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/SH5H"><img src="https://avatars.githubusercontent.com/u/25437192?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/asharonbaltazar"><img src="https://avatars.githubusercontent.com/u/58940073?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/edgarrmondragon"><img src="https://avatars.githubusercontent.com/u/16805946?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/arjunyel"><img src="https://avatars.githubusercontent.com/u/11153289?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/LemmyMwaura"><img src="https://avatars.githubusercontent.com/u/20738858?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/adrianmarinwork"><img src="https://avatars.githubusercontent.com/u/118568289?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/arthurzenika"><img src="https://avatars.githubusercontent.com/u/445200?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/hanywang2"><img src="https://avatars.githubusercontent.com/u/44352119?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/tobias-mintlify"><img src="https://avatars.githubusercontent.com/u/110702161?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/0xflotus"><img src="https://avatars.githubusercontent.com/u/26602940?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/wanjohiryan"><img src="https://avatars.githubusercontent.com/u/71614375?v=4" width="50" height="50" alt=""/></a>
324+
<a href="https://github.com/dangtony98"><img src="https://avatars.githubusercontent.com/u/25857006?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/mv-turtle"><img src="https://avatars.githubusercontent.com/u/78047717?s=96&v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/maidul98"><img src="https://avatars.githubusercontent.com/u/9300960?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/gangjun06"><img src="https://avatars.githubusercontent.com/u/50910815?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/reginaldbondoc"><img src="https://avatars.githubusercontent.com/u/7693108?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/SH5H"><img src="https://avatars.githubusercontent.com/u/25437192?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/gmgale"><img src="https://avatars.githubusercontent.com/u/62303146?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/asharonbaltazar"><img src="https://avatars.githubusercontent.com/u/58940073?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/edgarrmondragon"><img src="https://avatars.githubusercontent.com/u/16805946?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/arjunyel"><img src="https://avatars.githubusercontent.com/u/11153289?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/LemmyMwaura"><img src="https://avatars.githubusercontent.com/u/20738858?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/Zamion101"><img src="https://avatars.githubusercontent.com/u/8071263?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/jonerrr"><img src="https://avatars.githubusercontent.com/u/73760377?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/adrianmarinwork"><img src="https://avatars.githubusercontent.com/u/118568289?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/hanywang2"><img src="https://avatars.githubusercontent.com/u/44352119?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/tobias-mintlify"><img src="https://avatars.githubusercontent.com/u/110702161?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/0xflotus"><img src="https://avatars.githubusercontent.com/u/26602940?v=4" width="50" height="50" alt=""/></a> <a href="https://github.com/wanjohiryan"><img src="https://avatars.githubusercontent.com/u/71614375?v=4" width="50" height="50" alt=""/></a>

backend/__tests__/healthcheck.test.ts

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { server } from '../src/app';
2+
import { describe, expect, it, beforeAll, afterAll } from '@jest/globals';
3+
import supertest from 'supertest';
4+
import { setUpHealthEndpoint } from '../src/services/health';
5+
6+
const requestWithSupertest = supertest(server);
7+
describe('Healthcheck endpoint', () => {
8+
beforeAll(async () => {
9+
setUpHealthEndpoint(server);
10+
});
11+
afterAll(async () => {
12+
server.close();
13+
});
14+
15+
it('GET /healthcheck should return OK', async () => {
16+
const res = await requestWithSupertest.get('/healthcheck');
17+
expect(res.status).toEqual(200);
18+
});
19+
});

backend/environment.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ declare global {
2222
CLIENT_SECRET_NETLIFY: string;
2323
POSTHOG_HOST: string;
2424
POSTHOG_PROJECT_API_KEY: string;
25-
PRIVATE_KEY: string;
26-
PUBLIC_KEY: string;
2725
SENTRY_DSN: string;
2826
SITE_URL: string;
2927
SMTP_HOST: string;

0 commit comments

Comments
 (0)