conftab
config table
配置web版本管理系统(config version manager with web or code easily) 作为开发人员,经常会涉及到环境部署,一些数据库地址帐号密码配置我们不希望硬编码在项目文件里,再被一不小心提交到代码仓库再开源出去,所以,需要在内网环境部署一套配置管理系统。这样项目中再连接这个管理地址取到相应的配置,可以方便部署和管理环境配置又不用担心重要的信息泄露出去。
RUN
- 服务端: 启动web管理界面和接口
pip install conftab
# 运用sqlite数据库,-f指定配置数据的保存文件位置,方便备份和加密迁移,-p指定服务端的监听端口
python -m conftab.ctl run -p 7788 -f './conftab.db'
# 如果想要后台长期启动,可以利用nohup,并将日志写入conftab.log文件
nohup python3.9 -m conftab.ctl run -p 7788 -h "0.0.0.0" -f './conftab.db' > conftab.log 2>&1 &
- 客户端: 项目通过接口在线取config配置
import conftab
CONFIG = conftab.Tab(project='default', env='dev', ver='1.0.0', manager_url='127.0.0.1:7788')
# 设置
CONFIG.set('ES_PORT', 9200) # 可以在代码里也可以在web界面里去调整,浏览器访问 http://127.0.0.1:7788/html/conf 进行界面config管理
# 获取
ES_PORT = CONFIG.get('ES_PORT')
# 批量获取
conf = CONFIG.dict() # 一次性获取该项目全部配置dict,减少http请求
ES_PORT = conf.get('ES_PORT')
更多详细可见 example.py 文件
TODO list
- web manager
- server manager
Metadata
Release files for conftab 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| conftab-1.1.2.tar.gz | 42.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| conftab-1.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 88.9 kB
Release files / conftab-1.1.2.tar.gz
| Download URL | conftab-1.1.2.tar.gz |
|---|---|
| Size | 42.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32359001860ad3a458cf16be8e1d38d13ddfb3d6ca79d975b21bfefa3c35b949
|
|
BLAKE2b-256 checksum How to use checksums |
c7ced0093bae8553aa6dc649f4583bade3c2312291d4254d3619ce83b91affd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Release files / conftab-1.1.2-py3-none-any.whl
| Download URL | conftab-1.1.2-py3-none-any.whl |
|---|---|
| Size | 46.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
569d5ecc397129155fd6f3b2b1e536df1149dc6f46d628771a3725ef9aa770d1
|
|
BLAKE2b-256 checksum How to use checksums |
120199d89f48da2734593813ee2aa4e86f2beec4b948d8a76bb3734509216640
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Security for conftab 1.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.