-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from Snuffy2/Rewrite-to-async
Rewrite to async
- Loading branch information
Showing
14 changed files
with
1,722 additions
and
852 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: async_beta - Build and Publish GitHub Container Docker Image | ||
on: | ||
release: | ||
types: [published, edited] | ||
push: | ||
branches: | ||
- async_beta | ||
workflow_dispatch: | ||
|
||
jobs: | ||
async_beta_build_and_publish_docker_image: | ||
if: github.repository_owner == 'snicker' && (github.event.release.target_commitish == 'async_beta' || github.ref_name == 'async_beta') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: GitHub Context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJSON(github) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
- name: Debug Variables | ||
run: | | ||
echo "github.event_name: ${{ github.event_name }}" | ||
echo "github.ref_name: ${{ github.ref_name }}" | ||
echo "github.event.repository.default_branch: ${{ github.event.repository.default_branch }}" | ||
echo "github.event.release.target_commitish: ${{ github.event.release.target_commitish }}" | ||
echo "github.event.release.prerelease: ${{ github.event.release.prerelease }}" | ||
echo "github.event.release.draft: ${{ github.event.release.draft }}" | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
flavor: | | ||
latest=false | ||
tags: | | ||
type=raw, value=async_beta | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and Push Docker Container | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
FROM python:3.12-slim-bookworm | ||
# WARNING: Do not update python past 3.12.* if telnetlib is still being used. | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/snicker/juicepassproxy | ||
|
||
ENV DEBUG=false | ||
ENV UPDATE_UDPC=false | ||
|
||
RUN pip install --upgrade pip | ||
RUN pip install --root-user-action=ignore --no-cache-dir --upgrade pip | ||
RUN apt-get update && apt-get upgrade -y | ||
RUN apt-get install -y git curl | ||
RUN git clone https://github.com/snicker/juicepassproxy.git /juicepassproxy | ||
RUN pip install --no-cache-dir -r /juicepassproxy/requirements.txt | ||
RUN apt-get install -y tini git curl | ||
RUN mkdir -p /juicepassproxy | ||
RUN mkdir -p /log | ||
RUN mkdir -p /config | ||
COPY * /juicepassproxy | ||
RUN pip install --root-user-action=ignore --no-cache-dir -r /juicepassproxy/requirements.txt | ||
RUN chmod -f +x /juicepassproxy/*.sh | ||
|
||
ENTRYPOINT /juicepassproxy/docker_entrypoint.sh | ||
ENTRYPOINT ["/usr/bin/tini", "--", "/juicepassproxy/docker_entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM python:3.13-rc-slim-bookworm | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/snicker/juicepassproxy | ||
|
||
ENV DEBUG=false | ||
|
||
RUN pip install --root-user-action=ignore --no-cache-dir --upgrade pip | ||
RUN apt-get update && apt-get upgrade -y | ||
RUN apt-get install -y tini git curl | ||
RUN mkdir -p /juicepassproxy | ||
RUN mkdir -p /log | ||
RUN mkdir -p /config | ||
COPY requirements.txt /juicepassproxy | ||
RUN pip install --root-user-action=ignore --no-cache-dir -r /juicepassproxy/requirements.txt | ||
COPY * /juicepassproxy | ||
RUN chmod -f +x /juicepassproxy/*.sh | ||
|
||
#ENTRYPOINT ["/usr/bin/tini", "--", "/juicepassproxy/docker_entrypoint.sh"] | ||
ENTRYPOINT ["/juicepassproxy/docker_entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,47 @@ | ||
CONF_YAML = "juicepassproxy.yaml" | ||
import logging | ||
|
||
# Will auto-update based on GitHub release tag | ||
VERSION = "v0.2.2" | ||
|
||
CONF_YAML = "juicepassproxy.yaml" | ||
|
||
LOGFILE = "juicepassproxy.log" | ||
LOG_FORMAT = "%(asctime)-20s %(levelname)-9s [%(name)s] %(message)s" | ||
LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S" | ||
DEFAULT_LOGLEVEL = logging.INFO | ||
DAYS_TO_KEEP_LOGS = 14 | ||
|
||
# Defaults | ||
DEFAULT_ENELX_SERVER = "juicenet-udp-prod3-usa.enelx.com" | ||
DEFAULT_ENELX_PORT = "8047" | ||
DEFAULT_SRC = "127.0.0.1" | ||
DEFAULT_DST = "54.161.147.91" | ||
DEFAULT_LOCAL_IP = "127.0.0.1" | ||
DEFAULT_ENELX_IP = "54.161.147.91" | ||
DEFAULT_MQTT_HOST = "127.0.0.1" | ||
DEFAULT_MQTT_PORT = "1883" | ||
DEFAULT_MQTT_DISCOVERY_PREFIX = "homeassistant" | ||
DEFAULT_DEVICE_NAME = "JuiceBox" | ||
DEFAULT_TELNET_TIMEOUT = 30 | ||
|
||
# How many times to fully restart JPP before exiting | ||
MAX_JPP_LOOP = 10 | ||
|
||
# Will stop JuiceboxMITM or JuiceboxUDPC Updater if there are more than MAX_ERROR_COUNT handled exceptions within ERROR_LOOKBACK_MIN minutes. | ||
MAX_ERROR_COUNT = 10 | ||
ERROR_LOOKBACK_MIN = 60 | ||
|
||
# How many times to retry connections or sending attempts before failing | ||
MAX_RETRY_ATTEMPT = 3 | ||
|
||
# How many seconds before timing out a UDPC Update | ||
UDPC_UPDATE_CHECK_TIMEOUT = 60 | ||
|
||
# How many seconds before timing out handling a MITM Message | ||
MITM_HANDLER_TIMEOUT = 10 | ||
|
||
# How many seconds to wait to receive a MITM Message before timing out | ||
MITM_RECV_TIMEOUT = 120 | ||
|
||
# How many seconds before timing out sending a MITM Message | ||
MITM_SEND_DATA_TIMEOUT = 10 | ||
|
||
EXTERNAL_DNS = "1.1.1.1" |
Oops, something went wrong.