mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 05:04:27 +00:00
Better Docker support
This commit is contained in:
parent
7469188aaf
commit
4b20c26e4b
2 changed files with 4 additions and 3 deletions
|
@ -41,6 +41,7 @@ class Config(pydantic.BaseModel):
|
||||||
icon_url: str
|
icon_url: str
|
||||||
secret: str
|
secret: str
|
||||||
debug: bool = False
|
debug: bool = False
|
||||||
|
trusted_hosts: list[str] = ["127.0.0.1"]
|
||||||
|
|
||||||
# Config items to make tests easier
|
# Config items to make tests easier
|
||||||
sqlalchemy_database: str | None = None
|
sqlalchemy_database: str | None = None
|
||||||
|
|
|
@ -76,8 +76,6 @@ _RESIZED_CACHE: MutableMapping[tuple[str, int], tuple[bytes, str, Any]] = LFUCac
|
||||||
# TODO(ts):
|
# TODO(ts):
|
||||||
#
|
#
|
||||||
# Next:
|
# Next:
|
||||||
# - allow to set trusted_hosts=["*"] for Docker in config
|
|
||||||
# - maybe rename profile.toml to config.toml or add server.toml
|
|
||||||
# - share nginx config in doc
|
# - share nginx config in doc
|
||||||
# - prevent double accept/double follow
|
# - prevent double accept/double follow
|
||||||
# - UI support for updating posts
|
# - UI support for updating posts
|
||||||
|
@ -182,8 +180,10 @@ app.include_router(admin.unauthenticated_router, prefix="/admin")
|
||||||
app.include_router(indieauth.router)
|
app.include_router(indieauth.router)
|
||||||
app.include_router(micropub.router)
|
app.include_router(micropub.router)
|
||||||
app.include_router(webmentions.router)
|
app.include_router(webmentions.router)
|
||||||
app.add_middleware(ProxyHeadersMiddleware)
|
|
||||||
|
# XXX: order matters, the proxy middleware needs to be last
|
||||||
app.add_middleware(CustomMiddleware)
|
app.add_middleware(CustomMiddleware)
|
||||||
|
app.add_middleware(ProxyHeadersMiddleware, trusted_hosts=config.CONFIG.trusted_hosts)
|
||||||
|
|
||||||
logger.configure(extra={"request_id": "no_req_id"})
|
logger.configure(extra={"request_id": "no_req_id"})
|
||||||
logger.remove()
|
logger.remove()
|
||||||
|
|
Loading…
Reference in a new issue