首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在GuixSystem中配置阴影袜配置文件

在GuixSystem中配置阴影袜配置文件
EN

Unix & Linux用户
提问于 2020-12-07 14:52:43
回答 1查看 209关注 0票数 1

我在配置影子袜子配置文件时遇到了这个问题:

代码语言:javascript
复制
$ ssserver -c profile.json
/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/common.py:221: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if addr is "":
/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/common.py:233: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if len(block) is 1:
/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/common.py:235: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  while (ip & 1) == 0 and ip is not 0:
INFO: loading config from profile.json
Traceback (most recent call last):
  File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/bin/.ssserver-real", line 11, in <module>
    load_entry_point('shadowsocks==3.0.0', 'console_scripts', 'ssserver')()
  File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/server.py", line 34, in main
    config = shell.get_config(False)
  File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/shell.py", line 355, in get_config
    check_config(config, is_local)
  File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/shell.py", line 210, in check_config
    cryptor.try_cipher(config['password'], config['method'],
  File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/cryptor.py", line 51, in try_cipher
    Cryptor(key, method, crypto_path)
  File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/cryptor.py", line 98, in __init__
    self.cipher = self.get_cipher(
  File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/cryptor.py", line 130, in get_cipher
    return m[METHOD_INFO_CRYPTO](method, key, iv, op, self.crypto_path)
  File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/crypto/openssl.py", line 150, in __init__
    OpenSSLCryptoBase.__init__(self, cipher_name, crypto_path)
  File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/crypto/openssl.py", line 98, in __init__
    load_openssl(crypto_path)
  File "/gnu/store/yvjgk9n6xzpr32maq1mqw1ij2vhm9jxb-shadowsocks-2.8.2-0.e332ec9/lib/python3.8/site-packages/shadowsocks/crypto/openssl.py", line 51, in load_openssl
    raise Exception('libcrypto(OpenSSL) not found with path %s' % path)
Exception: libcrypto(OpenSSL) not found with path None

解决办法是什么?

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2020-12-07 15:30:51

编辑

有人,他比我写这篇文章时更好地看了源代码,他设计了一块地,并提交给了上游的Guix。换句话说,这个问题可能很快就会得到解决。

原始邮政

看一下“影子袜子”的包定义,它看上去相当空洞,甚至没有将OpenSSL作为输入或任何类似的东西列出。此外,似乎“影子袜子”希望您将所有这些路径保存在某种配置中。

代码语言:javascript
复制
config['crypto_path'] = {'openssl': config['libopenssl'],
                         'mbedtls': config['libmbedtls'],
                         'sodium': config['libsodium']}

这些技巧在传统发行版(如基于Debian等人的发行版)上可能非常聪明,但是当与任何类型的功能包管理一起使用时,它们就彻底崩溃了。处理这类问题的Guix方法是在构建时使用substitute*对输入路径进行硬编码。您的阶段可能如下所示:

代码语言:javascript
复制
  (add-after 'unpack 'patch-crypto-paths
    (lambda* (#:key inputs #:allow-other-keys)
      (substitute* "shadowsocks/shell.py"
        (("config\\['libopenssl'\\]") 
         (string-append (assoc-ref inputs "openssl") "/path/to/libopenssl"))
        [...])
      #t))

由于上面的代码显然是Guix代码,所以您可以在GPLv3+下自由地使用它,即使这样通常也会强制CC SA.

请注意,最近可能不再严格要求以#t结尾,但我认为您仍然可以在Guix代码中找到它。

票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/623324

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档