Skip to content

Commit

Permalink
Added the possibility of the http app DELETE action to have a body
Browse files Browse the repository at this point in the history
  • Loading branch information
frikky committed Oct 20, 2023
1 parent 52aa84d commit f3657fd
Show file tree
Hide file tree
Showing 6 changed files with 1,021 additions and 2 deletions.
2 changes: 1 addition & 1 deletion email/1.3.0/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def send_email_shuffle(self, apikey, recipients, subject, body):
return requests.post(url, headers=headers, json=data).text

def send_email_smtp(
self, username, password, smtp_host, recipient, subject, body, smtp_port, attachments="", ssl_verify="True", body_type="html"
self, smtp_host, recipient, subject, body, smtp_port, attachments="", username="", password="", ssl_verify="True", body_type="html"
):
if type(smtp_port) == str:
try:
Expand Down
3 changes: 2 additions & 1 deletion http/1.3.0/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def __init__(self, redis, logger, console_logger=None):

# This is dangerously fun :)
# Do we care about arbitrary code execution here?
# Probably not huh
def curl(self, statement):
process = subprocess.Popen(statement, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)
stdout = process.communicate()
Expand Down Expand Up @@ -73,7 +74,7 @@ def splitheaders(self, headers):

splitheader = header.split(splititem)
if len(splitheader) >= 2:
parsed_headers[splitheader[0]] = splititem.join(splitheader[1:])
parsed_headers[splitheader[0].strip()] = splititem.join(splitheader[1:]).strip()
else:
self.logger.info("Skipping header %s with split %s cus only one item" % (header, splititem))
continue
Expand Down
27 changes: 27 additions & 0 deletions http/1.4.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Base our app image off of the WALKOFF App SDK image
FROM frikky/shuffle:app_sdk as base

# We're going to stage away all of the bloat from the build tools so lets create a builder stage
FROM base as builder

# Install all alpine build tools needed for our pip installs
RUN apk --no-cache add --update alpine-sdk libffi libffi-dev musl-dev openssl-dev

# Install all of our pip packages in a single directory that we can copy to our base image later
RUN mkdir /install
WORKDIR /install
COPY requirements.txt /requirements.txt
RUN pip install --prefix="/install" -r /requirements.txt

# Switch back to our base image and copy in all of our built packages and source code
FROM base
COPY --from=builder /install /usr/local
COPY src /app
RUN apk add curl

# Install any binary dependencies needed in our final image
# RUN apk --no-cache add --update my_binary_dependency

# Finally, lets run our app!
WORKDIR /app
CMD python app.py --log-level DEBUG
Loading

0 comments on commit f3657fd

Please sign in to comment.