Replies: 1 comment 9 replies
-
Here's a Dockerfile# Dockerfile
FROM python:3.9-slim
# Set environment variables
ENV LANGFLOW_DATABASE_URL=postgresql://postgres:password@postgres:5432/langflow
ENV LANGFLOW_CONFIG_DIR=/var/lib/langflow
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy the custom build of Langflow
COPY langflow-0.6.19a1.tar.gz /app/
# Set working directory
WORKDIR /app
# Install Langflow
RUN pip install langflow-0.6.19a1.tar.gz
# Expose the port Langflow runs on
EXPOSE 7860
# Run Langflow
CMD ["langflow"] docker-compose.yml# docker-compose.yml
version: '3.8'
services:
langflow:
build: .
ports:
- "7860:7860"
depends_on:
- postgres
environment:
- LANGFLOW_DATABASE_URL=postgresql://postgres:password@postgres:5432/langflow
- LANGFLOW_CONFIG_DIR=/var/lib/langflow
volumes:
- langflow-data:/var/lib/langflow
postgres:
image: postgres:16
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_DB=langflow
volumes:
- langflow-postgres:/var/lib/postgresql/data
volumes:
langflow-data:
langflow-postgres: Resolving 403 ErrorThe 403 error when fetching types can be caused by invalid or expired access tokens or unauthorized URLs. Ensure your access tokens are valid and the URLs are authorized. The code includes mechanisms to renew access tokens and check authorized URLs: Renew Access Tokenasync function tryToRenewAccessToken(error: AxiosError) {
try {
if (window.location.pathname.includes("/login")) return;
const res = await renewAccessToken();
if (res?.data?.access_token && res?.data?.refresh_token) {
login(res?.data?.access_token);
}
if (error?.config?.headers) {
delete error.config.headers["Authorization"];
error.config.headers["Authorization"] = `Bearer ${cookies.get("access_token_lf")}`;
const response = await axios.request(error.config);
return response;
}
} catch (error) {
clearBuildVerticesState(error);
logout();
return Promise.reject("Authentication error");
}
} Check Authorized URLsconst isAuthorizedURL = (url) => {
const authorizedDomains = [
"https://raw.githubusercontent.com/langflow-ai/langflow_examples/main/examples",
"https://api.github.com/repos/langflow-ai/langflow_examples/contents/examples",
"https://api.github.com/repos/langflow-ai/langflow",
"auto_login",
];
const authorizedEndpoints = ["auto_login"];
try {
const parsedURL = new URL(url);
const isDomainAllowed = authorizedDomains.some(
(domain) => parsedURL.origin === new URL(domain).origin
);
const isEndpointAllowed = authorizedEndpoints.some((endpoint) =>
parsedURL.pathname.includes(endpoint)
);
return isDomainAllowed || isEndpointAllowed;
} catch (e) {
// Invalid URL
return false;
}
}; By ensuring the access token is valid and the URL is authorized, you can resolve the 403 error [1][2]. |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@dosu I have langflow-0.6.19a1.tar.gz custom build of langflow.
i get 403 error when I run langflow in docker container:
An error has occurred while fetching types.
Please refresh the page.
provide the dockerfile and docker-compose to run this custom build
Beta Was this translation helpful? Give feedback.
All reactions