Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议支持自定义端口和自生成的证书 #7

Closed
star7th opened this issue Nov 1, 2022 · 19 comments
Closed

建议支持自定义端口和自生成的证书 #7

star7th opened this issue Nov 1, 2022 · 19 comments
Labels

Comments

@star7th
Copy link

star7th commented Nov 1, 2022

对于某些特殊服务,尽管也使用https证书,但不是通过443端口。希望能支持自定义端口功能。
另外,由于未能自定义端口,所以我尚未测试是否支持自生成证书。如果不支持,希望提供支持。

@star7th star7th changed the title 建议支持自定义端口和自定义证书 建议支持自定义端口和自生成的证书 Nov 1, 2022
@mouday
Copy link
Owner

mouday commented Nov 2, 2022

使用docker可以指定外部映射端口

$ docker run -p 8000:8000 mouday/domain-admin

https可以通过nginx 代理实现

@star7th
Copy link
Author

star7th commented Nov 2, 2022

你理解错了。我说的不是指domain-admin本身暴露的端口号。我说的是目标域名的端口号。比如我要监测一个域名证书,但这个域名的端口不是443

@star7th
Copy link
Author

star7th commented Nov 2, 2022

举个例子,假如我想监测这个域名 https://dfyun-spare1.showdoc.com.cn:8888

@mouday
Copy link
Owner

mouday commented Nov 2, 2022

了解了,我升级试试

mouday added a commit that referenced this issue Nov 2, 2022
@mouday
Copy link
Owner

mouday commented Nov 2, 2022

已支持非443端口的域名检测,欢迎测试,v0.0.13
image

@mouday mouday closed this as completed Nov 2, 2022
@mouday mouday added the v0.0.13 label Nov 2, 2022
@star7th
Copy link
Author

star7th commented Nov 2, 2022

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.

mouday added a commit that referenced this issue Nov 4, 2022
@mouday
Copy link
Owner

mouday commented Nov 4, 2022

0.0.14已修复

image

@star7th
Copy link
Author

star7th commented Nov 4, 2022

在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.

mouday added a commit that referenced this issue Nov 4, 2022
@mouday
Copy link
Owner

mouday commented Nov 4, 2022

性能太好,启动太快了,建表操作还没完成就执行了查询操作,我增加了延迟 v0.0.15

@star7th
Copy link
Author

star7th commented Nov 5, 2022

已经可以了

@mouday
Copy link
Owner

mouday commented Nov 5, 2022

已经可以了

感谢反馈和测试

@star7th
Copy link
Author

star7th commented Nov 5, 2022

自定义端口实测已经好了。但是刚又发现,不支持自签名的证书。建议支持下,因为开发测试环境挺多自签名证书的。
其实我自己有写过一个php脚本,支持了所有自定义端口和自签名证书。我那时候的解决方案是指定端口,以及去掉证书签名校验(以支持自定义证书)。我想迁移到这个项目来是因为可视化操作更方便一点。你看看python怎么弄

@mouday
Copy link
Owner

mouday commented Nov 5, 2022

自签名证书

有空试试呀,v0.0.16

@star7th
Copy link
Author

star7th commented Nov 6, 2022

不存在docker镜像 mouday/domain-admin:0.0.16 或 mouday/domain-admin:v0.0.16

@mouday
Copy link
Owner

mouday commented Nov 6, 2022

刚没推送成功,现在可以了

docker pull mouday/domain-admin:0.0.16

@star7th
Copy link
Author

star7th commented Nov 6, 2022

0.016还是不行,不支持自签名证书。你先自己多做测试吧。

@mouday
Copy link
Owner

mouday commented Nov 6, 2022

好,我再试试看

@mouday
Copy link
Owner

mouday commented Nov 8, 2022

0.017 已支持,有空试试呀
image

@star7th
Copy link
Author

star7th commented Nov 8, 2022

嗯,已经可以添加自签名证书域名了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants