update lên v1.0.3
This commit is contained in:
@@ -7,3 +7,4 @@ dist
|
||||
apps/*/dist
|
||||
packages/*/dist
|
||||
.nx
|
||||
data
|
||||
|
||||
@@ -64,3 +64,13 @@ Special thanks to;
|
||||
cách up project lên ghcr.io
|
||||
docker build -t ghcr.io/victorphan03/docmost:latest .
|
||||
docker push ghcr.io/victorphan03/docmost:latest
|
||||
|
||||
./manage.sh start: Khởi chạy dự án (chạy ngầm).
|
||||
./manage.sh stop: Dừng các container.
|
||||
./manage.sh restart: Khởi động lại dự án.
|
||||
./manage.sh build: Xây dựng lại các image và khởi chạy.
|
||||
./manage.sh logs: Xem log thời gian thực.
|
||||
./manage.sh status: Kiểm tra trạng thái các container.
|
||||
./manage.sh clean: Dừng và xóa toàn bộ dữ liệu (Lưu ý: Dữ liệu trong database sẽ bị mất).
|
||||
|
||||
sudo chown -R 1000:1000 data/docmost
|
||||
|
||||
@@ -52,9 +52,7 @@ export async function uploadChatFile(
|
||||
if (chatId) {
|
||||
formData.append("chatId", chatId);
|
||||
}
|
||||
return await api.post("/ai/chats/upload", formData, {
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
});
|
||||
return await api.post("/ai/chats/upload", formData);
|
||||
}
|
||||
|
||||
export function sendChatMessage(
|
||||
|
||||
@@ -58,11 +58,7 @@ export async function uploadIcon(
|
||||
}
|
||||
formData.append("image", processed);
|
||||
|
||||
return await api.post("/attachments/upload-image", formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
});
|
||||
return await api.post("/attachments/upload-image", formData);
|
||||
}
|
||||
|
||||
export async function uploadUserAvatar(file: File): Promise<IAttachment> {
|
||||
|
||||
@@ -137,11 +137,7 @@ export async function importPage(file: File, spaceId: string) {
|
||||
formData.append("spaceId", spaceId);
|
||||
formData.append("file", file);
|
||||
|
||||
const req = await api.post<IPage>("/pages/import", formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
});
|
||||
const req = await api.post<IPage>("/pages/import", formData);
|
||||
|
||||
return req.data;
|
||||
}
|
||||
@@ -156,11 +152,7 @@ export async function importZip(
|
||||
formData.append("source", source);
|
||||
formData.append("file", file);
|
||||
|
||||
const req = await api.post<any>("/pages/import-zip", formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
});
|
||||
const req = await api.post<any>("/pages/import-zip", formData);
|
||||
|
||||
return req.data;
|
||||
}
|
||||
@@ -186,11 +178,7 @@ export async function uploadFile(
|
||||
formData.append("pageId", pageId);
|
||||
formData.append("file", file);
|
||||
|
||||
const req = await api.post<IAttachment>("/files/upload", formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
});
|
||||
const req = await api.post<IAttachment>("/files/upload", formData);
|
||||
|
||||
return req as unknown as IAttachment;
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
services:
|
||||
docmost:
|
||||
build: .
|
||||
image: ghcr.io/victorphan03/docmost:v1.0.2
|
||||
image: ghcr.io/victorphan03/docmost:v1.0.3
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
@@ -18,7 +18,7 @@ services:
|
||||
|
||||
db:
|
||||
build: ./custom-images/db
|
||||
image: ghcr.io/victorphan03/db:v1.0.2
|
||||
image: ghcr.io/victorphan03/db:v1.0.3
|
||||
environment:
|
||||
POSTGRES_DB: docmost
|
||||
POSTGRES_USER: docmost
|
||||
@@ -31,7 +31,7 @@ services:
|
||||
|
||||
redis:
|
||||
build: ./custom-images/redis
|
||||
image: ghcr.io/victorphan03/redis:v1.0.2
|
||||
image: ghcr.io/victorphan03/redis:v1.0.3
|
||||
command: ["redis-server", "--appendonly", "yes", "--maxmemory-policy", "noeviction"]
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Docmost Custom Management Script
|
||||
|
||||
# Colors for output
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
YELLOW='\033[1;33m'
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Function to display help
|
||||
show_help() {
|
||||
echo -e "${BLUE}Docmost Custom Management Script${NC}"
|
||||
echo "Usage: ./manage.sh [command]"
|
||||
echo ""
|
||||
echo "Commands:"
|
||||
echo " start Start the project in detached mode"
|
||||
echo " stop Stop the project"
|
||||
echo " restart Restart the project"
|
||||
echo " build Build the images and start"
|
||||
echo " logs Show real-time logs"
|
||||
echo " status Show status of containers"
|
||||
echo " clean Stop and remove all volumes (WARNING: Data will be lost)"
|
||||
echo " help Show this help message"
|
||||
}
|
||||
|
||||
# Check if docker is installed
|
||||
if ! command -v docker &> /dev/null; then
|
||||
echo -e "${RED}Error: docker is not installed.${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Determine docker compose command (docker compose or docker-compose)
|
||||
if docker compose version &> /dev/null; then
|
||||
DOCKER_COMPOSE="docker compose"
|
||||
else
|
||||
DOCKER_COMPOSE="docker-compose"
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -e "${GREEN}Starting Docmost Custom...${NC}"
|
||||
$DOCKER_COMPOSE up -d
|
||||
echo -e "${GREEN}Project is running at http://localhost:3000${NC}"
|
||||
;;
|
||||
stop)
|
||||
echo -e "${YELLOW}Stopping Docmost Custom...${NC}"
|
||||
$DOCKER_COMPOSE stop
|
||||
;;
|
||||
restart)
|
||||
echo -e "${YELLOW}Restarting Docmost Custom...${NC}"
|
||||
$DOCKER_COMPOSE restart
|
||||
;;
|
||||
build)
|
||||
echo -e "${BLUE}Building and starting Docmost Custom...${NC}"
|
||||
$DOCKER_COMPOSE up -d --build
|
||||
;;
|
||||
logs)
|
||||
$DOCKER_COMPOSE logs -f
|
||||
;;
|
||||
status)
|
||||
$DOCKER_COMPOSE ps
|
||||
;;
|
||||
clean)
|
||||
echo -e "${RED}WARNING: This will remove all data volumes.${NC}"
|
||||
read -p "Are you sure? (y/N) " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
$DOCKER_COMPOSE down -v
|
||||
echo -e "${GREEN}Project cleaned.${NC}"
|
||||
fi
|
||||
;;
|
||||
help|*)
|
||||
show_help
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user