Skip to content

Commit

Permalink
Fix production bugs
Browse files Browse the repository at this point in the history
Bugs discovered while deploying the service to production:
- URIs with # in .env need to be quoted
- ctx.response.body is not a function; need assignment

Update README
and a random .vscode settings change
  • Loading branch information
mrkvon committed Feb 16, 2024
1 parent 29b49e4 commit e281b7b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BEHIND_PROXY=
MAILER_IDENTITY_EMAIL=bot@example
MAILER_IDENTITY_PASSWORD=password
MAILER_IDENTITY_PROVIDER=http://localhost:3456
MAILER_IDENTITY_WEBID=http://localhost:3456/bot/profile/card#me
MAILER_IDENTITY_WEBID="http://localhost:3456/bot/profile/card#me"
MAILER_IDENTITY_CSS_VERSION=7 # supported versions are 6 and 7

# link to group of users who are allowed to use the service
Expand Down Expand Up @@ -44,4 +44,4 @@ JWT_KEY=./ecdsa-p256-private.pem
JWT_ALG=ES256

# type index class by which we find settings with email
EMAIL_DISCOVERY_TYPE=http://w3id.org/hospex/ns#PersonalHospexDocument
EMAIL_DISCOVERY_TYPE="http://w3id.org/hospex/ns#PersonalHospexDocument"
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
}
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ Email address and verification token should be stored in (webId) - space:prefere

To authenticate itself, the mailer needs to have its own identity, it can be identity hosted on some Community Solid Server

Copy `.env.sample` to `.env` and edit the latter according to your needs
Copy `.env.sample` to `.env` and edit the latter according to your needs.

_:warning: If you provide URIs with `#``, put them to `""`, otherwise # may be interpreted as comment!_

Alternatively, you may provide the configuration as environment variables

Expand Down
6 changes: 3 additions & 3 deletions src/controllers/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ export const finishIntegration: Middleware = async ctx => {
if (savedTokensCount === 0) {
ctx.response.status = 400
ctx.set('content-type', 'application/json')
ctx.response.body({
ctx.response.body = {
error:
"We could't find any writeable location on your Pod to save the email verifiation token. You can write it manually.",
"We couldn't find any writeable location on your Pod to save the email verifiation token. You can write it manually.",
token: jwt,
})
}
} else {
ctx.response.body = jwt
ctx.set('content-type', 'text/plain')
Expand Down

0 comments on commit e281b7b

Please sign in to comment.