Compare commits
3 Commits
v2.8.3
...
macos_arm6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d85c3d5460 | ||
|
|
df395f9a5d | ||
|
|
cac8d30cb4 |
3
.envrc
3
.envrc
@@ -1,3 +0,0 @@
|
|||||||
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="
|
|
||||||
|
|
||||||
use devenv
|
|
||||||
11
.github/dependabot.yml
vendored
11
.github/dependabot.yml
vendored
@@ -1,11 +0,0 @@
|
|||||||
# To get started with Dependabot version updates, you'll need to specify which
|
|
||||||
# package ecosystems to update and where the package manifests are located.
|
|
||||||
# Please see the documentation for all configuration options:
|
|
||||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
||||||
|
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "pip" # See documentation for possible values
|
|
||||||
directory: "/" # Location of package manifests
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
75
.github/workflows/ci.yml
vendored
75
.github/workflows/ci.yml
vendored
@@ -1,75 +0,0 @@
|
|||||||
name: tests
|
|
||||||
|
|
||||||
# https://docs.github.com/de/actions/using-workflows/workflow-syntax-for-github-actions
|
|
||||||
# https://docs.github.com/en/actions/using-workflows
|
|
||||||
# https://docs.github.com/en/actions/learn-github-actions/contexts
|
|
||||||
# https://docs.github.com/en/actions/learn-github-actions/expressions
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths-ignore:
|
|
||||||
- 'docs/**'
|
|
||||||
- '**.md'
|
|
||||||
# pull_request:
|
|
||||||
schedule:
|
|
||||||
# Run daily on default branch
|
|
||||||
- cron: '37 3 * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
python-version: ["3.13", "3.12", "3.11", "3.10", "3.9", "3.8"]
|
|
||||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
|
||||||
# exclude:
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.platform }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: ${{ matrix.python-version }}
|
|
||||||
check-latest: ${{ github.event_name == 'schedule' }}
|
|
||||||
- name: Install zbar shared lib for QReader (Linux)
|
|
||||||
if: runner.os == 'Linux'
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y libzbar0
|
|
||||||
- name: Install zbar shared lib for QReader (macOS)
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
run: |
|
|
||||||
brew install zbar
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -U -r requirements-dev.txt
|
|
||||||
pip install -U .
|
|
||||||
- name: Lint with flake8
|
|
||||||
run: |
|
|
||||||
# stop the build if there are Python syntax errors or undefined names
|
|
||||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
||||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
||||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=200 --statistics
|
|
||||||
- name: Type checking with mypy
|
|
||||||
run: |
|
|
||||||
mypy --install-types --non-interactive src/*.py tests/*.py
|
|
||||||
mypy --strict src/*.py tests/*.py
|
|
||||||
if: matrix.python-version == '3.x' && matrix.platform == 'ubuntu-latest'
|
|
||||||
- name: Test with pytest
|
|
||||||
run: pytest
|
|
||||||
if: (matrix.python-version != '3.x' || matrix.platform != 'ubuntu-latest') && (matrix.python-version != '3.10' && matrix.platform != 'macos-latest')
|
|
||||||
- name: Test with pytest (with code coverage)
|
|
||||||
run: pytest --cov=extract_otp_secrets_test --junitxml=pytest.xml --cov-report=term-missing | tee pytest-coverage.txt
|
|
||||||
if: matrix.python-version == '3.x' && matrix.platform == 'ubuntu-latest'
|
|
||||||
# https://github.com/marketplace/actions/pytest-coverage-comment
|
|
||||||
- name: Pytest coverage comment
|
|
||||||
uses: MishaKav/pytest-coverage-comment@main
|
|
||||||
with:
|
|
||||||
pytest-coverage-path: ./pytest-coverage.txt
|
|
||||||
junitxml-path: ./pytest.xml
|
|
||||||
if: |
|
|
||||||
false && matrix.python-version == '3.x' && matrix.platform == 'ubuntu-latest'
|
|
||||||
&& !contains(github.ref, 'refs/tags/')
|
|
||||||
|
|
||||||
259
.github/workflows/ci_docker.yml
vendored
259
.github/workflows/ci_docker.yml
vendored
@@ -1,259 +0,0 @@
|
|||||||
name: docker
|
|
||||||
|
|
||||||
# https://docs.github.com/de/actions/using-workflows/workflow-syntax-for-github-actions
|
|
||||||
# https://docs.github.com/en/actions/using-workflows
|
|
||||||
# https://docs.github.com/en/actions/learn-github-actions/contexts
|
|
||||||
# https://docs.github.com/en/actions/learn-github-actions/expressions
|
|
||||||
|
|
||||||
# How to setup: https://event-driven.io/en/how_to_buid_and_push_docker_image_with_github_actions/
|
|
||||||
# How to run: https://aschmelyun.com/blog/using-docker-run-inside-of-github-actions/
|
|
||||||
|
|
||||||
on:
|
|
||||||
# run it on push to the default repository branch
|
|
||||||
push:
|
|
||||||
paths-ignore:
|
|
||||||
- 'docs/**'
|
|
||||||
- '**.md'
|
|
||||||
tags-ignore:
|
|
||||||
- '**'
|
|
||||||
# branches is needed if tags-ignore is used
|
|
||||||
branches:
|
|
||||||
- '**'
|
|
||||||
schedule:
|
|
||||||
# Run weekly on default branch
|
|
||||||
- cron: '47 3 * * 6'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-push-docker-debian-image:
|
|
||||||
name: Build Docker Bookworm image and push to repositories
|
|
||||||
# run only when code is compiling and tests are passing
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
# steps to perform in job
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# avoid building if there are testing errors
|
|
||||||
- name: Run smoke test
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y libzbar0
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -U -r requirements-dev.txt
|
|
||||||
pip install -U .
|
|
||||||
pytest
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
# setup Docker build action
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
# Workaround for failing builds: https://github.com/docker/build-push-action/issues/761#issuecomment-1383822381
|
|
||||||
# TODO remove workaround when fixed
|
|
||||||
with:
|
|
||||||
driver-opts: |
|
|
||||||
image=moby/buildkit:v0.10.6
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
if: github.secret_source == 'Actions'
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Login to Github Packages
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
if: github.secret_source == 'Actions'
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GHCR_IO_TOKEN }}
|
|
||||||
|
|
||||||
- name: "Build image and push to Docker Hub and GitHub Container Registry"
|
|
||||||
id: docker_build_qr_reader_latest
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
# relative path to the place where source code with Dockerfile is located
|
|
||||||
# TODO file:, move to docker/
|
|
||||||
context: .
|
|
||||||
file: docker/Dockerfile
|
|
||||||
# builder: ${{ steps.buildx.outputs.name }}
|
|
||||||
# Note: tags has to be all lower-case
|
|
||||||
build-args: |
|
|
||||||
BASE_IMAGE=python:3.13-slim-bookworm
|
|
||||||
pull: true
|
|
||||||
tags: |
|
|
||||||
scit0/extract_otp_secrets:latest
|
|
||||||
scit0/extract_otp_secrets:bookworm
|
|
||||||
ghcr.io/scito/extract_otp_secrets:latest
|
|
||||||
ghcr.io/scito/extract_otp_secrets:bookworm
|
|
||||||
# build on feature branches, push only on master branch
|
|
||||||
push: ${{ github.ref == 'refs/heads/master' && github.secret_source == 'Actions'}}
|
|
||||||
|
|
||||||
- name: Image digest
|
|
||||||
# TODO upload digests to assets
|
|
||||||
run: |
|
|
||||||
echo "extract_otp_secrets digests: ${{ steps.docker_build_qr_reader_latest.outputs.digest }}"
|
|
||||||
echo "${{ steps.docker_build_qr_reader_latest.outputs.digest }}" > digests.txt
|
|
||||||
- name: Save docker digests as artifacts
|
|
||||||
if: github.ref == 'refs/heads/master'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: debian_digests
|
|
||||||
path: digests.txt
|
|
||||||
|
|
||||||
build-and-push-docker-alpine-image:
|
|
||||||
name: Build Docker Alpine image and push to repositories
|
|
||||||
# run only when code is compiling and tests are passing
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
# steps to perform in job
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# avoid building if there are testing errors
|
|
||||||
- name: Run smoke test
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y libzbar0
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -U -r requirements-dev.txt
|
|
||||||
pip install -U .
|
|
||||||
pytest
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
# setup Docker build action
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
if: github.secret_source == 'Actions'
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Login to Github Packages
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
if: github.secret_source == 'Actions'
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GHCR_IO_TOKEN }}
|
|
||||||
|
|
||||||
- name: "only_txt: Build image and push to Docker Hub and GitHub Container Registry"
|
|
||||||
id: docker_build_only_txt
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
# relative path to the place where source code with Dockerfile is located
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
context: .
|
|
||||||
file: docker/Dockerfile_only_txt
|
|
||||||
# builder: ${{ steps.buildx.outputs.name }}
|
|
||||||
# Note: tags has to be all lower-case
|
|
||||||
pull: true
|
|
||||||
tags: |
|
|
||||||
scit0/extract_otp_secrets:only-txt
|
|
||||||
scit0/extract_otp_secrets:alpine
|
|
||||||
ghcr.io/scito/extract_otp_secrets:only-txt
|
|
||||||
ghcr.io/scito/extract_otp_secrets:alpine
|
|
||||||
# build on feature branches, push only on master branch
|
|
||||||
push: ${{ github.ref == 'refs/heads/master' && github.secret_source == 'Actions'}}
|
|
||||||
build-args: |
|
|
||||||
RUN_TESTS=true
|
|
||||||
|
|
||||||
- name: Image digest
|
|
||||||
# TODO upload digests to assets
|
|
||||||
run: |
|
|
||||||
echo "extract_otp_secrets:only-txt digests: ${{ steps.docker_build_only_txt.outputs.digest }}"
|
|
||||||
echo "${{ steps.docker_build_qr_reader_latest.outputs.digest }}" > digests.txt
|
|
||||||
|
|
||||||
- name: Save docker digests as artifacts
|
|
||||||
if: github.ref == 'refs/heads/master'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: alpine_digests
|
|
||||||
path: digests.txt
|
|
||||||
|
|
||||||
build-and-push-docker-bullseye-image:
|
|
||||||
name: Build Docker Bullseye image (for PyInstsaller) and push to repositories
|
|
||||||
# run only when code is compiling and tests are passing
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
# steps to perform in job
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# avoid building if there are testing errors
|
|
||||||
- name: Run smoke test
|
|
||||||
run: |
|
|
||||||
sudo apt-get install -y libzbar0
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -U -r requirements-dev.txt
|
|
||||||
pip install -U .
|
|
||||||
pytest
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
# setup Docker build action
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
# Workaround for failing builds: https://github.com/docker/build-push-action/issues/761#issuecomment-1383822381
|
|
||||||
# TODO remove workaround when fixed
|
|
||||||
with:
|
|
||||||
driver-opts: |
|
|
||||||
image=moby/buildkit:v0.10.6
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
if: github.secret_source == 'Actions'
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Login to Github Packages
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
if: github.secret_source == 'Actions'
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GHCR_IO_TOKEN }}
|
|
||||||
|
|
||||||
- name: "Build image from Bullseye and push to GitHub Container Registry"
|
|
||||||
id: docker_build_bullseye
|
|
||||||
if: github.ref == 'refs/heads/master'
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
# relative path to the place where source code with Dockerfile is located
|
|
||||||
context: .
|
|
||||||
file: docker/Dockerfile
|
|
||||||
# builder: ${{ steps.buildx.outputs.name }}
|
|
||||||
build-args: |
|
|
||||||
BASE_IMAGE=python:3.13-slim-bullseye
|
|
||||||
# Note: tags has to be all lower-case
|
|
||||||
pull: true
|
|
||||||
tags: |
|
|
||||||
scit0/extract_otp_secrets:bullseye
|
|
||||||
push: ${{ github.secret_source == 'Actions' }}
|
|
||||||
|
|
||||||
- name: Image digest
|
|
||||||
# TODO upload digests to assets
|
|
||||||
run: |
|
|
||||||
echo "extract_otp_secrets digests: ${{ steps.docker_build_qr_reader_latest.outputs.digest }}"
|
|
||||||
echo "${{ steps.docker_build_qr_reader_latest.outputs.digest }}" > digests.txt
|
|
||||||
- name: Save docker digests as artifacts
|
|
||||||
if: github.ref == 'refs/heads/master'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: bullseye_digests
|
|
||||||
path: digests.txt
|
|
||||||
435
.github/workflows/ci_release.yml
vendored
435
.github/workflows/ci_release.yml
vendored
@@ -57,7 +57,7 @@ jobs:
|
|||||||
tag_message: ${{ steps.meta.outputs.tag_message }}
|
tag_message: ${{ steps.meta.outputs.tag_message }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Set meta data
|
- name: Set meta data
|
||||||
id: meta
|
id: meta
|
||||||
# Writing to env with >> $GITHUB_ENV is an alternative
|
# Writing to env with >> $GITHUB_ENV is an alternative
|
||||||
@@ -88,136 +88,136 @@ jobs:
|
|||||||
https://api.github.com/repos/scito/extract_otp_secrets/releases \
|
https://api.github.com/repos/scito/extract_otp_secrets/releases \
|
||||||
--silent \
|
--silent \
|
||||||
--show-error \
|
--show-error \
|
||||||
-d '{"tag_name":"${{ github.ref }}","target_commitish":"master","name":"${{ steps.meta.outputs.version }} - ${{ steps.meta.outputs.date }}","body":"${{ steps.meta.outputs.tag_message }}\n\n## Executables\n\nDownload the executable for your platform and execute it, see [README.md](https://github.com/scito/extract_otp_secrets#readme)\n\n | Executable | Description |\n | --- | --- |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_linux_x86_64 | Linux x86_64/amd64 (glibc >= 2.31) |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_linux_arm64 | Linux arm64 (glibc >= 2.31) |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_win_x86_64.exe | Windows x86_64/amd64/x64 |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_win_arm64.exe | N/A |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_macos_x86_64.dmg | N/A, see [README.md](https://github.com/scito/extract_otp_secrets#readme) |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_macos_x86_64.pkg | N/A, see [README.md](https://github.com/scito/extract_otp_secrets#readme) |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_macos_x86_64 | MacOS x86_64/amd64 (bare executable, see [README.md](https://github.com/scito/extract_otp_secrets#readme); optional libzbar must be installed manually, see [README.md](https://github.com/scito/extract_otp_secrets#readme)) |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_macos_arm64 | N/A |\n","draft":true,"prerelease":false,"generate_release_notes":true}')
|
-d '{"tag_name":"${{ github.ref }}","target_commitish":"master","name":"${{ steps.meta.outputs.version }} - ${{ steps.meta.outputs.date }}","body":"${{ steps.meta.outputs.tag_message }}\n\n## Executables\n\nDownload the executable for your platform and execute it, see [README.md](https://github.com/scito/extract_otp_secrets#readme)\n\n | Executable | Description |\n | --- | --- |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_linux_x86_64 | Linux x86_64/amd64 (glibc >= 2.31) |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_linux_arm64 | Linux arm64 (glibc >= 2.31) |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_win_x86_64.exe | Windows x86_64/amd64/x64 |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_win_arm64.exe | N/A |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_macos_x86_64.dmg | N/A, see [README.md](https://github.com/scito/extract_otp_secrets#readme) |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_macos_x86_64.pkg | N/A, see [README.md](https://github.com/scito/extract_otp_secrets#readme) |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_macos_x86_64 | MacOS x86_64/amd64 (bare executable, see [README.md](https://github.com/scito/extract_otp_secrets#readme); optional libzbar must be installed manually, see [README.md](https://github.com/scito/extract_otp_secrets#readme)) |\n | extract_otp_secrets${{ steps.meta.outputs.inline_version }}_macos_arm64 | MacOS Apple Silicon (>= M1) |\n","draft":true,"prerelease":false,"generate_release_notes":true}')
|
||||||
echo upload_url=$(jq '.upload_url' <<< "$response") >> $GITHUB_OUTPUT
|
echo upload_url=$(jq '.upload_url' <<< "$response") >> $GITHUB_OUTPUT
|
||||||
echo $(jq -r '.upload_url' <<< "$response") > release_url.txt
|
echo $(jq -r '.upload_url' <<< "$response") > release_url.txt
|
||||||
echo $(jq -r '.id' <<< "$response") > release_id.txt
|
echo $(jq -r '.id' <<< "$response") > release_id.txt
|
||||||
- name: Save Release URL File for publish
|
- name: Save Release URL File for publish
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: release_url
|
name: release_url
|
||||||
path: release_url.txt
|
path: release_url.txt
|
||||||
- name: Save asset upload id for publish
|
- name: Save asset upload id for publish
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: release_id
|
name: release_id
|
||||||
path: release_id.txt
|
path: release_id.txt
|
||||||
|
|
||||||
build-linux-executable-in-docker:
|
# build-linux-executable-in-docker:
|
||||||
name: Build ${{ matrix.PLATFORM }} release in docker container
|
# name: Build ${{ matrix.PLATFORM }} release in docker container
|
||||||
# run only when code is compiling and tests are passing
|
# # run only when code is compiling and tests are passing
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
needs: create-release
|
# needs: create-release
|
||||||
strategy:
|
# strategy:
|
||||||
matrix:
|
# matrix:
|
||||||
include:
|
# include:
|
||||||
- PLATFORM: linux/amd64
|
# - PLATFORM: linux/amd64
|
||||||
EXE: extract_otp_secrets_linux_x86_64
|
# EXE: extract_otp_secrets_linux_x86_64
|
||||||
ASSET_NAME: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_linux_x86_64
|
# ASSET_NAME: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_linux_x86_64
|
||||||
- PLATFORM: linux/arm64
|
# - PLATFORM: linux/arm64
|
||||||
EXE: extract_otp_secrets_linux_arm64
|
# EXE: extract_otp_secrets_linux_arm64
|
||||||
ASSET_NAME: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_linux_arm64
|
# ASSET_NAME: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_linux_arm64
|
||||||
|
|
||||||
# steps to perform in job
|
# # steps to perform in job
|
||||||
steps:
|
# steps:
|
||||||
- name: Checkout code
|
# - name: Checkout code
|
||||||
uses: actions/checkout@v4
|
# uses: actions/checkout@v3
|
||||||
|
|
||||||
# avoid building if there are testing errors
|
# # avoid building if there are testing errors
|
||||||
- name: Run smoke test
|
# - name: Run smoke test
|
||||||
run: |
|
# run: |
|
||||||
sudo apt-get install -y libzbar0
|
# sudo apt-get install -y libzbar0
|
||||||
python -m pip install --upgrade pip
|
# python -m pip install --upgrade pip
|
||||||
pip install -U -r requirements-dev.txt
|
# pip install -U -r requirements-dev.txt
|
||||||
pip install -U .
|
# pip install -U .
|
||||||
pytest
|
# pytest
|
||||||
|
|
||||||
- name: Set up QEMU
|
# - name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
# uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
# setup Docker build action
|
# # setup Docker build action
|
||||||
- name: Set up Docker Buildx
|
# - name: Set up Docker Buildx
|
||||||
id: buildx
|
# id: buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
# uses: docker/setup-buildx-action@v2
|
||||||
# Workaround for failing builds: https://github.com/docker/build-push-action/issues/761#issuecomment-1383822381
|
# # Workaround for failing builds: https://github.com/docker/build-push-action/issues/761#issuecomment-1383822381
|
||||||
# TODO remove workaround when fixed
|
# # TODO remove workaround when fixed
|
||||||
with:
|
# with:
|
||||||
driver-opts: |
|
# driver-opts: |
|
||||||
image=moby/buildkit:v0.10.6
|
# image=moby/buildkit:v0.10.6
|
||||||
|
|
||||||
- name: Login to DockerHub
|
# - name: Login to DockerHub
|
||||||
uses: docker/login-action@v3
|
# uses: docker/login-action@v2
|
||||||
if: github.secret_source == 'Actions'
|
# if: github.secret_source == 'Actions'
|
||||||
with:
|
# with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
# username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to Github Packages
|
# - name: Login to Github Packages
|
||||||
uses: docker/login-action@v3
|
# uses: docker/login-action@v2
|
||||||
if: github.secret_source == 'Actions'
|
# if: github.secret_source == 'Actions'
|
||||||
with:
|
# with:
|
||||||
registry: ghcr.io
|
# registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
# username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GHCR_IO_TOKEN }}
|
# password: ${{ secrets.GHCR_IO_TOKEN }}
|
||||||
|
|
||||||
- name: Image digest
|
# - name: Image digest
|
||||||
# TODO upload digests to assets
|
# # TODO upload digests to assets
|
||||||
run: |
|
# run: |
|
||||||
echo "extract_otp_secrets: ${{ steps.docker_build_bullseye.outputs.digest }}"
|
# echo "extract_otp_secrets: ${{ steps.docker_build_bullseye.outputs.digest }}"
|
||||||
|
|
||||||
# TODO use local docker image https://stackoverflow.com/a/61155718/1663871
|
# # TODO use local docker image https://stackoverflow.com/a/61155718/1663871
|
||||||
# https://github.com/multiarch/qemu-user-static
|
# # https://github.com/multiarch/qemu-user-static
|
||||||
# https://hub.docker.com/r/multiarch/qemu-user-static/
|
# # https://hub.docker.com/r/multiarch/qemu-user-static/
|
||||||
- name: Run Pyinstaller in container for ${{ matrix.EXE }}
|
# - name: Run Pyinstaller in container for ${{ matrix.EXE }}
|
||||||
run: |
|
# run: |
|
||||||
docker run --pull always --rm --privileged multiarch/qemu-user-static --reset -p yes
|
# docker run --pull always --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
docker run --platform ${{ matrix.PLATFORM }} --pull always --entrypoint /bin/bash --rm -v "$(pwd)":/files -w /files scit0/extract_otp_secrets:bullseye -c 'apt-get update && apt-get -y install binutils && pip install -U -r /files/requirements.txt && pip install pyinstaller && PYTHONHASHSEED=31 && pyinstaller -y --add-data /usr/local/__yolo_v3_qr_detector/:__yolo_v3_qr_detector/ --onefile --name ${{ matrix.EXE }} --distpath /files/dist/ /files/src/extract_otp_secrets.py'
|
# docker run --platform ${{ matrix.PLATFORM }} --pull always --entrypoint /bin/bash --rm -v "$(pwd)":/files -w /files scit0/extract_otp_secrets:bullseye -c 'apt-get update && apt-get -y install binutils && pip install -U -r /files/requirements.txt && pip install pyinstaller && PYTHONHASHSEED=31 && pyinstaller -y --add-data /usr/local/__yolo_v3_qr_detector/:__yolo_v3_qr_detector/ --onefile --name ${{ matrix.EXE }} --distpath /files/dist/ /files/src/extract_otp_secrets.py'
|
||||||
|
|
||||||
- name: Smoke tests linux/amd64
|
# - name: Smoke tests linux/amd64
|
||||||
if: matrix.PLATFORM == 'linux/amd64'
|
# if: matrix.PLATFORM == 'linux/amd64'
|
||||||
run: |
|
# run: |
|
||||||
dist/${{ matrix.EXE }} -V
|
# dist/${{ matrix.EXE }} -V
|
||||||
dist/${{ matrix.EXE }} -h
|
# dist/${{ matrix.EXE }} -h
|
||||||
dist/${{ matrix.EXE }} --debug
|
# dist/${{ matrix.EXE }} --debug
|
||||||
dist/${{ matrix.EXE }} example_export.png
|
# dist/${{ matrix.EXE }} example_export.png
|
||||||
dist/${{ matrix.EXE }} - < example_export.txt
|
# dist/${{ matrix.EXE }} - < example_export.txt
|
||||||
dist/${{ matrix.EXE }} --qr ZBAR example_export.png
|
# dist/${{ matrix.EXE }} --qr ZBAR example_export.png
|
||||||
dist/${{ matrix.EXE }} --qr QREADER example_export.png
|
# dist/${{ matrix.EXE }} --qr QREADER example_export.png
|
||||||
dist/${{ matrix.EXE }} --qr QREADER_DEEP example_export.png
|
# dist/${{ matrix.EXE }} --qr QREADER_DEEP example_export.png
|
||||||
dist/${{ matrix.EXE }} --qr CV2 example_export.png
|
# dist/${{ matrix.EXE }} --qr CV2 example_export.png
|
||||||
dist/${{ matrix.EXE }} --qr CV2_WECHAT example_export.png
|
# dist/${{ matrix.EXE }} --qr CV2_WECHAT example_export.png
|
||||||
- name: Smoke tests linux/arm64
|
# - name: Smoke tests linux/arm64
|
||||||
if: matrix.PLATFORM == 'linux/arm64'
|
# if: matrix.PLATFORM == 'linux/arm64'
|
||||||
run: |
|
# run: |
|
||||||
docker run --platform ${{ matrix.PLATFORM }} --pull always --entrypoint /bin/bash --rm -v "$(pwd)":/files -w /files scit0/extract_otp_secrets -c 'dist/${{ matrix.EXE }} -V && dist/${{ matrix.EXE }} -h && dist/${{ matrix.EXE }} example_export.png && dist/${{ matrix.EXE }} - < example_export.txt && dist/${{ matrix.EXE }} --qr ZBAR example_export.png && dist/${{ matrix.EXE }} --qr QREADER example_export.png && dist/${{ matrix.EXE }} --qr QREADER_DEEP example_export.png && dist/${{ matrix.EXE }} --qr CV2 example_export.png && dist/${{ matrix.EXE }} --qr CV2_WECHAT example_export.png'
|
# docker run --platform ${{ matrix.PLATFORM }} --pull always --entrypoint /bin/bash --rm -v "$(pwd)":/files -w /files scit0/extract_otp_secrets -c 'dist/${{ matrix.EXE }} -V && dist/${{ matrix.EXE }} -h && dist/${{ matrix.EXE }} example_export.png && dist/${{ matrix.EXE }} - < example_export.txt && dist/${{ matrix.EXE }} --qr ZBAR example_export.png && dist/${{ matrix.EXE }} --qr QREADER example_export.png && dist/${{ matrix.EXE }} --qr QREADER_DEEP example_export.png && dist/${{ matrix.EXE }} --qr CV2 example_export.png && dist/${{ matrix.EXE }} --qr CV2_WECHAT example_export.png'
|
||||||
- name: Load Release URL File from release job
|
# - name: Load Release URL File from release job
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
# if: startsWith(github.ref, 'refs/tags/v')
|
||||||
uses: actions/download-artifact@v4
|
# uses: actions/download-artifact@v3
|
||||||
with:
|
# with:
|
||||||
name: release_url
|
# name: release_url
|
||||||
- name: Display structure of files
|
# - name: Display structure of files
|
||||||
run: ls -R
|
# run: ls -R
|
||||||
- name: Upload EXE to artifacts
|
# - name: Upload EXE to artifacts
|
||||||
uses: actions/upload-artifact@v4
|
# uses: actions/upload-artifact@v3
|
||||||
with:
|
# with:
|
||||||
name: ${{ matrix.EXE }}
|
# name: ${{ matrix.EXE }}
|
||||||
path: dist/${{ matrix.EXE }}
|
# path: dist/${{ matrix.EXE }}
|
||||||
- name: Upload Release Asset
|
# - name: Upload Release Asset
|
||||||
id: upload-release-asset
|
# id: upload-release-asset
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
# if: startsWith(github.ref, 'refs/tags/v')
|
||||||
run: |
|
# run: |
|
||||||
response=$(curl \
|
# response=$(curl \
|
||||||
-X POST \
|
# -X POST \
|
||||||
-H "Accept: application/vnd.github+json" \
|
# -H "Accept: application/vnd.github+json" \
|
||||||
-H "Content-Type: application/x-executable" \
|
# -H "Content-Type: application/x-executable" \
|
||||||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\
|
# -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"\
|
||||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
# -H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
--silent \
|
# --silent \
|
||||||
--show-error \
|
# --show-error \
|
||||||
--data-binary @dist/${{ matrix.EXE }} \
|
# --data-binary @dist/${{ matrix.EXE }} \
|
||||||
$(cat release_url.txt)=${{ matrix.ASSET_NAME }})
|
# $(cat release_url.txt)=${{ matrix.ASSET_NAME }})
|
||||||
|
|
||||||
build-native-executables:
|
build-native-executables:
|
||||||
name: Build native packages
|
name: Build native packages
|
||||||
@@ -227,41 +227,52 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners
|
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners
|
||||||
include:
|
include:
|
||||||
- os: windows-latest
|
# - os: windows-latest
|
||||||
TARGET: windows
|
# TARGET: windows
|
||||||
# TODO add --icon
|
# # TODO add --icon
|
||||||
# TODO add --manifest
|
# # TODO add --manifest
|
||||||
# TODO find more elegant solution for pyzbar\libiconv.dll and pyzbar\libzbar-64.dll
|
# # TODO find more elegant solution for pyzbar\libiconv.dll and pyzbar\libzbar-64.dll
|
||||||
# Files of Visual C++ 2013 Redistributable Package: https://support.microsoft.com/en-us/topic/update-for-visual-c-2013-redistributable-package-d8ccd6a5-4e26-c290-517b-8da6cfdf4f10
|
# # Files of Visual C++ 2013 Redistributable Package: https://support.microsoft.com/en-us/topic/update-for-visual-c-2013-redistributable-package-d8ccd6a5-4e26-c290-517b-8da6cfdf4f10
|
||||||
EXE: extract_otp_secrets.exe
|
# EXE: extract_otp_secrets.exe
|
||||||
ASSET_NAME: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_win_x86_64.exe
|
# ASSET_NAME: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_win_x86_64.exe
|
||||||
ASSET_MIME: application/vnd.microsoft.portable-executable
|
# ASSET_MIME: application/vnd.microsoft.portable-executable
|
||||||
UPLOAD: true
|
|
||||||
CMD_BUILD: |
|
|
||||||
pyinstaller -y --add-data "$($Env:pythonLocation)\__yolo_v3_qr_detector:__yolo_v3_qr_detector" --add-binary "$($Env:pythonLocation)\Lib\site-packages\pyzbar\libiconv.dll:pyzbar" --add-binary "$($Env:pythonLocation)\Lib\site-packages\pyzbar\libzbar-64.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\msvcr120.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\msvcp120.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\vcamp120.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\vcomp120.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\vccorlib120.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120u.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120chs.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120cht.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120deu.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120enu.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120esn.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120fra.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120ita.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120jpn.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120kor.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120rus.dll:pyzbar" --onefile --version-file build\win_file_version_info.txt --name extract_otp_secrets.exe src\extract_otp_secrets.py
|
|
||||||
- os: ubuntu-latest
|
|
||||||
TARGET: linux
|
|
||||||
EXE: extract_otp_secrets_ubuntu
|
|
||||||
ASSET_NAME: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_linux_x86_64_ubuntu_latest
|
|
||||||
ASSET_MIME: application/x-executable
|
|
||||||
UPLOAD: false
|
|
||||||
CMD_BUILD: |
|
|
||||||
pyinstaller -y --add-data $pythonLocation/__yolo_v3_qr_detector/:__yolo_v3_qr_detector/ --onefile --name extract_otp_secrets_ubuntu src/extract_otp_secrets.py
|
|
||||||
# TODO temp disable macos releases to due
|
|
||||||
# FileNotFoundError: Icon input file /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/PyInstaller/bootloader/images/icon-windowed.icns not found
|
|
||||||
# - os: macos-12
|
|
||||||
# TARGET: macos
|
|
||||||
# # https://pyinstaller.org/en/stable/spec-files.html#spec-file-options-for-a-macos-bundle
|
|
||||||
# EXE: extract_otp_secrets
|
|
||||||
# ASSET_NAME: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_macos_x86_64
|
|
||||||
# DMG: extract_otp_secrets.dmg
|
|
||||||
# ASSET_NAME_DMG: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_macos_x86_64.dmg
|
|
||||||
# ASSET_MIME: application/octet-stream
|
|
||||||
# UPLOAD: true
|
# UPLOAD: true
|
||||||
# CMD_BUILD: |
|
# CMD_BUILD: |
|
||||||
# VERSION_STR=$(setuptools-git-versioning) COPYRIGHT_YEARS='2020-2023' envsubst < installer/extract_otp_secrets_macos_template.spec > extract_otp_secrets_macos.spec
|
# pyinstaller -y --add-data "$($Env:pythonLocation)\__yolo_v3_qr_detector:__yolo_v3_qr_detector" --add-binary "$($Env:pythonLocation)\Lib\site-packages\pyzbar\libiconv.dll:pyzbar" --add-binary "$($Env:pythonLocation)\Lib\site-packages\pyzbar\libzbar-64.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\msvcr120.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\msvcp120.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\vcamp120.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\vcomp120.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\vccorlib120.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120u.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120chs.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120cht.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120deu.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120enu.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120esn.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120fra.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120ita.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120jpn.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120kor.dll:pyzbar" --add-binary "$($Env:WinDir)\system32\mfc120rus.dll:pyzbar" --onefile --version-file build\win_file_version_info.txt --name extract_otp_secrets.exe src\extract_otp_secrets.py
|
||||||
# pyinstaller -y extract_otp_secrets_macos.spec
|
- os: macos-12
|
||||||
# installer/build_dmg.sh
|
TARGET: macos
|
||||||
|
# https://pyinstaller.org/en/stable/spec-files.html#spec-file-options-for-a-macos-bundle
|
||||||
|
EXE: extract_otp_secrets
|
||||||
|
ASSET_NAME: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_macos_x86_64
|
||||||
|
DMG: extract_otp_secrets.dmg
|
||||||
|
ASSET_NAME_DMG: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_macos_x86_64.dmg
|
||||||
|
ASSET_MIME: application/octet-stream
|
||||||
|
UPLOAD: true
|
||||||
|
CMD_BUILD: |
|
||||||
|
VERSION_STR=$(setuptools-git-versioning) COPYRIGHT_YEARS='2020-2024' envsubst < installer/extract_otp_secrets_macos_template.spec > extract_otp_secrets_macos.spec
|
||||||
|
pyinstaller -y extract_otp_secrets_macos.spec
|
||||||
|
installer/build_dmg.sh
|
||||||
|
- os: macos-14
|
||||||
|
TARGET: macos
|
||||||
|
# https://pyinstaller.org/en/stable/spec-files.html#spec-file-options-for-a-macos-bundle
|
||||||
|
EXE: extract_otp_secrets
|
||||||
|
ASSET_NAME: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_macos_arm64
|
||||||
|
DMG: extract_otp_secrets.dmg
|
||||||
|
ASSET_NAME_DMG: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_macos_arm64.dmg
|
||||||
|
ASSET_MIME: application/octet-stream
|
||||||
|
UPLOAD: true
|
||||||
|
CMD_BUILD: |
|
||||||
|
VERSION_STR=$(setuptools-git-versioning) COPYRIGHT_YEARS='2020-2024' envsubst < installer/extract_otp_secrets_macos_template.spec > extract_otp_secrets_macos.spec
|
||||||
|
pyinstaller -y extract_otp_secrets_macos.spec
|
||||||
|
installer/build_dmg.sh
|
||||||
|
# - os: ubuntu-latest
|
||||||
|
# TARGET: linux
|
||||||
|
# EXE: extract_otp_secrets_ubuntu
|
||||||
|
# ASSET_NAME: extract_otp_secrets${{ needs.create-release.outputs.inline_version }}_linux_x86_64_ubuntu_latest
|
||||||
|
# ASSET_MIME: application/x-executable
|
||||||
|
# UPLOAD: false
|
||||||
|
# CMD_BUILD: |
|
||||||
|
# pyinstaller -y --add-data $pythonLocation/__yolo_v3_qr_detector/:__yolo_v3_qr_detector/ --onefile --name extract_otp_secrets_ubuntu src/extract_otp_secrets.py
|
||||||
steps:
|
steps:
|
||||||
- name: Output path
|
- name: Output path
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
@@ -269,14 +280,11 @@ jobs:
|
|||||||
- name: List Windir
|
- name: List Windir
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
run: ls "$($Env:WinDir)\system32"
|
run: ls "$($Env:WinDir)\system32"
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: Set macos macos_python_path
|
- name: Set up Python 3.12
|
||||||
# TODO use variable for Python version
|
uses: actions/setup-python@v4
|
||||||
run: echo "macos_python_path=/Library/Frameworks/Python.framework/Versions/3.13" >> $GITHUB_ENV
|
|
||||||
- name: Set up Python 3.13
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
with:
|
||||||
python-version: 3.13
|
python-version: 3.12
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- name: Install zbar shared lib for QReader (Linux)
|
- name: Install zbar shared lib for QReader (Linux)
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
@@ -285,7 +293,28 @@ jobs:
|
|||||||
- name: Install zbar shared lib for QReader (macOS)
|
- name: Install zbar shared lib for QReader (macOS)
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
run: |
|
run: |
|
||||||
|
# https://earthly.dev/blog/homebrew-on-m1/
|
||||||
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||||
brew install zbar create-dmg
|
brew install zbar create-dmg
|
||||||
|
- name: List MacOS dirs
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
run: |
|
||||||
|
echo "ls /opt/homebrew/Cellar/zbar"
|
||||||
|
ls -al "/opt/homebrew/Cellar/zbar"
|
||||||
|
echo "ls /opt/homebrew/Cellar/zbar/0.23.93"
|
||||||
|
ls -al "/opt/homebrew/Cellar/zbar/0.23.93"
|
||||||
|
echo /opt/homebrew/lib
|
||||||
|
ls -al /opt/homebrew/lib
|
||||||
|
echo PATH
|
||||||
|
echo $PATH
|
||||||
|
echo HOMEBREW_CELLAR
|
||||||
|
echo $HOMEBREW_CELLAR
|
||||||
|
echo brew deps --tree --installed
|
||||||
|
brew deps --tree --installed
|
||||||
|
- name: List env
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
run: |
|
||||||
|
set
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
# TODO fix --use-pep517
|
# TODO fix --use-pep517
|
||||||
run: |
|
run: |
|
||||||
@@ -319,12 +348,12 @@ jobs:
|
|||||||
dist/${{ matrix.EXE }} - < example_export.txt
|
dist/${{ matrix.EXE }} - < example_export.txt
|
||||||
- name: Load Release URL File from release job
|
- name: Load Release URL File from release job
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: release_url
|
name: release_url
|
||||||
- name: Load Release Id File from release job
|
- name: Load Release Id File from release job
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: release_id
|
name: release_id
|
||||||
- name: Display structure of files
|
- name: Display structure of files
|
||||||
@@ -337,12 +366,12 @@ jobs:
|
|||||||
echo "release_id=$(cat release_id.txt)" >> $GITHUB_OUTPUT
|
echo "release_id=$(cat release_id.txt)" >> $GITHUB_OUTPUT
|
||||||
echo "upload_url=https://uploads.github.com/repos/scito/extract_otp_secrets/releases/$(cat release_id.txt)/assets?name=" >> $GITHUB_OUTPUT
|
echo "upload_url=https://uploads.github.com/repos/scito/extract_otp_secrets/releases/$(cat release_id.txt)/assets?name=" >> $GITHUB_OUTPUT
|
||||||
- name: Upload EXE to artifacts
|
- name: Upload EXE to artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.EXE }}
|
name: ${{ matrix.EXE }}
|
||||||
path: dist/${{ matrix.EXE }}
|
path: dist/${{ matrix.EXE }}
|
||||||
- name: Upload DMG to artifacts
|
- name: Upload DMG to artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.DMG }}
|
name: ${{ matrix.DMG }}
|
||||||
@@ -358,55 +387,55 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
curl -X POST -H "Accept: application/vnd.github+json" -H "Content-Type: ${{ matrix.ASSET_MIME }}" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" --show-error --data-binary @dist/${{ matrix.DMG }} ${{ steps.meta.outputs.upload_url }}=${{ matrix.ASSET_NAME_DMG }}
|
curl -X POST -H "Accept: application/vnd.github+json" -H "Content-Type: ${{ matrix.ASSET_MIME }}" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" --show-error --data-binary @dist/${{ matrix.DMG }} ${{ steps.meta.outputs.upload_url }}=${{ matrix.ASSET_NAME_DMG }}
|
||||||
|
|
||||||
upload-hashes:
|
# upload-hashes:
|
||||||
name: Upload hashes
|
# name: Upload hashes
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
# if: startsWith(github.ref, 'refs/tags/v')
|
||||||
needs:
|
# needs:
|
||||||
- build-linux-executable-in-docker
|
# - build-linux-executable-in-docker
|
||||||
- build-native-executables
|
# - build-native-executables
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
steps:
|
# steps:
|
||||||
- name: Load Release Id File from release job
|
# - name: Load Release Id File from release job
|
||||||
uses: actions/download-artifact@v4
|
# uses: actions/download-artifact@v3
|
||||||
with:
|
# with:
|
||||||
name: release_id
|
# name: release_id
|
||||||
- name: Set meta data
|
# - name: Set meta data
|
||||||
id: meta
|
# id: meta
|
||||||
run: |
|
# run: |
|
||||||
echo "release_id=$(cat release_id.txt)" >> $GITHUB_OUTPUT
|
# echo "release_id=$(cat release_id.txt)" >> $GITHUB_OUTPUT
|
||||||
echo "upload_url=https://uploads.github.com/repos/scito/extract_otp_secrets/releases/$(cat release_id.txt)/assets?name=" >> $GITHUB_OUTPUT
|
# echo "upload_url=https://uploads.github.com/repos/scito/extract_otp_secrets/releases/$(cat release_id.txt)/assets?name=" >> $GITHUB_OUTPUT
|
||||||
- name: Calculate and upload hashes from assets
|
# - name: Calculate and upload hashes from assets
|
||||||
run: |
|
# run: |
|
||||||
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
|
# GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
|
||||||
for asset_url in $(curl \
|
# for asset_url in $(curl \
|
||||||
-H "Accept: application/vnd.github+json" \
|
# -H "Accept: application/vnd.github+json" \
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"\
|
# -H "Authorization: Bearer $GITHUB_TOKEN"\
|
||||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
# -H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
--silent \
|
# --silent \
|
||||||
--show-error \
|
# --show-error \
|
||||||
https://api.github.com/repos/scito/extract_otp_secrets/releases/${{ steps.meta.outputs.release_id }}/assets |
|
# https://api.github.com/repos/scito/extract_otp_secrets/releases/${{ steps.meta.outputs.release_id }}/assets |
|
||||||
jq -r '.[].url'); do
|
# jq -r '.[].url'); do
|
||||||
echo "Download $asset_url"
|
# echo "Download $asset_url"
|
||||||
name=$(curl \
|
# name=$(curl \
|
||||||
-H "Accept: application/vnd.github+json" \
|
# -H "Accept: application/vnd.github+json" \
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"\
|
# -H "Authorization: Bearer $GITHUB_TOKEN"\
|
||||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
# -H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
--output-dir assets \
|
# --output-dir assets \
|
||||||
-L \
|
# -L \
|
||||||
$asset_url |
|
# $asset_url |
|
||||||
jq -r '.name')
|
# jq -r '.name')
|
||||||
curl \
|
# curl \
|
||||||
-H "Accept: application/octet-stream" \
|
# -H "Accept: application/octet-stream" \
|
||||||
-H "Authorization: Bearer $GITHUB_TOKEN"\
|
# -H "Authorization: Bearer $GITHUB_TOKEN"\
|
||||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
# -H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
--create-dirs \
|
# --create-dirs \
|
||||||
--output-dir assets \
|
# --output-dir assets \
|
||||||
-L \
|
# -L \
|
||||||
-o $name \
|
# -o $name \
|
||||||
$asset_url
|
# $asset_url
|
||||||
done
|
# done
|
||||||
(cd assets/ && sha256sum * > ../sha256_hashes.txt)
|
# (cd assets/ && sha256sum * > ../sha256_hashes.txt)
|
||||||
curl -X POST -H "Accept: application/vnd.github+json" -H "Content-Type: text/plain" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" --show-error --data-binary @sha256_hashes.txt ${{ steps.meta.outputs.upload_url }}=sha256_hashes.txt
|
# curl -X POST -H "Accept: application/vnd.github+json" -H "Content-Type: text/plain" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" --show-error --data-binary @sha256_hashes.txt ${{ steps.meta.outputs.upload_url }}=sha256_hashes.txt
|
||||||
|
|
||||||
(cd assets/ && sha512sum * > ../sha512_hashes.txt)
|
# (cd assets/ && sha512sum * > ../sha512_hashes.txt)
|
||||||
curl -X POST -H "Accept: application/vnd.github+json" -H "Content-Type: text/plain" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" --show-error --data-binary @sha512_hashes.txt ${{ steps.meta.outputs.upload_url }}=sha512_hashes.txt
|
# curl -X POST -H "Accept: application/vnd.github+json" -H "Content-Type: text/plain" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" --show-error --data-binary @sha512_hashes.txt ${{ steps.meta.outputs.upload_url }}=sha512_hashes.txt
|
||||||
|
|||||||
74
.github/workflows/codeql-analysis.yml
vendored
74
.github/workflows/codeql-analysis.yml
vendored
@@ -1,74 +0,0 @@
|
|||||||
# For most projects, this workflow file will not need changing; you simply need
|
|
||||||
# to commit it to your repository.
|
|
||||||
#
|
|
||||||
# You may wish to alter this file to override the set of languages analyzed,
|
|
||||||
# or to provide custom queries or build logic.
|
|
||||||
#
|
|
||||||
# ******** NOTE ********
|
|
||||||
# We have attempted to detect the languages in your repository. Please check
|
|
||||||
# the `language` matrix defined below to confirm you have the correct set of
|
|
||||||
# supported CodeQL languages.
|
|
||||||
#
|
|
||||||
name: "CodeQL"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "master" ]
|
|
||||||
pull_request:
|
|
||||||
# The branches below must be a subset of the branches above
|
|
||||||
branches: [ "master" ]
|
|
||||||
schedule:
|
|
||||||
- cron: '25 19 * * 0'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analyze:
|
|
||||||
name: Analyze
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
language: [ 'python' ]
|
|
||||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
|
||||||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@v3
|
|
||||||
with:
|
|
||||||
languages: ${{ matrix.language }}
|
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
||||||
# By default, queries listed here will override any specified in a config file.
|
|
||||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
||||||
|
|
||||||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
||||||
# queries: security-extended,security-and-quality
|
|
||||||
|
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
|
||||||
- name: Autobuild
|
|
||||||
uses: github/codeql-action/autobuild@v3
|
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
|
||||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
||||||
|
|
||||||
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
|
||||||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
|
||||||
|
|
||||||
# - run: |
|
|
||||||
# echo "Run, Build Application using script"
|
|
||||||
# ./location_of_script_within_repo/buildscript.sh
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@v3
|
|
||||||
with:
|
|
||||||
category: "/language:${{matrix.language}}"
|
|
||||||
9
.gitignore
vendored
9
.gitignore
vendored
@@ -35,12 +35,3 @@ extract_otp_secrets.build/
|
|||||||
extract_otp_secrets.dist/
|
extract_otp_secrets.dist/
|
||||||
extract_otp_secrets.onefile-build/
|
extract_otp_secrets.onefile-build/
|
||||||
extract_otp_secrets.bin
|
extract_otp_secrets.bin
|
||||||
# Devenv
|
|
||||||
.devenv*
|
|
||||||
devenv.local.nix
|
|
||||||
|
|
||||||
# direnv
|
|
||||||
.direnv
|
|
||||||
|
|
||||||
# pre-commit
|
|
||||||
.pre-commit-config.yaml
|
|
||||||
|
|||||||
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -2,7 +2,7 @@
|
|||||||
"python.testing.pytestArgs": [
|
"python.testing.pytestArgs": [
|
||||||
"."
|
"."
|
||||||
],
|
],
|
||||||
"python.testing.unittestEnabled": false,
|
"python.testing.unittestEnabled": true,
|
||||||
"python.testing.pytestEnabled": true,
|
"python.testing.pytestEnabled": true,
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
"devbox",
|
"devbox",
|
||||||
|
|||||||
847
Pipfile.lock
generated
847
Pipfile.lock
generated
File diff suppressed because it is too large
Load Diff
50
README.md
50
README.md
@@ -5,7 +5,7 @@
|
|||||||

|

|
||||||
[](https://github.com/scito/extract_otp_secrets/blob/master/LICENSE)
|
[](https://github.com/scito/extract_otp_secrets/blob/master/LICENSE)
|
||||||
[](https://github.com/scito/extract_otp_secrets/releases/latest)
|
[](https://github.com/scito/extract_otp_secrets/releases/latest)
|
||||||

|

|
||||||
[](https://hub.docker.com/repository/docker/scit0/extract_otp_secrets/general)
|
[](https://hub.docker.com/repository/docker/scit0/extract_otp_secrets/general)
|
||||||
[](https://github.com/scito/extract_otp_secrets/releases/latest)
|
[](https://github.com/scito/extract_otp_secrets/releases/latest)
|
||||||
[](https://github.com/scito/extract_otp_secrets/releases/latest)
|
[](https://github.com/scito/extract_otp_secrets/releases/latest)
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
[](https://stand-with-ukraine.pp.ua)
|
[](https://stand-with-ukraine.pp.ua)
|
||||||
<!-- 
|
<!-- 
|
||||||
[](https://github.com/scito/extract_otp_secrets/blob/master/Pipfile.lock)
|
[](https://github.com/scito/extract_otp_secrets/blob/master/Pipfile.lock)
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- [](https://GitHub.com/scito/extract_otp_secrets/releases/) -->
|
<!-- [](https://GitHub.com/scito/extract_otp_secrets/releases/) -->
|
||||||
|
|
||||||
@@ -121,21 +121,13 @@ However, the bare executable can be executed from the command line:
|
|||||||
3. Change to Downloads folder in Terminal: `cd $HOME/Downloads`
|
3. Change to Downloads folder in Terminal: `cd $HOME/Downloads`
|
||||||
4. Remove quarantine bit for the downloaded file: `xattr -r -d com.apple.quarantine extract_otp_secrets_X.Y.Z_macos_x86_64`
|
4. Remove quarantine bit for the downloaded file: `xattr -r -d com.apple.quarantine extract_otp_secrets_X.Y.Z_macos_x86_64`
|
||||||
5. Set executable bit for the downloaded file: `chmod +x extract_otp_secrets_X.Y.Z_macos_x86_64`
|
5. Set executable bit for the downloaded file: `chmod +x extract_otp_secrets_X.Y.Z_macos_x86_64`
|
||||||
6. Start executable from command line for the first time: `./extract_otp_secrets_X.Y.Z_macos_x86_64`
|
6. Start executable from command line: `./extract_otp_secrets_X.Y.Z_macos_x86_64`
|
||||||
7. Wait approximately 30 seconds to 1 minute on the first run. Terminal will display the following error:
|
|
||||||
```
|
|
||||||
OpenCV: not authorized to capture video (status 0), requesting...
|
|
||||||
OpenCV: camera failed to properly initialize!
|
|
||||||
```
|
|
||||||
8. macOS will then prompt to request camera access.
|
|
||||||
9. After allowing camera access, rerun the program.
|
|
||||||
10. On the second run, the GUI prompt shows correctly and is fully operable: `./extract_otp_secrets_X.Y.Z_macos_x86_64`
|
|
||||||
|
|
||||||
:information_source: Replace `X.Y.Z` in above commands with the version number of your downloaded file, e.g. `extract_otp_secrets_2.4.0_macos_x86_64`
|
:information_source: Replace `X.Y.Z` in above commands with the version number of your downloaded file, e.g. `extract_otp_secrets_2.4.0_macos_x86_64`
|
||||||
|
|
||||||
:information_source: If Rosetta2 emulation is installed, these steps work also for M1 and M2 Apple Silicon processors and the program can be executed directly.
|
:information_source: If Rosetta2 emulation is installed, these steps work also for M1 and M2 Apple Silicon processors and the program can be executed directly.
|
||||||
|
|
||||||
Tested with extract_otp_secrets_2.8.1_macos_x86_64 on macOS Sequoia 15.1 beta. Source: [#283](https://github.com/scito/extract_otp_secrets/issues/283)
|
> :warning: It seems the GUI mode is not working in Terminal on macOS. In tests no [GUI window](#usage) was opened. (Remarks and hints about macOS are welcome since I do not know macOS.)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -243,7 +235,7 @@ OpenCV requires [Visual C++ redistributable 2015](https://www.microsoft.com/en-u
|
|||||||
|
|
||||||
## Program help: arguments and options
|
## Program help: arguments and options
|
||||||
|
|
||||||
<pre>usage: extract_otp_secrets.py [-h] [--csv FILE] [--keepass FILE] [--json FILE] [--txt FILE] [--urls FILE] [--printqr] [--saveqr DIR] [--camera NUMBER] [--qr {ZBAR,QREADER,QREADER_DEEP,CV2,CV2_WECHAT}] [-i] [--no-color] [--version] [-d | -v | -q] [infile ...]
|
<pre>usage: extract_otp_secrets.py [-h] [--csv FILE] [--keepass FILE] [--json FILE] [--txt FILE] [--printqr] [--saveqr DIR] [--camera NUMBER] [--qr {ZBAR,QREADER,QREADER_DEEP,CV2,CV2_WECHAT}] [-i] [--no-color] [--version] [-d | -v | -q] [infile ...]
|
||||||
|
|
||||||
Extracts one time password (OTP) secrets from QR codes exported by two-factor authentication (2FA) apps
|
Extracts one time password (OTP) secrets from QR codes exported by two-factor authentication (2FA) apps
|
||||||
If no infiles are provided, a GUI window starts and QR codes are captured from the camera.
|
If no infiles are provided, a GUI window starts and QR codes are captured from the camera.
|
||||||
@@ -254,11 +246,10 @@ positional arguments:
|
|||||||
|
|
||||||
options:
|
options:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
--csv FILE, -c FILE export csv file, or - for stdout
|
--csv FILE, -c FILE export csv file or - for stdout
|
||||||
--keepass FILE, -k FILE export totp/hotp csv file(s) for KeePass, - for stdout
|
--keepass FILE, -k FILE export totp/hotp csv file(s) for KeePass, - for stdout
|
||||||
--json FILE, -j FILE export json file or - for stdout
|
--json FILE, -j FILE export json file or - for stdout
|
||||||
--txt FILE, -t FILE export txt file or - for stdout
|
--txt FILE, -t FILE export txt file or - for stdout
|
||||||
--urls FILE, -u FILE export file with list of otpauth urls, or - for stdout
|
|
||||||
--printqr, -p print QR code(s) as text to the terminal
|
--printqr, -p print QR code(s) as text to the terminal
|
||||||
--saveqr DIR, -s DIR save QR code(s) as images to directory
|
--saveqr DIR, -s DIR save QR code(s) as images to directory
|
||||||
--camera NUMBER, -C NUMBER camera number of system (default camera: 0)
|
--camera NUMBER, -C NUMBER camera number of system (default camera: 0)
|
||||||
@@ -363,6 +354,9 @@ python extract_otp_secrets.py = < example_export.png</pre>
|
|||||||
* extract_otp_secrets_macos_x86_64 (optional [libzbar](#installation-of-optional-shared-system-libraries-recommended) needs to be installed manually if needed)
|
* extract_otp_secrets_macos_x86_64 (optional [libzbar](#installation-of-optional-shared-system-libraries-recommended) needs to be installed manually if needed)
|
||||||
* extract_otp_secrets_macos_x86_64.dmg N/A, see [why](#macos)
|
* extract_otp_secrets_macos_x86_64.dmg N/A, see [why](#macos)
|
||||||
* extract_otp_secrets_macos_x86_64.pkg N/A, see [why](#macos)
|
* extract_otp_secrets_macos_x86_64.pkg N/A, see [why](#macos)
|
||||||
|
* extract_otp_secrets_macos_arm64 (optional [libzbar](#installation-of-optional-shared-system-libraries-recommended) needs to be installed manually if needed) (🆕 since v2.7)
|
||||||
|
* extract_otp_secrets_macos_arm64.dmg N/A, see [why](#macos)
|
||||||
|
* extract_otp_secrets_macos_arm64.pkg N/A, see [why](#macos)
|
||||||
* Prebuilt Docker images provided for amd64 and arm64 (🆕 since v2.0)
|
* Prebuilt Docker images provided for amd64 and arm64 (🆕 since v2.0)
|
||||||
* Many ways to run the script:
|
* Many ways to run the script:
|
||||||
* Native Python
|
* Native Python
|
||||||
@@ -525,14 +519,6 @@ Install [devbox](https://github.com/jetpack-io/devbox), which is a wrapper for n
|
|||||||
devbox shell
|
devbox shell
|
||||||
```
|
```
|
||||||
|
|
||||||
### devbox
|
|
||||||
|
|
||||||
Install [devbox](https://devenv.sh), which is a wrapper for nix. Then enter the environment with Python and the packages installed with:
|
|
||||||
|
|
||||||
```
|
|
||||||
devenv shell
|
|
||||||
```
|
|
||||||
|
|
||||||
### docker
|
### docker
|
||||||
|
|
||||||
Install [Docker](https://docs.docker.com/get-docker/).
|
Install [Docker](https://docs.docker.com/get-docker/).
|
||||||
@@ -542,35 +528,35 @@ Prebuilt docker images are available for amd64 and arm64 architectures on [Docke
|
|||||||
Extracting from an QR image file:
|
Extracting from an QR image file:
|
||||||
|
|
||||||
```
|
```
|
||||||
curl -s https://raw.githubusercontent.com/scito/extract_otp_secrets/master/example_export.png | docker run --network none --pull always -i --rm -v "$(pwd)":/files:ro scit0/extract_otp_secrets =
|
curl -s https://raw.githubusercontent.com/scito/extract_otp_secrets/master/example_export.png | docker run --pull always -i --rm -v "$(pwd)":/files:ro scit0/extract_otp_secrets =
|
||||||
```
|
```
|
||||||
|
|
||||||
Capturing from camera in GUI window (X Window system required on host):
|
Capturing from camera in GUI window (X Window system required on host):
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run --network none --pull always --rm -v "$(pwd)":/files:ro -i --device="/dev/video0:/dev/video0" --env="DISPLAY" -v /tmp/.X11-unix:/tmp/.X11-unix:ro scit0/extract_otp_secrets
|
docker run --pull always --rm -v "$(pwd)":/files:ro -i --device="/dev/video0:/dev/video0" --env="DISPLAY" -v /tmp/.X11-unix:/tmp/.X11-unix:ro scit0/extract_otp_secrets
|
||||||
```
|
```
|
||||||
|
|
||||||
If only text processing is required, there is a small Image based on Alpine Linux:
|
If only text processing is required, there is a small Image based on Alpine Linux:
|
||||||
|
|
||||||
```
|
```
|
||||||
curl -s https://raw.githubusercontent.com/scito/extract_otp_secrets/master/example_export.txt | docker run --network none --pull always -i --rm -v "$(pwd)":/files:ro scit0/extract_otp_secrets:latest-only-txt -
|
curl -s https://raw.githubusercontent.com/scito/extract_otp_secrets/master/example_export.txt | docker run --pull always -i --rm -v "$(pwd)":/files:ro scit0/extract_otp_secrets:latest-only-txt -
|
||||||
```
|
```
|
||||||
|
|
||||||
Docker image from GitHub:
|
Docker image from GitHub:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker login ghcr.io -u USERNAME
|
docker login ghcr.io -u USERNAME
|
||||||
curl -s https://raw.githubusercontent.com/scito/extract_otp_secrets/master/example_export.png | docker run --network none --pull always -i --rm -v "$(pwd)":/files:ro ghcr.io/scito/extract_otp_secrets =
|
curl -s https://raw.githubusercontent.com/scito/extract_otp_secrets/master/example_export.png | docker run --pull always -i --rm -v "$(pwd)":/files:ro ghcr.io/scito/extract_otp_secrets =
|
||||||
```
|
```
|
||||||
|
|
||||||
### More docker examples
|
### More docker examples
|
||||||
|
|
||||||
docker run --network none --pull always --rm -v "$(pwd)":/files:ro scit0/extract_otp_secrets example_export.png
|
docker run --pull always --rm -v "$(pwd)":/files:ro scit0/extract_otp_secrets example_export.png
|
||||||
|
|
||||||
docker run --network none --pull always --rm -i -v "$(pwd)":/files:ro scit0/extract_otp_secrets_only_txt - < example_export.txt
|
docker run --pull always --rm -i -v "$(pwd)":/files:ro scit0/extract_otp_secrets_only_txt - < example_export.txt
|
||||||
|
|
||||||
cat example_export.txt | docker run --network none --pull always --rm -i -v "$(pwd)":/files:ro scit0/extract_otp_secrets:latest_only_txt - -c - > example_out.csv
|
cat example_export.txt | docker run --pull always --rm -i -v "$(pwd)":/files:ro scit0/extract_otp_secrets:latest_only_txt - -c - > example_out.csv
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
@@ -726,7 +712,7 @@ Command for regeneration of Python code from proto3 message definition file (onl
|
|||||||
|
|
||||||
protoc --plugin=protoc-gen-mypy=path/to/protoc-gen-mypy --python_out=src/protobuf_generated_python --mypy_out=src/protobuf_generated_python src/google_auth.proto
|
protoc --plugin=protoc-gen-mypy=path/to/protoc-gen-mypy --python_out=src/protobuf_generated_python --mypy_out=src/protobuf_generated_python src/google_auth.proto
|
||||||
|
|
||||||
The generated protobuf Python code was generated by protoc 28.3 (https://github.com/protocolbuffers/protobuf/releases/tag/v28.3).
|
The generated protobuf Python code was generated by protoc 25.2 (https://github.com/protocolbuffers/protobuf/releases/tag/v25.2).
|
||||||
|
|
||||||
For Python type hint generation the [mypy-protobuf](https://github.com/nipunn1313/mypy-protobuf) package is used.
|
For Python type hint generation the [mypy-protobuf](https://github.com/nipunn1313/mypy-protobuf) package is used.
|
||||||
|
|
||||||
@@ -737,7 +723,7 @@ For Python type hint generation the [mypy-protobuf](https://github.com/nipunn131
|
|||||||
|
|
||||||
## Issues
|
## Issues
|
||||||
|
|
||||||
* Segmentation fault on macOS with CV2 4.7.0: https://github.com/opencv/opencv/issues/23072 (fixed)
|
* Segmentation fault on macOS with CV2 4.7.0: https://github.com/opencv/opencv/issues/23072
|
||||||
* CV2 window does not show icons: https://github.com/opencv/opencv-python/issues/585
|
* CV2 window does not show icons: https://github.com/opencv/opencv-python/issues/585
|
||||||
|
|
||||||
## Problems and Troubleshooting
|
## Problems and Troubleshooting
|
||||||
|
|||||||
46
build.sh
46
build.sh
@@ -101,7 +101,7 @@ while test $# -gt 0; do
|
|||||||
echo "-C Ignore version check of protobuf/protoc"
|
echo "-C Ignore version check of protobuf/protoc"
|
||||||
echo "-e Build exe"
|
echo "-e Build exe"
|
||||||
echo "-n Build nuitka exe"
|
echo "-n Build nuitka exe"
|
||||||
echo "-L Do not run protoc and base build locally incl. exes"
|
echo "-L Do not build local (exe)"
|
||||||
echo "-d Build docker"
|
echo "-d Build docker"
|
||||||
echo "-a Build arm"
|
echo "-a Build arm"
|
||||||
echo "-X Do not build x86_64"
|
echo "-X Do not build x86_64"
|
||||||
@@ -365,13 +365,6 @@ if $build_local; then
|
|||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
# Update Code Coverage in README.md
|
|
||||||
|
|
||||||
# https://github.com/marketplace/actions/pytest-coverage-comment
|
|
||||||
# Coverage-95%25-yellowgreen
|
|
||||||
echo -e "Update code coverage in README.md"
|
|
||||||
TOTAL_COVERAGE=$(cat $COVERAGE_OUT_FILE | grep 'TOTAL' | perl -ne 'print "$&" if /\b(\d{1,3})%/') && perl -i -pe "s/coverage-(\d{1,3}%)25-/coverage-${TOTAL_COVERAGE}25-/" README.md
|
|
||||||
|
|
||||||
# Pipenv
|
# Pipenv
|
||||||
|
|
||||||
if $run_pipenv; then
|
if $run_pipenv; then
|
||||||
@@ -406,7 +399,7 @@ if $build_local; then
|
|||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
echo "local glibc: $LOCAL_GLIBC_VERSION"
|
echo "local glibc: $LOCAL_GLIBC_VERSION"
|
||||||
|
|
||||||
cmd="time pyinstaller -y --specpath installer --add-data $HOME/.local/__yolo_v3_qr_detector/:__yolo_v3_qr_detector/ --onefile $clean_flag src/extract_otp_secrets.py"
|
cmd="pyinstaller -y --specpath installer --add-data $HOME/.local/__yolo_v3_qr_detector/:__yolo_v3_qr_detector/ --onefile $clean_flag src/extract_otp_secrets.py"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
@@ -431,7 +424,7 @@ if $build_local; then
|
|||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
cmd="time $PYTHON -m nuitka --enable-plugin=tk-inter --enable-plugin=pyqt5 --noinclude-default-mode=nofollow --clang --include-data-dir=$HOME/.local/__yolo_v3_qr_detector/=__yolo_v3_qr_detector/ --onefile --output-dir=build/nuitka --output-filename=extract_otp_secrets_compiled src/extract_otp_secrets.py"
|
cmd="$PYTHON -m nuitka --enable-plugin=tk-inter --enable-plugin=pyqt5 --include-data-dir=$HOME/.local/__yolo_v3_qr_detector/=__yolo_v3_qr_detector/ --onefile --output-dir=build/nuitka --output-filename=extract_otp_secrets_compiled src/extract_otp_secrets.py"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
@@ -454,6 +447,13 @@ if $build_local; then
|
|||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
|
# Update Code Coverage in README.md
|
||||||
|
|
||||||
|
# https://github.com/marketplace/actions/pytest-coverage-comment
|
||||||
|
# Coverage-95%25-yellowgreen
|
||||||
|
echo -e "Update code coverage in README.md"
|
||||||
|
TOTAL_COVERAGE=$(cat $COVERAGE_OUT_FILE | grep 'TOTAL' | perl -ne 'print "$&" if /\b(\d{1,3})%/') && perl -i -pe "s/coverage-(\d{1,3}%)25-/coverage-${TOTAL_COVERAGE}25-/" README.md
|
||||||
|
|
||||||
# create Windows win_file_version_info.txt
|
# create Windows win_file_version_info.txt
|
||||||
cmd="VERSION_STR=$(setuptools-git-versioning) VERSION_MAJOR=$(cut -d '.' -f 1 <<< "$(setuptools-git-versioning)") VERSION_MINOR=$(cut -d '.' -f 2 <<< "$(setuptools-git-versioning)") VERSION_PATCH=$(cut -d '.' -f 3 <<< "$(setuptools-git-versioning)") VERSION_BUILD=$(($(git rev-list --count $(git tag | sort -V -r | sed '1!d')..HEAD))) COPYRIGHT_YEARS='2020-2023' envsubst < installer/win_file_version_info_template.txt > build/win_file_version_info.txt"
|
cmd="VERSION_STR=$(setuptools-git-versioning) VERSION_MAJOR=$(cut -d '.' -f 1 <<< "$(setuptools-git-versioning)") VERSION_MINOR=$(cut -d '.' -f 2 <<< "$(setuptools-git-versioning)") VERSION_PATCH=$(cut -d '.' -f 3 <<< "$(setuptools-git-versioning)") VERSION_BUILD=$(($(git rev-list --count $(git tag | sort -V -r | sed '1!d')..HEAD))) COPYRIGHT_YEARS='2020-2023' envsubst < installer/win_file_version_info_template.txt > build/win_file_version_info.txt"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
@@ -474,11 +474,11 @@ if $build_docker; then
|
|||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
cmd="docker run --network none --rm -v \"$(pwd)\":/files:ro extract_otp_secrets_only_txt example_export.txt"
|
cmd="docker run --rm -v \"$(pwd)\":/files:ro extract_otp_secrets_only_txt example_export.txt"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
cmd="docker run --network none --rm -i -v \"$(pwd)\":/files:ro extract_otp_secrets_only_txt - < example_export.txt"
|
cmd="docker run --rm -i -v \"$(pwd)\":/files:ro extract_otp_secrets_only_txt - < example_export.txt"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
@@ -491,15 +491,15 @@ if $build_docker; then
|
|||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
cmd="docker run --network none --rm -v \"$(pwd)\":/files:ro extract_otp_secrets example_export.txt"
|
cmd="docker run --rm -v \"$(pwd)\":/files:ro extract_otp_secrets example_export.txt"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
cmd="cat example_export.txt | docker run --network none --rm -i -v \"$(pwd)\":/files:ro extract_otp_secrets - -c - > example_output.csv"
|
cmd="cat example_export.txt | docker run --rm -i -v \"$(pwd)\":/files:ro extract_otp_secrets - -c - > example_output.csv"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
cmd="docker run --network none --rm -i -v \"$(pwd)\":/files:ro extract_otp_secrets = < example_export.png"
|
cmd="docker run --rm -i -v \"$(pwd)\":/files:ro extract_otp_secrets = < example_export.png"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
@@ -512,15 +512,15 @@ if $build_docker; then
|
|||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
cmd="docker run --network none --rm -v \"$(pwd)\":/files:ro extract_otp_secrets:bullseye example_export.txt"
|
cmd="docker run --rm -v \"$(pwd)\":/files:ro extract_otp_secrets:bullseye example_export.txt"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
cmd="cat example_export.txt | docker run --network none --rm -i -v \"$(pwd)\":/files:ro extract_otp_secrets:bullseye - -c - > example_output.csv"
|
cmd="cat example_export.txt | docker run --rm -i -v \"$(pwd)\":/files:ro extract_otp_secrets:bullseye - -c - > example_output.csv"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
cmd="docker run --network none --rm -i -v \"$(pwd)\":/files:ro extract_otp_secrets:bullseye = < example_export.png"
|
cmd="docker run --rm -i -v \"$(pwd)\":/files:ro extract_otp_secrets:bullseye = < example_export.png"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
@@ -530,13 +530,13 @@ if $build_docker; then
|
|||||||
|
|
||||||
# Build executable from Docker latest
|
# Build executable from Docker latest
|
||||||
# sed "1!d" is workaround for head -n 1 since it head procduces exit code != 0
|
# sed "1!d" is workaround for head -n 1 since it head procduces exit code != 0
|
||||||
BOOKWORM_GLIBC_VERSION=$(docker run --network none --entrypoint /bin/bash --rm extract_otp_secrets -c 'ldd --version | sed "1!d" | sed -E "s/.* ([[:digit:]]+\.[[:digit:]]+)$/\1/"')
|
BOOKWORM_GLIBC_VERSION=$(docker run --entrypoint /bin/bash --rm extract_otp_secrets -c 'ldd --version | sed "1!d" | sed -E "s/.* ([[:digit:]]+\.[[:digit:]]+)$/\1/"')
|
||||||
echo "Bookworm glibc: $BOOKWORM_GLIBC_VERSION"
|
echo "Bookworm glibc: $BOOKWORM_GLIBC_VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $build_arm; then
|
if $build_arm; then
|
||||||
# build linux/arm64
|
# build linux/arm64
|
||||||
cmd="docker run --network none --pull always --rm --privileged multiarch/qemu-user-static --reset -p yes"
|
cmd="docker run --pull always --rm --privileged multiarch/qemu-user-static --reset -p yes"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
@@ -561,7 +561,7 @@ if $build_docker; then
|
|||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
# Build executable from Docker bullseye
|
# Build executable from Docker bullseye
|
||||||
BULLSEYE_GLIBC_VERSION=$(docker run --network none --entrypoint /bin/bash --rm extract_otp_secrets:bullseye -c 'ldd --version | sed "1!d" | sed -E "s/.* ([[:digit:]]+\.[[:digit:]]+)$/\1/"')
|
BULLSEYE_GLIBC_VERSION=$(docker run --entrypoint /bin/bash --rm extract_otp_secrets:bullseye -c 'ldd --version | sed "1!d" | sed -E "s/.* ([[:digit:]]+\.[[:digit:]]+)$/\1/"')
|
||||||
echo "Bullseye glibc: $BULLSEYE_GLIBC_VERSION"
|
echo "Bullseye glibc: $BULLSEYE_GLIBC_VERSION"
|
||||||
|
|
||||||
cmd="docker run --platform linux/amd64 --entrypoint /bin/bash --rm -v \"$(pwd)\":/files -w /files extract_otp_secrets:bullseye -c 'apt-get update && apt-get -y install binutils && pip install -U pip && pip install -U -r /files/requirements.txt && pip install pyinstaller && PYTHONHASHSEED=31 && pyinstaller -y --specpath installer --add-data /usr/local/__yolo_v3_qr_detector/:__yolo_v3_qr_detector/ --onefile --name extract_otp_secrets_linux_x86_64 --distpath /files/dist/ /files/src/extract_otp_secrets.py'"
|
cmd="docker run --platform linux/amd64 --entrypoint /bin/bash --rm -v \"$(pwd)\":/files -w /files extract_otp_secrets:bullseye -c 'apt-get update && apt-get -y install binutils && pip install -U pip && pip install -U -r /files/requirements.txt && pip install pyinstaller && PYTHONHASHSEED=31 && pyinstaller -y --specpath installer --add-data /usr/local/__yolo_v3_qr_detector/:__yolo_v3_qr_detector/ --onefile --name extract_otp_secrets_linux_x86_64 --distpath /files/dist/ /files/src/extract_otp_secrets.py'"
|
||||||
@@ -608,7 +608,7 @@ if $build_docker; then
|
|||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
|
|
||||||
# Build executable from Docker bullseye
|
# Build executable from Docker bullseye
|
||||||
BULLSEYE_GLIBC_VERSION=$(docker run --network none --entrypoint /bin/bash --rm extract_otp_secrets:bullseye -c 'ldd --version | sed "1!d" | sed -E "s/.* ([[:digit:]]+\.[[:digit:]]+)$/\1/"')
|
BULLSEYE_GLIBC_VERSION=$(docker run --entrypoint /bin/bash --rm extract_otp_secrets:bullseye -c 'ldd --version | sed "1!d" | sed -E "s/.* ([[:digit:]]+\.[[:digit:]]+)$/\1/"')
|
||||||
echo "Bookworm glibc: $BULLSEYE_GLIBC_VERSION"
|
echo "Bookworm glibc: $BULLSEYE_GLIBC_VERSION"
|
||||||
|
|
||||||
cmd="docker run --platform linux/amd64 --entrypoint /bin/bash --rm -v \"$(pwd)\":/files -w /files extract_otp_secrets:bullseye -c 'apt-get update && apt-get -y install binutils build-essential patchelf && pip install -U pip && pip install -U -r /files/requirements.txt && pip install nuitka pyqt5 && PYTHONHASHSEED=31 && python -m nuitka --enable-plugin=tk-inter --enable-plugin=pyqt5 --include-data-dir=/usr/local/__yolo_v3_qr_detector/=__yolo_v3_qr_detector/ --onefile --output-dir=/files/build/docker/nuitka --output-filename=extract_otp_secrets_linux_x86_64_bullseye_compiled /files/src/extract_otp_secrets.py'"
|
cmd="docker run --platform linux/amd64 --entrypoint /bin/bash --rm -v \"$(pwd)\":/files -w /files extract_otp_secrets:bullseye -c 'apt-get update && apt-get -y install binutils build-essential patchelf && pip install -U pip && pip install -U -r /files/requirements.txt && pip install nuitka pyqt5 && PYTHONHASHSEED=31 && python -m nuitka --enable-plugin=tk-inter --enable-plugin=pyqt5 --include-data-dir=/usr/local/__yolo_v3_qr_detector/=__yolo_v3_qr_detector/ --onefile --output-dir=/files/build/docker/nuitka --output-filename=extract_otp_secrets_linux_x86_64_bullseye_compiled /files/src/extract_otp_secrets.py'"
|
||||||
@@ -646,7 +646,7 @@ if $build_docker; then
|
|||||||
|
|
||||||
# Run GUI from Docker
|
# Run GUI from Docker
|
||||||
if $build_x86_64 && $run_gui; then
|
if $build_x86_64 && $run_gui; then
|
||||||
cmd="docker run --network none --rm -v "$(pwd)":/files:ro --device=\"/dev/video0:/dev/video0\" --env=\"DISPLAY\" -v /tmp/.X11-unix:/tmp/.X11-unix:ro extract_otp_secrets &"
|
cmd="docker run --rm -v "$(pwd)":/files:ro --device=\"/dev/video0:/dev/video0\" --env=\"DISPLAY\" -v /tmp/.X11-unix:/tmp/.X11-unix:ro extract_otp_secrets &"
|
||||||
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
fi
|
fi
|
||||||
|
|||||||
122
devenv.lock
122
devenv.lock
@@ -1,122 +0,0 @@
|
|||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"devenv": {
|
|
||||||
"locked": {
|
|
||||||
"dir": "src/modules",
|
|
||||||
"lastModified": 1726050924,
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "devenv",
|
|
||||||
"rev": "cf471f691c3765ed431199f61b8bd70530bc4305",
|
|
||||||
"treeHash": "04a5d566820f8fb1955c7c49ccbd3ff95d9129d7",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"dir": "src/modules",
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "devenv",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1696426674,
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
|
||||||
"treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"gitignore": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"pre-commit-hooks",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1709087332,
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
|
||||||
"treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1716977621,
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "devenv-nixpkgs",
|
|
||||||
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
|
|
||||||
"treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"ref": "rolling",
|
|
||||||
"repo": "devenv-nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs-stable": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1725826545,
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "f4c846aee8e1e29062aa8514d5e0ab270f4ec2f9",
|
|
||||||
"treeHash": "8fc49deaed3f2728a7147c38163cc468a117570a",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-24.05",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"pre-commit-hooks": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"gitignore": "gitignore",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1725513492,
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "pre-commit-hooks.nix",
|
|
||||||
"rev": "7570de7b9b504cfe92025dd1be797bf546f66528",
|
|
||||||
"treeHash": "4b46d77870afecd8f642541cb4f4927326343b59",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "pre-commit-hooks.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"devenv": "devenv",
|
|
||||||
"nixpkgs": "nixpkgs",
|
|
||||||
"pre-commit-hooks": "pre-commit-hooks"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
||||||
24
devenv.nix
24
devenv.nix
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
cachix.enable = false;
|
|
||||||
|
|
||||||
languages.python = {
|
|
||||||
enable = true;
|
|
||||||
venv = {
|
|
||||||
enable = true;
|
|
||||||
requirements = ./requirements.txt;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
packages = [
|
|
||||||
pkgs.git
|
|
||||||
pkgs.zbar
|
|
||||||
];
|
|
||||||
}
|
|
||||||
14
devenv.yaml
14
devenv.yaml
@@ -1,14 +0,0 @@
|
|||||||
inputs:
|
|
||||||
nixpkgs:
|
|
||||||
url: github:cachix/devenv-nixpkgs/rolling
|
|
||||||
|
|
||||||
# If you're using non-OSS software, you can set allowUnfree to true.
|
|
||||||
# allowUnfree: true
|
|
||||||
|
|
||||||
# If you're willing to use a package that's vulnerable
|
|
||||||
# permittedInsecurePackages:
|
|
||||||
# - "openssl-1.1.1w"
|
|
||||||
|
|
||||||
# If you have more than one devenv you can merge them
|
|
||||||
#imports:
|
|
||||||
# - ./backend
|
|
||||||
@@ -21,11 +21,11 @@ classifiers = [
|
|||||||
"Topic :: Utilities",
|
"Topic :: Utilities",
|
||||||
"Topic :: Security",
|
"Topic :: Security",
|
||||||
"Topic :: Multimedia :: Graphics :: Capture :: Digital Camera",
|
"Topic :: Multimedia :: Graphics :: Capture :: Digital Camera",
|
||||||
|
"Programming Language :: Python :: 3.7",
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
"Programming Language :: Python :: 3.11",
|
"Programming Language :: Python :: 3.11",
|
||||||
"Programming Language :: Python :: 3.12",
|
|
||||||
"Intended Audience :: End Users/Desktop",
|
"Intended Audience :: End Users/Desktop",
|
||||||
"Intended Audience :: Developers",
|
"Intended Audience :: Developers",
|
||||||
"Intended Audience :: System Administrators",
|
"Intended Audience :: System Administrators",
|
||||||
@@ -40,7 +40,8 @@ classifiers = [
|
|||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"colorama>=0.4.6",
|
"colorama>=0.4.6",
|
||||||
"opencv-contrib-python",
|
"opencv-contrib-python; sys_platform != 'darwin'",
|
||||||
|
"opencv-contrib-python<=4.7.0; sys_platform == 'darwin'",
|
||||||
"Pillow",
|
"Pillow",
|
||||||
"protobuf",
|
"protobuf",
|
||||||
"pyzbar",
|
"pyzbar",
|
||||||
@@ -54,7 +55,7 @@ license = {text = "GNU General Public License v3 (GPLv3)"}
|
|||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = [{name = "scito", email = "info@scito.ch"}]
|
authors = [{name = "scito", email = "info@scito.ch"}]
|
||||||
maintainers = [{name = "scito", email = "info@scito.ch"}]
|
maintainers = [{name = "scito", email = "info@scito.ch"}]
|
||||||
requires-python = ">=3.8, <4"
|
requires-python = ">=3.7, <4"
|
||||||
scripts = {extract_otp_secrets = "extract_otp_secrets:sys_main"}
|
scripts = {extract_otp_secrets = "extract_otp_secrets:sys_main"}
|
||||||
urls = {Project-URL = "https://github.com/scito/extract_otp_secrets", Bug-Reports = "https://github.com/scito/extract_otp_secrets/issues", Source = "https://github.com/scito/extract_otp_secrets"}
|
urls = {Project-URL = "https://github.com/scito/extract_otp_secrets", Bug-Reports = "https://github.com/scito/extract_otp_secrets/issues", Source = "https://github.com/scito/extract_otp_secrets"}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
colorama>=0.4.6
|
colorama>=0.4.6
|
||||||
opencv-contrib-python
|
importlib_metadata; python_version<='3.7'
|
||||||
|
opencv-contrib-python; sys_platform != 'darwin'
|
||||||
|
opencv-contrib-python<=4.7.0; sys_platform == 'darwin'
|
||||||
Pillow
|
Pillow
|
||||||
protobuf
|
protobuf
|
||||||
pyzbar
|
pyzbar
|
||||||
qrcode
|
qrcode
|
||||||
qreader<2.0.0
|
qreader<2.0.0
|
||||||
|
typing_extensions; python_version<='3.7'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
name = extract_otp_secrets
|
name = extract_otp_secrets
|
||||||
|
|
||||||
[options]
|
[options]
|
||||||
python_requires = >=3.8, <4
|
python_requires = >=3.7, <4
|
||||||
py_modules = extract_otp_secrets, protobuf_generated_python.google_auth_pb2
|
py_modules = extract_otp_secrets, protobuf_generated_python.google_auth_pb2
|
||||||
package_dir =
|
package_dir =
|
||||||
=src
|
=src
|
||||||
|
|||||||
@@ -188,7 +188,6 @@ def main(sys_args: list[str]) -> None:
|
|||||||
write_keepass_csv(args.keepass, otps)
|
write_keepass_csv(args.keepass, otps)
|
||||||
write_json(args.json, otps)
|
write_json(args.json, otps)
|
||||||
write_txt(args.txt, otps, True)
|
write_txt(args.txt, otps, True)
|
||||||
write_urls(args.urls, otps)
|
|
||||||
|
|
||||||
|
|
||||||
# workaround for PYTHON <= 3.9 use: pb.MigrationPayload | None
|
# workaround for PYTHON <= 3.9 use: pb.MigrationPayload | None
|
||||||
@@ -281,11 +280,10 @@ def parse_args(sys_args: list[str]) -> Args:
|
|||||||
epilog=example_text)
|
epilog=example_text)
|
||||||
arg_parser.add_argument('infile', help="""a) file or - for stdin with 'otpauth-migration://...' URLs separated by newlines, lines starting with # are ignored;
|
arg_parser.add_argument('infile', help="""a) file or - for stdin with 'otpauth-migration://...' URLs separated by newlines, lines starting with # are ignored;
|
||||||
b) image file containing a QR code or = for stdin for an image containing a QR code""", nargs='*' if cv2_available else '+')
|
b) image file containing a QR code or = for stdin for an image containing a QR code""", nargs='*' if cv2_available else '+')
|
||||||
arg_parser.add_argument('--csv', '-c', help='export csv file, or - for stdout', metavar=('FILE'))
|
arg_parser.add_argument('--csv', '-c', help='export csv file or - for stdout', metavar=('FILE'))
|
||||||
arg_parser.add_argument('--keepass', '-k', help='export totp/hotp csv file(s) for KeePass, - for stdout', metavar=('FILE'))
|
arg_parser.add_argument('--keepass', '-k', help='export totp/hotp csv file(s) for KeePass, - for stdout', metavar=('FILE'))
|
||||||
arg_parser.add_argument('--json', '-j', help='export json file or - for stdout', metavar=('FILE'))
|
arg_parser.add_argument('--json', '-j', help='export json file or - for stdout', metavar=('FILE'))
|
||||||
arg_parser.add_argument('--txt', '-t', help='export txt file or - for stdout', metavar=('FILE'))
|
arg_parser.add_argument('--txt', '-t', help='export txt file or - for stdout', metavar=('FILE'))
|
||||||
arg_parser.add_argument('--urls', '-u', help='export file with list of otpauth urls, or - for stdout', metavar=('FILE'))
|
|
||||||
arg_parser.add_argument('--printqr', '-p', help='print QR code(s) as text to the terminal', action='store_true')
|
arg_parser.add_argument('--printqr', '-p', help='print QR code(s) as text to the terminal', action='store_true')
|
||||||
arg_parser.add_argument('--saveqr', '-s', help='save QR code(s) as images to directory', metavar=('DIR'))
|
arg_parser.add_argument('--saveqr', '-s', help='save QR code(s) as images to directory', metavar=('DIR'))
|
||||||
if cv2_available:
|
if cv2_available:
|
||||||
@@ -303,14 +301,13 @@ b) image file containing a QR code or = for stdin for an image containing a QR c
|
|||||||
output_group.add_argument('-q', '--quiet', help='no stdout output, except output set by -', action='store_true')
|
output_group.add_argument('-q', '--quiet', help='no stdout output, except output set by -', action='store_true')
|
||||||
args = arg_parser.parse_args(sys_args)
|
args = arg_parser.parse_args(sys_args)
|
||||||
colored = not args.no_color
|
colored = not args.no_color
|
||||||
if args.csv == '-' or args.json == '-' or args.keepass == '-' or args.txt == '-' or args.urls == '-':
|
if args.csv == '-' or args.json == '-' or args.keepass == '-' or args.txt == '-':
|
||||||
args.quiet = args.q = True
|
args.quiet = args.q = True
|
||||||
|
|
||||||
verbose = args.verbose if args.verbose else LogLevel.NORMAL
|
verbose = args.verbose if args.verbose else LogLevel.NORMAL
|
||||||
if args.debug:
|
if args.debug:
|
||||||
verbose = LogLevel.DEBUG
|
verbose = LogLevel.DEBUG
|
||||||
log_debug('Debug mode start')
|
log_debug('Debug mode start')
|
||||||
log_debug(args)
|
|
||||||
quiet = True if args.quiet else False
|
quiet = True if args.quiet else False
|
||||||
if verbose: print(f"QReader installed: {cv2_available}")
|
if verbose: print(f"QReader installed: {cv2_available}")
|
||||||
if cv2_available:
|
if cv2_available:
|
||||||
@@ -381,7 +378,7 @@ def extract_otps_from_camera(args: Args) -> Otps:
|
|||||||
|
|
||||||
cv2_print_text(img, f"Mode: {qr_mode.name} (Hit SPACE to change)", 0, TextPosition.LEFT, FONT_COLOR, 20)
|
cv2_print_text(img, f"Mode: {qr_mode.name} (Hit SPACE to change)", 0, TextPosition.LEFT, FONT_COLOR, 20)
|
||||||
cv2_print_text(img, "Press ESC to quit", 1, TextPosition.LEFT, FONT_COLOR, 17)
|
cv2_print_text(img, "Press ESC to quit", 1, TextPosition.LEFT, FONT_COLOR, 17)
|
||||||
cv2_print_text(img, "Press c,j,k,t,u to save as csv/json/keepass/txt/urls file", 2, TextPosition.LEFT, FONT_COLOR, None)
|
cv2_print_text(img, "Press C/J/K/T to save as csv/json/keepass/txt file", 2, TextPosition.LEFT, FONT_COLOR, None)
|
||||||
|
|
||||||
cv2_print_text(img, f"{len(otp_urls)} QR code{'s'[:len(otp_urls) != 1]} captured", 0, TextPosition.RIGHT, FONT_COLOR)
|
cv2_print_text(img, f"{len(otp_urls)} QR code{'s'[:len(otp_urls) != 1]} captured", 0, TextPosition.RIGHT, FONT_COLOR)
|
||||||
cv2_print_text(img, f"{len(otps)} otp{'s'[:len(otps) != 1]} extracted", 1, TextPosition.RIGHT, FONT_COLOR)
|
cv2_print_text(img, f"{len(otps)} otp{'s'[:len(otps) != 1]} extracted", 1, TextPosition.RIGHT, FONT_COLOR)
|
||||||
@@ -487,18 +484,6 @@ def cv2_handle_pressed_keys(qr_mode: QRMode, otps: Otps) -> Tuple[bool, QRMode]:
|
|||||||
tk_root.update()
|
tk_root.update()
|
||||||
if len(file_name) > 0:
|
if len(file_name) > 0:
|
||||||
write_txt(file_name, otps, True)
|
write_txt(file_name, otps, True)
|
||||||
elif (key == ord('u') or key == ord('U')) and is_not_headless():
|
|
||||||
if has_no_otps_show_warning(otps):
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
file_name = tkinter.filedialog.asksaveasfilename(
|
|
||||||
title="Save extracted otp secrets as list of urls",
|
|
||||||
defaultextension='.txt',
|
|
||||||
filetypes=[('Text', '*.txt'), ('All', '*.*')]
|
|
||||||
)
|
|
||||||
tk_root.update()
|
|
||||||
if len(file_name) > 0:
|
|
||||||
write_urls(file_name, otps)
|
|
||||||
elif key == 32:
|
elif key == 32:
|
||||||
qr_mode = next_valid_qr_mode(qr_mode, zbar_available)
|
qr_mode = next_valid_qr_mode(qr_mode, zbar_available)
|
||||||
if verbose >= LogLevel.MORE_VERBOSE: print(f"QR reading mode: {qr_mode}")
|
if verbose >= LogLevel.MORE_VERBOSE: print(f"QR reading mode: {qr_mode}")
|
||||||
@@ -592,7 +577,7 @@ def convert_img_to_otp_urls(filename: str, args: Args) -> OtpUrls:
|
|||||||
stdin = sys.stdin.buffer.read()
|
stdin = sys.stdin.buffer.read()
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# Workaround for pytest, since pytest cannot monkeypatch sys.stdin.buffer
|
# Workaround for pytest, since pytest cannot monkeypatch sys.stdin.buffer
|
||||||
stdin = sys.stdin.read()
|
stdin = sys.stdin.read() # type: ignore # Workaround for pytest fixtures
|
||||||
if not stdin:
|
if not stdin:
|
||||||
log_warn("stdin is empty")
|
log_warn("stdin is empty")
|
||||||
try:
|
try:
|
||||||
@@ -679,10 +664,6 @@ def print_otp(otp: Otp, out: Optional[TextIO] = None) -> None:
|
|||||||
print(otp['url'], file=out)
|
print(otp['url'], file=out)
|
||||||
|
|
||||||
|
|
||||||
def write_url(otp: Otp, out: Optional[TextIO] = None) -> None:
|
|
||||||
print(otp['url'], file=out)
|
|
||||||
|
|
||||||
|
|
||||||
def save_qr_image(otp: Otp, dir: str, j: int) -> str:
|
def save_qr_image(otp: Otp, dir: str, j: int) -> str:
|
||||||
if not (os.path.exists(dir)): os.makedirs(dir, exist_ok=True)
|
if not (os.path.exists(dir)): os.makedirs(dir, exist_ok=True)
|
||||||
pattern = re.compile(r'[\W_]+')
|
pattern = re.compile(r'[\W_]+')
|
||||||
@@ -716,14 +697,6 @@ def write_txt(file: str, otps: Otps, write_qr: bool = False) -> None:
|
|||||||
print(file=outfile)
|
print(file=outfile)
|
||||||
|
|
||||||
|
|
||||||
def write_urls(file: str, otps: Otps) -> None:
|
|
||||||
if file and len(file) > 0 and len(otps) > 0:
|
|
||||||
with open_file_or_stdout(file) as outfile:
|
|
||||||
for otp in otps:
|
|
||||||
write_url(otp, outfile)
|
|
||||||
if not quiet: print(f"Exported {len(otps)} otp{'s'[:len(otps) != 1]} to otpauth url list file {file}")
|
|
||||||
|
|
||||||
|
|
||||||
def write_csv(file: str, otps: Otps) -> None:
|
def write_csv(file: str, otps: Otps) -> None:
|
||||||
if file and len(file) > 0 and len(otps) > 0:
|
if file and len(file) > 0 and len(otps) > 0:
|
||||||
with open_file_or_stdout_for_csv(file) as outfile:
|
with open_file_or_stdout_for_csv(file) as outfile:
|
||||||
@@ -915,15 +888,10 @@ def get_raw_version() -> str:
|
|||||||
|
|
||||||
# workaround for PYTHON <= 3.9 use: BaseException | None
|
# workaround for PYTHON <= 3.9 use: BaseException | None
|
||||||
def log_debug(*values: object, sep: Optional[str] = ' ') -> None:
|
def log_debug(*values: object, sep: Optional[str] = ' ') -> None:
|
||||||
if os.name == 'nt':
|
|
||||||
# Workaround "Windows fatal exception: access violation"
|
|
||||||
print(f"\nDEBUG: {str(values[0])}")
|
|
||||||
return
|
|
||||||
|
|
||||||
if colored:
|
if colored:
|
||||||
print(f"{colorama.Fore.CYAN}\nDEBUG: {str(values[0])}", *values[1:], colorama.Fore.RESET, sep=sep)
|
print(f"{colorama.Fore.CYAN}\nDEBUG: {str(values[0])}", *values[1:], colorama.Fore.RESET, sep)
|
||||||
else:
|
else:
|
||||||
print(f"\nDEBUG: {str(values[0])}", *values[1:], sep=sep)
|
print(f"\nDEBUG: {str(values[0])}", *values[1:], sep)
|
||||||
|
|
||||||
|
|
||||||
# workaround for PYTHON <= 3.9 use: BaseException | None
|
# workaround for PYTHON <= 3.9 use: BaseException | None
|
||||||
|
|||||||
@@ -1,22 +1,12 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
# NO CHECKED-IN PROTOBUF GENCODE
|
|
||||||
# source: google_auth.proto
|
# source: google_auth.proto
|
||||||
# Protobuf Python Version: 5.28.3
|
# Protobuf Python Version: 4.25.2
|
||||||
"""Generated protocol buffer code."""
|
"""Generated protocol buffer code."""
|
||||||
from google.protobuf import descriptor as _descriptor
|
from google.protobuf import descriptor as _descriptor
|
||||||
from google.protobuf import descriptor_pool as _descriptor_pool
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
||||||
from google.protobuf import runtime_version as _runtime_version
|
|
||||||
from google.protobuf import symbol_database as _symbol_database
|
from google.protobuf import symbol_database as _symbol_database
|
||||||
from google.protobuf.internal import builder as _builder
|
from google.protobuf.internal import builder as _builder
|
||||||
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
||||||
_runtime_version.Domain.PUBLIC,
|
|
||||||
5,
|
|
||||||
28,
|
|
||||||
3,
|
|
||||||
'',
|
|
||||||
'google_auth.proto'
|
|
||||||
)
|
|
||||||
# @@protoc_insertion_point(imports)
|
# @@protoc_insertion_point(imports)
|
||||||
|
|
||||||
_sym_db = _symbol_database.Default()
|
_sym_db = _symbol_database.Default()
|
||||||
@@ -29,8 +19,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11google_auth.pr
|
|||||||
_globals = globals()
|
_globals = globals()
|
||||||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
||||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google_auth_pb2', _globals)
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google_auth_pb2', _globals)
|
||||||
if not _descriptor._USE_C_DESCRIPTORS:
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||||
DESCRIPTOR._loaded_options = None
|
DESCRIPTOR._options = None
|
||||||
_globals['_MIGRATIONPAYLOAD']._serialized_start=22
|
_globals['_MIGRATIONPAYLOAD']._serialized_start=22
|
||||||
_globals['_MIGRATIONPAYLOAD']._serialized_end=461
|
_globals['_MIGRATIONPAYLOAD']._serialized_end=461
|
||||||
_globals['_MIGRATIONPAYLOAD_OTPPARAMETERS']._serialized_start=176
|
_globals['_MIGRATIONPAYLOAD_OTPPARAMETERS']._serialized_start=176
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
@generated by mypy-protobuf. Do not edit manually!
|
@generated by mypy-protobuf. Do not edit manually!
|
||||||
isort:skip_file
|
isort:skip_file
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import builtins
|
import builtins
|
||||||
import collections.abc
|
import collections.abc
|
||||||
import google.protobuf.descriptor
|
import google.protobuf.descriptor
|
||||||
@@ -19,7 +18,7 @@ else:
|
|||||||
|
|
||||||
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
||||||
|
|
||||||
@typing.final
|
@typing_extensions.final
|
||||||
class MigrationPayload(google.protobuf.message.Message):
|
class MigrationPayload(google.protobuf.message.Message):
|
||||||
"""Copied from: https://github.com/beemdevelopment/Aegis/blob/master/app/src/main/proto/google_auth.proto"""
|
"""Copied from: https://github.com/beemdevelopment/Aegis/blob/master/app/src/main/proto/google_auth.proto"""
|
||||||
|
|
||||||
@@ -53,7 +52,7 @@ class MigrationPayload(google.protobuf.message.Message):
|
|||||||
OTP_HOTP: MigrationPayload.OtpType.ValueType # 1
|
OTP_HOTP: MigrationPayload.OtpType.ValueType # 1
|
||||||
OTP_TOTP: MigrationPayload.OtpType.ValueType # 2
|
OTP_TOTP: MigrationPayload.OtpType.ValueType # 2
|
||||||
|
|
||||||
@typing.final
|
@typing_extensions.final
|
||||||
class OtpParameters(google.protobuf.message.Message):
|
class OtpParameters(google.protobuf.message.Message):
|
||||||
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
||||||
|
|
||||||
@@ -82,19 +81,19 @@ class MigrationPayload(google.protobuf.message.Message):
|
|||||||
type: global___MigrationPayload.OtpType.ValueType = ...,
|
type: global___MigrationPayload.OtpType.ValueType = ...,
|
||||||
counter: builtins.int = ...,
|
counter: builtins.int = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def ClearField(self, field_name: typing.Literal["algorithm", b"algorithm", "counter", b"counter", "digits", b"digits", "issuer", b"issuer", "name", b"name", "secret", b"secret", "type", b"type"]) -> None: ...
|
def ClearField(self, field_name: typing_extensions.Literal["algorithm", b"algorithm", "counter", b"counter", "digits", b"digits", "issuer", b"issuer", "name", b"name", "secret", b"secret", "type", b"type"]) -> None: ...
|
||||||
|
|
||||||
OTP_PARAMETERS_FIELD_NUMBER: builtins.int
|
OTP_PARAMETERS_FIELD_NUMBER: builtins.int
|
||||||
VERSION_FIELD_NUMBER: builtins.int
|
VERSION_FIELD_NUMBER: builtins.int
|
||||||
BATCH_SIZE_FIELD_NUMBER: builtins.int
|
BATCH_SIZE_FIELD_NUMBER: builtins.int
|
||||||
BATCH_INDEX_FIELD_NUMBER: builtins.int
|
BATCH_INDEX_FIELD_NUMBER: builtins.int
|
||||||
BATCH_ID_FIELD_NUMBER: builtins.int
|
BATCH_ID_FIELD_NUMBER: builtins.int
|
||||||
|
@property
|
||||||
|
def otp_parameters(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___MigrationPayload.OtpParameters]: ...
|
||||||
version: builtins.int
|
version: builtins.int
|
||||||
batch_size: builtins.int
|
batch_size: builtins.int
|
||||||
batch_index: builtins.int
|
batch_index: builtins.int
|
||||||
batch_id: builtins.int
|
batch_id: builtins.int
|
||||||
@property
|
|
||||||
def otp_parameters(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___MigrationPayload.OtpParameters]: ...
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
@@ -104,6 +103,6 @@ class MigrationPayload(google.protobuf.message.Message):
|
|||||||
batch_index: builtins.int = ...,
|
batch_index: builtins.int = ...,
|
||||||
batch_id: builtins.int = ...,
|
batch_id: builtins.int = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def ClearField(self, field_name: typing.Literal["batch_id", b"batch_id", "batch_index", b"batch_index", "batch_size", b"batch_size", "otp_parameters", b"otp_parameters", "version", b"version"]) -> None: ...
|
def ClearField(self, field_name: typing_extensions.Literal["batch_id", b"batch_id", "batch_index", b"batch_index", "batch_size", b"batch_size", "otp_parameters", b"otp_parameters", "version", b"version"]) -> None: ...
|
||||||
|
|
||||||
global___MigrationPayload = MigrationPayload
|
global___MigrationPayload = MigrationPayload
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
QReader installed: True
|
QReader installed: True
|
||||||
CV2 version: 4.10.0
|
CV2 version: 4.7.0
|
||||||
QR reading mode: ZBAR
|
QR reading mode: ZBAR
|
||||||
|
|
||||||
Input files: ['example_export.txt']
|
Input files: ['example_export.txt']
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
QReader installed: True
|
QReader installed: True
|
||||||
CV2 version: 4.10.0
|
CV2 version: 4.7.0
|
||||||
QR reading mode: ZBAR
|
QR reading mode: ZBAR
|
||||||
|
|
||||||
Input files: ['example_export.txt']
|
Input files: ['example_export.txt']
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
QReader installed: True
|
QReader installed: True
|
||||||
CV2 version: 4.10.0
|
CV2 version: 4.7.0
|
||||||
QR reading mode: ZBAR
|
QR reading mode: ZBAR
|
||||||
|
|
||||||
Version: extract_otp_secrets 2.8.1.post17+git.3dc7d1c2.dirty Linux x86_64 Python 3.11.9 (CPython/called as script)
|
Version: extract_otp_secrets 2.0.2.post50+git.158245dd.dirty Linux x86_64 Python 3.11.1 (CPython/called as script)
|
||||||
|
|
||||||
Input files: ['example_export.txt']
|
Input files: ['example_export.txt']
|
||||||
Processing infile example_export.txt
|
Processing infile example_export.txt
|
||||||
@@ -32,17 +32,16 @@ otpauth-migration://offline?data=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8O
|
|||||||
# otpauth://totp/pi@raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&issuer=raspberrypi
|
# otpauth://totp/pi@raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&issuer=raspberrypi
|
||||||
otpauth-migration://offline?data=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK%2B%2F%2F%2F%2F%2F8B
|
otpauth-migration://offline?data=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK%2B%2F%2F%2F%2F%2F8B
|
||||||
|
|
||||||
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK%2B%2F%2F%2F%2F%2F8B', fragment='')
|
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK%2B%2F%2F%2F%2F%2F8B', fragment='')
|
||||||
|
|
||||||
DEBUG: querystring params={'data': ['CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK+/////8B']}
|
DEBUG: querystring params={'data': ['CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK+/////8B']}
|
||||||
|
|
||||||
DEBUG: data_base64=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK+/////8B
|
DEBUG: data_base64=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK+/////8B
|
||||||
|
|
||||||
DEBUG: data_base64_fixed=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK+/////8B
|
DEBUG: data_base64_fixed=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK+/////8B
|
||||||
|
|
||||||
DEBUG:
|
DEBUG:
|
||||||
1. Payload Line
|
1. Payload Line otp_parameters {
|
||||||
otp_parameters {
|
|
||||||
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
||||||
name: "pi@raspberrypi"
|
name: "pi@raspberrypi"
|
||||||
issuer: "raspberrypi"
|
issuer: "raspberrypi"
|
||||||
@@ -53,11 +52,12 @@ otp_parameters {
|
|||||||
version: 1
|
version: 1
|
||||||
batch_size: 1
|
batch_size: 1
|
||||||
batch_id: -1320898453
|
batch_id: -1320898453
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
1. Secret
|
1. Secret
|
||||||
|
|
||||||
DEBUG: OTP enum type: OTP_TOTP
|
DEBUG: OTP enum type: OTP_TOTP
|
||||||
Name: pi@raspberrypi
|
Name: pi@raspberrypi
|
||||||
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
Issuer: raspberrypi
|
Issuer: raspberrypi
|
||||||
@@ -68,17 +68,16 @@ otpauth://totp/pi%40raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&issuer=raspber
|
|||||||
# otpauth://totp/pi@raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY
|
# otpauth://totp/pi@raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
otpauth-migration://offline?data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4%2F%2F%2F%2F%2FwE%3D
|
otpauth-migration://offline?data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4%2F%2F%2F%2F%2FwE%3D
|
||||||
|
|
||||||
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4%2F%2F%2F%2F%2FwE%3D', fragment='')
|
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4%2F%2F%2F%2F%2FwE%3D', fragment='')
|
||||||
|
|
||||||
DEBUG: querystring params={'data': ['CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4/////wE=']}
|
DEBUG: querystring params={'data': ['CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4/////wE=']}
|
||||||
|
|
||||||
DEBUG: data_base64=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4/////wE=
|
DEBUG: data_base64=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4/////wE=
|
||||||
|
|
||||||
DEBUG: data_base64_fixed=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4/////wE=
|
DEBUG: data_base64_fixed=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4/////wE=
|
||||||
|
|
||||||
DEBUG:
|
DEBUG:
|
||||||
2. Payload Line
|
2. Payload Line otp_parameters {
|
||||||
otp_parameters {
|
|
||||||
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
||||||
name: "pi@raspberrypi"
|
name: "pi@raspberrypi"
|
||||||
algorithm: ALGO_SHA1
|
algorithm: ALGO_SHA1
|
||||||
@@ -88,11 +87,12 @@ otp_parameters {
|
|||||||
version: 1
|
version: 1
|
||||||
batch_size: 1
|
batch_size: 1
|
||||||
batch_id: -2094403140
|
batch_id: -2094403140
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
2. Secret
|
2. Secret
|
||||||
|
|
||||||
DEBUG: OTP enum type: OTP_TOTP
|
DEBUG: OTP enum type: OTP_TOTP
|
||||||
Name: pi@raspberrypi
|
Name: pi@raspberrypi
|
||||||
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
Type: totp
|
Type: totp
|
||||||
@@ -103,17 +103,16 @@ otpauth://totp/pi%40raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY
|
|||||||
# otpauth://totp/pi@raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY
|
# otpauth://totp/pi@raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
otpauth-migration://offline?data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa%2Bf%2F%2F%2F%2F8B
|
otpauth-migration://offline?data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa%2Bf%2F%2F%2F%2F8B
|
||||||
|
|
||||||
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa%2Bf%2F%2F%2F%2F8B', fragment='')
|
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa%2Bf%2F%2F%2F%2F8B', fragment='')
|
||||||
|
|
||||||
DEBUG: querystring params={'data': ['CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa+f////8B']}
|
DEBUG: querystring params={'data': ['CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa+f////8B']}
|
||||||
|
|
||||||
DEBUG: data_base64=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa+f////8B
|
DEBUG: data_base64=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa+f////8B
|
||||||
|
|
||||||
DEBUG: data_base64_fixed=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa+f////8B
|
DEBUG: data_base64_fixed=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa+f////8B
|
||||||
|
|
||||||
DEBUG:
|
DEBUG:
|
||||||
3. Payload Line
|
3. Payload Line otp_parameters {
|
||||||
otp_parameters {
|
|
||||||
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
||||||
name: "pi@raspberrypi"
|
name: "pi@raspberrypi"
|
||||||
algorithm: ALGO_SHA1
|
algorithm: ALGO_SHA1
|
||||||
@@ -131,11 +130,12 @@ otp_parameters {
|
|||||||
version: 1
|
version: 1
|
||||||
batch_size: 1
|
batch_size: 1
|
||||||
batch_id: -1822886384
|
batch_id: -1822886384
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
3. Secret
|
3. Secret
|
||||||
|
|
||||||
DEBUG: OTP enum type: OTP_TOTP
|
DEBUG: OTP enum type: OTP_TOTP
|
||||||
Name: pi@raspberrypi
|
Name: pi@raspberrypi
|
||||||
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
Type: totp
|
Type: totp
|
||||||
@@ -144,7 +144,7 @@ otpauth://totp/pi%40raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY
|
|||||||
|
|
||||||
4. Secret
|
4. Secret
|
||||||
|
|
||||||
DEBUG: OTP enum type: OTP_TOTP
|
DEBUG: OTP enum type: OTP_TOTP
|
||||||
Name: pi@raspberrypi
|
Name: pi@raspberrypi
|
||||||
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
Issuer: raspberrypi
|
Issuer: raspberrypi
|
||||||
@@ -155,17 +155,16 @@ otpauth://totp/pi%40raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&issuer=raspber
|
|||||||
# otpauth://hotp/hotp%20demo?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&counter=4
|
# otpauth://hotp/hotp%20demo?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&counter=4
|
||||||
otpauth-migration://offline?data=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6%2F%2F%2F%2F%2FwE%3D
|
otpauth-migration://offline?data=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6%2F%2F%2F%2F%2FwE%3D
|
||||||
|
|
||||||
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6%2F%2F%2F%2F%2FwE%3D', fragment='')
|
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6%2F%2F%2F%2F%2FwE%3D', fragment='')
|
||||||
|
|
||||||
DEBUG: querystring params={'data': ['CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6/////wE=']}
|
DEBUG: querystring params={'data': ['CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6/////wE=']}
|
||||||
|
|
||||||
DEBUG: data_base64=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6/////wE=
|
DEBUG: data_base64=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6/////wE=
|
||||||
|
|
||||||
DEBUG: data_base64_fixed=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6/////wE=
|
DEBUG: data_base64_fixed=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6/////wE=
|
||||||
|
|
||||||
DEBUG:
|
DEBUG:
|
||||||
4. Payload Line
|
4. Payload Line otp_parameters {
|
||||||
otp_parameters {
|
|
||||||
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
||||||
name: "hotp demo"
|
name: "hotp demo"
|
||||||
algorithm: ALGO_SHA1
|
algorithm: ALGO_SHA1
|
||||||
@@ -176,11 +175,12 @@ otp_parameters {
|
|||||||
version: 1
|
version: 1
|
||||||
batch_size: 1
|
batch_size: 1
|
||||||
batch_id: -1558849573
|
batch_id: -1558849573
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
5. Secret
|
5. Secret
|
||||||
|
|
||||||
DEBUG: OTP enum type: OTP_HOTP
|
DEBUG: OTP enum type: OTP_HOTP
|
||||||
Name: hotp demo
|
Name: hotp demo
|
||||||
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
Type: hotp
|
Type: hotp
|
||||||
@@ -192,17 +192,16 @@ otpauth://hotp/hotp%20demo?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&counter=4
|
|||||||
# Name: "encoding: ¿äÄéÉ? (demo)"
|
# Name: "encoding: ¿äÄéÉ? (demo)"
|
||||||
otpauth-migration://offline?data=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv%2F%2F%2F%2F%2F%2FAQ%3D%3D
|
otpauth-migration://offline?data=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv%2F%2F%2F%2F%2F%2FAQ%3D%3D
|
||||||
|
|
||||||
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv%2F%2F%2F%2F%2F%2FAQ%3D%3D', fragment='')
|
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv%2F%2F%2F%2F%2F%2FAQ%3D%3D', fragment='')
|
||||||
|
|
||||||
DEBUG: querystring params={'data': ['CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv//////AQ==']}
|
DEBUG: querystring params={'data': ['CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv//////AQ==']}
|
||||||
|
|
||||||
DEBUG: data_base64=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv//////AQ==
|
DEBUG: data_base64=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv//////AQ==
|
||||||
|
|
||||||
DEBUG: data_base64_fixed=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv//////AQ==
|
DEBUG: data_base64_fixed=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv//////AQ==
|
||||||
|
|
||||||
DEBUG:
|
DEBUG:
|
||||||
5. Payload Line
|
5. Payload Line otp_parameters {
|
||||||
otp_parameters {
|
|
||||||
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
||||||
name: "encoding: ¿äÄéÉ? (demo)"
|
name: "encoding: ¿äÄéÉ? (demo)"
|
||||||
algorithm: ALGO_SHA1
|
algorithm: ALGO_SHA1
|
||||||
@@ -212,11 +211,12 @@ otp_parameters {
|
|||||||
version: 1
|
version: 1
|
||||||
batch_size: 1
|
batch_size: 1
|
||||||
batch_id: -171198419
|
batch_id: -171198419
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
6. Secret
|
6. Secret
|
||||||
|
|
||||||
DEBUG: OTP enum type: OTP_TOTP
|
DEBUG: OTP enum type: OTP_TOTP
|
||||||
Name: encoding: ¿äÄéÉ? (demo)
|
Name: encoding: ¿äÄéÉ? (demo)
|
||||||
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
Type: totp
|
Type: totp
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
QReader installed: True
|
QReader installed: True
|
||||||
CV2 version: 4.10.0
|
CV2 version: 4.7.0
|
||||||
QR reading mode: ZBAR
|
QR reading mode: ZBAR
|
||||||
|
|
||||||
Input files: ['example_export.txt']
|
Input files: ['example_export.txt']
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
QReader installed: True
|
QReader installed: True
|
||||||
CV2 version: 4.10.0
|
CV2 version: 4.7.0
|
||||||
QR reading mode: ZBAR
|
QR reading mode: ZBAR
|
||||||
|
|
||||||
Input files: ['example_export.txt']
|
Input files: ['example_export.txt']
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
QReader installed: True
|
QReader installed: True
|
||||||
CV2 version: 4.10.0
|
CV2 version: 4.7.0
|
||||||
QR reading mode: ZBAR
|
QR reading mode: ZBAR
|
||||||
|
|
||||||
Version: extract_otp_secrets 2.8.1.post17+git.3dc7d1c2.dirty Linux x86_64 Python 3.11.9 (CPython/called as script)
|
Version: extract_otp_secrets 2.0.2.post50+git.158245dd.dirty Linux x86_64 Python 3.11.1 (CPython/called as script)
|
||||||
|
|
||||||
Input files: ['example_export.txt']
|
Input files: ['example_export.txt']
|
||||||
[36mProcessing infile example_export.txt[39m
|
[36mProcessing infile example_export.txt[39m
|
||||||
@@ -32,17 +32,16 @@ Reading lines of example_export.txt
|
|||||||
[36m# otpauth://totp/pi@raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&issuer=raspberrypi[39m
|
[36m# otpauth://totp/pi@raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&issuer=raspberrypi[39m
|
||||||
[36motpauth-migration://offline?data=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK%2B%2F%2F%2F%2F%2F8B[39m
|
[36motpauth-migration://offline?data=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK%2B%2F%2F%2F%2F%2F8B[39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK%2B%2F%2F%2F%2F%2F8B', fragment='') [39m
|
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK%2B%2F%2F%2F%2F%2F8B', fragment='') [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: querystring params={'data': ['CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK+/////8B']} [39m
|
DEBUG: querystring params={'data': ['CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK+/////8B']} [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: data_base64=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK+/////8B [39m
|
DEBUG: data_base64=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK+/////8B [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: data_base64_fixed=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK+/////8B [39m
|
DEBUG: data_base64_fixed=CjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACjr4JKK+/////8B [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG:
|
DEBUG:
|
||||||
1. Payload Line
|
1. Payload Line otp_parameters {
|
||||||
otp_parameters {
|
|
||||||
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
||||||
name: "pi@raspberrypi"
|
name: "pi@raspberrypi"
|
||||||
issuer: "raspberrypi"
|
issuer: "raspberrypi"
|
||||||
@@ -53,12 +52,12 @@ otp_parameters {
|
|||||||
version: 1
|
version: 1
|
||||||
batch_size: 1
|
batch_size: 1
|
||||||
batch_id: -1320898453
|
batch_id: -1320898453
|
||||||
|
[39m
|
||||||
|
|
||||||
[39m
|
|
||||||
|
|
||||||
1. Secret
|
1. Secret
|
||||||
[36m
|
[36m
|
||||||
DEBUG: OTP enum type: OTP_TOTP [39m
|
DEBUG: OTP enum type: OTP_TOTP [39m
|
||||||
Name: pi@raspberrypi
|
Name: pi@raspberrypi
|
||||||
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
Issuer: raspberrypi
|
Issuer: raspberrypi
|
||||||
@@ -69,17 +68,16 @@ otpauth://totp/pi%40raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&issuer=raspber
|
|||||||
[36m# otpauth://totp/pi@raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY[39m
|
[36m# otpauth://totp/pi@raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY[39m
|
||||||
[36motpauth-migration://offline?data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4%2F%2F%2F%2F%2FwE%3D[39m
|
[36motpauth-migration://offline?data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4%2F%2F%2F%2F%2FwE%3D[39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4%2F%2F%2F%2F%2FwE%3D', fragment='') [39m
|
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4%2F%2F%2F%2F%2FwE%3D', fragment='') [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: querystring params={'data': ['CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4/////wE=']} [39m
|
DEBUG: querystring params={'data': ['CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4/////wE=']} [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: data_base64=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4/////wE= [39m
|
DEBUG: data_base64=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4/////wE= [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: data_base64_fixed=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4/////wE= [39m
|
DEBUG: data_base64_fixed=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACEAEYASAAKLzjp5n4/////wE= [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG:
|
DEBUG:
|
||||||
2. Payload Line
|
2. Payload Line otp_parameters {
|
||||||
otp_parameters {
|
|
||||||
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
||||||
name: "pi@raspberrypi"
|
name: "pi@raspberrypi"
|
||||||
algorithm: ALGO_SHA1
|
algorithm: ALGO_SHA1
|
||||||
@@ -89,12 +87,12 @@ otp_parameters {
|
|||||||
version: 1
|
version: 1
|
||||||
batch_size: 1
|
batch_size: 1
|
||||||
batch_id: -2094403140
|
batch_id: -2094403140
|
||||||
|
[39m
|
||||||
|
|
||||||
[39m
|
|
||||||
|
|
||||||
2. Secret
|
2. Secret
|
||||||
[36m
|
[36m
|
||||||
DEBUG: OTP enum type: OTP_TOTP [39m
|
DEBUG: OTP enum type: OTP_TOTP [39m
|
||||||
Name: pi@raspberrypi
|
Name: pi@raspberrypi
|
||||||
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
Type: totp
|
Type: totp
|
||||||
@@ -105,17 +103,16 @@ otpauth://totp/pi%40raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY
|
|||||||
[36m# otpauth://totp/pi@raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY[39m
|
[36m# otpauth://totp/pi@raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY[39m
|
||||||
[36motpauth-migration://offline?data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa%2Bf%2F%2F%2F%2F8B[39m
|
[36motpauth-migration://offline?data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa%2Bf%2F%2F%2F%2F8B[39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa%2Bf%2F%2F%2F%2F8B', fragment='') [39m
|
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa%2Bf%2F%2F%2F%2F8B', fragment='') [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: querystring params={'data': ['CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa+f////8B']} [39m
|
DEBUG: querystring params={'data': ['CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa+f////8B']} [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: data_base64=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa+f////8B [39m
|
DEBUG: data_base64=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa+f////8B [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: data_base64_fixed=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa+f////8B [39m
|
DEBUG: data_base64_fixed=CigKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpIAEoATACCjUKEPqlBekzoNEukL7qlsjBCDYSDnBpQHJhc3BiZXJyeXBpGgtyYXNwYmVycnlwaSABKAEwAhABGAEgACiQ7OOa+f////8B [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG:
|
DEBUG:
|
||||||
3. Payload Line
|
3. Payload Line otp_parameters {
|
||||||
otp_parameters {
|
|
||||||
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
||||||
name: "pi@raspberrypi"
|
name: "pi@raspberrypi"
|
||||||
algorithm: ALGO_SHA1
|
algorithm: ALGO_SHA1
|
||||||
@@ -133,12 +130,12 @@ otp_parameters {
|
|||||||
version: 1
|
version: 1
|
||||||
batch_size: 1
|
batch_size: 1
|
||||||
batch_id: -1822886384
|
batch_id: -1822886384
|
||||||
|
[39m
|
||||||
|
|
||||||
[39m
|
|
||||||
|
|
||||||
3. Secret
|
3. Secret
|
||||||
[36m
|
[36m
|
||||||
DEBUG: OTP enum type: OTP_TOTP [39m
|
DEBUG: OTP enum type: OTP_TOTP [39m
|
||||||
Name: pi@raspberrypi
|
Name: pi@raspberrypi
|
||||||
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
Type: totp
|
Type: totp
|
||||||
@@ -147,7 +144,7 @@ otpauth://totp/pi%40raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY
|
|||||||
|
|
||||||
4. Secret
|
4. Secret
|
||||||
[36m
|
[36m
|
||||||
DEBUG: OTP enum type: OTP_TOTP [39m
|
DEBUG: OTP enum type: OTP_TOTP [39m
|
||||||
Name: pi@raspberrypi
|
Name: pi@raspberrypi
|
||||||
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
Issuer: raspberrypi
|
Issuer: raspberrypi
|
||||||
@@ -158,17 +155,16 @@ otpauth://totp/pi%40raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&issuer=raspber
|
|||||||
[36m# otpauth://hotp/hotp%20demo?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&counter=4[39m
|
[36m# otpauth://hotp/hotp%20demo?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&counter=4[39m
|
||||||
[36motpauth-migration://offline?data=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6%2F%2F%2F%2F%2FwE%3D[39m
|
[36motpauth-migration://offline?data=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6%2F%2F%2F%2F%2FwE%3D[39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6%2F%2F%2F%2F%2FwE%3D', fragment='') [39m
|
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6%2F%2F%2F%2F%2FwE%3D', fragment='') [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: querystring params={'data': ['CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6/////wE=']} [39m
|
DEBUG: querystring params={'data': ['CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6/////wE=']} [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: data_base64=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6/////wE= [39m
|
DEBUG: data_base64=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6/////wE= [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: data_base64_fixed=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6/////wE= [39m
|
DEBUG: data_base64_fixed=CiUKEPqlBekzoNEukL7qlsjBCDYSCWhvdHAgZGVtbyABKAEwATgEEAEYASAAKNuv15j6/////wE= [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG:
|
DEBUG:
|
||||||
4. Payload Line
|
4. Payload Line otp_parameters {
|
||||||
otp_parameters {
|
|
||||||
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
||||||
name: "hotp demo"
|
name: "hotp demo"
|
||||||
algorithm: ALGO_SHA1
|
algorithm: ALGO_SHA1
|
||||||
@@ -179,12 +175,12 @@ otp_parameters {
|
|||||||
version: 1
|
version: 1
|
||||||
batch_size: 1
|
batch_size: 1
|
||||||
batch_id: -1558849573
|
batch_id: -1558849573
|
||||||
|
[39m
|
||||||
|
|
||||||
[39m
|
|
||||||
|
|
||||||
5. Secret
|
5. Secret
|
||||||
[36m
|
[36m
|
||||||
DEBUG: OTP enum type: OTP_HOTP [39m
|
DEBUG: OTP enum type: OTP_HOTP [39m
|
||||||
Name: hotp demo
|
Name: hotp demo
|
||||||
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
Type: hotp
|
Type: hotp
|
||||||
@@ -196,17 +192,16 @@ otpauth://hotp/hotp%20demo?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&counter=4
|
|||||||
[36m# Name: "encoding: ¿äÄéÉ? (demo)"[39m
|
[36m# Name: "encoding: ¿äÄéÉ? (demo)"[39m
|
||||||
[36motpauth-migration://offline?data=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv%2F%2F%2F%2F%2F%2FAQ%3D%3D[39m
|
[36motpauth-migration://offline?data=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv%2F%2F%2F%2F%2F%2FAQ%3D%3D[39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv%2F%2F%2F%2F%2F%2FAQ%3D%3D', fragment='') [39m
|
DEBUG: parsed_url=ParseResult(scheme='otpauth-migration', netloc='offline', path='', params='', query='data=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv%2F%2F%2F%2F%2F%2FAQ%3D%3D', fragment='') [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: querystring params={'data': ['CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv//////AQ==']} [39m
|
DEBUG: querystring params={'data': ['CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv//////AQ==']} [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: data_base64=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv//////AQ== [39m
|
DEBUG: data_base64=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv//////AQ== [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG: data_base64_fixed=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv//////AQ== [39m
|
DEBUG: data_base64_fixed=CjYKEPqlBekzoNEukL7qlsjBCDYSHGVuY29kaW5nOiDCv8Okw4TDqcOJPyAoZGVtbykgASgBMAIQARgBIAAorfCurv//////AQ== [39m
|
||||||
[36m
|
[36m
|
||||||
DEBUG:
|
DEBUG:
|
||||||
5. Payload Line
|
5. Payload Line otp_parameters {
|
||||||
otp_parameters {
|
|
||||||
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
secret: "\372\245\005\3513\240\321.\220\276\352\226\310\301\0106"
|
||||||
name: "encoding: ¿äÄéÉ? (demo)"
|
name: "encoding: ¿äÄéÉ? (demo)"
|
||||||
algorithm: ALGO_SHA1
|
algorithm: ALGO_SHA1
|
||||||
@@ -216,12 +211,12 @@ otp_parameters {
|
|||||||
version: 1
|
version: 1
|
||||||
batch_size: 1
|
batch_size: 1
|
||||||
batch_id: -171198419
|
batch_id: -171198419
|
||||||
|
[39m
|
||||||
|
|
||||||
[39m
|
|
||||||
|
|
||||||
6. Secret
|
6. Secret
|
||||||
[36m
|
[36m
|
||||||
DEBUG: OTP enum type: OTP_TOTP [39m
|
DEBUG: OTP enum type: OTP_TOTP [39m
|
||||||
Name: encoding: ¿äÄéÉ? (demo)
|
Name: encoding: ¿äÄéÉ? (demo)
|
||||||
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
Secret: 7KSQL2JTUDIS5EF65KLMRQIIGY
|
||||||
Type: totp
|
Type: totp
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
otpauth://totp/pi%40raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&issuer=raspberrypi
|
|
||||||
otpauth://totp/pi%40raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY
|
|
||||||
otpauth://totp/pi%40raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY
|
|
||||||
otpauth://totp/pi%40raspberrypi?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&issuer=raspberrypi
|
|
||||||
otpauth://hotp/hotp%20demo?secret=7KSQL2JTUDIS5EF65KLMRQIIGY&counter=4
|
|
||||||
otpauth://totp/encoding%3A%20%C2%BF%C3%A4%C3%84%C3%A9%C3%89%3F%20%28demo%29?secret=7KSQL2JTUDIS5EF65KLMRQIIGY
|
|
||||||
@@ -418,37 +418,6 @@ def test_extract_txt_stdout_only_comments(capsys: pytest.CaptureFixture[str]) ->
|
|||||||
assert captured.err == ''
|
assert captured.err == ''
|
||||||
|
|
||||||
|
|
||||||
def test_extract_urls(capsys: pytest.CaptureFixture[str], tmp_path: pathlib.Path) -> None:
|
|
||||||
# Arrange
|
|
||||||
output_file = str(tmp_path / 'test_example_url_list.txt')
|
|
||||||
|
|
||||||
# Act
|
|
||||||
extract_otp_secrets.main(['-q', '-u', output_file, 'example_export.txt'])
|
|
||||||
|
|
||||||
# Assert
|
|
||||||
expected_txt = read_file_to_str('tests/data/url_list_output.txt')
|
|
||||||
actual_txt = read_file_to_str(output_file)
|
|
||||||
|
|
||||||
assert actual_txt == expected_txt
|
|
||||||
|
|
||||||
captured = capsys.readouterr()
|
|
||||||
|
|
||||||
assert captured.out == ''
|
|
||||||
assert captured.err == ''
|
|
||||||
|
|
||||||
|
|
||||||
def test_extract_urls_stdout(capsys: pytest.CaptureFixture[str]) -> None:
|
|
||||||
# Act
|
|
||||||
extract_otp_secrets.main(['-u', '-', 'example_export.txt'])
|
|
||||||
|
|
||||||
# Assert
|
|
||||||
expected_txt = read_file_to_str('tests/data/url_list_output.txt')
|
|
||||||
captured = capsys.readouterr()
|
|
||||||
|
|
||||||
assert captured.out == expected_txt
|
|
||||||
assert captured.err == ''
|
|
||||||
|
|
||||||
|
|
||||||
def test_extract_not_encoded_plus(capsys: pytest.CaptureFixture[str]) -> None:
|
def test_extract_not_encoded_plus(capsys: pytest.CaptureFixture[str]) -> None:
|
||||||
# Act
|
# Act
|
||||||
extract_otp_secrets.main(['tests/data/test_plus_problem_export.txt'])
|
extract_otp_secrets.main(['tests/data/test_plus_problem_export.txt'])
|
||||||
@@ -559,7 +528,7 @@ def test_normalize_bytes() -> None:
|
|||||||
# Generate verbose output:
|
# Generate verbose output:
|
||||||
# for color in '' '-n'; do for level in '' '-v' '-vv' '-vvv'; do python3.11 src/extract_otp_secrets.py example_export.txt $color $level > tests/data/print_verbose_output$color$level.txt; done; done
|
# for color in '' '-n'; do for level in '' '-v' '-vv' '-vvv'; do python3.11 src/extract_otp_secrets.py example_export.txt $color $level > tests/data/print_verbose_output$color$level.txt; done; done
|
||||||
# workaround for PYTHON <= 3.10
|
# workaround for PYTHON <= 3.10
|
||||||
@pytest.mark.skipif(sys.version_info < (3, 10) or sys.platform.startswith("win"), reason="fileinput.input encoding exists since PYTHON 3.10 OR Windows fatal exception: access violation")
|
@pytest.mark.skipif(sys.version_info < (3, 10), reason="fileinput.input encoding exists since PYTHON 3.10")
|
||||||
@pytest.mark.parametrize("verbose_level", ['', '-v', '-vv', '-vvv'])
|
@pytest.mark.parametrize("verbose_level", ['', '-v', '-vv', '-vvv'])
|
||||||
@pytest.mark.parametrize("color", ['', '-n'])
|
@pytest.mark.parametrize("color", ['', '-n'])
|
||||||
def test_extract_verbose(verbose_level: str, color: str, capsys: pytest.CaptureFixture[str], relaxed: bool) -> None:
|
def test_extract_verbose(verbose_level: str, color: str, capsys: pytest.CaptureFixture[str], relaxed: bool) -> None:
|
||||||
@@ -849,14 +818,7 @@ data=XXXX
|
|||||||
Exception: unpack requires a buffer of 4 bytes
|
Exception: unpack requires a buffer of 4 bytes
|
||||||
'''
|
'''
|
||||||
|
|
||||||
#
|
assert captured.err == first_expected_stderr or captured.err == second_expected_stderr
|
||||||
third_expected_stderr = '''
|
|
||||||
ERROR: Cannot decode otpauth-migration migration payload.
|
|
||||||
data=XXXX
|
|
||||||
Exception: Error parsing message with type 'MigrationPayload'
|
|
||||||
'''
|
|
||||||
|
|
||||||
assert captured.err == first_expected_stderr or captured.err == second_expected_stderr or captured.err == third_expected_stderr
|
|
||||||
assert captured.out == ''
|
assert captured.out == ''
|
||||||
assert e.value.code == 1
|
assert e.value.code == 1
|
||||||
assert e.type == SystemExit
|
assert e.type == SystemExit
|
||||||
|
|||||||
Reference in New Issue
Block a user