mirror of
https://github.com/benbusby/whoogle-search.git
synced 2026-03-11 08:54:34 +00:00
Update dependencies and configuration for version 1.2.0
- Bump target Python version to 3.12 in `pyproject.toml`. - Update Flask to version 3.1.2 in `requirements.txt`. - Remove deprecated dark mode configuration from the application. - Adjust logo rendering in templates to remove dark mode dependency. - Update GitHub Actions workflows to support the 'updates' branch for builds. - Increment version to 1.1.3 with an optional update-testing tag.
This commit is contained in:
parent
178d67a73f
commit
cffef7aa15
13 changed files with 32 additions and 45 deletions
12
.github/workflows/.pre-commit-config.yaml
vendored
12
.github/workflows/.pre-commit-config.yaml
vendored
|
|
@ -1,12 +0,0 @@
|
||||||
repos:
|
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
||||||
rev: v0.6.9
|
|
||||||
hooks:
|
|
||||||
- id: ruff
|
|
||||||
args: [--fix]
|
|
||||||
- id: ruff-format
|
|
||||||
- repo: https://github.com/psf/black
|
|
||||||
rev: 24.8.0
|
|
||||||
hooks:
|
|
||||||
- id: black
|
|
||||||
args: [--quiet]
|
|
||||||
13
.github/workflows/buildx.yml
vendored
13
.github/workflows/buildx.yml
vendored
|
|
@ -3,7 +3,7 @@ name: buildx
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: ["docker_main"]
|
workflows: ["docker_main"]
|
||||||
branches: [main]
|
branches: [main, updates]
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
push:
|
push:
|
||||||
|
|
@ -50,6 +50,17 @@ jobs:
|
||||||
# docker buildx build --push \
|
# docker buildx build --push \
|
||||||
# --tag ghcr.io/benbusby/whoogle-search:latest \
|
# --tag ghcr.io/benbusby/whoogle-search:latest \
|
||||||
# --platform linux/amd64,linux/arm64 .
|
# --platform linux/amd64,linux/arm64 .
|
||||||
|
- name: build and push updates branch (update-testing tag)
|
||||||
|
if: github.event.workflow_run.head_branch == 'updates' && github.event.workflow_run.conclusion == 'success' && (github.actor == 'benbusby' || github.actor == 'Don-Swanson')
|
||||||
|
run: |
|
||||||
|
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
|
docker buildx ls
|
||||||
|
docker buildx build --push \
|
||||||
|
--tag benbusby/whoogle-search:update-testing \
|
||||||
|
--platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||||
|
docker buildx build --push \
|
||||||
|
--tag ghcr.io/benbusby/whoogle-search:update-testing \
|
||||||
|
--platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||||
- name: build and push release (version + latest)
|
- name: build and push release (version + latest)
|
||||||
if: github.event_name == 'release' && github.event.release.prerelease == false && (github.actor == 'benbusby' || github.actor == 'Don-Swanson')
|
if: github.event_name == 'release' && github.event.release.prerelease == false && (github.actor == 'benbusby' || github.actor == 'Don-Swanson')
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
2
.github/workflows/docker_main.yml
vendored
2
.github/workflows/docker_main.yml
vendored
|
|
@ -3,7 +3,7 @@ name: docker_main
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: ["tests"]
|
workflows: ["tests"]
|
||||||
branches: [main]
|
branches: [main, updates]
|
||||||
types:
|
types:
|
||||||
- completed
|
- completed
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,6 @@ class Config:
|
||||||
self.tbs = os.getenv('WHOOGLE_CONFIG_TIME_PERIOD', '')
|
self.tbs = os.getenv('WHOOGLE_CONFIG_TIME_PERIOD', '')
|
||||||
self.theme = os.getenv('WHOOGLE_CONFIG_THEME', 'system')
|
self.theme = os.getenv('WHOOGLE_CONFIG_THEME', 'system')
|
||||||
self.safe = read_config_bool('WHOOGLE_CONFIG_SAFE')
|
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.alts = read_config_bool('WHOOGLE_CONFIG_ALTS')
|
||||||
self.nojs = read_config_bool('WHOOGLE_CONFIG_NOJS')
|
self.nojs = read_config_bool('WHOOGLE_CONFIG_NOJS')
|
||||||
self.tor = read_config_bool('WHOOGLE_CONFIG_TOR')
|
self.tor = read_config_bool('WHOOGLE_CONFIG_TOR')
|
||||||
|
|
|
||||||
|
|
@ -217,9 +217,7 @@ def index():
|
||||||
translation=app.config['TRANSLATIONS'][
|
translation=app.config['TRANSLATIONS'][
|
||||||
g.user_config.get_localization_lang()
|
g.user_config.get_localization_lang()
|
||||||
],
|
],
|
||||||
logo=render_template(
|
logo=render_template('logo.html'),
|
||||||
'logo.html',
|
|
||||||
dark=g.user_config.dark),
|
|
||||||
config_disabled=(
|
config_disabled=(
|
||||||
app.config['CONFIG_DISABLE'] or
|
app.config['CONFIG_DISABLE'] or
|
||||||
not valid_user_session(session)),
|
not valid_user_session(session)),
|
||||||
|
|
@ -581,7 +579,7 @@ def search():
|
||||||
languages=app.config['LANGUAGES'],
|
languages=app.config['LANGUAGES'],
|
||||||
countries=app.config['COUNTRIES'],
|
countries=app.config['COUNTRIES'],
|
||||||
time_periods=app.config['TIME_PERIODS'],
|
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),
|
query=urlparse.unquote(query),
|
||||||
search_type=search_util.search_type,
|
search_type=search_util.search_type,
|
||||||
mobile=g.user_request.mobile,
|
mobile=g.user_request.mobile,
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,12 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<link rel="stylesheet" href="{{ cb_url(config.theme + '-theme.css') }}"/>
|
<link rel="stylesheet" href="{{ cb_url(config.theme + '-theme.css') }}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
|
||||||
<link rel="stylesheet" href="{{ cb_url(('dark' if config.dark else 'light') + '-theme.css') }}"/>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<style>{{ config.style }}</style>
|
{% if config.style %}
|
||||||
|
<style>
|
||||||
|
{{ config.style }}
|
||||||
|
</style>
|
||||||
|
{% endif %}
|
||||||
<title>{{ clean_query(query) }} - Whoogle Search</title>
|
<title>{{ clean_query(query) }} - Whoogle Search</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<link rel="stylesheet" href="{{ cb_url(config.theme + '-theme.css') }}"/>
|
<link rel="stylesheet" href="{{ cb_url(config.theme + '-theme.css') }}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
|
||||||
<link rel="stylesheet" href="{{ cb_url(('dark' if config.dark else 'light') + '-theme.css') }}"/>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if bundle_static() %}
|
{% if bundle_static() %}
|
||||||
<link rel="stylesheet" href="/{{ cb_url('bundle.css') }}">
|
<link rel="stylesheet" href="/{{ cb_url('bundle.css') }}">
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,6 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<link rel="stylesheet" href="{{ cb_url(config.theme + '-theme.css') }}"/>
|
<link rel="stylesheet" href="{{ cb_url(config.theme + '-theme.css') }}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
|
||||||
<link rel="stylesheet" href="{{ cb_url(('dark' if config.dark else 'light') + '-theme.css') }}"/>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not bundle_static() %}
|
{% if not bundle_static() %}
|
||||||
<link rel="stylesheet" href="{{ cb_url('main.css') }}">
|
<link rel="stylesheet" href="{{ cb_url('main.css') }}">
|
||||||
|
|
@ -204,10 +202,6 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<!-- DEPRECATED -->
|
<!-- 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">
|
<div class="config-div config-div-safe">
|
||||||
<label for="config-safe">{{ translation['config-safe'] }}: </label>
|
<label for="config-safe">{{ translation['config-safe'] }}: </label>
|
||||||
<input type="checkbox" name="safe" id="config-safe" {{ 'checked' if config.safe else '' }}>
|
<input type="checkbox" name="safe" id="config-safe" {{ 'checked' if config.safe else '' }}>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
optional_dev_tag = ''
|
optional_dev_tag = '-update-testing'
|
||||||
if os.getenv('DEV_BUILD'):
|
if os.getenv('DEV_BUILD'):
|
||||||
optional_dev_tag = '.dev' + 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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
line-length = 100
|
line-length = 100
|
||||||
target-version = "py311"
|
target-version = "py312"
|
||||||
lint.select = [
|
lint.select = [
|
||||||
"E", "F", "W", # pycodestyle/pyflakes
|
"E", "F", "W", # pycodestyle/pyflakes
|
||||||
"I", # isort
|
"I", # isort
|
||||||
|
|
@ -13,4 +13,4 @@ lint.ignore = []
|
||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
line-length = 100
|
line-length = 100
|
||||||
target-version = ['py311']
|
target-version = ['py312']
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,12 @@ brotli==1.2.0
|
||||||
certifi==2025.8.3
|
certifi==2025.8.3
|
||||||
cffi==2.0.0
|
cffi==2.0.0
|
||||||
click==8.3.0
|
click==8.3.0
|
||||||
cryptography==3.3.2; platform_machine == 'armv7l'
|
cryptography==46.0.1
|
||||||
cryptography==46.0.1; platform_machine != 'armv7l'
|
|
||||||
cssutils==2.11.1
|
cssutils==2.11.1
|
||||||
defusedxml==0.7.1
|
defusedxml==0.7.1
|
||||||
Flask==2.3.2
|
Flask==3.1.2
|
||||||
idna==3.10
|
idna==3.10
|
||||||
itsdangerous==2.1.2
|
itsdangerous==2.2.0
|
||||||
Jinja2==3.1.6
|
Jinja2==3.1.6
|
||||||
MarkupSafe==3.0.2
|
MarkupSafe==3.0.2
|
||||||
more-itertools==10.8.0
|
more-itertools==10.8.0
|
||||||
|
|
@ -18,8 +17,7 @@ packaging==25.0
|
||||||
pluggy==1.6.0
|
pluggy==1.6.0
|
||||||
pycodestyle==2.14.0
|
pycodestyle==2.14.0
|
||||||
pycparser==2.22
|
pycparser==2.22
|
||||||
pyOpenSSL==19.1.0; platform_machine == 'armv7l'
|
pyOpenSSL==25.3.0
|
||||||
pyOpenSSL==25.3.0; platform_machine != 'armv7l'
|
|
||||||
pyparsing==3.2.5
|
pyparsing==3.2.5
|
||||||
pytest==8.3.3
|
pytest==8.3.3
|
||||||
python-dateutil==2.9.0.post0
|
python-dateutil==2.9.0.post0
|
||||||
|
|
@ -32,5 +30,5 @@ h11>=0.16.0
|
||||||
validators==0.35.0
|
validators==0.35.0
|
||||||
waitress==3.0.2
|
waitress==3.0.2
|
||||||
wcwidth==0.2.14
|
wcwidth==0.2.14
|
||||||
Werkzeug==3.0.6
|
Werkzeug==3.1.3
|
||||||
python-dotenv==1.1.1
|
python-dotenv==1.1.1
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import random
|
||||||
|
|
||||||
demo_config = {
|
demo_config = {
|
||||||
'near': random.choice(['Seattle', 'New York', 'San Francisco']),
|
'near': random.choice(['Seattle', 'New York', 'San Francisco']),
|
||||||
'dark': str(random.getrandbits(1)),
|
|
||||||
'nojs': str(random.getrandbits(1)),
|
'nojs': str(random.getrandbits(1)),
|
||||||
'lang_interface': random.choice(app.config['LANGUAGES'])['value'],
|
'lang_interface': random.choice(app.config['LANGUAGES'])['value'],
|
||||||
'lang_search': random.choice(app.config['LANGUAGES'])['value'],
|
'lang_search': random.choice(app.config['LANGUAGES'])['value'],
|
||||||
|
|
|
||||||
|
|
@ -75,14 +75,14 @@ def test_config(client):
|
||||||
|
|
||||||
# Test disabling changing config from client
|
# Test disabling changing config from client
|
||||||
app.config['CONFIG_DISABLE'] = 1
|
app.config['CONFIG_DISABLE'] = 1
|
||||||
dark_mod = not demo_config['dark']
|
nojs_mod = not bool(int(demo_config['nojs']))
|
||||||
demo_config['dark'] = dark_mod
|
demo_config['nojs'] = str(int(nojs_mod))
|
||||||
rv = client.post(f'/{Endpoint.config}', data=demo_config)
|
rv = client.post(f'/{Endpoint.config}', data=demo_config)
|
||||||
assert rv._status_code == 403
|
assert rv._status_code == 403
|
||||||
|
|
||||||
rv = client.get(f'/{Endpoint.config}')
|
rv = client.get(f'/{Endpoint.config}')
|
||||||
config = json.loads(rv.data)
|
config = json.loads(rv.data)
|
||||||
assert config['dark'] != dark_mod
|
assert config['nojs'] != nojs_mod
|
||||||
|
|
||||||
|
|
||||||
def test_opensearch(client):
|
def test_opensearch(client):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue