一、Pyhon-tuf
1.github link
向该Pyhton-tuf的repo server上传包不会持久化保存到本地,是个demo级别的demo。
二、安装方法
1.下载Python-tuf
git clone git@github.com:theupdateframework/python-tuf.git
2.使用python 的virtualenv环境,这样不会污染我们的OS环境
sudo apt-get install -y virtualenv
3.安装依赖的pip包
pip securesystemslib[crypto,pynacl] tuf
4.使用python虚拟环境–virtualenv
$ virtualenv venv #venv为虚拟环境目录名,目录名自定义
$ source venv/bin/activate #激活环境
$ . venv/bin/deactivate #停用环境
5.上述依赖包安装完毕后,不能启动,需要重新将新版的securesystemslib和tub的包覆盖到/home/wangji/Updater/python-tuf/venv/lib/python3.8/site-packages/
目录下
移除上面旧的securesystemslib和tuf包:
(venv) wangji@script-wang:~/Updater/python-tuf$ mv /home/wangji/Updater/python-tuf/venv/lib/python3.8/site-packages/securesystemslib
(venv) wangji@script-wang:~/Updater/python-tuf$ mv /home/wangji/Updater/python-tuf/venv/lib/python3.8/site-packages/securesystemslib_bak
/home/wangji/Updater/python-tuf/venv/lib/python3.8/site-packages/tuf /home/wangji/Updater/python-tuf/venv/lib/python3.8/site-packages/tuf_bak
拷贝新的securesystemslib
(venv) wangji@script-wang:~/Updater/python-tuf$ git clone (venv) wangji@script-wang:~/Updater/python-tuf$ git@github.com:secure-systems-lab/securesystemslib.git
(venv) wangji@script-wang:~/Updater/python-tuf$ cp -rf securesystemslib/securesystemslib /home/wangji/Updater/python-tuf/venv/lib/python3.8/site-packages/
拷贝新的tuf
(venv) wangji@script-wang:~/Updater/python-tuf$ !cp
(venv) wangji@script-wang:~/Updater/python-tuf$ cp -rf tuf /home/wangji/Updater/python-tuf/venv/lib/python3.8/site-packages/
三、启动
repository
(venv) wangji@script-wang:~/Updater/python-tuf/examples/repository$ ./repo
INFO:__main__:Now serving. Root v1 at http://127.0.0.1:8001/metadata/1.root.json
client
(venv) wangji@script-wang:~/Updater/python-tuf/examples/client$ ./client -h
upload packages
- 上传的包,如果repository重启,则会丢失
(venv) wangji@script-wang:~/Updater/python-tuf/examples/uploader$ ./uploader
ref:Installation,python虚拟环境–virtualenv文章来源:https://www.toymoban.com/news/detail-420232.html
四、一个可用的Python-Tuf
git clone git@github.com:Jiwangreal/avaliable-python-tuf.git
wangji@script-wang:~/Updater/python-tuf$ cd avaliable-python-tuf
wangji@script-wang:~/Updater/python-tuf$ source venv/bin/activate
reference:文章来源地址https://www.toymoban.com/news/detail-420232.html
- theupdateframework/python-tuf
到了这里,关于Available-Python-Tuf的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!