Skip to content

Commit

Permalink
Clean up loose ends
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec committed Jul 19, 2024
1 parent caeccde commit cedee67
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Backend/Services/CaptchaService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public async Task<bool> VerifyToken(string token)
{
if (!_captchaContext.CaptchaEnabled)
{
throw new TurnstileNotEnabledException();
throw new CaptchaNotEnabledException();
}

var secret = _captchaContext.CaptchaSecretKey;
Expand All @@ -39,6 +39,6 @@ public async Task<bool> VerifyToken(string token)
return contentString.Contains("\"success\":true");
}

private sealed class TurnstileNotEnabledException : Exception { }
private sealed class CaptchaNotEnabledException : Exception { }
}
}
4 changes: 2 additions & 2 deletions Backend/Services/EmailService.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Diagnostics.CodeAnalysis;
using BackendFramework.Interfaces;
using System.Threading.Tasks;
using BackendFramework.Interfaces;
using MimeKit;
using System;

namespace BackendFramework.Services
{
Expand Down
5 changes: 2 additions & 3 deletions deploy/helm/thecombine/charts/backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ global:
awsDefaultRegion: "Override"
pullSecretName: "None"
combineJwtSecretKey: "Override"
emailEnabled: true
combineSmtpUsername: "Override"
combineSmtpPassword: "Override"
# Values for pulling container image from image registry
imagePullPolicy: "Override"
imageTag: "latest"
# Define the image registry to use (may be blank for local images)
imageRegistry: ""
# Email services
emailEnabled: true
# CAPTCHA verification
captchaRequired: true
captchaSecretKey: "Override"

persistentVolumeSize: 32Gi
Expand All @@ -38,5 +38,4 @@ combineSmtpFrom: "The Combine"
combineSmtpPort: 587
combineSmtpServer: "email-smtp.us-east-1.amazonaws.com"
imageName: combine_backend
captchaRequired: true
captchaVerifyUrl: "https://challenges.cloudflare.com/turnstile/v0/siteverify"
2 changes: 1 addition & 1 deletion deploy/helm/thecombine/charts/frontend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ global:
# Email services
emailEnabled: "true"
# CAPTCHA verification
captchaRequired: "true"
captchaRequired: "false"

imageName: combine_frontend

Expand Down
1 change: 0 additions & 1 deletion deploy/helm/thecombine/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ global:
combineJwtSecretKey: "Override"
combineSmtpUsername: "Override"
combineSmtpPassword: "Override"
offline: false
# Local Storage for fonts
fontStorageAccessMode: "ReadWriteOnce"
fontStorageSize: 1Gi
Expand Down
10 changes: 5 additions & 5 deletions deploy/scripts/setup_files/combine_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ targets:
# override values for 'thecombine' chart
thecombine:
global:
serverName: qa-kube.thecombine.app
emailEnabled: true
captchaRequired: true
emailEnabled: true
serverName: qa-kube.thecombine.app
frontend:
configCaptchaSiteKey: "0x4AAAAAAAe9zmM2ysXGSJk1" # Turnstile site key
prod:
Expand All @@ -90,9 +90,9 @@ targets:
# override values for 'thecombine' chart
thecombine:
global:
serverName: thecombine.app
emailEnabled: true
captchaRequired: true
emailEnabled: true
serverName: thecombine.app
frontend:
configCaptchaSiteKey: "0x4AAAAAAAe9zmM2ysXGSJk1" # Turnstile site key

Expand Down Expand Up @@ -159,7 +159,7 @@ charts:
- config_item: combineSmtpPassword
env_var: COMBINE_SMTP_PASSWORD
- config_item: captchaSecretKey
env_var: CAPTCHA_SECRET_KEY
env_var: COMBINE_CAPTCHA_SECRET_KEY
create-admin-user:
namespace: thecombine
install_langs: false
Expand Down
2 changes: 1 addition & 1 deletion deploy/scripts/setup_files/profiles/desktop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ charts:
enabled: false
global:
awsS3Location: local.thecombine.app
emailEnabled: false
captchaRequired: false
emailEnabled: false
imagePullPolicy: IfNotPresent
pullSecretName: None
frontend:
Expand Down
2 changes: 1 addition & 1 deletion docs/deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ The setup scripts require the following environment variables to be set:
- COMBINE_ADMIN_USERNAME
- COMBINE_ADMIN_PASSWORD
- COMBINE_ADMIN_EMAIL
- TURNSTILE_SECRET_KEY
- COMBINE_CAPTCHA_SECRET_KEY

You may also set the KUBECONFIG environment variable to the location of the `kubectl` configuration file. This is not
necessary if the configuration file is at `${HOME}/.kube/config`.
Expand Down
12 changes: 6 additions & 6 deletions src/api/models/sense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,22 @@ export interface Sense {
grammaticalInfo: GrammaticalInfo;
/**
*
* @type {Array<Definition>}
* @type {Array<ProtectReason>}
* @memberof Sense
*/
definitions: Array<Definition>;
protectReasons?: Array<ProtectReason> | null;
/**
*
* @type {Array<Gloss>}
* @type {Array<Definition>}
* @memberof Sense
*/
glosses: Array<Gloss>;
definitions: Array<Definition>;
/**
*
* @type {Array<ProtectReason>}
* @type {Array<Gloss>}
* @memberof Sense
*/
protectReasons?: Array<ProtectReason> | null;
glosses: Array<Gloss>;
/**
*
* @type {Array<SemanticDomain>}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Login/Captcha.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface CaptchaProps {
setSuccess: (success: boolean) => void;
}

/** Component wrapper for Cloudflare Turnstile (CAPTCHA replacement). */
/** Component wrapper for CAPTCHA implementation. */
export default function Captcha(props: CaptchaProps): ReactElement {
const setSuccess = props.setSuccess;
const isRequired = useRef(RuntimeConfig.getInstance().captchaRequired());
Expand Down

0 comments on commit cedee67

Please sign in to comment.