mirror of
https://github.com/Shadowfita/docmost.git
synced 2025-11-10 04:22:00 +10:00
Merge branch 'SMTP-IgnoreTLS' into Merged-Downstream
This commit is contained in:
@ -44,6 +44,7 @@ SMTP_PORT=587
|
||||
SMTP_USERNAME=
|
||||
SMTP_PASSWORD=
|
||||
SMTP_SECURE=false
|
||||
SMTP_IGNORETLS=false
|
||||
|
||||
# Postmark driver config
|
||||
POSTMARK_TOKEN=
|
||||
|
||||
@ -17,6 +17,7 @@ To get started with Docmost, please refer to our [documentation](https://docmost
|
||||
|
||||
## Features
|
||||
- Real-time collaboration
|
||||
- Diagrams (Draw.io, Excalidraw and Mermaid)
|
||||
- Spaces
|
||||
- Permissions management
|
||||
- Groups
|
||||
@ -32,4 +33,4 @@ To get started with Docmost, please refer to our [documentation](https://docmost
|
||||
</p>
|
||||
|
||||
### Contributing
|
||||
See the [development doc](https://docmost.com/docs/self-hosting/development)
|
||||
See the [development documentation](https://docmost.com/docs/self-hosting/development)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "client",
|
||||
"private": true,
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
|
||||
@ -7,23 +7,27 @@ declare global {
|
||||
export function getAppUrl(): string {
|
||||
//let appUrl = window.CONFIG?.APP_URL || process.env.APP_URL;
|
||||
|
||||
// if (import.meta.env.DEV) {
|
||||
// return appUrl || "http://localhost:3000";
|
||||
// if (import.meta.env.DEV) {
|
||||
// return appUrl || "http://localhost:3000";
|
||||
//}
|
||||
|
||||
return `${window.location.protocol}//${window.location.host}`;
|
||||
}
|
||||
|
||||
export function getBackendUrl(): string {
|
||||
return getAppUrl() + "/api";
|
||||
return getAppUrl() + '/api';
|
||||
}
|
||||
|
||||
export function getCollaborationUrl(): string {
|
||||
const COLLAB_PATH = "/collab";
|
||||
const url = process.env.APP_URL || getAppUrl();
|
||||
const COLLAB_PATH = '/collab';
|
||||
|
||||
const wsProtocol = url.startsWith("https") ? "wss" : "ws";
|
||||
return `${wsProtocol}://${url.split("://")[1]}${COLLAB_PATH}`;
|
||||
let url = getAppUrl();
|
||||
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) {
|
||||
@ -31,17 +35,17 @@ export function getAvatarUrl(avatarUrl: string) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (avatarUrl?.startsWith("http")) {
|
||||
if (avatarUrl?.startsWith('http')) {
|
||||
return avatarUrl;
|
||||
}
|
||||
|
||||
return getBackendUrl() + "/attachments/img/avatar/" + avatarUrl;
|
||||
return getBackendUrl() + '/attachments/img/avatar/' + avatarUrl;
|
||||
}
|
||||
|
||||
export function getSpaceUrl(spaceSlug: string) {
|
||||
return "/s/" + spaceSlug;
|
||||
return '/s/' + spaceSlug;
|
||||
}
|
||||
|
||||
export function getFileUrl(src: string) {
|
||||
return src?.startsWith("/files/") ? getBackendUrl() + src : src;
|
||||
return src?.startsWith('/files/') ? getBackendUrl() + src : src;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "server",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"description": "",
|
||||
"author": "",
|
||||
"private": true,
|
||||
|
||||
@ -98,6 +98,13 @@ export class EnvironmentService {
|
||||
return secure === 'true';
|
||||
}
|
||||
|
||||
getSmtpIgnoreTLS(): boolean {
|
||||
const ignoretls = this.configService
|
||||
.get<string>('SMTP_IGNORETLS', 'false')
|
||||
.toLowerCase();
|
||||
return ignoretls === 'true';
|
||||
}
|
||||
|
||||
getSmtpUsername(): string {
|
||||
return this.configService.get<string>('SMTP_USERNAME');
|
||||
}
|
||||
|
||||
@ -41,6 +41,7 @@ export const mailDriverConfigProvider = {
|
||||
connectionTimeout: 30 * 1000, // 30 seconds
|
||||
auth,
|
||||
secure: environmentService.getSmtpSecure(),
|
||||
ignoreTLS: environmentService.getSmtpIgnoreTLS()
|
||||
} as SMTPTransport.Options,
|
||||
};
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "docmost",
|
||||
"homepage": "https://docmost.com",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "nx run-many -t build",
|
||||
|
||||
Reference in New Issue
Block a user