Skip to content

Commit

Permalink
Update docker compose versions of neucore to 2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd-johnson committed May 5, 2024
1 parent 14f4f75 commit 1dd3bd6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
MARIADB_PASSWORD: "neucore"

neucore:
image: tkhamez/neucore:2.2.1
image: tkhamez/neucore:2.4.0
ports:
- "8080:80"
environment:
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ services:
SSO_CLIENT_ID:
SSO_CLIENT_SECRET:
SSO_REDIRECT_URI: "http://localhost:3000/auth/callback"
SSO_TOKEN_URI: "https://login.eveonline.com/v2/oauth/token"
SSO_AUTHORIZATION_URI: "https://login.eveonline.com/v2/oauth/authorize"
SLACK_TOKEN:
CORE_URL: "http://neucore/api"
CORE_APP_ID:
Expand Down Expand Up @@ -68,7 +70,7 @@ services:
MARIADB_PASSWORD: "neucore"

neucore:
image: tkhamez/neucore:2.2.1
image: tkhamez/neucore:2.4.0
ports:
- "8080:80"
environment:
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ SSO_CLIENT_SECRET
# if you mount the application behind a reverse proxy and under a subpath, it
# may also be something like https://example.com/pingboard/auth/callback.
SSO_REDIRECT_URI

# The Eve OAuth2 Token URI (defaults to https://login.eveonline.com/v2/oauth/token)
#SSO_TOKEN_URI
# The Eve OAuth2 Authorization URI (defaults to https://login.eveonline.com/v2/oauth/authorize/)
#SSO_AUTHORIZATION_URI
```

### Slack configuration
Expand Down
8 changes: 8 additions & 0 deletions packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ async function main() {
clientId: getFromEnv('SSO_CLIENT_ID'),
clientSecret: getFromEnv('SSO_CLIENT_SECRET'),
redirectUri: getFromEnv('SSO_REDIRECT_URI'),
accessTokenUri: getOptionalFromEnv('SSO_TOKEN_URI'),
authorizationUri: getOptionalFromEnv('SSO_AUTHORIZATION_URI'),
})
eveSsoClient.startAutoCleanup()

Expand Down Expand Up @@ -93,6 +95,12 @@ function getFromEnv(key: string): string {
return value
}

function getOptionalFromEnv(key: string): string | undefined {
const value = process.env[key]
if (value) return value
return undefined
}

function getNumberFromEnv(key: string, fallback?: number): number {
const value = process.env[key]
if (typeof value !== 'string') {
Expand Down
9 changes: 7 additions & 2 deletions packages/backend/src/sso/eve-sso-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export interface EveSSOClientConfig {
/** The Callback URL configured on https://developers.eveonline.com/ */
redirectUri: string

/** The Eve OAuth2 Token URI */
accessTokenUri?: string,
/** The Eve OAuth2 Authorization URI */
authorizationUri?: string,

/**
* Time in seconds after which OAuth2 login states expire.
* Defaults to 5 minutes.
Expand Down Expand Up @@ -45,8 +50,8 @@ export class EveSSOClient {
clientId: options.clientId,
clientSecret: options.clientSecret,
redirectUri: options.redirectUri,
accessTokenUri: 'https://login.eveonline.com/v2/oauth/token',
authorizationUri: 'https://login.eveonline.com/v2/oauth/authorize/',
accessTokenUri: options.accessTokenUri ?? 'https://login.eveonline.com/v2/oauth/token',
authorizationUri: options.authorizationUri ?? 'https://login.eveonline.com/v2/oauth/authorize',

Check warning on line 54 in packages/backend/src/sso/eve-sso-client.ts

View workflow job for this annotation

GitHub Actions / lint

This line has a length of 101. Maximum allowed is 100
})

this.stateTimeout = options.stateTimeout ?? 300
Expand Down

0 comments on commit 1dd3bd6

Please sign in to comment.