-
-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into no-more-ssl-wrap-socket
- Loading branch information
Showing
56 changed files
with
1,428 additions
and
320 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,79 @@ | ||
--- | ||
name: base | ||
|
||
on: # yamllint disable-line rule:truthy | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: >- | ||
${{ | ||
github.workflow | ||
}}-${{ | ||
github.event.pull_request.number || github.sha | ||
}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pre-setup: | ||
name: ⚙️ Pre-set global build settings | ||
runs-on: ubuntu-20.04 | ||
defaults: | ||
run: | ||
shell: bash | ||
outputs: | ||
container-platforms: ${{ steps.container.outputs.platforms }} | ||
steps: | ||
- name: Calculate container attributes | ||
id: container | ||
shell: bash | ||
run: >- | ||
PLATFORMS="linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x"; | ||
echo "::set-output name=platforms::$PLATFORMS" | ||
ghcr-base: | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
packages: write | ||
if: success() | ||
needs: | ||
- pre-setup # transitive, for accessing settings | ||
name: 🐳 ghcr:base | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.release-commitish }} | ||
- name: Login to GHCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
# See https://github.com/docker/buildx/issues/850#issuecomment-996408167 | ||
with: | ||
version: v0.7.0 | ||
buildkitd-flags: --debug | ||
config: .github/buildkitd.toml | ||
install: true | ||
- name: Enable Multiarch # This slows down arm build by 4-5x | ||
run: | | ||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
- name: Create builder | ||
run: | | ||
docker buildx create --name proxypybuilder | ||
docker buildx use proxypybuilder | ||
docker buildx inspect | ||
docker buildx ls | ||
- name: Push base to GHCR | ||
run: >- | ||
docker buildx build | ||
--push | ||
--platform ${{ | ||
needs.pre-setup.outputs.container-platforms | ||
}} | ||
-t ghcr.io/abhinavsingh/proxy.py:base | ||
-f DockerfileBase . | ||
... |
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 |
---|---|---|
|
@@ -36,3 +36,5 @@ build | |
|
||
pyreverse.png | ||
profile.svg | ||
*-pre-push | ||
jaxl-api-credentials*.json |
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
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,33 +1,54 @@ | ||
FROM python:3.10-alpine as base | ||
FROM ghcr.io/abhinavsingh/proxy.py:base as builder | ||
|
||
LABEL com.abhinavsingh.name="abhinavsingh/proxy.py" \ | ||
com.abhinavsingh.description="⚡ Fast • 🪶 Lightweight • 0️⃣ Dependency • 🔌 Pluggable • \ | ||
org.opencontainers.image.title="proxy.py" \ | ||
org.opencontainers.image.description="⚡ Fast • 🪶 Lightweight • 0️⃣ Dependency • 🔌 Pluggable • \ | ||
😈 TLS interception • 🔒 DNS-over-HTTPS • 🔥 Poor Man's VPN • ⏪ Reverse & ⏩ Forward • \ | ||
👮🏿 \"Proxy Server\" framework • 🌐 \"Web Server\" framework • ➵ ➶ ➷ ➠ \"PubSub\" framework • \ | ||
👷 \"Work\" acceptor & executor framework" \ | ||
com.abhinavsingh.url="https://github.com/abhinavsingh/proxy.py" \ | ||
com.abhinavsingh.vcs-url="https://github.com/abhinavsingh/proxy.py" \ | ||
org.opencontainers.url="https://github.com/abhinavsingh/proxy.py" \ | ||
org.opencontainers.image.source="https://github.com/abhinavsingh/proxy.py" \ | ||
com.abhinavsingh.docker.cmd="docker run -it --rm -p 8899:8899 abhinavsingh/proxy.py" \ | ||
org.opencontainers.image.source="https://github.com/abhinavsingh/proxy.py" | ||
org.opencontainers.image.licenses="BSD-3-Clause" \ | ||
org.opencontainers.image.authors="Abhinav Singh <[email protected]>" \ | ||
org.opencontainers.image.vendor="Abhinav Singh" | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
|
||
ARG SKIP_OPENSSL | ||
ARG PROXYPY_PKG_PATH | ||
|
||
COPY README.md / | ||
COPY $PROXYPY_PKG_PATH / | ||
|
||
RUN pip install --upgrade pip && \ | ||
pip install \ | ||
# proxy.py itself needs no external dependencies | ||
# Optionally, include openssl to allow | ||
# users to use TLS interception features using Docker | ||
# Use `--build-arg SKIP_OPENSSL=1` to disable openssl installation | ||
RUN /proxy/venv/bin/pip install --no-compile --no-cache-dir \ | ||
-U pip && \ | ||
/proxy/venv/bin/pip install --no-compile --no-cache-dir \ | ||
--no-index \ | ||
--find-links file:/// \ | ||
proxy.py && \ | ||
rm *.whl | ||
|
||
# Use `--build-arg SKIP_OPENSSL=1` to disable openssl installation | ||
RUN if [[ -z "$SKIP_OPENSSL" ]]; then apk update && apk add openssl; fi | ||
rm *.whl && \ | ||
find . -type d -name '__pycache__' | xargs rm -rf && \ | ||
rm -rf /var/cache/apk/* && \ | ||
rm -rf /root/.cache/ && \ | ||
/proxy/venv/bin/pip uninstall -y wheel setuptools pip && \ | ||
/usr/local/bin/pip uninstall -y wheel setuptools pip | ||
|
||
FROM python:3.11-alpine | ||
COPY --from=builder /README.md /README.md | ||
COPY --from=builder /proxy /proxy | ||
RUN if [[ -z "$SKIP_OPENSSL" ]]; then \ | ||
apk update && \ | ||
apk --no-cache add openssl && \ | ||
rm -rf /var/cache/apk/* && \ | ||
rm -rf /root/.cache/; \ | ||
fi | ||
ENV PATH="/proxy/venv/bin:${PATH}" | ||
EXPOSE 8899/tcp | ||
ENTRYPOINT [ "proxy" ] | ||
CMD [ \ | ||
|
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,41 @@ | ||
FROM python:3.11-alpine | ||
|
||
LABEL com.abhinavsingh.name="abhinavsingh/proxy.py" \ | ||
org.opencontainers.image.title="proxy.py" \ | ||
org.opencontainers.image.description="⚡ Fast • 🪶 Lightweight • 0️⃣ Dependency • 🔌 Pluggable • \ | ||
😈 TLS interception • 🔒 DNS-over-HTTPS • 🔥 Poor Man's VPN • ⏪ Reverse & ⏩ Forward • \ | ||
👮🏿 \"Proxy Server\" framework • 🌐 \"Web Server\" framework • ➵ ➶ ➷ ➠ \"PubSub\" framework • \ | ||
👷 \"Work\" acceptor & executor framework" \ | ||
org.opencontainers.url="https://github.com/abhinavsingh/proxy.py" \ | ||
org.opencontainers.image.source="https://github.com/abhinavsingh/proxy.py" \ | ||
com.abhinavsingh.docker.cmd="docker run -it --rm -p 8899:8899 abhinavsingh/proxy.py" \ | ||
org.opencontainers.image.licenses="BSD-3-Clause" \ | ||
org.opencontainers.image.authors="Abhinav Singh <[email protected]>" \ | ||
org.opencontainers.image.vendor="Abhinav Singh" | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
|
||
# Install paramiko and cryptography to allow | ||
# users to use tunneling features using Docker | ||
RUN apk update && apk --no-cache add \ | ||
--virtual .builddeps \ | ||
gcc \ | ||
musl-dev \ | ||
libffi-dev \ | ||
openssl-dev \ | ||
python3-dev \ | ||
cargo \ | ||
rust \ | ||
make | ||
RUN python -m venv /proxy/venv && \ | ||
/proxy/venv/bin/pip install --no-compile --no-cache-dir \ | ||
-U pip wheel && \ | ||
/proxy/venv/bin/pip install --no-compile --no-cache-dir \ | ||
paramiko==3.4.0 \ | ||
cryptography==42.0.4 \ | ||
--prefer-binary && \ | ||
apk del .builddeps && \ | ||
find . -type d -name '__pycache__' | xargs rm -rf && \ | ||
rm -rf /var/cache/apk/* && \ | ||
rm -rf /root/.cache/ |
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
Oops, something went wrong.