建议支持自定义端口和自生成的证书
star7th opened this issue · 19 comments
对于某些特殊服务,尽管也使用https证书,但不是通过443端口。希望能支持自定义端口功能。
另外,由于未能自定义端口,所以我尚未测试是否支持自生成证书。如果不支持,希望提供支持。
使用docker可以指定外部映射端口
$ docker run -p 8000:8000 mouday/domain-admin
https可以通过nginx 代理实现
你理解错了。我说的不是指domain-admin本身暴露的端口号。我说的是目标域名的端口号。比如我要监测一个域名证书,但这个域名的端口不是443
举个例子,假如我想监测这个域名 https://dfyun-spare1.showdoc.com.cn:8888
了解了,我升级试试
docker版本0.0.13报错信息:
[2022-11-02 23:09:02 +0800] [7] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 3221, in execute_sql
cursor.execute(sql, params or ())
sqlite3.OperationalError: no such table: tb_version
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/usr/local/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/usr/local/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
mod = importlib.import_module(module)
File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/app/domain_admin/main.py", line 80, in
init_app(app)
File "/app/domain_admin/main.py", line 74, in init_app
version_service.update_version()
File "/app/domain_admin/service/version_service.py", line 37, in update_version
local_version = get_local_version()
File "/app/domain_admin/service/version_service.py", line 16, in get_local_version
row = VersionModel.select().order_by(
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 7057, in get_or_none
return self.get(database=database)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 7048, in get
return clone.execute(database)[0]
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 1946, in inner
return method(self, database, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 2017, in execute
return self._execute(database)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 2190, in _execute
cursor = database.execute(self)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 3234, in execute
return self.execute_sql(sql, params, commit=commit)
File "/usr/local/lib/python3.9/site-packages/playhouse/sqliteq.py", line 249, in execute_sql
return self._execute(sql, params, commit=commit)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 3228, in execute_sql
self.commit()
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 2994, in exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 191, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 3221, in execute_sql
cursor.execute(sql, params or ())
peewee.OperationalError: no such table: tb_version
[2022-11-02 23:09:02 +0800] [7] [INFO] Worker exiting (pid: 7)
[2022-11-02 23:09:02 +0800] [1] [INFO] Shutting down: Master
[2022-11-02 23:09:02 +0800] [1] [INFO] Reason: Worker failed to boot.
在centos7.6的服务器上,依然存在问题。我试了好几台服务器,都是这个结果。你可以去阿里云创建个按量付费的临时服务器试试。centos7.6的服务器都是这个结果。
root@localhost dfyun-node]# docker run mouday/domain-admin:0.0.14
[2022-11-04 14:18:06 +0800] [1] [INFO] Starting gunicorn 20.1.0
[2022-11-04 14:18:06 +0800] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
[2022-11-04 14:18:06 +0800] [1] [INFO] Using worker: sync
[2022-11-04 14:18:06 +0800] [6] [INFO] Booting worker with pid: 6
[2022-11-04 14:18:19 +0800] [6] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 3221, in execute_sql
cursor.execute(sql, params or ())
sqlite3.OperationalError: no such table: tb_version
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/usr/local/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/usr/local/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
mod = importlib.import_module(module)
File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/app/domain_admin/main.py", line 86, in
init_app(app)
File "/app/domain_admin/main.py", line 80, in init_app
version_service.update_version()
File "/app/domain_admin/service/version_service.py", line 37, in update_version
local_version = get_local_version()
File "/app/domain_admin/service/version_service.py", line 16, in get_local_version
row = VersionModel.select().order_by(
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 7057, in get_or_none
return self.get(database=database)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 7048, in get
return clone.execute(database)[0]
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 1946, in inner
return method(self, database, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 2017, in execute
return self._execute(database)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 2190, in _execute
cursor = database.execute(self)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 3234, in execute
return self.execute_sql(sql, params, commit=commit)
File "/usr/local/lib/python3.9/site-packages/playhouse/sqliteq.py", line 249, in execute_sql
return self._execute(sql, params, commit=commit)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 3228, in execute_sql
self.commit()
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 2994, in exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 191, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.9/site-packages/peewee.py", line 3221, in execute_sql
cursor.execute(sql, params or ())
peewee.OperationalError: no such table: tb_version
[2022-11-04 14:18:19 +0800] [6] [INFO] Worker exiting (pid: 6)
[2022-11-04 14:18:19 +0800] [1] [INFO] Shutting down: Master
[2022-11-04 14:18:19 +0800] [1] [INFO] Reason: Worker failed to boot.
性能太好,启动太快了,建表操作还没完成就执行了查询操作,我增加了延迟 v0.0.15
已经可以了
已经可以了
感谢反馈和测试
自定义端口实测已经好了。但是刚又发现,不支持自签名的证书。建议支持下,因为开发测试环境挺多自签名证书的。
其实我自己有写过一个php脚本,支持了所有自定义端口和自签名证书。我那时候的解决方案是指定端口,以及去掉证书签名校验(以支持自定义证书)。我想迁移到这个项目来是因为可视化操作更方便一点。你看看python怎么弄
自签名证书
有空试试呀,v0.0.16
不存在docker镜像 mouday/domain-admin:0.0.16 或 mouday/domain-admin:v0.0.16
刚没推送成功,现在可以了
docker pull mouday/domain-admin:0.0.16
0.016还是不行,不支持自签名证书。你先自己多做测试吧。
好,我再试试看
嗯,已经可以添加自签名证书域名了