Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ The used format is based on
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.5.41] - 2026-05-06

### 🐛 Bug Fixes

- _(notifiers)_ Enforce template usage and fix dynamic template directory
discovery

## [1.5.40] - 2026-05-06

### 🐛 Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

NAME := flatpak-automatic
EPOCH := 1
VERSION := 1.5.40
VERSION := 1.5.41
REL_NUM := 1
DATE := $(shell LC_ALL=C date +"%a %b %d %Y")
AUTHOR := "fedoraBee <9395414+fedoraBee@users.noreply.github.com>"
Expand Down
2 changes: 1 addition & 1 deletion assets/banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion config/sysconfig/flatpak-automatic
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Please migrate your settings to the new YAML format.
# ==============================================================================

# Version: 1.5.40 | Built for Fedora & Universal RPM Systems
# Version: 1.5.41 | Built for Fedora & Universal RPM Systems
# Built for Fedora & Universal RPM Systems

# --- [ Universal Notifications (Apprise) ] ---
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "flatpak-automatic"
version = "1.5.40"
version = "1.5.41"
authors = [
{ name = "fedoraBee", email = "9395414+fedoraBee@users.noreply.github.com" },
]
Expand Down
2 changes: 1 addition & 1 deletion src/flatpak-automatic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Version: 1.5.40
# Version: 1.5.41
import sys
import os

Expand Down
2 changes: 1 addition & 1 deletion src/flatpak_automatic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .updater import FlatpakUpdater

__version__ = "1.5.40"
__version__ = "1.5.41"

from .snapper import SnapperManager
from .config import ConfigManager, StateManager
Expand Down
2 changes: 1 addition & 1 deletion src/flatpak_automatic/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def banner() -> str:
f"{Colors.OKBLUE} | __| |__ _ | |_ _ __ __ _ | |__ \n"
f"{Colors.HEADER} | _|| / _` || ._| '_ \\/ _` || / / \n"
f"{Colors.OKPINK} |_| |_\\__,_|\\__|| .__/\\__,_||_\\_\\\n"
f" AUTOMATIC |_| {Colors.ENDC} {Colors.OKCYAN} v1.5.40{Colors.ENDC}\n"
f" AUTOMATIC |_| {Colors.ENDC} {Colors.OKCYAN} v1.5.41{Colors.ENDC}\n"
)


Expand Down
22 changes: 21 additions & 1 deletion src/flatpak_automatic/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,26 @@ def find_brand_icon() -> str:


ICON_PATH = find_brand_icon()
TEMPLATE_DIR = "/etc/flatpak-automatic/templates"


def find_template_dir() -> str:
"""Locate the templates directory."""
# 1. System-wide Installation Path (RPM/DEB)
sys_path = "/etc/flatpak-automatic/templates"
if os.path.exists(sys_path):
return sys_path

# 2. Local Development Path
script_dir = os.path.dirname(os.path.abspath(__file__))
local_path = os.path.join(
os.path.dirname(os.path.dirname(script_dir)), "config", "templates"
)
if os.path.exists(local_path):
return local_path

return sys_path


TEMPLATE_DIR = find_template_dir()
CONFIG_FILE = "/etc/flatpak-automatic/config.yaml"
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
15 changes: 9 additions & 6 deletions src/flatpak_automatic/notifiers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ def get_state_val(v: Any) -> Any:
res = get_state_val(target_val)
if res is None and group_val is not None:
res = get_state_val(group_val)

# Enforce global defaults for body_template if still unresolved
if res is None and field_name == "body_template":
res = "default_success.md" if success else "default_failure.md"

if res is None:
res = default_val
return res
Expand All @@ -105,9 +110,7 @@ def get_state_val(v: Any) -> Any:
"$UPDATE_COUNT", str(update_count)
).replace("$(hostname)", hostname)
app_tpl = _resolve(group, apprise_cfg, "body_template", "")
app_body = (
TemplateRenderer.render(app_tpl, context) if app_tpl else body
)
app_body = TemplateRenderer.render(app_tpl, context)
if not ConfigManager.verify_policy("apprise"):
logging.info(
"Apprise notifications disabled by global policy. Skipping."
Expand Down Expand Up @@ -140,7 +143,7 @@ def get_state_val(v: Any) -> Any:
"$(hostname)", hostname
)
m_tpl = _resolve(group, mails_cfg, "body_template", "")
m_body = TemplateRenderer.render(m_tpl, context) if m_tpl else body
m_body = TemplateRenderer.render(m_tpl, context)

for to_addr in to_addrs:
mailer = MailNotifier(to_addr, from_addr)
Expand All @@ -156,7 +159,7 @@ def get_state_val(v: Any) -> Any:
"$(hostname)", hostname
)
wh_tpl = _resolve(group, webhook_cfg, "body_template", "")
wh_body = TemplateRenderer.render(wh_tpl, context) if wh_tpl else body
wh_body = TemplateRenderer.render(wh_tpl, context)

wh = WebhookNotifier(wh_urls, secret)
wh.send_notification(wh_title, wh_body)
Expand All @@ -169,6 +172,6 @@ def get_state_val(v: Any) -> Any:
"$(hostname)", hostname
)
dt_tpl = _resolve(group, desktop_cfg, "body_template", "")
dt_body = TemplateRenderer.render(dt_tpl, context) if dt_tpl else body
dt_body = TemplateRenderer.render(dt_tpl, context)
desktop = DesktopNotifier()
desktop.send_notification(dt_title, dt_body)
2 changes: 1 addition & 1 deletion tbump.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[version]
current = "1.5.40"
current = "1.5.41"
# Updated regex to support X.Y.Z and X.Y.Z-rc1 (or -beta, -alpha)
regex = '''
(?P<major>\d+)
Expand Down
Loading