-
Notifications
You must be signed in to change notification settings - Fork 1.7k
What searx option is a part of the brand and what is a part of instance settings.yml ? #2394
Comments
Yes, this needs some discussion .. but I would use a different title simmilar: What searx option is a part of the brand and what is a part of instance .. and and what are the intersections. |
Let's start with
|
I think the brand is needed for the buildenv while settings are needed for a instance. Values like One brand might maintain one or more instances. I think we need some hierarchy: if a value is not given in the |
In the current master branch: # git grep "CONTACT_URL"
# set value
Makefile:# export CONTACT_URL=mailto:contact@example.com
# boilerplate
Makefile: @echo ' CONTACT_URL = $(CONTACT_URL)'
Makefile: $(Q)echo "CONTACT_URL = '$(CONTACT_URL)'" >> searx/brand.py
Makefile: $(Q)echo "export CONTACT_URL='$(CONTACT_URL)'" >> utils/brand.env
# output
searx/brand.py:CONTACT_URL = 'mailto:contact@example.com'
# real usage: templates
searx/templates/oscar/base.html: <a href="{{ brand.PUBLIC_INSTANCES }}">{{ _('Public instances') }}</a>{% if brand.CONTACT_URL %} |
searx/templates/oscar/base.html: <a href="{{ brand.CONTACT_URL }}">{{ _('Contact instance maintainer') }}</a>{% endif %}
searx/templates/simple/base.html: <a href="{{ brand.PUBLIC_INSTANCES }}">{{ _('Public instances') }}</a>{% if brand.CONTACT_URL %} |
searx/templates/simple/base.html: <a href="{{ brand.CONTACT_URL }}">{{ _('Contact instance maintainer') }}</a>{% endif %} # git grep "SEARX_URL"
# set value
Makefile:export SEARX_URL=https://searx.me
# boilerplate
.config.sh:PUBLIC_URL="${SEARX_URL}"
Makefile: @echo ' SEARX_URL = $(SEARX_URL)'
Makefile: $(Q)echo "SEARX_URL = '$(SEARX_URL)'" >> searx/brand.py
Makefile: $(Q)echo "export SEARX_URL='$(SEARX_URL)'" >> utils/brand.env
docs/conf.py:from searx.brand import SEARX_URL
manage.sh: SEARX_URL: ${SEARX_URL}
# output
searx/brand.py:SEARX_URL = 'https://searx.me'
utils/brand.env:export SEARX_URL='https://searx.me'
# false positive: documentation
docs/dev/makefile.rst::SEARX_URL: Changes this, to point to your searx instance.
# doc really uses SEARX_URL
docs/conf.py:extlinks['search'] = (SEARX_URL + '/%s', '#')
# usage
utils/filtron.sh: SEARX_URL_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_URL_PATH)
utils/morty.sh:SEARX_URL="${PUBLIC_URL:-http://$(uname -n)/searx}"
utils/morty.sh:PUBLIC_URL_MORTY="${PUBLIC_URL_MORTY:-$(echo "$SEARX_URL" | sed -e's,^\(.*://[^/]*\).*,\1,g')${PUBLIC_URL_PATH_MORTY}}"
utils/morty.sh: SEARX_URL_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_URL_PATH)
utils/searx.sh:SEARX_URL_PATH="${SEARX_URL_PATH:-$(echo "${PUBLIC_URL}" \
utils/searx.sh:[[ "${SEARX_URL_PATH}" == "${PUBLIC_URL}" ]] && SEARX_URL_PATH=/
utils/searx.sh: SEARX_URL_PATH : ${SEARX_URL_PATH}
utils/templates/etc/httpd/sites-available/searx.conf:uwsgi:# SetEnvIf Request_URI "${SEARX_URL_PATH}" dontlog
utils/templates/etc/httpd/sites-available/searx.conf:uwsgi:<Location ${SEARX_URL_PATH}>
utils/templates/etc/nginx/default.apps-available/searx.conf:filtron:location ${SEARX_URL_PATH} {
utils/templates/etc/nginx/default.apps-available/searx.conf:filtron: proxy_set_header X-Script-Name ${SEARX_URL_PATH};
utils/templates/etc/nginx/default.apps-available/searx.conf:filtron:location ${SEARX_URL_PATH}/static { So SEARX_URL has two usages (and according extlinks documentation ):
About the documentation:
Sum of the sum up, SEARX_URL has two usages:
My feeling is that:
|
Thanks for your analysis, your conclusion seems (more or less) the same than mine:
I think there are values needed at installation (build) time and also needed at runtime, e.g. CONTACT_URL. In my draft #2404 I used inheritance to handle both usages of CONTACT_URL In commit e2d40cc CONTACT_URL is used in the project links of the docs. What do you think, is the draft a way we can go, or I am wrong?
Yes, this is a problem of the searx brand but not if someone maintain its own brand. |
Meh, it starts to be complicated, three different locations for one setting.
What is branding ? What is the process to brand a new version of searx ? Here different searx forks / packages:
Should these fork be changed in a way or another ? I'm not saying branding should be removed, rather the process to brand a searx should be more documented and perhaps adjusted. |
Package manger should ask for values which are individually or have some documentation. A brand concept (however it looks like at the end) should help to maintain forks. Forks are created for package managers and for instances or (docker) images. To maintain a fork, a minimal build process will be needed,
I can implement a draft |
I send another draft #2408 The implementation moves all options to settings.yml, with there is no longer any need to touch the Makefile. |
About GIT_URL
Purpose: documentationWhen IMO, this additional value tries to answer this question: which searx version are we talking about ?
Purpose: Where to publish the documentationThere are two different ways to deploy the documentation:
In the second case, when Purpose: Which git repository to use to install searx. The value can be completly different from the current git repository.When |
@dalf: here are my 5cent about GIT_URL:
Is it? .. If someone wants to install a instance from its fork (like I do it), he will clone from this fork and the 'origin' is set to fork's Vice-Versus: This rule will no match in use cases where the remote alias 'origin' does not point to
I don't see any contradiction in this.
ATM, I do not know any use case, where it is different. After #2408 has been merged I can try to replace May be we can also replace other environment (settings). But this will need more investigation from my side .. first, it might be good to merge #2408 to have one single point of definition. |
@dalf what do you think, can we close this issue? |
Currently:
searx/searx/brand.py
Lines 1 to 6 in 002d53a
SEARX_URL
is very similar tosearx/searx/settings.yml
Line 16 in 002d53a
GIT_URL
usage:searx/utils/makefile.sphinx
Line 180 in 002d53a
searx/utils/searx.sh
Line 398 in 002d53a
GIT_BRANCH
usage: utils/searx.shsearx/utils/searx.sh
Line 329 in 002d53a
DOCS_URL
is displayed in the themes, referenced insetup.py
andutils/morty.sh
PUBLIC_INSTANCES
,DOCS_URL
,ISSUE_URL
are displayed in the themes and referenced insetup.py
When a setting should go into brand.py ? (brand.py but it is actually Makefile )
The text was updated successfully, but these errors were encountered: