-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
284 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
kubernetes/main/apps/selfhosted/searxng/app/externalsecret.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/external-secrets.io/externalsecret_v1beta1.json | ||
apiVersion: external-secrets.io/v1beta1 | ||
kind: ExternalSecret | ||
metadata: | ||
name: searxng | ||
spec: | ||
refreshInterval: 5m | ||
secretStoreRef: | ||
kind: ClusterSecretStore | ||
name: onepassword-connect | ||
target: | ||
name: searxng-secret | ||
creationPolicy: Owner | ||
template: | ||
engineVersion: v2 | ||
data: | ||
SEARXNG_SECRET: "{{ .searxng_secret_key }}" | ||
dataFrom: | ||
- extract: | ||
key: searxng | ||
rewrite: | ||
- regexp: | ||
source: "(.*)" | ||
target: "searxng_$1" |
139 changes: 139 additions & 0 deletions
139
kubernetes/main/apps/selfhosted/searxng/app/helmrelease.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json | ||
apiVersion: helm.toolkit.fluxcd.io/v2 | ||
kind: HelmRelease | ||
metadata: | ||
name: searxng | ||
spec: | ||
interval: 30m | ||
chart: | ||
spec: | ||
chart: app-template | ||
version: 3.5.1 | ||
interval: 30m | ||
sourceRef: | ||
kind: HelmRepository | ||
name: bjw-s | ||
namespace: flux-system | ||
|
||
values: | ||
controllers: | ||
searxng: | ||
strategy: RollingUpdate | ||
annotations: | ||
reloader.stakater.com/auto: "true" | ||
|
||
containers: | ||
main: | ||
image: | ||
repository: docker.io/searxng/searxng | ||
tag: 2024.6.30-39aaac40d | ||
env: | ||
SEARXNG_BASE_URL: https://search.bjw-s.dev | ||
SEARXNG_URL: https://search.bjw-s.dev | ||
SEARXNG_PORT: &httpPort 8080 | ||
SEARXNG_REDIS_URL: redis://searxng-redis.selfhosted.svc.cluster.local:6379/0 | ||
envFrom: | ||
- secretRef: | ||
name: searxng-secret | ||
probes: | ||
liveness: &probes | ||
enabled: true | ||
custom: true | ||
spec: | ||
httpGet: | ||
path: /stats | ||
port: 8080 | ||
initialDelaySeconds: 0 | ||
periodSeconds: 10 | ||
timeoutSeconds: 1 | ||
failureThreshold: 3 | ||
readiness: *probes | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 256Mi | ||
limits: | ||
memory: 2Gi | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
readOnlyRootFilesystem: true | ||
capabilities: | ||
drop: | ||
- ALL | ||
add: | ||
- CHOWN | ||
- SETGID | ||
- SETUID | ||
- DAC_OVERRIDE | ||
|
||
redis: | ||
pod: | ||
securityContext: | ||
runAsUser: 65534 | ||
runAsGroup: 65534 | ||
strategy: RollingUpdate | ||
containers: | ||
redis: | ||
image: | ||
repository: docker.io/valkey/valkey | ||
tag: 8.0.1 | ||
args: | ||
- --save | ||
- "" | ||
- --appendonly | ||
- "no" | ||
resources: | ||
requests: | ||
cpu: 5m | ||
memory: 32Mi | ||
limits: | ||
memory: 128Mi | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
readOnlyRootFilesystem: true | ||
capabilities: | ||
drop: | ||
- ALL | ||
|
||
service: | ||
app: | ||
controller: searxng | ||
ports: | ||
http: | ||
port: *httpPort | ||
redis: | ||
controller: redis | ||
ports: | ||
http: | ||
port: 6379 | ||
|
||
ingress: | ||
app: | ||
className: "internal-nginx" | ||
annotations: | ||
external-dns.alpha.kubernetes.io/target: ingress-int.bjw-s.dev | ||
hosts: | ||
- host: search.bjw-s.dev | ||
paths: | ||
- path: / | ||
service: | ||
identifier: app | ||
port: http | ||
|
||
persistence: | ||
config: | ||
type: configMap | ||
name: searxng-configmap | ||
globalMounts: | ||
- path: /etc/searxng/settings.yml | ||
subPath: settings.yml | ||
readOnly: true | ||
- path: /etc/searxng/limiter.toml | ||
subPath: limiter.toml | ||
readOnly: true | ||
tmpfs: | ||
enabled: true | ||
type: emptyDir | ||
globalMounts: | ||
- path: /etc/searxng |
14 changes: 14 additions & 0 deletions
14
kubernetes/main/apps/selfhosted/searxng/app/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ./externalsecret.yaml | ||
- ./helmrelease.yaml | ||
configMapGenerator: | ||
- name: searxng-configmap | ||
files: | ||
- ./resources/limiter.toml | ||
- ./resources/settings.yml | ||
generatorOptions: | ||
disableNameSuffixHash: true |
38 changes: 38 additions & 0 deletions
38
kubernetes/main/apps/selfhosted/searxng/app/resources/limiter.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[real_ip] | ||
|
||
# Number of values to trust for X-Forwarded-For. | ||
|
||
x_for = 1 | ||
|
||
# The prefix defines the number of leading bits in an address that are compared | ||
# to determine whether or not an address is part of a (client) network. | ||
|
||
ipv4_prefix = 32 | ||
ipv6_prefix = 48 | ||
|
||
[botdetection.ip_limit] | ||
|
||
# To get unlimited access in a local network, by default link-lokal addresses | ||
# (networks) are not monitored by the ip_limit | ||
filter_link_local = true | ||
|
||
# activate link_token method in the ip_limit method | ||
link_token = false | ||
|
||
[botdetection.ip_lists] | ||
|
||
# In the limiter, the ip_lists method has priority over all other methods -> if | ||
# an IP is in the pass_ip list, it has unrestricted access and it is also not | ||
# checked if e.g. the "user agent" suggests a bot (e.g. curl). | ||
|
||
block_ip = [ | ||
] | ||
|
||
pass_ip = [ | ||
'192.168.0.0/16', # IPv4 private network | ||
'10.0.0.0/8', # IPv4 private network | ||
] | ||
|
||
# Activate passlist of (hardcoded) IPs from the SearXNG organization, | ||
# e.g. `check.searx.space`. | ||
pass_searxng_org = false |
42 changes: 42 additions & 0 deletions
42
kubernetes/main/apps/selfhosted/searxng/app/resources/settings.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
use_default_settings: true | ||
|
||
server: | ||
limiter: true | ||
image_proxy: true | ||
method: GET # https://github.com/searxng/searxng/pull/3619 | ||
|
||
search: | ||
autocomplete: duckduckgo | ||
|
||
general: | ||
instance_name: BJW-S Search | ||
|
||
ui: | ||
static_use_hash: true | ||
default_theme: simple | ||
theme_args: | ||
simple_style: dark | ||
infinite_scroll: true | ||
results_on_new_tab: true | ||
|
||
enabled_plugins: | ||
- Basic Calculator | ||
- Hash plugin | ||
- Hostnames plugin | ||
- Open Access DOI rewrite | ||
- Self Informations | ||
- Tracker URL remover | ||
- Unit converter plugin | ||
|
||
hostnames: | ||
high_priority: | ||
- (.*)\/blog\/(.*) | ||
- (.*\.)?wikipedia.org$ | ||
- (.*\.)?github.com$ | ||
- (.*\.)?reddit.com$ | ||
- (.*\.)?docker.com$ | ||
- (.*\.)?archlinux.org$ | ||
- (.*\.)?stackoverflow.com$ | ||
- (.*\.)?askubuntu.com$ | ||
- (.*\.)?superuser.com$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json | ||
apiVersion: kustomize.toolkit.fluxcd.io/v1 | ||
kind: Kustomization | ||
metadata: | ||
name: &appname searxng | ||
namespace: flux-system | ||
spec: | ||
targetNamespace: selfhosted | ||
commonMetadata: | ||
labels: | ||
app.kubernetes.io/name: *appname | ||
interval: 30m | ||
timeout: 5m | ||
path: "./kubernetes/main/apps/selfhosted/searxng/app" | ||
prune: true | ||
sourceRef: | ||
kind: GitRepository | ||
name: home-ops-kubernetes | ||
wait: false | ||
dependsOn: | ||
- name: external-secrets-stores | ||
postBuild: | ||
substitute: | ||
APP: *appname |