move Dockerfiles to docker/; update README

pull/64/head
scito 1 year ago committed by Roland Kurmann
parent 05f3d89c42
commit 9e334748ac

@ -72,6 +72,6 @@ jobs:
pytest-coverage-path: ./pytest-coverage.txt pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml junitxml-path: ./pytest.xml
if: | if: |
matrix.python-version == '3.x' && matrix.platform == 'ubuntu-latest' false && matrix.python-version == '3.x' && matrix.platform == 'ubuntu-latest'
&& !contains(github.ref, 'refs/tags/') && !contains(github.ref, 'refs/tags/')

@ -79,7 +79,7 @@ jobs:
# relative path to the place where source code with Dockerfile is located # relative path to the place where source code with Dockerfile is located
# TODO file:, move to docker/ # TODO file:, move to docker/
context: . context: .
file: Dockerfile file: docker/Dockerfile
# builder: ${{ steps.buildx.outputs.name }} # builder: ${{ steps.buildx.outputs.name }}
# Note: tags has to be all lower-case # Note: tags has to be all lower-case
pull: true pull: true
@ -152,7 +152,7 @@ jobs:
# relative path to the place where source code with Dockerfile is located # relative path to the place where source code with Dockerfile is located
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
context: . context: .
file: Dockerfile_only_txt file: docker/Dockerfile_only_txt
# builder: ${{ steps.buildx.outputs.name }} # builder: ${{ steps.buildx.outputs.name }}
# Note: tags has to be all lower-case # Note: tags has to be all lower-case
pull: true pull: true
@ -235,7 +235,7 @@ jobs:
# relative path to the place where source code with Dockerfile is located # relative path to the place where source code with Dockerfile is located
# TODO file:, move to docker/ # TODO file:, move to docker/
context: . context: .
file: Dockerfile file: docker/Dockerfile
# builder: ${{ steps.buildx.outputs.name }} # builder: ${{ steps.buildx.outputs.name }}
build-args: | build-args: |
BASE_IMAGE=python:3.11-slim-buster BASE_IMAGE=python:3.11-slim-buster

2
Pipfile.lock generated

@ -55,7 +55,7 @@
"sha256:f64bb98ac59b3ea3bf74b02f13836eb2e24e48e0ab0145bbda646295769bd780", "sha256:f64bb98ac59b3ea3bf74b02f13836eb2e24e48e0ab0145bbda646295769bd780",
"sha256:f9006288bcf4895917d02583cf3411f98631275bc67cce355a7f39f8c14338fa" "sha256:f9006288bcf4895917d02583cf3411f98631275bc67cce355a7f39f8c14338fa"
], ],
"markers": "python_version >= '3.7'", "markers": "python_version >= '3.10'",
"version": "==1.24.2" "version": "==1.24.2"
}, },
"opencv-contrib-python": { "opencv-contrib-python": {

@ -37,7 +37,7 @@ The secrets can be exported to JSON or CSV, or printed as QR codes to console or
## Table of contents ## Table of contents
- [Download and run binary executable (🆕 since v2.1)](#download-and-run-binary-executable--since-v21) - [Download and run binary executable (🆕 since v2.1)](#download-and-run-binary-executable--since-v21)
- [MacOS application](#macos-application) - [MacOS](#macos)
- [Usage](#usage) - [Usage](#usage)
- [Capture QR codes from camera (🆕 since version 2.0)](#capture-qr-codes-from-camera--since-version-20) - [Capture QR codes from camera (🆕 since version 2.0)](#capture-qr-codes-from-camera--since-version-20)
- [With builtin QR decoder from image files (🆕 since version 2.0)](#with-builtin-qr-decoder-from-image-files--since-version-20) - [With builtin QR decoder from image files (🆕 since version 2.0)](#with-builtin-qr-decoder-from-image-files--since-version-20)
@ -108,7 +108,7 @@ The secrets can be exported to JSON or CSV, or printed as QR codes to console or
:information_source: The executables are not signed. Thus, the operating system may show a warning about download from unknown source. :information_source: The executables are not signed. Thus, the operating system may show a warning about download from unknown source.
### MacOS application ### MacOS
> Beginning in macOS 10.15, all software built after June 1, 2019, and distributed with Developer ID must be notarized. However, you arent required to notarize software that you distribute through the Mac App Store because the App Store submission process already includes equivalent security checks. <small>[developer.apple.com](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution)</small> > Beginning in macOS 10.15, all software built after June 1, 2019, and distributed with Developer ID must be notarized. However, you arent required to notarize software that you distribute through the Mac App Store because the App Store submission process already includes equivalent security checks. <small>[developer.apple.com](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution)</small>
@ -122,6 +122,15 @@ However, the bare executable can be executed from the command line:
4. Set executable bit for the downloaded file: `chmod +x extract_otp_secrets_OS_vX.X.X` 4. Set executable bit for the downloaded file: `chmod +x extract_otp_secrets_OS_vX.X.X`
5. Start executable from command line: `./extract_otp_secrets_OS_vX.X.X` 5. Start executable from command line: `./extract_otp_secrets_OS_vX.X.X`
#### Apple Silicon (ARM)
Currently, there is no build for M1 and M2 Apple Silicon processors due to lack of hardware. However, the binary executable should be runnable by Rosetta2 emulation.
```
arch -x86_64 extract_otp_secrets_OS_vX.X.X
```
:warning: This command is untested due to lack of hardware.
## Usage ## Usage
### Capture QR codes from camera (🆕 since version 2.0) ### Capture QR codes from camera (🆕 since version 2.0)
@ -345,8 +354,8 @@ python extract_otp_secrets.py = < example_export.png</pre>
* extract_otp_secrets_linux_arm64 (requires glibc >= 2.28) * extract_otp_secrets_linux_arm64 (requires glibc >= 2.28)
* extract_otp_secrets_win_x86_64.exe * extract_otp_secrets_win_x86_64.exe
* 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-application) * extract_otp_secrets_macos_x86_64.dmg N/A, see [why](#macos)
* extract_otp_secrets_macos_x86_64.pkg N/A, see [why](#macos-application) * extract_otp_secrets_macos_x86_64.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
@ -622,7 +631,7 @@ pip install -U -r requirements.txt
Build and run the app within the container: Build and run the app within the container:
```bash ```bash
docker build . -t extract_otp_secrets --pull --build-arg RUN_TESTS=false docker build . -t extract_otp_secrets --pull -f docker/Dockerfile --build-arg RUN_TESTS=false
``` ```
Run tests in docker container: Run tests in docker container:
@ -634,7 +643,7 @@ docker run --entrypoint /extract/run_pytest.sh --rm -v "$(pwd)":/files:ro extrac
#### Alpine (only text file processing) #### Alpine (only text file processing)
```bash ```bash
docker build . -t extract_otp_secrets:only_txt --pull -f Dockerfile_only_txt --build-arg RUN_TESTS=false docker build . -t extract_otp_secrets:only_txt --pull -f docker/Dockerfile_only_txt --build-arg RUN_TESTS=false
``` ```
Run tests in docker container: Run tests in docker container:

@ -374,7 +374,7 @@ if $build_docker; then
# Build docker # Build docker
# Build Dockerfile_only_txt (Alpine) # Build Dockerfile_only_txt (Alpine)
cmd="docker build . -t extract_otp_secrets_only_txt -t extract_otp_secrets:only-txt -t extract_otp_secrets:alpine -f Dockerfile_only_txt --pull --build-arg RUN_TESTS=false" cmd="docker build . -t extract_otp_secrets_only_txt -t extract_otp_secrets:only-txt -t extract_otp_secrets:alpine -f docker/Dockerfile_only_txt --pull --build-arg RUN_TESTS=false"
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"
@ -391,7 +391,7 @@ if $build_docker; then
eval "$cmd" eval "$cmd"
# Build extract_otp_secrets (Debian Bullseye) # Build extract_otp_secrets (Debian Bullseye)
cmd="docker build . -t extract_otp_secrets -t extract_otp_secrets:bullseye --pull --build-arg RUN_TESTS=false" cmd="docker build . -t extract_otp_secrets -t extract_otp_secrets:bullseye --pull -f docker/Dockerfile --build-arg RUN_TESTS=false"
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"
@ -412,7 +412,7 @@ if $build_docker; then
eval "$cmd" eval "$cmd"
# Build extract_otp_secrets (Debian Buster) # Build extract_otp_secrets (Debian Buster)
cmd="docker build . -t extract_otp_secrets:buster --pull --build-arg RUN_TESTS=false --build-arg BASE_IMAGE=python:3.11-slim-buster" cmd="docker build . -t extract_otp_secrets:buster --pull -f docker/Dockerfile --build-arg RUN_TESTS=false --build-arg BASE_IMAGE=python:3.11-slim-buster"
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"
@ -469,7 +469,7 @@ if $build_docker; then
# build linux/arm64 # build linux/arm64
# Build extract_otp_secrets (Debian Buster) # Build extract_otp_secrets (Debian Buster)
cmd="docker buildx build --platform=linux/arm64 . -t extract_otp_secrets:buster --pull --build-arg RUN_TESTS=false --build-arg BASE_IMAGE=python:3.11-slim-buster" cmd="docker buildx build --platform=linux/arm64 . -t extract_otp_secrets:buster --pull -f docker/Dockerfile --build-arg RUN_TESTS=false --build-arg BASE_IMAGE=python:3.11-slim-buster"
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"

@ -4,7 +4,7 @@ Generate from file: README.md
- [Table of contents](#table-of-contents) - [Table of contents](#table-of-contents)
- [Download and run binary executable (🆕 since v2.1)](#download-and-run-binary-executable--since-v21) - [Download and run binary executable (🆕 since v2.1)](#download-and-run-binary-executable--since-v21)
- [MacOS application](#macos-application) - [MacOS](#macos)
- [Usage](#usage) - [Usage](#usage)
- [Capture QR codes from camera (🆕 since version 2.0)](#capture-qr-codes-from-camera--since-version-20) - [Capture QR codes from camera (🆕 since version 2.0)](#capture-qr-codes-from-camera--since-version-20)
- [With builtin QR decoder from image files (🆕 since version 2.0)](#with-builtin-qr-decoder-from-image-files--since-version-20) - [With builtin QR decoder from image files (🆕 since version 2.0)](#with-builtin-qr-decoder-from-image-files--since-version-20)

Loading…
Cancel
Save