4 Commits

Author SHA1 Message Date
0bfd3b6771 Implement nodemailer ignore tls property 2024-09-11 11:23:38 +10:00
be0d97661a update README 2024-09-04 18:56:14 +01:00
4e2b23c97e v0.3.1 2024-09-03 10:49:38 +01:00
dc3ce27762 fix collaboration websocket 2024-09-03 10:48:47 +01:00
8 changed files with 29 additions and 15 deletions

View File

@ -32,6 +32,7 @@ SMTP_PORT=587
SMTP_USERNAME= SMTP_USERNAME=
SMTP_PASSWORD= SMTP_PASSWORD=
SMTP_SECURE=false SMTP_SECURE=false
SMTP_IGNORETLS=false
# Postmark driver config # Postmark driver config
POSTMARK_TOKEN= POSTMARK_TOKEN=

View File

@ -17,6 +17,7 @@ To get started with Docmost, please refer to our [documentation](https://docmost
## Features ## Features
- Real-time collaboration - Real-time collaboration
- Diagrams (Draw.io, Excalidraw and Mermaid)
- Spaces - Spaces
- Permissions management - Permissions management
- Groups - Groups
@ -32,4 +33,4 @@ To get started with Docmost, please refer to our [documentation](https://docmost
</p> </p>
### Contributing ### Contributing
See the [development doc](https://docmost.com/docs/self-hosting/development) See the [development documentation](https://docmost.com/docs/self-hosting/development)

View File

@ -1,7 +1,7 @@
{ {
"name": "client", "name": "client",
"private": true, "private": true,
"version": "0.3.0", "version": "0.3.1",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc && vite build", "build": "tsc && vite build",

View File

@ -7,23 +7,27 @@ declare global {
export function getAppUrl(): string { export function getAppUrl(): string {
//let appUrl = window.CONFIG?.APP_URL || process.env.APP_URL; //let appUrl = window.CONFIG?.APP_URL || process.env.APP_URL;
// if (import.meta.env.DEV) { // if (import.meta.env.DEV) {
// return appUrl || "http://localhost:3000"; // return appUrl || "http://localhost:3000";
//} //}
return `${window.location.protocol}//${window.location.host}`; return `${window.location.protocol}//${window.location.host}`;
} }
export function getBackendUrl(): string { export function getBackendUrl(): string {
return getAppUrl() + "/api"; return getAppUrl() + '/api';
} }
export function getCollaborationUrl(): string { export function getCollaborationUrl(): string {
const COLLAB_PATH = "/collab"; const COLLAB_PATH = '/collab';
const url = process.env.APP_URL || getAppUrl();
const wsProtocol = url.startsWith("https") ? "wss" : "ws"; let url = getAppUrl();
return `${wsProtocol}://${url.split("://")[1]}${COLLAB_PATH}`; if (import.meta.env.DEV) {
url = process.env.APP_URL;
}
const wsProtocol = url.startsWith('https') ? 'wss' : 'ws';
return `${wsProtocol}://${url.split('://')[1]}${COLLAB_PATH}`;
} }
export function getAvatarUrl(avatarUrl: string) { export function getAvatarUrl(avatarUrl: string) {
@ -31,17 +35,17 @@ export function getAvatarUrl(avatarUrl: string) {
return null; return null;
} }
if (avatarUrl?.startsWith("http")) { if (avatarUrl?.startsWith('http')) {
return avatarUrl; return avatarUrl;
} }
return getBackendUrl() + "/attachments/img/avatar/" + avatarUrl; return getBackendUrl() + '/attachments/img/avatar/' + avatarUrl;
} }
export function getSpaceUrl(spaceSlug: string) { export function getSpaceUrl(spaceSlug: string) {
return "/s/" + spaceSlug; return '/s/' + spaceSlug;
} }
export function getFileUrl(src: string) { export function getFileUrl(src: string) {
return src?.startsWith("/files/") ? getBackendUrl() + src : src; return src?.startsWith('/files/') ? getBackendUrl() + src : src;
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "server", "name": "server",
"version": "0.3.0", "version": "0.3.1",
"description": "", "description": "",
"author": "", "author": "",
"private": true, "private": true,

View File

@ -98,6 +98,13 @@ export class EnvironmentService {
return secure === 'true'; return secure === 'true';
} }
getSmtpIgnoreTLS(): boolean {
const ignoretls = this.configService
.get<string>('SMTP_IGNORETLS', 'false')
.toLowerCase();
return ignoretls === 'true';
}
getSmtpUsername(): string { getSmtpUsername(): string {
return this.configService.get<string>('SMTP_USERNAME'); return this.configService.get<string>('SMTP_USERNAME');
} }

View File

@ -41,6 +41,7 @@ export const mailDriverConfigProvider = {
connectionTimeout: 30 * 1000, // 30 seconds connectionTimeout: 30 * 1000, // 30 seconds
auth, auth,
secure: environmentService.getSmtpSecure(), secure: environmentService.getSmtpSecure(),
ignoreTLS: environmentService.getSmtpIgnoreTLS()
} as SMTPTransport.Options, } as SMTPTransport.Options,
}; };

View File

@ -1,7 +1,7 @@
{ {
"name": "docmost", "name": "docmost",
"homepage": "https://docmost.com", "homepage": "https://docmost.com",
"version": "0.3.0", "version": "0.3.1",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "nx run-many -t build", "build": "nx run-many -t build",