Move gsb data to meson_options.txt
Move gsb_api_key to meson_options.txt so we can provide the necessary support within flatpak, but can disable it for the rest.
Fixes: https://gitlab.gnome.org/GNOME/epiphany/-/issues/682
Jan-Michael Brummer
3 years ago
185 | 185 |
<summary>Enable safe browsing</summary>
|
186 | 186 |
<description>Whether to enable safe browsing. Safe browsing operates via Google Safe Browsing API v4.</description>
|
187 | 187 |
</key>
|
188 | |
<key type="s" name="gsb-api-key">
|
189 | |
<default>'AIzaSyAtuURrRblYXvwCyDC5ZFq0mEw1x4VN6KA'</default>
|
190 | |
<summary>Google Safe Browsing API key</summary>
|
191 | |
<description>The API key used to access the Google Safe Browsing API v4.</description>
|
192 | |
</key>
|
193 | 188 |
<key type="b" name="enable-itp">
|
194 | 189 |
<default>true</default>
|
195 | 190 |
<summary>Enable Intelligent Tracking Prevention (ITP)</summary>
|
637 | 637 |
g_assert (EPHY_IS_EMBED_SHELL (shell));
|
638 | 638 |
|
639 | 639 |
if (!priv->global_gsb_service) {
|
640 | |
g_autofree char *api_key = NULL;
|
641 | 640 |
g_autofree char *db_path = NULL;
|
642 | 641 |
|
643 | |
api_key = g_settings_get_string (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_GSB_API_KEY);
|
644 | 642 |
db_path = g_build_filename (ephy_default_cache_dir (), EPHY_GSB_FILE, NULL);
|
645 | |
priv->global_gsb_service = ephy_gsb_service_new (api_key, db_path);
|
|
643 |
priv->global_gsb_service = ephy_gsb_service_new (GSB_API_KEY, db_path);
|
646 | 644 |
}
|
647 | 645 |
|
648 | 646 |
return priv->global_gsb_service;
|
106 | 106 |
#define EPHY_PREFS_WEB_REMEMBER_PASSWORDS "remember-passwords"
|
107 | 107 |
#define EPHY_PREFS_WEB_ENABLE_SITE_SPECIFIC_QUIRKS "enable-site-specific-quirks"
|
108 | 108 |
#define EPHY_PREFS_WEB_ENABLE_SAFE_BROWSING "enable-safe-browsing"
|
109 | |
#define EPHY_PREFS_WEB_GSB_API_KEY "gsb-api-key"
|
110 | 109 |
#define EPHY_PREFS_WEB_ENABLE_ITP "enable-itp"
|
111 | 110 |
#define EPHY_PREFS_WEB_ENABLE_WEBSITE_DATA_STORAGE "enable-website-data-storage"
|
112 | 111 |
#define EPHY_PREFS_WEB_DEFAULT_ZOOM_LEVEL "default-zoom-level"
|
|
136 | 135 |
EPHY_PREFS_WEB_REMEMBER_PASSWORDS,
|
137 | 136 |
EPHY_PREFS_WEB_ENABLE_SITE_SPECIFIC_QUIRKS,
|
138 | 137 |
EPHY_PREFS_WEB_ENABLE_SAFE_BROWSING,
|
139 | |
EPHY_PREFS_WEB_GSB_API_KEY,
|
140 | 138 |
EPHY_PREFS_WEB_ENABLE_ITP,
|
141 | 139 |
EPHY_PREFS_WEB_ENABLE_WEBSITE_DATA_STORAGE,
|
142 | 140 |
EPHY_PREFS_WEB_DEFAULT_ZOOM_LEVEL,
|
66 | 66 |
|
67 | 67 |
conf.set_quoted('VERSION', '@VCS_TAG@')
|
68 | 68 |
|
|
69 |
gsb_api_key = get_option('gsb_api_key')
|
|
70 |
conf.set_quoted('GSB_API_KEY', gsb_api_key)
|
|
71 |
if gsb_api_key != ''
|
|
72 |
message('GSB API Key provided')
|
|
73 |
endif
|
|
74 |
|
69 | 75 |
config_h = declare_dependency(
|
70 | 76 |
sources: vcs_tag(
|
71 | 77 |
input: configure_file(
|
|
127 | 133 |
subdir('tests')
|
128 | 134 |
|
129 | 135 |
meson.add_install_script('post_install.py')
|
|
136 |
|
26 | 26 |
value: 'enabled',
|
27 | 27 |
description: 'Enable unit tests'
|
28 | 28 |
)
|
|
29 |
|
|
30 |
option('gsb_api_key',
|
|
31 |
type: 'string',
|
|
32 |
value: '',
|
|
33 |
description: 'The API key used to access the Google Safe Browsing API v4'
|
|
34 |
)
|
|
35 |
|