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

deprecate:backend client #183

Merged
merged 5 commits into from
Nov 19, 2024
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
56 changes: 2 additions & 54 deletions ovos_config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,6 @@
from ovos_config.locations import USER_CONFIG, DISTRIBUTION_CONFIG, SYSTEM_CONFIG, WEB_CONFIG_CACHE, DEFAULT_CONFIG


def is_remote_list(values):
""" DEPRECATED """
# TODO: Deprecate in 0.1.0
LOG.warning("This reference will be deprecated in v0.1.0. Import from "
"ovos_backend_client.config directly")
from ovos_backend_client.config import _is_remote_list
return _is_remote_list(values)


def translate_remote(config, setting):
""" DEPRECATED """
# TODO: Deprecate in 0.1.0
LOG.warning("This reference will be deprecated in v0.1.0. Import from "
"ovos_backend_client.config directly")
from ovos_backend_client.config import _translate_remote
return _translate_remote(config, setting)


def translate_list(config, values):
""" DEPRECATED """
# TODO: Deprecate in 0.1.0
LOG.warning("This reference will be deprecated in v0.1.0. Import from "
"ovos_backend_client.config directly")
from ovos_backend_client.config import _translate_list
return _translate_list(config, values)


class LocalConf(dict):
"""Config dictionary from file."""
allow_overwrite = True
Expand Down Expand Up @@ -196,37 +169,12 @@ def __init__(self, allow_overwrite=False):


class RemoteConf(LocalConf):
"""Config dictionary fetched from the backend"""
"""Config dictionary fetched from the backend
It's a local file expected to be managed by an external service"""

def __init__(self, cache=WEB_CONFIG_CACHE):
super(RemoteConf, self).__init__(cache)

def reload(self):
try:
from ovos_backend_client.pairing import is_paired
from ovos_backend_client.config import RemoteConfigManager

if not is_paired():
self.load_local(self.path)
return

remote = RemoteConfigManager()
remote.download()

changed = []
for key in remote.config:
if self.get(key) != remote.config[key]:
changed.append(key)
self.__setitem__(key, remote.config[key])

if changed:
LOG.debug(f"config key(s) {changed} changed, writing remote config to {self.path}")
self.store(self.path)

except Exception as e:
LOG.error(f"Exception fetching remote configuration: {e}")
self.load_local(self.path)


class MycroftUserConfig(LocalConf):
def __init__(self):
Expand Down
82 changes: 1 addition & 81 deletions ovos_config/mycroft.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
// Date format, either 'MDY' (e.g. "11-29-1978") or 'DMY' (e.g. "29-11-1978")
"date_format": "MDY",

// Whether to opt in to data collection
"opt_in": false,

// Play a beep when system begins to listen?
"confirm_listening": true,

Expand Down Expand Up @@ -217,25 +214,6 @@
// relative to "data_dir"
"directory": "skills",

// used by selene for marketplace integration in web interface
// NOTE: selene seems to work fine without this data
// no need to advertise installed skills if they dont have settings
// this data was tightly coupled to msm and is now mostly useless for selene
"upload_skill_manifest": false,

// if "sync_skill_settings" is enabled in "server" section
// should skill settingg changes on device be upload to selene?
// NOTE: this should be true, but it was removed (bug ?) in selene at some point
// old endpoints are however still available so functionality has been restored here
// it is only configurable in case you want to retain "old" mycroft-core behaviour
// or in case selene deprecates the old endpoint
"sync2way": true,
// values in skill settings missing in settingsmeta wont show up in selene
// this flag auto generates settingsmeta on the fly
// TODO - settings this to true may run into permission issues until settingsmeta.json gets XDG support
// it writes to skill base folder
"autogen_meta": false,

// blacklisted skills to not load
// NB: This is skill_id of the skill, usually defined in the skills setup.py
"blacklisted_skills": [
Expand Down Expand Up @@ -326,78 +304,20 @@
// eg. {"a": {"b": True, "c": False}}
// to protect "c" you would enter "a:c" in the section below
"protected_keys": {
// NOTE: selene backend expects "opt_in" to be changeable in their web ui
// that effectively gives them a means to enable spying without your input
// Mycroft AI can be trusted, but you dont need to anymore!
// The other keys are not currently populated by the remote backend
// they are defined for protection against bugs and for future proofing
// (what if facebook buys mycroft tomorrow?)
"remote": [
"enclosure",
"server",
"system",
"websocket",
"gui_websocket",
"network_tests",
"listener:wake_word_upload:disable",
// NOTE: selene returns listener settings as part of ww config
// they are protected because selene has no clue about your mic setup
"listener:channels",
"listener:sample_rate",
"listener:multiplier",
"listener:energy_ratio",
"skills:upload_skill_manifest",
"skills:auto_update",
"skills:priority_skills",
"skills:blacklisted_skills",
// NOTE: selene exposes this in web_ui, this has been disabled
// if you unprotect this key selene can enable opt_in behind your back
"opt_in"
"listener:sample_rate"
],
"user": []
}
},

// Address of the REMOTE server
// Needs to be explicitly enabled, also see "protected_keys" under "system" above
// Possible backends
// - https://github.com/OpenVoiceOS/OVOS-local-backend
"server": {
// Valid types: offline, personal
"backend_type": "offline",
// url for self hosted personal backend
"url": "",
"version": "v1",
"update": false,
"metrics": true,
"sync_skill_settings": true
},

// This section controls what providers should be used by each 3rd party API
"microservices": {
// auto == backend from "server" section above
// auto / wolfram / personal
"wolfram_provider": "auto",
// auto / owm / personal
"weather_provider": "auto",
// auto / osm / personal
"geolocation_provider": "auto",

// secret keys for offline usage
"wolfram_key": "",
"owm_key": "",
"email": {
// by default send emails here
"recipient": "",
"smtp": {
"username": "",
"password": "",
"host": "smtp.mailprovider.com",
"port": 465
}
}
},

// The ovos-core messagebus websocket
"websocket": {
"host": "127.0.0.1",
Expand Down
1 change: 0 additions & 1 deletion requirements/extras.txt

This file was deleted.

7 changes: 1 addition & 6 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,4 @@ flake8==3.7.9
pytest==8.2.2
pytest-cov==2.8.1
cov-core==1.15.0
sphinx==2.2.1
sphinx-rtd-theme==0.4.3
mock_msm~=0.9.2
ovos-stt-plugin-vosk>=0.1.3
python-vlc==1.1.2
ovos-bus-client~=0.0.8
ovos-bus-client<2.0.0
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ def required(requirements_file):
package_data={'': package_files('ovos_config')},
include_package_data=True,
install_requires=required('requirements/requirements.txt'),
extras_require={
"extras": required("requirements/extras.txt")
},
entry_points={
'console_scripts': [
'ovos-config=ovos_config.__main__:config'
Expand Down
Loading