Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switches to multilingual Elevenlabs #181

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Bump server limits to 50mb now that we're dealing with images
  • Loading branch information
jp-ipu committed Nov 13, 2023
commit 65ad9d180e0a911bd1e3792ccf25f74096d33ac1
14 changes: 7 additions & 7 deletions server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default class ChatServer {
//const { default: helmet } = await import('helmet');
//this.app.use(helmet());

this.app.use(express.urlencoded({ extended: false }));
this.app.use(express.urlencoded({ extended: true, limit: '50mb' }));

if (config.auth0?.clientID && config.auth0?.issuer && config.publicSiteURL) {
console.log('Configuring Auth0.');
Expand All @@ -62,7 +62,7 @@ export default class ChatServer {
configurePassport(this);
}

this.app.use(express.json({ limit: '1mb' }));
this.app.use(express.json({ limit: '50mb' }));
this.app.use(compression({
filter: (req, res) => !req.path.includes("proxies"),
}));
Expand All @@ -88,7 +88,7 @@ export default class ChatServer {
windowMs: config.rateLimit.windowMs,
max: config.rateLimit.max,
}));

this.app.post('/chatapi/delete', (req, res) => new DeleteChatRequestHandler(this, req, res));
this.app.get('/chatapi/share/:id', (req, res) => new GetShareRequestHandler(this, req, res));
this.app.post('/chatapi/share', (req, res) => new ShareRequestHandler(this, req, res));
Expand Down Expand Up @@ -143,7 +143,7 @@ export default class ChatServer {
key: fs.readFileSync(config.tls.key),
cert: fs.readFileSync(config.tls.cert),
}, this.app);

server.listen(port, () => callback(true));
} else if (config.tls?.selfSigned) {
console.log('Configuring self-signed TLS.');
Expand All @@ -156,7 +156,7 @@ export default class ChatServer {
key: fs.readFileSync('./data/key.pem'),
cert: fs.readFileSync('./data/cert.pem'),
}, this.app);

server.listen(port, callback);
} else {
this.app.listen(port, callback);
Expand All @@ -167,7 +167,7 @@ export default class ChatServer {

const displayStatistics = () => {
const activeUsers = getActiveUsersInLast5Minutes();

const activeUsersToDisplay = activeUsers.slice(0, 10);
const extraActiveUsers = activeUsers.slice(10);

Expand All @@ -181,7 +181,7 @@ export default class ChatServer {
console.log(` - Active users: ${activeUsersToDisplay.join(', ')}`);
}
}

setInterval(displayStatistics, 1000 * 60 * 5);
setTimeout(displayStatistics, 1000 * 30);
}
Expand Down