diff --git a/command_line_assistant/dbus/constants.py b/command_line_assistant/dbus/constants.py index 62b2bf0..3aa146f 100644 --- a/command_line_assistant/dbus/constants.py +++ b/command_line_assistant/dbus/constants.py @@ -1,10 +1,10 @@ -from dasbus.connection import SessionMessageBus +from dasbus.connection import SystemMessageBus from dasbus.error import ErrorMapper from dasbus.identifier import DBusServiceIdentifier ERROR_MAPPER = ErrorMapper() -SESSION_BUS = SessionMessageBus(error_mapper=ERROR_MAPPER) +SESSION_BUS = SystemMessageBus(error_mapper=ERROR_MAPPER) SERVICE_NAMESPACE = ("com", "redhat", "lightspeed") diff --git a/data/release/clad.service b/data/release/clad.service index 3fc1c8e..2ddce8c 100644 --- a/data/release/clad.service +++ b/data/release/clad.service @@ -4,11 +4,10 @@ Documentation=https://github.com/rhel-lightspeed/command-line-assistant After=network.service [Service] -BusName=com.rhel.lightspeed PrivateTmp=yes RemainAfterExit=no -ExecStart=$(exec_prefix}/sbin/clad +ExecStart=/usr/sbin/clad [Install] -WantedBy=multi-user.target +WantedBy=default.target Alias=clad.service diff --git a/data/release/com.redhat.lightspeed.conf b/data/release/com.redhat.lightspeed.conf new file mode 100644 index 0000000..9de351f --- /dev/null +++ b/data/release/com.redhat.lightspeed.conf @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + diff --git a/data/release/config.toml b/data/release/config.toml index e69de29..367833a 100644 --- a/data/release/config.toml +++ b/data/release/config.toml @@ -0,0 +1,19 @@ +[output] +# otherwise recording via script session will be enforced +enforce_script = false +# file with output(s) of regular commands (e.g. ls, echo, etc.) +file = "/tmp/command-line-assistant/output.txt" +# Keep non-empty if your file contains only output of commands (not prompt itself) +prompt_separator = "$" + +[history] +enabled = true +file = "/tmp/command-line-assistant/history.json" +# max number of queries in history (including responses) +max_size = 100 + +[backend] +endpoint = "http://localhost:8080" + +[logging] +level = "DEBUG" diff --git a/packaging/command-line-assistant.spec b/packaging/command-line-assistant.spec index b6bdab1..9b722ad 100644 --- a/packaging/command-line-assistant.spec +++ b/packaging/command-line-assistant.spec @@ -44,6 +44,7 @@ A simple wrapper to interact with RAG # Create sbin directory in buildroot %{__install} -d %{buildroot}/%{_sbindir} +%{__install} -d %{buildroot}/%{_sysconfdir}/xdg/%{python_package_src} # Move the daemon to /usr/sbin instead of /usr/bin %{__install} -m 0755 %{buildroot}/%{_bindir}/%{daemon_binary_name} %{buildroot}/%{_sbindir}/%{daemon_binary_name} @@ -51,6 +52,10 @@ A simple wrapper to interact with RAG # System units %{__install} -D -m 0644 data/release/%{daemon_binary_name}.service %{buildroot}/%{_unitdir}/%{daemon_binary_name}.service +%{__install} -D -m 0644 data/release/com.redhat.lightspeed.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/com.redhat.lightspeed.conf + +# Config file +%{__install} -D -m 0644 data/release/config.toml %{buildroot}/%{_sysconfdir}/xdg/%{python_package_src}/config.toml %files %doc README.md @@ -61,8 +66,14 @@ A simple wrapper to interact with RAG # Binaries %{_bindir}/%{binary_name} %{_sbindir}/%{daemon_binary_name} + +# System units %{_unitdir}/%{daemon_binary_name}.service +# Config file +%config %{_sysconfdir}/xdg/%{python_package_src}/config.toml +%config %{_sysconfdir}/dbus-1/system.d/com.redhat.lightspeed.conf + %preun if [ "$1" -eq 0 ]; then systemctl stop %{daemon_binary_name}.service || :