Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .env-cmdrc-template
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"dev": {
"ENV": "DEV",
"PORT": "3000",
"SERVER_PROTOCOL": "auto",
"SSL_KEY": "",
"SSL_CERT": "",
"MONGODB_URI": "mongodb://mongodb:27017/switcher-api",
"RESOURCE_SECRECT": "admin",
"JWT_SECRET": "[JWT_SECRET]",
Expand Down Expand Up @@ -48,6 +51,9 @@
"ENV": "TEST",
"NODE_OPTIONS": "--experimental-vm-modules",
"PORT": "3000",
"SERVER_PROTOCOL": "auto",
"SSL_KEY": "",
"SSL_CERT": "",
"MONGODB_URI": "mongodb://mongodb:27017/switcher-api-test",
"JWT_SECRET": "[JWT_SECRET]",
"JWT_ADMIN_TOKEN_RENEW_INTERVAL": "5m",
Expand Down Expand Up @@ -75,4 +81,4 @@
"SWITCHER_GITOPS_JWT_SECRET": "[SWITCHER_GITOPS_JWT_SECRET]",
"SWITCHER_GITOPS_URL": "http://localhost:8000"
}
}
}
1 change: 0 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
patreon: switcherapi
ko_fi: petruki
github: [petruki]
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
SWITCHER_API_LOGGER: false

- name: SonarCloud Scan
uses: sonarsource/sonarqube-scan-action@v7.0.0
uses: sonarsource/sonarqube-scan-action@v8.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
if: env.SONAR_TOKEN != ''
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
SWITCHER_API_LOGGER: false

- name: SonarCloud Scan
uses: sonarsource/sonarqube-scan-action@v7.0.0
uses: sonarsource/sonarqube-scan-action@v8.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
if: env.SONAR_TOKEN != ''
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ Main features:
2. Add .env-cmdrc file into the project directory (use '.env-cmdrc-template')
3. Replace values such as secret keys and URLs

### HTTP/2 and TLS

Switcher API can negotiate HTTP/2 directly from the Node.js server when TLS certificates are available.

- `SERVER_PROTOCOL=auto` (default): uses HTTP/2 when `SSL_KEY` and `SSL_CERT` are configured; otherwise uses cleartext HTTP/1.1.
- `SERVER_PROTOCOL=http1`: forces HTTP/1.1. If TLS certificates are configured, the server stays on HTTPS over HTTP/1.1.
- `SERVER_PROTOCOL=http2`: requires `SSL_KEY` and `SSL_CERT`; startup fails fast when they are missing.
- The HTTP/2 server is created with HTTP/1.1 fallback enabled, so TLS clients without HTTP/2 support can still connect.
- `GET /check?details=1` reports the active server mode and negotiated protocol configuration.

### Auth Providers

Switcher API supports multiple auth providers such as email/password-based authentication, SAML 2.0 for Single Sign-On (SSO), or GitHub/Bitbucket OAuth.
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ services:
- NODE_ENV=development
- PORT=3000
- ENV=${ENV}
- SERVER_PROTOCOL=${SERVER_PROTOCOL:-auto}
- SSL_KEY=${SSL_KEY}
- SSL_CERT=${SSL_CERT}

Expand Down Expand Up @@ -107,4 +108,4 @@ services:
- BITBUCKET_CLIENTID=${BITBUCKET_OAUTH_CLIENT_ID}
- SWITCHERSLACKAPP_URL=${SWITCHERSLACKAPP_URL}
depends_on:
- switcherapi
- switcherapi
Loading