Skip to content

Commit 2989e54

Browse files
authored
chore: improve example project and development environement (#302)
1 parent c076f00 commit 2989e54

File tree

5 files changed

+30
-19
lines changed

5 files changed

+30
-19
lines changed

.vscode/settings.json

+7
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,11 @@
5656
"Dateonly",
5757
"sessionmaker"
5858
],
59+
"files.watcherExclude": {
60+
"**/.git/objects/**": true,
61+
"**/.git/subtree-cache/**": true,
62+
"**/node_modules/**": true,
63+
"**/venv*/**": true,
64+
"**/__pycache__/**": true
65+
},
5966
}

src/_example/django/Dockerfile

+5-4
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ RUN \
2828

2929
# Copy the source code into the container.
3030
# we're using a volume for that, but for initialization
31-
COPY ./ /app/
32-
33-
WORKDIR /app/src/_example/django/
3431

3532
RUN curl -sSL https://install.python-poetry.org | python3 - ;\
3633
export PATH="/opt/poetry/bin:$PATH"
3734

38-
RUN /opt/poetry/bin/poetry install --no-cache
35+
COPY ./ /app/
36+
37+
WORKDIR /app/src/_example/django/
38+
39+
RUN /opt/poetry/bin/poetry install --no-cache --no-interaction
3940

4041
# for a bind mount on running repo
4142
VOLUME /app

src/_example/django/docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
PYTHON_VERSION: 3.11 # 3.11 is default if not set
1818
environment:
1919
# forest related
20-
FOREST_VERIFY_SSL: "False"
20+
FOREST_VERIFY_SSL: False
2121
FOREST_SERVER_URL: 'https://api.development.forestadmin.com'
2222
# django related
2323
DJANGO_SECRET_KEY: "^=k+h&r(f7d+#@3f)%h2xef!zvsn2f5_^ahuo*9v7k^6gk=*ey"

src/_example/django/poetry.lock

+13-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/agent_toolkit/forestadmin/agent_toolkit/services/permissions/sse_cache_invalidation.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ def run(self) -> None:
4242
url = f"{self.options['server_url']}/liana/v4/subscribe-to-events"
4343
headers = {"forest-secret-key": self.options["env_secret"], "Accept": "text/event-stream"}
4444
try:
45-
http = urllib3.PoolManager()
45+
args = {}
46+
if self.options["verify_ssl"] is False:
47+
args["cert_reqs"] = "CERT_NONE"
48+
http = urllib3.PoolManager(**args)
4649
self.sse_client = SSEClient(http.request("GET", url, preload_content=False, headers=headers))
4750

4851
for msg in self.sse_client.events():

0 commit comments

Comments
 (0)