Jump to content
vectorforce

bcrypt

Recommended Posts

Здравствуйте, прошу помощи у знающих, для настройки авторизации radicale (carddav&caldav) требуется пакет bcrypt, есть проблемы с установкой.

Spoiler

~ # pip3 install bcrypt
Collecting bcrypt
  Using cached bcrypt-3.2.0.tar.gz (42 kB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/bin/python3 /opt/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /opt/tmp/pip-build-env-tk9yrc1v/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel 'cffi>=1.1; python_implementation != '"'"'PyPy'"'"''
       cwd: None
  Complete output (100 lines):
  Collecting cffi>=1.1
    Using cached cffi-1.14.4.tar.gz (471 kB)
  Collecting wheel
    Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
  Collecting pycparser
    Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
  Collecting setuptools>=40.8.0
    Using cached setuptools-51.0.0-py3-none-any.whl (785 kB)
  Building wheels for collected packages: cffi
    Building wheel for cffi (setup.py): started
    Building wheel for cffi (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /opt/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/opt/tmp/pip-install-5dycuzcx/cffi_550a07c9dd3a4a3c8cb063409a1c050d/setup.py'"'"'; __file__='"'"'/opt/tmp/pip-install-5dycuzcx/cffi_550a07c9dd3a4a3c8cb063409a1c050d/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /opt/tmp/pip-wheel-j6xu2w3l
         cwd: /opt/tmp/pip-install-5dycuzcx/cffi_550a07c9dd3a4a3c8cb063409a1c050d/
    Complete output (36 lines):
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-mips-3.9
    creating build/lib.linux-mips-3.9/cffi
    copying cffi/__init__.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/pkgconfig.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/verifier.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/vengine_cpy.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/ffiplatform.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/model.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/cparser.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/cffi_opcode.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/commontypes.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/error.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/setuptools_ext.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/vengine_gen.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/api.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/lock.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/backend_ctypes.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/recompiler.py -> build/lib.linux-mips-3.9/cffi
    copying cffi/_cffi_include.h -> build/lib.linux-mips-3.9/cffi
    copying cffi/parse_c_type.h -> build/lib.linux-mips-3.9/cffi
    copying cffi/_embedding.h -> build/lib.linux-mips-3.9/cffi
    copying cffi/_cffi_errors.h -> build/lib.linux-mips-3.9/cffi
    running build_ext
    building '_cffi_backend' extension
    creating build/temp.linux-mips-3.9
    creating build/temp.linux-mips-3.9/c
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -DNDEBUG -fno-inline -pthread -O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -DNDEBUG -fno-inline -pthread -I/home/ryzhovau/Entware.mipsel/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/include -I/home/ryzhovau/Entware.mipsel/staging_dir/toolchain-mipsel_mips32r2_gcc-8.4.0_glibc-2.27/include -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/opt/include/python3.9 -c c/_cffi_backend.c -o build/temp.linux-mips-3.9/c/_cffi_backend.o
    c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
     #include <ffi.h>
              ^~~~~~~
    compilation terminated.
    error: command '/opt/bin/gcc' failed with exit code 1
    ----------------------------------------
    ERROR: Failed building wheel for cffi
    Running setup.py clean for cffi
  Failed to build cffi
  Installing collected packages: pycparser, wheel, setuptools, cffi
      Running setup.py install for cffi: started
      Running setup.py install for cffi: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: /opt/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/opt/tmp/pip-install-5dycuzcx/cffi_550a07c9dd3a4a3c8cb063409a1c050d/setup.py'"'"'; __file__='"'"'/opt/tmp/pip-install-5dycuzcx/cffi_550a07c9dd3a4a3c8cb063409a1c050d/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /opt/tmp/pip-record-fjevzqqc/install-record.txt --single-version-externally-managed --prefix /opt/tmp/pip-build-env-tk9yrc1v/overlay --compile --install-headers /opt/tmp/pip-build-env-tk9yrc1v/overlay/include/python3.9/cffi
           cwd: /opt/tmp/pip-install-5dycuzcx/cffi_550a07c9dd3a4a3c8cb063409a1c050d/
      Complete output (36 lines):
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-mips-3.9
      creating build/lib.linux-mips-3.9/cffi
      copying cffi/__init__.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/verifier.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/model.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/cparser.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/commontypes.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/error.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/api.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/lock.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/recompiler.py -> build/lib.linux-mips-3.9/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-mips-3.9/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-mips-3.9/cffi
      copying cffi/_embedding.h -> build/lib.linux-mips-3.9/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-mips-3.9/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-mips-3.9
      creating build/temp.linux-mips-3.9/c
      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -DNDEBUG -fno-inline -pthread -O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -DNDEBUG -fno-inline -pthread -I/home/ryzhovau/Entware.mipsel/staging_dir/target-mipsel_mips32r2_glibc-2.27/opt/include -I/home/ryzhovau/Entware.mipsel/staging_dir/toolchain-mipsel_mips32r2_gcc-8.4.0_glibc-2.27/include -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/opt/include/python3.9 -c c/_cffi_backend.c -o build/temp.linux-mips-3.9/c/_cffi_backend.o
      c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
       #include <ffi.h>
                ^~~~~~~
      compilation terminated.
      error: command '/opt/bin/gcc' failed with exit code 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /opt/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/opt/tmp/pip-install-5dycuzcx/cffi_550a07c9dd3a4a3c8cb063409a1c050d/setup.py'"'"'; __file__='"'"'/opt/tmp/pip-install-5dycuzcx/cffi_550a07c9dd3a4a3c8cb063409a1c050d/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /opt/tmp/pip-record-fjevzqqc/install-record.txt --single-version-externally-managed --prefix /opt/tmp/pip-build-env-tk9yrc1v/overlay --compile --install-headers /opt/tmp/pip-build-env-tk9yrc1v/overlay/include/python3.9/cffi Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/bin/python3 /opt/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /opt/tmp/pip-build-env-tk9yrc1v/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel 'cffi>=1.1; python_implementation != '"'"'PyPy'"'"'' Check the logs for full command output.

 

Share this post


Link to post
Share on other sites

Ставьте из entware

opkg install python3-bcrypt

PS по хорошему в "системный" питон с pip'кой лучше не лезть, только если в своем venv

Edited by r13
  • Thanks 1

Share this post


Link to post
Share on other sites
4 минуты назад, vectorforce сказал:

такого пакета в entware к сожалению нет.

Странно...

BusyBox v1.31.1 () built-in shell (ash)

~ # opkg list python3-bc*
python3-bcrypt - 3.1.7-4 - Good password hashing for your software and your servers.
~ #

Share this post


Link to post
Share on other sites
opkg install http://bin.entware.net/mipselsf-k3.4/test/HA/python3-bcrypt_3.1.7-4_mipsel-3.4.ipk

 

  • Thanks 1

Share this post


Link to post
Share on other sites
10 минут назад, TheBB сказал:

opkg install http://bin.entware.net/mipselsf-k3.4/test/HA/python3-bcrypt_3.1.7-4_mipsel-3.4.ipk

 

А, вот почему ) пакет в репе HomeAssistant

Share this post


Link to post
Share on other sites
7 минут назад, r13 сказал:

А, вот почему ) пакет в репе HomeAssistant

угу, можно добавить в сборку (пакет есть в OpenWrt)

45 минут назад, vectorforce сказал:

требуется пакет bcrypt, есть проблемы с установкой.

выполнить https://github.com/Entware/Entware/wiki/Self-installation-of-python-modules и (если пропустили) https://github.com/Entware/Entware/wiki/Using-GCC-for-native-compilation

(для mipsel - `wget -qO- http://bin.entware.net/mipselsf-k3.2/include/include.tar.gz | tar xvz -C /opt/include`)

~ # pip3 install bcrypt
Collecting bcrypt
  Downloading bcrypt-3.2.0.tar.gz (42 kB)
     |████████████████████████████████| 42 kB 155 kB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: cffi>=1.1 in /opt/lib/python3.9/site-packages (from bcrypt) (1.14.4)
Requirement already satisfied: six>=1.4.1 in /opt/lib/python3.9/site-packages (from bcrypt) (1.15.0)
Requirement already satisfied: pycparser in /opt/lib/python3.9/site-packages (from cffi>=1.1->bcrypt) (2.20)
Building wheels for collected packages: bcrypt
  Building wheel for bcrypt (PEP 517) ... done
  Created wheel for bcrypt: filename=bcrypt-3.2.0-cp39-cp39-linux_mips.whl size=30606 sha256=5867d826400dc12ad6437152f26c6c9a19c4d442efd4172bbc92071e9992e3bd
  Stored in directory: /opt/root/.cache/pip/wheels/9a/0b/a2/2c559982bbee4bd184557267e5760e114de3e9ba826fe8d691
Successfully built bcrypt
Installing collected packages: bcrypt
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

homeassistant 2020.12.0 requires bcrypt==3.1.7, but you'll have bcrypt 3.2.0 which is incompatible.
Successfully installed bcrypt-3.2.0
WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
You should consider upgrading via the '/opt/bin/python3 -m pip install --upgrade pip' command.
~ # 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Спасибо, еще вопросик, убивается opkg shell, если закинуть в /opt/etc/init.d для автозапуска S100radicale:

Spoiler

#!/bin/sh

PATH=/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin:/usr/sbin:/usr/bin:/sbin:/bin

radicale

done

В журнале:

Spoiler
Opkg::Manager: /opt/etc/init.d/rc.unslung: timed out.
Дек 17 13:41:27
ndm
Process: killing all processes in "Opkg shell" group...

как увеличить время на выполнение? или есть альтернативы?

Edited by vectorforce

Share this post


Link to post
Share on other sites
8 минут назад, vectorforce сказал:

Спасибо, еще вопросик, убивается opkg shell, если закинуть в /opt/etc/init.d для автозапуска S100radicale:

  Скрыть содержимое

#!/bin/sh

PATH=/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin:/usr/sbin:/usr/bin:/sbin:/bin

radicale

done

В журнале:

  Скрыть содержимое
Opkg::Manager: /opt/etc/init.d/rc.unslung: timed out.
Дек 17 13:41:27
ndm
Process: killing all processes in "Opkg shell" group...

как увеличить время на выполнение? или есть альтернативы?

Запустить в фоне чтобы не висеть на этом скрипте

Share this post


Link to post
Share on other sites

Уже проверял, при 'radicale &' в скрипте сервер не стартует.

Edited by vectorforce

Share this post


Link to post
Share on other sites
2 часа назад, vectorforce сказал:

Спасибо, еще вопросик, убивается opkg shell, если закинуть в /opt/etc/init.d для автозапуска S100radicale:

скрипт запуска кривой.

Скрытый текст

~ # cat /opt/etc/init.d/S99radicale 
#!/bin/sh

ENABLED=yes
PROCS=radicale
ARGS=""
PREARGS=""
DESC=$PROCS
PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

. /opt/etc/init.d/rc.func
~ # 
~ # /opt/etc/init.d/S99radicale check
 Checking radicale...              dead. 
~ # /opt/etc/init.d/S99radicale start
 Starting radicale...              done. 
~ # /opt/etc/init.d/S99radicale check
 Checking radicale...              alive. 
~ # ps | grep -v grep | grep radi
20727 root     26488 S    {radicale} /opt/bin/python3 /opt/bin/radicale
~ # /opt/etc/init.d/S99radicale stop
 Checking radicale...              alive. 
 Shutting down radicale...              done. 
~ # /opt/etc/init.d/S99radicale check
 Checking radicale...              dead. 
~ # ps | grep -v grep | grep radi
~ # /opt/etc/init.d/S99radicale start
 Starting radicale...              done. 
~ # /opt/etc/init.d/S99radicale check
 Checking radicale...              alive. 
~ # ps | grep -v grep | grep radi
20765 root     18872 R    {radicale} /opt/bin/python3 /opt/bin/radicale
~ # /opt/etc/init.d/S99radicale restart
 Shutting down radicale...              done. 
 Starting radicale...              done. 
~ # /opt/etc/init.d/S99radicale check
 Checking radicale...              alive. 
~ # ps | grep -v grep | grep radi
20787 root     22284 R    {radicale} /opt/bin/python3 /opt/bin/radicale
~ #

 

можно и "классический" SysV слепить при желании ))) типа:

Скрытый текст

~ # cat /opt/etc/init.d/S99radicale 
#!/bin/sh

PATH=/opt/sbin:/opt/bin:/opt/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


case "$1" in
    start)
        radicale &
    ;;
    stop)
        killall radicale
    ;;
    *)
        echo "Usage: $0 {start|stop}"
    ;;
esac
~ # 
~ # /opt/etc/init.d/S99radicale start
~ # 
~ # ps | grep -v grep | grep radi
21345 root     26484 S    {radicale} /opt/bin/python3 /opt/bin/radicale
~ # 
~ # /opt/etc/init.d/S99radicale stop
~ # 
~ # ps | grep -v grep | grep radi
~ # 
~ # /opt/etc/init.d/S99radicale start
~ # 
~ # ps | grep -v grep | grep radi
21360 root     17056 R    {radicale} /opt/bin/python3 /opt/bin/radicale
~ #

 

 

  • Thanks 1
  • Upvote 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...