Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: example sock path #391

Merged
merged 4 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions examples/python/src/sock.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
# Create a session that can make requests to Unix sockets
session = requests_unixsocket.Session()

default_path = os.path.join(os.path.expanduser("~"), ".nodex/run/nodex.sock")
path_by_installed_deb = "/home/nodex/.nodex/run/nodex.sock"
sock_path = path_by_installed_deb if os.path.exists(path_by_installed_deb) else default_path

# Construct the base URL using the Unix socket path
base = f'http+unix://{urllib.parse.quote(
os.path.join(os.path.expanduser("~"), ".nodex/run/nodex.sock"), safe="")}'
base = f'http+unix://{urllib.parse.quote(sock_path, safe="")}'


def call(method, path, payload):
Expand Down
4 changes: 3 additions & 1 deletion omnibus/images/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM --platform=linux/amd64 ubuntu:22.04

ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
Expand All @@ -19,6 +19,8 @@ RUN apt-get update && apt-get install -y \
sudo \
podman \
dmidecode \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
RUN gem install bundler

Expand Down
Loading