fix: added PI_BASE_PATH (#4192)
* fix: added PI_BASE_PATH * feat: add PI_URL configuration for new PI service integration * feat: include PI_BASE_URL in InstanceEndpoint configuration and response * feat: add NEXT_PUBLIC_PI_BASE_URL and NEXT_PUBLIC_PI_BASE_PATH to Dockerfile for PI service integration * fix: removed SILO variables * fix: reverted instance file changes --------- Co-authored-by: akshat5302 <[email protected]>
This commit is contained in:
co-authored by
akshat5302
parent
ac0b901d50
commit
53cc661f0d
@@ -399,6 +399,10 @@ LIVE_BASE_PATH = os.environ.get("LIVE_BASE_PATH", "live/")
|
||||
LIVE_URL = urljoin(LIVE_BASE_URL, LIVE_BASE_PATH) if LIVE_BASE_URL else None
|
||||
LIVE_SERVER_SECRET_KEY = os.environ.get("LIVE_SERVER_SECRET_KEY", "")
|
||||
|
||||
PI_BASE_URL = os.environ.get("PI_BASE_URL", "")
|
||||
PI_BASE_PATH = os.environ.get("PI_BASE_PATH", "/pi")
|
||||
PI_URL = urljoin(PI_BASE_URL, PI_BASE_PATH)
|
||||
|
||||
# WEB URL
|
||||
WEB_URL = os.environ.get("WEB_URL")
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@ import { clsx, type ClassValue } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
export const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || "";
|
||||
export const PI_BASE_URL = process.env.NEXT_PUBLIC_PI_BASE_URL || "https://dev.plane-pi.plane.town";
|
||||
|
||||
export const PI_BASE_URL = process.env.NEXT_PUBLIC_PI_BASE_URL || "";
|
||||
export const PI_BASE_PATH = process.env.NEXT_PUBLIC_PI_BASE_PATH || "";
|
||||
export const PI_URL = encodeURI(`${PI_BASE_URL}${PI_BASE_PATH}`);
|
||||
|
||||
export const ADMIN_BASE_URL = process.env.NEXT_PUBLIC_ADMIN_BASE_URL || "";
|
||||
export const ADMIN_BASE_PATH = process.env.NEXT_PUBLIC_ADMIN_BASE_PATH || "";
|
||||
|
||||
@@ -13,3 +13,6 @@ NEXT_PUBLIC_LIVE_BASE_PATH="/live"
|
||||
|
||||
NEXT_PUBLIC_SILO_BASE_URL="http://localhost:3200"
|
||||
NEXT_PUBLIC_SILO_BASE_PATH="/silo"
|
||||
|
||||
NEXT_PUBLIC_PI_BASE_URL="http://127.0.0.1:8001"
|
||||
NEXT_PUBLIC_PI_BASE_PATH="/pi"
|
||||
@@ -71,6 +71,12 @@ ENV NEXT_PUBLIC_SILO_BASE_URL=$NEXT_PUBLIC_SILO_BASE_URL
|
||||
ARG NEXT_PUBLIC_SILO_BASE_PATH="/silo"
|
||||
ENV NEXT_PUBLIC_SILO_BASE_PATH=$NEXT_PUBLIC_SILO_BASE_PATH
|
||||
|
||||
ARG NEXT_PUBLIC_PI_BASE_URL=""
|
||||
ENV NEXT_PUBLIC_PI_BASE_URL=$NEXT_PUBLIC_PI_BASE_URL
|
||||
|
||||
ARG NEXT_PUBLIC_PI_BASE_PATH="/pi"
|
||||
ENV NEXT_PUBLIC_PI_BASE_PATH=$NEXT_PUBLIC_PI_BASE_PATH
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV TURBO_TELEMETRY_DISABLED=1
|
||||
|
||||
@@ -118,6 +124,12 @@ ENV NEXT_PUBLIC_SPACE_BASE_PATH=$NEXT_PUBLIC_SPACE_BASE_PATH
|
||||
ARG NEXT_PUBLIC_WEB_BASE_URL=""
|
||||
ENV NEXT_PUBLIC_WEB_BASE_URL=$NEXT_PUBLIC_WEB_BASE_URL
|
||||
|
||||
ARG NEXT_PUBLIC_PI_BASE_URL=""
|
||||
ENV NEXT_PUBLIC_PI_BASE_URL=$NEXT_PUBLIC_PI_BASE_URL
|
||||
|
||||
ARG NEXT_PUBLIC_PI_BASE_PATH="/pi"
|
||||
ENV NEXT_PUBLIC_PI_BASE_PATH=$NEXT_PUBLIC_PI_BASE_PATH
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV TURBO_TELEMETRY_DISABLED=1
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useParams } from "next/navigation";
|
||||
import Markdown from "react-markdown";
|
||||
import remarkGfm from "remark-gfm";
|
||||
// plane imports
|
||||
import { PI_BASE_URL } from "@plane/constants";
|
||||
import { PI_URL } from "@plane/constants";
|
||||
import { Loader } from "@plane/ui";
|
||||
// plane-web imports
|
||||
import { useWorkspace } from "@/hooks/store/use-workspace";
|
||||
@@ -43,7 +43,7 @@ export const AiMessage = observer((props: TProps) => {
|
||||
className="pi-chat-root [&>*:first-child]:mt-0 animate-fade-in"
|
||||
components={{
|
||||
a: ({ children, href }) =>
|
||||
href?.startsWith(`${PI_BASE_URL}/api/v1/oauth/authorize/`) && !isLatest ? ( // NOTE: Prev auth links shouldn't be accessible
|
||||
href?.startsWith(`${PI_URL}/api/v1/oauth/authorize/`) && !isLatest ? ( // NOTE: Prev auth links shouldn't be accessible
|
||||
<span className="!underline !text-custom-text-350">{children}</span>
|
||||
) : (
|
||||
<a href={href || ""} rel="noopener noreferrer">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// constants
|
||||
import type { AxiosRequestConfig } from "axios";
|
||||
import { PI_BASE_URL } from "@plane/constants";
|
||||
import { PI_URL } from "@plane/constants";
|
||||
import { getFileMetaDataForUpload, generateFileUploadPayload } from "@plane/services";
|
||||
// services
|
||||
import { APIService } from "@/services/api.service";
|
||||
@@ -62,13 +62,13 @@ export const getPiFileURL = (path: string): string | undefined => {
|
||||
if (!path) return undefined;
|
||||
const isValidURL = path.startsWith("http");
|
||||
if (isValidURL) return path;
|
||||
return `${PI_BASE_URL}${path}`;
|
||||
return `${PI_URL}${path}`;
|
||||
};
|
||||
|
||||
export class PiChatService extends APIService {
|
||||
private fileUploadService: FileUploadService;
|
||||
constructor() {
|
||||
super(PI_BASE_URL);
|
||||
super(PI_URL);
|
||||
// upload service
|
||||
this.fileUploadService = new FileUploadService();
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// plane imports
|
||||
import { PI_BASE_URL } from "@plane/constants";
|
||||
import { PI_URL } from "@plane/constants";
|
||||
import type { TDuplicateIssuePayload, TDuplicateIssueResponse } from "@plane/types";
|
||||
// services
|
||||
import { APIService } from "@/services/api.service";
|
||||
|
||||
export class PIService extends APIService {
|
||||
constructor() {
|
||||
super(PI_BASE_URL);
|
||||
super(PI_URL);
|
||||
}
|
||||
|
||||
async getDuplicateIssues(data: Partial<TDuplicateIssuePayload>): Promise<TDuplicateIssueResponse> {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { update, set, isEmpty } from "lodash-es";
|
||||
import { action, computed, makeObservable, observable, runInAction } from "mobx";
|
||||
import { computedFn } from "mobx-utils";
|
||||
// plane imports
|
||||
import { PI_BASE_URL } from "@plane/constants";
|
||||
import { PI_URL } from "@plane/constants";
|
||||
// plane web imports
|
||||
import { WorkspaceService } from "@/plane-web/services";
|
||||
import { PiChatService } from "@/plane-web/services/pi-chat.service";
|
||||
@@ -362,7 +362,7 @@ export class PiChatStore implements IPiChatStore {
|
||||
workspaceId: string | undefined,
|
||||
newDialogue: TDialogue
|
||||
) => {
|
||||
const url = `${PI_BASE_URL}/api/v1/chat/stream-answer/${token}`;
|
||||
const url = `${PI_URL}/api/v1/chat/stream-answer/${token}`;
|
||||
|
||||
const eventSource = new EventSource(url, {
|
||||
withCredentials: true,
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
// PI Base Url
|
||||
export const PI_BASE_URL = process.env.NEXT_PUBLIC_PI_BASE_URL || "https://dev.plane-pi.plane.town";
|
||||
export const PI_BASE_URL = process.env.NEXT_PUBLIC_PI_BASE_URL || "";
|
||||
export const PI_BASE_PATH = process.env.NEXT_PUBLIC_PI_BASE_PATH || "";
|
||||
export const PI_URL = encodeURI(`${PI_BASE_URL}${PI_BASE_PATH}`);
|
||||
|
||||
Reference in New Issue
Block a user