Skip to content

Commit

Permalink
Move ETHERPAD_COOKIE_RELEASE_THRESHOLD to etherpad object
Browse files Browse the repository at this point in the history
  • Loading branch information
bischofmax committed Jun 10, 2024
1 parent 4587c78 commit 532754e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface CollaborativeTextEditorConfig {
ETHERPAD__COOKIE_EXPIRES_SECONDS: number;
ETHERPAD_COOKIE_RELEASE_THRESHOLD: number;
ETHERPAD__COOKIE_RELEASE_THRESHOLD: number;
ETHERPAD__PAD_URI: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class CollaborativeTextEditorService {
params: GetCollaborativeTextEditorForParentParams
): Promise<CollaborativeTextEditor> {
const sessionExpiryDate = this.buildSessionExpiryDate();
const durationThreshold = Number(this.configService.get('ETHERPAD_COOKIE_RELEASE_THRESHOLD'));
const durationThreshold = Number(this.configService.get('ETHERPAD__COOKIE_RELEASE_THRESHOLD'));
const { parentId } = params;

const groupId = await this.collaborativeTextEditorAdapter.getOrCreateGroupId(parentId);
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/modules/server/server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const config: ServerConfig = {
FEATURE_ETHERPAD_ENABLED: Configuration.get('FEATURE_ETHERPAD_ENABLED') as boolean,
ETHERPAD__PAD_URI: Configuration.get('ETHERPAD__PAD_URI') as string,
ETHERPAD__COOKIE_EXPIRES_SECONDS: Configuration.get('ETHERPAD__COOKIE_EXPIRES_SECONDS') as number,
ETHERPAD_COOKIE_RELEASE_THRESHOLD: Configuration.get('ETHERPAD_COOKIE_RELEASE_THRESHOLD') as number,
ETHERPAD__COOKIE_RELEASE_THRESHOLD: Configuration.get('ETHERPAD__COOKIE_RELEASE_THRESHOLD') as number,
I18N__AVAILABLE_LANGUAGES: (Configuration.get('I18N__AVAILABLE_LANGUAGES') as string).split(',') as LanguageType[],
I18N__DEFAULT_LANGUAGE: Configuration.get('I18N__DEFAULT_LANGUAGE') as unknown as LanguageType,
I18N__FALLBACK_LANGUAGE: Configuration.get('I18N__FALLBACK_LANGUAGE') as unknown as LanguageType,
Expand Down
10 changes: 5 additions & 5 deletions config/default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -814,14 +814,14 @@
"type": "integer",
"default": 28800,
"description": "Number of seconds after an etherpad cookie expires."
},
"COOKIE_RELEASE_THRESHOLD": {
"type": "integer",
"default": 7200,
"description": "If Session Valid time is smaller than this, a new session is created on request."
}
}
},
"ETHERPAD_COOKIE_RELEASE_THRESHOLD": {
"type": "integer",
"default": 7200,
"description": "If Session Valid time is smaller than this, a new session is created on request."
},
"NEXTCLOUD_BASE_URL": {
"type": "string",
"default": "http://nextcloud.localhost:9090",
Expand Down
4 changes: 2 additions & 2 deletions src/services/etherpad/utils/EtherpadClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class EtherpadClient {
} else {
this.cookieExpiresSeconds = 28800;
}
if (Configuration.has('ETHERPAD_COOKIE_RELEASE_THRESHOLD')) {
this.cookieReleaseThreshold = Configuration.get('ETHERPAD_COOKIE_RELEASE_THRESHOLD');
if (Configuration.has('ETHERPAD__COOKIE_RELEASE_THRESHOLD')) {
this.cookieReleaseThreshold = Configuration.get('ETHERPAD__COOKIE_RELEASE_THRESHOLD');
} else {
this.cookieReleaseThreshold = 7200;
}
Expand Down

0 comments on commit 532754e

Please sign in to comment.