Article directory
1. Python-tuf
Uploading packages to the Pyhton-tuf repo server will not be persisted locally, and it is a demo-level demo.
2. Installation method
1. Download Python-tuf
git clone [email protected]:theupdateframework/python-tuf.git
2. Use python's virtualenv environment so that it will not pollute our OS environment
sudo apt-get install -y virtualenv
3. Install the dependent pip package
pip securesystemslib[crypto,pynacl] tuf
4. Use python virtual environment – virtualenv
$ virtualenv venv #venv为虚拟环境目录名,目录名自定义
$ source venv/bin/activate #激活环境
$ . venv/bin/deactivate #停用环境
5. After the above dependent packages are installed, they cannot be started. You need to overwrite the new version of securesystemslib and tub packages to /home/wangji/Updater/python-tuf/venv/lib/python3.8/site-packages/
the directory
移除上面旧的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$ [email protected]: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/
3. Start
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
- The uploaded package will be lost if the repository is restarted
(venv) wangji@script-wang:~/Updater/python-tuf/examples/uploader$ ./uploader
ref: Installation , python virtual environment – virtualenv
4. An available Python-Tuf
git clone [email protected]: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: