Merge remote-tracking branch 'origin/main' into heroku-app
This commit is contained in:
commit
d6eec22bba
|
@ -70,6 +70,6 @@ COPY whoogle.env .
|
||||||
EXPOSE $EXPOSE_PORT
|
EXPOSE $EXPOSE_PORT
|
||||||
|
|
||||||
HEALTHCHECK --interval=30s --timeout=5s \
|
HEALTHCHECK --interval=30s --timeout=5s \
|
||||||
CMD wget --no-verbose --tries=1 http://localhost:${EXPOSE_PORT}/ || exit 1
|
CMD wget -qO- --no-verbose --tries=1 http://localhost:${EXPOSE_PORT}/ || exit 1
|
||||||
|
|
||||||
CMD misc/tor/start-tor.sh & ./run
|
CMD misc/tor/start-tor.sh & ./run
|
||||||
|
|
|
@ -366,6 +366,7 @@ A lot of the app currently piggybacks on Google's existing support for fetching
|
||||||
- [https://search.garudalinux.org](https://search.garudalinux.org)
|
- [https://search.garudalinux.org](https://search.garudalinux.org)
|
||||||
- [https://whooglesearch.net/](https://whooglesearch.net/)
|
- [https://whooglesearch.net/](https://whooglesearch.net/)
|
||||||
- [https://search.whoogle.tech/](https://search.whoogle.tech/)
|
- [https://search.whoogle.tech/](https://search.whoogle.tech/)
|
||||||
|
- [https://search.flawcra.cc/](https://search.flawcra.cc/)
|
||||||
## Screenshots
|
## Screenshots
|
||||||
#### Desktop
|
#### Desktop
|
||||||

|

|
||||||
|
|
|
@ -8,17 +8,19 @@ class Config:
|
||||||
self.url = os.getenv('WHOOGLE_CONFIG_URL', '')
|
self.url = os.getenv('WHOOGLE_CONFIG_URL', '')
|
||||||
self.lang_search = os.getenv('WHOOGLE_CONFIG_LANGUAGE', '')
|
self.lang_search = os.getenv('WHOOGLE_CONFIG_LANGUAGE', '')
|
||||||
self.lang_interface = os.getenv('WHOOGLE_CONFIG_LANGUAGE', '')
|
self.lang_interface = os.getenv('WHOOGLE_CONFIG_LANGUAGE', '')
|
||||||
self.style = open(os.path.join(app_config['STATIC_FOLDER'],
|
self.style = os.getenv(
|
||||||
'css/variables.css')).read()
|
'WHOOGLE_CONFIG_STYLE',
|
||||||
|
open(os.path.join(app_config['STATIC_FOLDER'],
|
||||||
|
'css/variables.css')).read())
|
||||||
self.ctry = os.getenv('WHOOGLE_CONFIG_COUNTRY', '')
|
self.ctry = os.getenv('WHOOGLE_CONFIG_COUNTRY', '')
|
||||||
self.safe = bool(os.getenv('WHOOGLE_CONFIG_SAFE', False))
|
self.safe = int(os.getenv('WHOOGLE_CONFIG_SAFE', '0'))
|
||||||
self.dark = bool(os.getenv('WHOOGLE_CONFIG_DARK', False))
|
self.dark = int(os.getenv('WHOOGLE_CONFIG_DARK', '0'))
|
||||||
self.alts = bool(os.getenv('WHOOGLE_CONFIG_ALTS', False))
|
self.alts = int(os.getenv('WHOOGLE_CONFIG_ALTS', '0'))
|
||||||
self.nojs = bool(os.getenv('WHOOGLE_CONFIG_NOJS', False))
|
self.nojs = int(os.getenv('WHOOGLE_CONFIG_NOJS', '0'))
|
||||||
self.tor = bool(os.getenv('WHOOGLE_CONFIG_TOR', False))
|
self.tor = int(os.getenv('WHOOGLE_CONFIG_TOR', '0'))
|
||||||
self.near = os.getenv('WHOOGLE_CONFIG_NEAR', '')
|
self.near = os.getenv('WHOOGLE_CONFIG_NEAR', '')
|
||||||
self.new_tab = bool(os.getenv('WHOOGLE_CONFIG_NEW_TAB', False))
|
self.new_tab = int(os.getenv('WHOOGLE_CONFIG_NEW_TAB', '0'))
|
||||||
self.get_only = bool(os.getenv('WHOOGLE_CONFIG_GET_ONLY', False))
|
self.get_only = int(os.getenv('WHOOGLE_CONFIG_GET_ONLY', '0'))
|
||||||
self.safe_keys = [
|
self.safe_keys = [
|
||||||
'lang_search',
|
'lang_search',
|
||||||
'lang_interface',
|
'lang_interface',
|
||||||
|
@ -26,10 +28,13 @@ class Config:
|
||||||
'dark'
|
'dark'
|
||||||
]
|
]
|
||||||
|
|
||||||
for key, value in kwargs.items():
|
# Skip setting custom config if there isn't one
|
||||||
if not value:
|
if kwargs:
|
||||||
continue
|
for attr in self.get_mutable_attrs():
|
||||||
setattr(self, key, value)
|
if attr not in kwargs.keys():
|
||||||
|
setattr(self, attr, '')
|
||||||
|
else:
|
||||||
|
setattr(self, attr, kwargs[attr])
|
||||||
|
|
||||||
def __getitem__(self, name):
|
def __getitem__(self, name):
|
||||||
return getattr(self, name)
|
return getattr(self, name)
|
||||||
|
@ -43,6 +48,11 @@ class Config:
|
||||||
def __contains__(self, name):
|
def __contains__(self, name):
|
||||||
return hasattr(self, name)
|
return hasattr(self, name)
|
||||||
|
|
||||||
|
def get_mutable_attrs(self):
|
||||||
|
return {name: attr for name, attr in self.__dict__.items()
|
||||||
|
if not name.startswith("__")
|
||||||
|
and (type(attr) is int or type(attr) is str)}
|
||||||
|
|
||||||
def is_safe_key(self, key) -> bool:
|
def is_safe_key(self, key) -> bool:
|
||||||
"""Establishes a group of config options that are safe to set
|
"""Establishes a group of config options that are safe to set
|
||||||
in the url.
|
in the url.
|
||||||
|
|
|
@ -15,7 +15,7 @@ label {
|
||||||
}
|
}
|
||||||
|
|
||||||
li a {
|
li a {
|
||||||
color: #4b8eaa !important;
|
color: var(--whoogle-dark-result-url) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
|
@ -116,17 +116,18 @@ select {
|
||||||
}
|
}
|
||||||
|
|
||||||
.autocomplete-items {
|
.autocomplete-items {
|
||||||
border: 1px solid #685e79;
|
border: 1px solid var(--whoogle-dark-element-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.autocomplete-items div {
|
.autocomplete-items div {
|
||||||
color: #fff;
|
color: var(--whoogle-dark-text);
|
||||||
background-color: #222;
|
background-color: var(--whoogle-dark-page-bg);
|
||||||
border-bottom: 1px solid #242424;
|
border-bottom: 1px solid var(--whoogle-dark-element-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.autocomplete-items div:hover {
|
.autocomplete-items div:hover {
|
||||||
background-color: #404040;
|
background-color: var(--whoogle-dark-element-bg);
|
||||||
|
color: var(--whoogle-dark-contrast-text) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.autocomplete-active {
|
.autocomplete-active {
|
||||||
|
|
|
@ -15,7 +15,7 @@ label {
|
||||||
}
|
}
|
||||||
|
|
||||||
li a {
|
li a {
|
||||||
color: #4b8eaa !important;
|
color: var(--whoogle-result-url) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
|
@ -112,16 +112,16 @@ input {
|
||||||
}
|
}
|
||||||
|
|
||||||
.autocomplete-items {
|
.autocomplete-items {
|
||||||
border: 1px solid #d4d4d4;
|
border: 1px solid var(--whoogle-element-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.autocomplete-items div {
|
.autocomplete-items div {
|
||||||
background-color: #fff;
|
background-color: var(--whoogle-page-bg);
|
||||||
border-bottom: 1px solid #d4d4d4;
|
border-bottom: 1px solid var(--whoogle-element-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.autocomplete-items div:hover {
|
.autocomplete-items div:hover {
|
||||||
background-color: #e9e9e9;
|
background-color: var(--whoogle-element-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.autocomplete-active {
|
.autocomplete-active {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import random
|
||||||
|
|
||||||
demo_config = {
|
demo_config = {
|
||||||
'near': random.choice(['Seattle', 'New York', 'San Francisco']),
|
'near': random.choice(['Seattle', 'New York', 'San Francisco']),
|
||||||
'dark_mode': str(random.getrandbits(1)),
|
'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'],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user