detached 5f7dbbb

chore(config): add content filtering configuration

commit
5f7dbbb3b12943c70771b4cb9a122e5b27fda045
author
brice · · 2025-12-18 17:24 UTC
committer
brice · · 2025-12-18 19:34 UTC
parent
2708968
signature
unsigned
3 files · +7 -15
M internal/infrastructure/config/defaults.go +2 -11
@@ -174,17 +174,8 @@ func DefaultConfig() *Config {
174174 },
175175 },
176176 ContentFiltering: ContentFilteringConfig{
177- Enabled: true, // Ad blocking enabled by default
178- // Note: Whitelist is now managed via database (content_whitelist table)
179- FilterLists: []string{
180- // Core blocking
181- "https://easylist.to/easylist/easylist.txt", // Ads
182- "https://easylist.to/easylist/easyprivacy.txt", // Tracking
183- // uBlock extras
184- "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt", // uBO optimizations
185- "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/annoyances.txt", // Cookie banners, popups
186- "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/quick-fixes.txt", // Site fixes
187- },
177+ Enabled: true, // Ad blocking enabled by default
178+ AutoUpdate: true, // Auto-update filters from GitHub releases
188179 },
189180 Omnibox: OmniboxConfig{
190181 InitialBehavior: defaultOmniboxInitialBehavior,
@@ -174,17 +174,8 @@ func DefaultConfig() *Config {
174 },174 },
175 },175 },
176 ContentFiltering: ContentFilteringConfig{176 ContentFiltering: ContentFilteringConfig{
177- Enabled: true, // Ad blocking enabled by default177+ Enabled: true, // Ad blocking enabled by default
178- // Note: Whitelist is now managed via database (content_whitelist table)178+ AutoUpdate: true, // Auto-update filters from GitHub releases
179- FilterLists: []string{
180- // Core blocking
181- "https://easylist.to/easylist/easylist.txt", // Ads
182- "https://easylist.to/easylist/easyprivacy.txt", // Tracking
183- // uBlock extras
184- "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt", // uBO optimizations
185- "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/annoyances.txt", // Cookie banners, popups
186- "https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/quick-fixes.txt", // Site fixes
187- },
188 },179 },
189 Omnibox: OmniboxConfig{180 Omnibox: OmniboxConfig{
190 InitialBehavior: defaultOmniboxInitialBehavior,181 InitialBehavior: defaultOmniboxInitialBehavior,
M internal/infrastructure/config/loader.go +1 -1
@@ -284,7 +284,7 @@ func (m *Manager) setDefaults() {
284284
285285 // Content filtering
286286 m.viper.SetDefault("content_filtering.enabled", defaults.ContentFiltering.Enabled)
287- m.viper.SetDefault("content_filtering.filter_lists", defaults.ContentFiltering.FilterLists)
287+ m.viper.SetDefault("content_filtering.auto_update", defaults.ContentFiltering.AutoUpdate)
288288
289289 // Omnibox defaults
290290 m.viper.SetDefault("omnibox.initial_behavior", defaults.Omnibox.InitialBehavior)
@@ -284,7 +284,7 @@ func (m *Manager) setDefaults() {
284 284
285 // Content filtering285 // Content filtering
286 m.viper.SetDefault("content_filtering.enabled", defaults.ContentFiltering.Enabled)286 m.viper.SetDefault("content_filtering.enabled", defaults.ContentFiltering.Enabled)
287- m.viper.SetDefault("content_filtering.filter_lists", defaults.ContentFiltering.FilterLists)287+ m.viper.SetDefault("content_filtering.auto_update", defaults.ContentFiltering.AutoUpdate)
288 288
289 // Omnibox defaults289 // Omnibox defaults
290 m.viper.SetDefault("omnibox.initial_behavior", defaults.Omnibox.InitialBehavior)290 m.viper.SetDefault("omnibox.initial_behavior", defaults.Omnibox.InitialBehavior)
M internal/infrastructure/config/schema.go +4 -3
@@ -145,9 +145,10 @@ type ColorPalette struct {
145145 type ContentFilteringConfig struct {
146146 // Enabled controls whether ad blocking is active (default: true)
147147 Enabled bool `mapstructure:"enabled" yaml:"enabled" toml:"enabled"`
148- // FilterLists URLs of filter lists to use (EasyList, uBlock, etc.)
149- FilterLists []string `mapstructure:"filter_lists" yaml:"filter_lists" toml:"filter_lists"`
150- // Note: Whitelist is now managed via database (content_whitelist table)
148+ // AutoUpdate controls whether filters are automatically updated (default: true)
149+ AutoUpdate bool `mapstructure:"auto_update" yaml:"auto_update" toml:"auto_update"`
150+ // Note: Filters are downloaded from bnema/ublock-webkit-filters GitHub releases
151+ // Note: Whitelist is managed via database (content_whitelist table)
151152 }
152153
153154 // OmniboxConfig holds omnibox behavior preferences
@@ -145,9 +145,10 @@ type ColorPalette struct {
145 type ContentFilteringConfig struct {145 type ContentFilteringConfig struct {
146 // Enabled controls whether ad blocking is active (default: true)146 // Enabled controls whether ad blocking is active (default: true)
147 Enabled bool `mapstructure:"enabled" yaml:"enabled" toml:"enabled"`147 Enabled bool `mapstructure:"enabled" yaml:"enabled" toml:"enabled"`
148- // FilterLists URLs of filter lists to use (EasyList, uBlock, etc.)148+ // AutoUpdate controls whether filters are automatically updated (default: true)
149- FilterLists []string `mapstructure:"filter_lists" yaml:"filter_lists" toml:"filter_lists"`149+ AutoUpdate bool `mapstructure:"auto_update" yaml:"auto_update" toml:"auto_update"`
150- // Note: Whitelist is now managed via database (content_whitelist table)150+ // Note: Filters are downloaded from bnema/ublock-webkit-filters GitHub releases
151+ // Note: Whitelist is managed via database (content_whitelist table)
151 }152 }
152 153
153 // OmniboxConfig holds omnibox behavior preferences154 // OmniboxConfig holds omnibox behavior preferences

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close