mirror of
https://gitverse.ru/kpa39l/vesti.git
synced 2026-09-29 09:55:03 +00:00
fediverse: публикация в GoToSocial (@vesti@dedinit.ru) из publisher-service
- gotosocial.py: клиент GtS (httpx): post_status (markdown), upload_media v2, verify_credentials, delete_status - config.py: gt_social_url/token/visibility/format/channels - channels.py: fediverse-каналы (VESTI_GTS_CHANNELS, префикс gt:), gt: уходит только в fediverse - main.py: _publish_gotosocial + healthz-блок gotosocial + dry_run; status_id (ULID) в ответе - .env.example: GT_SOCIAL_* и VESTI_GTS_CHANNELS - STATUS.md/WALKTHROUGH.md: fediverse-раздел, хронология - openspec: change gotosocial-publisher (proposal/design/tasks/specs), validate чисто
This commit is contained in:
@@ -32,6 +32,12 @@ class Settings:
|
||||
channels: list[str] = None # type: ignore
|
||||
port: int = 8410
|
||||
api_base: str = "https://api.telegram.org"
|
||||
# GoToSocial (fediverse, Mastodon-совместимый API)
|
||||
gt_social_url: str = ""
|
||||
gt_social_token: str = ""
|
||||
gt_social_visibility: str = "public"
|
||||
gt_social_format: str = "markdown"
|
||||
gt_social_channels: list[str] = None # type: ignore
|
||||
|
||||
def __post_init__(self):
|
||||
if self.channels is None:
|
||||
@@ -39,6 +45,12 @@ class Settings:
|
||||
self.bot_token = self.bot_token or os.getenv("VESTI_BOT_TOKEN", "")
|
||||
self.tg_proxy = self.tg_proxy or os.getenv("TG_PROXY", "socks5://127.0.0.1:1080")
|
||||
self.port = self.port or int(os.getenv("PUBLISHER_PORT", "8410"))
|
||||
self.gt_social_url = self.gt_social_url or os.getenv("GT_SOCIAL_URL", "")
|
||||
self.gt_social_token = self.gt_social_token or os.getenv("GT_SOCIAL_ACCESS_TOKEN", "")
|
||||
self.gt_social_visibility = self.gt_social_visibility or os.getenv("GT_SOCIAL_VISIBILITY", "public")
|
||||
self.gt_social_format = self.gt_social_format or os.getenv("GT_SOCIAL_FORMAT", "markdown")
|
||||
if self.gt_social_channels is None:
|
||||
self.gt_social_channels = _channels_list(os.getenv("VESTI_GTS_CHANNELS", ""))
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user