Merge pull request #1279 from benbusby/updates

Updates
This commit is contained in:
Don 2025-11-26 16:51:03 -06:00 committed by GitHub
commit b3c09ade5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 57 additions and 39 deletions

View file

@ -20,6 +20,13 @@ jobs:
- name: Wait for tests to succeed
if: ${{ github.event.workflow_run.conclusion != 'success' && startsWith(github.ref, 'refs/tags') != true }}
run: exit 1
- name: Debug workflow context
run: |
echo "Event name: ${{ github.event_name }}"
echo "Ref: ${{ github.ref }}"
echo "Actor: ${{ github.actor }}"
echo "Branch: ${{ github.event.workflow_run.head_branch }}"
echo "Conclusion: ${{ github.event.workflow_run.conclusion }}"
- name: checkout code
uses: actions/checkout@v4
- name: Set up QEMU

View file

@ -14,7 +14,7 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: build and test (docker)
run: |
docker build --tag whoogle-search:test .

View file

@ -1,4 +1,14 @@
FROM python:3.12.6-alpine3.20 AS builder
# NOTE: ARMv7 support has been dropped due to lack of pre-built cryptography wheels for Alpine/musl.
# To restore ARMv7 support for local builds:
# 1. Change requirements.txt:
# cryptography==3.3.2; platform_machine == 'armv7l'
# cryptography==46.0.1; platform_machine != 'armv7l'
# pyOpenSSL==19.1.0; platform_machine == 'armv7l'
# pyOpenSSL==25.3.0; platform_machine != 'armv7l'
# 2. Add linux/arm/v7 to --platform flag when building:
# docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64 .
FROM python:3.12-alpine3.22 AS builder
RUN apk --no-cache add \
build-base \
@ -12,13 +22,16 @@ COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --prefix /install --no-warn-script-location --no-cache-dir -r requirements.txt
FROM python:3.12.6-alpine3.20
FROM python:3.12-alpine3.22
RUN apk add --no-cache tor curl openrc libstdc++
# Remove bridge package to avoid CVEs (not needed for Docker containers)
RUN apk add --no-cache --no-scripts tor curl openrc libstdc++ && \
apk del --no-cache bridge || true
# git go //for obfs4proxy
# libcurl4-openssl-dev
RUN apk --no-cache upgrade
RUN pip install --upgrade pip
RUN apk --no-cache upgrade && \
apk del --no-cache --rdepends bridge || true
# uncomment to build obfs4proxy
# RUN git clone https://gitlab.com/yawning/obfs4.git

View file

@ -4,7 +4,7 @@
>works -- Whoogle requests the JavaScript-free search results, then filters out garbage from the results page and proxies all external content for the user.
>
>This is possibly a breaking change that may mean the end for Whoogle. We'll continue fighting back and releasing workarounds until all workarounds are
>exhausted or a better method is found.
>exhausted or a better method is found. If you know of a better way, please review and comment in our Way Forward Discussion
___
@ -88,6 +88,17 @@ Contents
<sup>***If deployed to a remote server, or configured to send requests through a VPN, Tor, proxy, etc.</sup>
## Install
### Supported Platforms
Official Docker images are built for:
- **linux/amd64** (x86_64)
- **linux/arm64** (ARM 64-bit, Raspberry Pi 3/4/5, Apple Silicon)
**Note**: ARMv7 support (32-bit ARM, Raspberry Pi 2) was dropped in v1.2.0 due to incompatibility with modern security libraries on Alpine Linux. Users with ARMv7 devices can either:
- Use an older version (v1.1.x or earlier)
- Build locally with pinned dependencies (see notes in Dockerfile)
- Upgrade to a 64-bit OS if hardware supports it (Raspberry Pi 3+)
There are a few different ways to begin using the app, depending on your preferences:
___
@ -700,7 +711,6 @@ Instead of using auto-generated Opera UA strings, you can provide your own list
```
Opera/9.80 (J2ME/MIDP; Opera Mini/4.2.13337/22.478; U; en) Presto/2.4.15 Version/10.00
Opera/9.80 (Android; Linux; Opera Mobi/498; U; en) Presto/2.12.423 Version/10.1
Opera/9.30 (Nintendo Wii; U; ; 3642; en)
```
2. Set the `WHOOGLE_UA_LIST_FILE` environment variable to point to your file:

View file

@ -81,7 +81,6 @@ class Config:
self.tbs = os.getenv('WHOOGLE_CONFIG_TIME_PERIOD', '')
self.theme = os.getenv('WHOOGLE_CONFIG_THEME', 'system')
self.safe = read_config_bool('WHOOGLE_CONFIG_SAFE')
self.dark = read_config_bool('WHOOGLE_CONFIG_DARK') # deprecated
self.alts = read_config_bool('WHOOGLE_CONFIG_ALTS')
self.nojs = read_config_bool('WHOOGLE_CONFIG_NOJS')
self.tor = read_config_bool('WHOOGLE_CONFIG_TOR')

View file

@ -217,9 +217,7 @@ def index():
translation=app.config['TRANSLATIONS'][
g.user_config.get_localization_lang()
],
logo=render_template(
'logo.html',
dark=g.user_config.dark),
logo=render_template('logo.html'),
config_disabled=(
app.config['CONFIG_DISABLE'] or
not valid_user_session(session)),
@ -581,7 +579,7 @@ def search():
languages=app.config['LANGUAGES'],
countries=app.config['COUNTRIES'],
time_periods=app.config['TIME_PERIODS'],
logo=render_template('logo.html', dark=g.user_config.dark),
logo=render_template('logo.html'),
query=urlparse.unquote(query),
search_type=search_util.search_type,
mobile=g.user_request.mobile,

View file

@ -26,10 +26,12 @@
{% else %}
<link rel="stylesheet" href="{{ cb_url(config.theme + '-theme.css') }}"/>
{% endif %}
{% else %}
<link rel="stylesheet" href="{{ cb_url(('dark' if config.dark else 'light') + '-theme.css') }}"/>
{% endif %}
<style>{{ config.style }}</style>
{% if config.style %}
<style>
{{ config.style }}
</style>
{% endif %}
<title>{{ clean_query(query) }} - Whoogle Search</title>
</head>
<body>

View file

@ -7,8 +7,6 @@
{% else %}
<link rel="stylesheet" href="{{ cb_url(config.theme + '-theme.css') }}"/>
{% endif %}
{% else %}
<link rel="stylesheet" href="{{ cb_url(('dark' if config.dark else 'light') + '-theme.css') }}"/>
{% endif %}
{% if bundle_static() %}
<link rel="stylesheet" href="/{{ cb_url('bundle.css') }}">

View file

@ -41,8 +41,6 @@
{% else %}
<link rel="stylesheet" href="{{ cb_url(config.theme + '-theme.css') }}"/>
{% endif %}
{% else %}
<link rel="stylesheet" href="{{ cb_url(('dark' if config.dark else 'light') + '-theme.css') }}"/>
{% endif %}
{% if not bundle_static() %}
<link rel="stylesheet" href="{{ cb_url('main.css') }}">
@ -204,10 +202,6 @@
</select>
</div>
<!-- DEPRECATED -->
<!--<div class="config-div config-div-dark">-->
<!--<label for="config-dark">{{ translation['config-dark'] }}: </label>-->
<!--<input type="checkbox" name="dark" id="config-dark" {{ 'checked' if config.dark else '' }}>-->
<!--</div>-->
<div class="config-div config-div-safe">
<label for="config-safe">{{ translation['config-safe'] }}: </label>
<input type="checkbox" name="safe" id="config-safe" {{ 'checked' if config.safe else '' }}>

View file

@ -1,8 +1,8 @@
import os
optional_dev_tag = ''
optional_dev_tag = '-update-testing'
if os.getenv('DEV_BUILD'):
optional_dev_tag = '.dev' + os.getenv('DEV_BUILD')
__version__ = '1.1.2' + optional_dev_tag
__version__ = '1.2.0' + optional_dev_tag

View file

@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[tool.ruff]
line-length = 100
target-version = "py311"
target-version = "py312"
lint.select = [
"E", "F", "W", # pycodestyle/pyflakes
"I", # isort
@ -13,4 +13,4 @@ lint.ignore = []
[tool.black]
line-length = 100
target-version = ['py311']
target-version = ['py312']

View file

@ -4,13 +4,12 @@ brotli==1.2.0
certifi==2025.8.3
cffi==2.0.0
click==8.3.0
cryptography==3.3.2; platform_machine == 'armv7l'
cryptography==46.0.1; platform_machine != 'armv7l'
cryptography==46.0.1
cssutils==2.11.1
defusedxml==0.7.1
Flask==2.3.2
Flask==3.1.2
idna==3.10
itsdangerous==2.1.2
itsdangerous==2.2.0
Jinja2==3.1.6
MarkupSafe==3.0.2
more-itertools==10.8.0
@ -18,8 +17,7 @@ packaging==25.0
pluggy==1.6.0
pycodestyle==2.14.0
pycparser==2.22
pyOpenSSL==19.1.0; platform_machine == 'armv7l'
pyOpenSSL==25.3.0; platform_machine != 'armv7l'
pyOpenSSL==25.3.0
pyparsing==3.2.5
pytest==8.3.3
python-dateutil==2.9.0.post0
@ -32,5 +30,5 @@ h11>=0.16.0
validators==0.35.0
waitress==3.0.2
wcwidth==0.2.14
Werkzeug==3.0.6
Werkzeug==3.1.3
python-dotenv==1.1.1

View file

@ -8,7 +8,6 @@ import random
demo_config = {
'near': random.choice(['Seattle', 'New York', 'San Francisco']),
'dark': str(random.getrandbits(1)),
'nojs': str(random.getrandbits(1)),
'lang_interface': random.choice(app.config['LANGUAGES'])['value'],
'lang_search': random.choice(app.config['LANGUAGES'])['value'],

View file

@ -75,14 +75,14 @@ def test_config(client):
# Test disabling changing config from client
app.config['CONFIG_DISABLE'] = 1
dark_mod = not demo_config['dark']
demo_config['dark'] = dark_mod
nojs_mod = not bool(int(demo_config['nojs']))
demo_config['nojs'] = str(int(nojs_mod))
rv = client.post(f'/{Endpoint.config}', data=demo_config)
assert rv._status_code == 403
rv = client.get(f'/{Endpoint.config}')
config = json.loads(rv.data)
assert config['dark'] != dark_mod
assert config['nojs'] != nojs_mod
def test_opensearch(client):