Compare commits

...

20 commits

Author SHA1 Message Date
Rafael Caricio 2edb8d8e15
Predictable memory usage
Signed-off-by: Rafael Caricio <rafael@caricio.com>
2022-07-08 19:04:48 +02:00
Rafael Caricio 15d4435d80
Updated dockerfile with metadata
Signed-off-by: Rafael Caricio <rafael@caricio.com>
2022-07-08 18:40:49 +02:00
Rafael Caricio 9a822af310
Enable redis addon
Signed-off-by: Rafael Caricio <rafael@caricio.com>
2022-07-08 18:21:11 +02:00
Rafael Caricio 7c7a55c078
Initial usable version
Signed-off-by: Rafael Caricio <rafael@caricio.com>
2022-07-08 18:07:39 +02:00
Girish Ramakrishnan b7b5a688a7 Version 1.6.1 2022-01-23 11:00:04 -08:00
Girish Ramakrishnan 73e3ad3341 Make tests async 2022-01-23 10:50:53 -08:00
Girish Ramakrishnan be87dfccc4 Update base image to 3.2.0 2022-01-23 10:45:00 -08:00
Johannes Zellner 98dd94bd4a Update test deps 2021-03-28 11:12:32 +02:00
Johannes Zellner 10b6dc9962 Bump version for 1.0.0 2021-03-28 11:11:31 +02:00
Girish Ramakrishnan 4c80338eba Version 1.5.0 2021-02-22 18:38:30 -08:00
Girish Ramakrishnan 48776dd2eb fix restore test 2021-02-22 18:37:56 -08:00
Girish Ramakrishnan 0d1b521cd5 Fix ignore files 2021-02-22 16:53:08 -08:00
Girish Ramakrishnan d44dcd27f8 Update base image to v3 2021-02-22 16:52:09 -08:00
Girish Ramakrishnan 838444dc93 Version 1.4.0 2020-12-14 12:41:32 -08:00
Girish Ramakrishnan bd6a356b13 Update modules 2020-12-14 12:34:28 -08:00
Girish Ramakrishnan 3348258e40 update manifest 2020-12-14 12:32:39 -08:00
Girish Ramakrishnan e0bf22252d Update searx to 0.18.0 2020-12-14 12:32:35 -08:00
Johannes Zellner 35858fb399 Update test deps 2020-07-10 11:38:33 +02:00
Johannes Zellner 969b349508 Ensuer we set LANG for python unicode handling 2020-07-10 11:38:27 +02:00
Johannes Zellner 61c976d7e1 Bump version for 0.17.0 2020-07-10 11:02:00 +02:00
11 changed files with 2163 additions and 1113 deletions

View file

@ -3,4 +3,5 @@
.dockerignore
node_modules
screenshots
test

4
.gitignore vendored
View file

@ -1,2 +1,2 @@
node_modules/
test/node_modules/
tmp/*

View file

@ -20,3 +20,29 @@
[1.2.0]
* Use latest base image 2.0.0
[1.3.0]
* Update Searx to 0.17.0
* Add new search engines
* [Full changelog](https://github.com/asciimoo/searx/releases/tag/v0.17.0)
[1.4.0]
* Update Searx to 0.18.0
* [Full changelog](https://github.com/asciimoo/searx/releases/tag/v0.18.0)
* separate index and search routes ( #1681 ). warning add & remove your searx instance(s) from your browser.
* add external_bang ( #2027 #2043 #2059 )
* add external plugins supports ( #2074 )
* add plugin converting strings into hash digests ( #1246 )
* new category: Onions ( #565 )
* allow searx query parts anywhere in the query ( aa3c18d 2aef38c )
[1.5.0]
* Update base image to v3
[1.6.0]
* Update Searx to 1.0.0
* The searx maintainer team, would like to say a huge thank you for everybody who had been involved in the development of searx or supported us in the past 7 years - making our first stable release available. Special thanks to NLNet for sponsoring multiple features of this release.
* [Full changelog](https://github.com/searx/searx/releases/tag/1.0.0)
[1.6.1]
* Update base image to 3.2.0

View file

@ -1,28 +1,30 @@
{
"id": "io.github.ascimoo.searx",
"title": "searx",
"author": "searx authors",
"id": "io.github.searxng.searxng",
"title": "searxng",
"author": "searxng authors",
"description": "file://DESCRIPTION.md",
"changelog": "file://CHANGELOG",
"tagline": "Privacy-respecting metasearch engine",
"version": "1.2.0",
"version": "1.0.0",
"memoryLimit": 589719142400,
"healthCheckPath": "/",
"httpPort": 8888,
"addons": {
"localstorage": {}
"localstorage": {},
"redis": {}
},
"manifestVersion": 2,
"website": "https://asciimoo.github.io/searx/",
"website": "https://docs.searxng.org",
"contactEmail": "support@cloudron.io",
"icon": "file://logo.png",
"tags": [
"search", "metasearch"
"search", "metasearch", "bing", "google", "duckduckgo", "privacy"
],
"mediaLinks": [
"https://cloudron-app-screenshots.s3.amazonaws.com/io.github.ascimoo.searx/9456666ef5a9d278b2282a888a53aa7f676c305c/1.png",
"https://cloudron-app-screenshots.s3.amazonaws.com/io.github.ascimoo.searx/9456666ef5a9d278b2282a888a53aa7f676c305c/2.png",
"https://cloudron-app-screenshots.s3.amazonaws.com/io.github.ascimoo.searx/9456666ef5a9d278b2282a888a53aa7f676c305c/3.png"
"https://screenshots.cloudron.io/io.github.ascimoo.searx/1.png",
"https://screenshots.cloudron.io/io.github.ascimoo.searx/2.png",
"https://screenshots.cloudron.io/io.github.ascimoo.searx/3.png"
],
"minBoxVersion": "4.1.5",
"documentationUrl": "https://cloudron.io/documentation/apps/searx/"
"minBoxVersion": "5.3.0",
"documentationUrl": "https://git.caric.io/cloudron-apps/searxng-app"
}

View file

@ -1,10 +1,10 @@
This app packages searx version <upstream>0.16.0</upstream>.
This app packages searx version <upstream>1.0.0</upstream>.
## About
### About
Searx is a [metasearch engine](https://en.wikipedia.org/wiki/Metasearch_engine), aggregating the results of other [search engines]({{ url_for('preferences') }}) while not storing information about its users.
## Why use searx?
### Why use searx?
* searx may not offer you as personalised results as Google, but it doesn't generate a profile about you
* searx doesn't care about what you search for, never shares anything with a third party, and it can't be used to compromise you
@ -12,19 +12,19 @@ Searx is a [metasearch engine](https://en.wikipedia.org/wiki/Metasearch_engine),
If you do care about privacy, want to be a conscious user, or otherwise believe in digital freedom, make searx your default search engine or run it on your own server
## Technical details - How does it work?
### Technical details - How does it work?
Searx is a [metasearch engine](https://en.wikipedia.org/wiki/Metasearch_engine), inspired by the [seeks project](https://beniz.github.io/seeks/).
It provides basic privacy by mixing your queries with searches on other platforms without storing search data. Queries are made using a POST request on every browser (except chrome*). Therefore they show up in neither our logs, nor your url history. In case of Chrome* users there is an exception, searx uses the search bar to perform GET requests.
Searx is a [metasearch engine](https://en.wikipedia.org/wiki/Metasearch_engine), inspired by the [seeks project](https://beniz.github.io/seeks/).
It provides basic privacy by mixing your queries with searches on other platforms without storing search data. Queries are made using a POST request on every browser (except chrome*). Therefore they show up in neither our logs, nor your url history. In case of Chrome* users there is an exception, searx uses the search bar to perform GET requests.
Searx can be added to your browser's search bar; moreover, it can be set as the default search engine.
## How can I make it my own?
### How can I make it my own?
Searx appreciates your concern regarding logs, so take the [code](https://github.com/asciimoo/searx) and run it yourself!
Add your Searx to this [list](https://github.com/asciimoo/searx/wiki/Searx-instances) to help other people reclaim their privacy and make the Internet freer!
Searx appreciates your concern regarding logs, so take the [code](https://github.com/asciimoo/searx) and run it yourself!
Add your Searx to this [list](https://github.com/asciimoo/searx/wiki/Searx-instances) to help other people reclaim their privacy and make the Internet freer!
The more decentralized the Internet is, the more freedom we have!
## More about searx
### More about searx
* [github](https://github.com/asciimoo/searx)
* [ohloh](https://www.ohloh.net/p/searx/)

View file

@ -1,23 +1,41 @@
FROM cloudron/base:2.0.0@sha256:f9fea80513aa7c92fe2e7bf3978b54c8ac5222f47a9a32a7f8833edf0eb5a4f4
FROM cloudron/base:3.2.0@sha256:ba1d566164a67c266782545ea9809dc611c4152e27686fd14060332dd88263ea
# this is one commit from 0.16.0 (https://github.com/asciimoo/searx/issues/1830)
ARG VERSION=f9c7a678d273c55a0e8a1a7a2dbfd696b2046e60
ARG VERSION=1.0.0
RUN mkdir -p /app/code /app/pkg
WORKDIR /app/code
RUN apt update && \
apt install -y python3 build-essential libxslt-dev python3-dev python3-virtualenv python3-setuptools zlib1g-dev libffi-dev libssl-dev python3-pip && \
rm -rf /var/cache/apt /var/lib/apt/lists
# download the source code
RUN curl -L https://git.caric.io/mirrors/searxng/archive/m${VERSION}.tar.gz | tar -xz --strip-components 1 -f -
RUN curl -L https://github.com/asciimoo/searx/archive/${VERSION}.tar.gz | tar -xz --strip-components 1 -f -
RUN pip3 install --no-cache -r /app/code/requirements.txt
# install dependencies, including app dependencies from `requirements.txt`
RUN apt update && \
apt install -y python3 build-essential libxslt-dev python3-dev python3-virtualenv python3-setuptools zlib1g-dev libffi-dev libssl-dev python3-pip git tar ca-certificates libxml2 libxslt1-dev brotli && \
rm -rf /var/cache/apt /var/lib/apt/lists && \
pip3 install --upgrade pip wheel setuptools uwsgi && \
pip3 install --no-cache -r /app/code/requirements.txt
# compile code and compress static files
RUN /usr/bin/python3 -m compileall -q searx
# RUN find /app/code/searx/static -a \( -name '*.html' -o -name '*.css' -o -name '*.js' -o -name '*.svg' -o -name '*.ttf' -o -name '*.eot' \) -type f -exec gzip -9 -k {} \+ -exec brotli --best {} \+
ENV INSTANCE_NAME=searxng \
AUTOCOMPLETE= \
BASE_URL= \
MORTY_KEY= \
MORTY_URL= \
SEARXNG_SETTINGS_PATH=/app/data/settings.yml \
UWSGI_SETTINGS_PATH=/app/data/uwsgi.ini
RUN mv /app/code/searx/settings.yml /app/code/searx/settings.yml.orig && \
ln -sf /app/data/settings.yml /app/code/searx/settings.yml
RUN echo "VERSION_STRING=\"m${VERSION}\";VERSION_TAG=\"m${VERSION}\";GIT_URL=\"https://git.caric.io/mirrors/searxng\";GIT_BRANCH=\"m${VERSION}\"" \
> /app/code/searx/version_frozen.py
RUN chown -R www-data.www-data /app/code
EXPOSE 8888
# Fix python UnicodeDecodeError
ENV LANG C.UTF-8
COPY start.sh /app/pkg/start.sh

View file

@ -1,8 +1,8 @@
# Searx for Cloudron
# SearXNG for Cloudron
A privacy-respecting, hackable metasearch engine
- developped by : [Adam Tauber](https://github.com/asciimoo/searx/)
- forked from : [Joey / Searx-app](https://git.cloudron.io/joey/searx-app/)
- developed at : [SearXNG official repo](https://github.com/searxng/searxng)
- forked from : [Cloudron / Searx-app](https://git.cloudron.io/cloudron/searx-app)
## History
The success of this app belong to [Joey](https://git.cloudron.io/joey/searx-app/) who, pretty much, build it. I added few pieces on the puzzle and maintain it.

View file

@ -2,15 +2,29 @@
set -eu
if [[ -z "$(ls -A /app/data)" ]]; then
echo "=> Detected first run"
if [[ ! -f /app/data/uwsgi.ini ]]; then
echo "==> Copying uwsgi template on first run"
cp /app/code/dockerfiles/uwsgi.ini /app/data/uwsgi.ini
sed -e "s/pythonpath = .*/pythonpath = \/app\/code/g" \
-e "s/chdir = .*/chdir = \/app\/code\/searx/g" \
-e "s/uid = .*/uid = www-data/g" \
-e "s/gid = .*/gid = www-data/g" \
-e "s/workers = .*/workers = 4/g" \
-e "s/static-map = \/static=.*/static-map = \/static=\/app\/code\/searx\/static/g" \
-i /app/data/uwsgi.ini
fi
if [[ ! -f /app/data/settings.yml ]]; then
echo "=> Copying settings from template on first run"
cp /app/code/searx/settings.yml.orig /app/data/settings.yml
sed -e 's/bind_address : "127.0.0.1"/bind_address : "0.0.0.0"/g' \
sed -e 's/bind_address: "127.0.0.1"/bind_address: "0.0.0.0"/g' \
-e "s/url: .*redis\.sock.*/url: \"redis:\/\/:${CLOUDRON_REDIS_PASSWORD}@${CLOUDRON_REDIS_HOST}:${CLOUDRON_REDIS_PORT}\/0\"/g" \
-e "s/ultrasecretkey/`openssl rand -hex 16`/g" \
-i /app/data/settings.yml
fi
chown -R www-data.www-data /app/data
echo "==> Starting searx"
exec gosu www-data python3 /app/code/searx/webapp.py
echo "==> Starting searXNG"
exec gosu www-data uwsgi --master --ini /app/data/uwsgi.ini --http-socket "0.0.0.0:8888"

3014
test/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -8,17 +8,11 @@
},
"author": "",
"license": "ISC",
"devDependencies": {
"ejs": "^3.1.3",
"expect.js": "^0.3.1",
"mkdirp": "^1.0.4",
"mocha": "^7.2.0",
"rimraf": "^3.0.2",
"selenium-server-standalone-jar": "^3.141.59",
"selenium-webdriver": "^3.6.0",
"superagent": "^5.2.2"
},
"dependencies": {
"chromedriver": "^83.0.0"
"expect.js": "^0.3.1",
"mocha": "^9.1.4",
"selenium-server-standalone-jar": "^3.141.59",
"selenium-webdriver": "^4.1.1",
"chromedriver": "^97.0.0"
}
}

View file

@ -11,15 +11,11 @@
require('chromedriver');
var execSync = require('child_process').execSync,
const execSync = require('child_process').execSync,
expect = require('expect.js'),
path = require('path'),
webdriver = require('selenium-webdriver');
var by = require('selenium-webdriver').By,
until = require('selenium-webdriver').until,
Key = require('selenium-webdriver').Key,
Builder = require('selenium-webdriver').Builder;
{ Builder, By, Key, until } = require('selenium-webdriver'),
{ Options } = require('selenium-webdriver/chrome');
if (!process.env.USERNAME || !process.env.PASSWORD || !process.env.EMAIL) {
console.log('USERNAME, PASSWORD and EMAIL env vars need to be set');
@ -29,110 +25,89 @@ if (!process.env.USERNAME || !process.env.PASSWORD || !process.env.EMAIL) {
describe('Application life cycle test', function () {
this.timeout(0);
var server, browser = new Builder().forBrowser('chrome').build();
var username = process.env.USERNAME, password = process.env.PASSWORD;
var email = process.env.EMAIL;
let browser, app;
const LOCATION = 'test';
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
before(function (done) {
var seleniumJar= require('selenium-server-standalone-jar');
var SeleniumServer = require('selenium-webdriver/remote').SeleniumServer;
server = new SeleniumServer(seleniumJar.path, { port: 4444 });
server.start();
done();
before(function () {
browser = new Builder().forBrowser('chrome').setChromeOptions(new Options().windowSize({ width: 1280, height: 1024 })).build();
});
after(function (done) {
after(function () {
browser.quit();
server.stop();
done();
});
function search(done) {
browser.get(`https://${app.fqdn}`).then(function () {
return browser.wait(until.elementLocated(by.id('q')), 5000);
}).then(function () {
return browser.findElement(by.id('q')).sendKeys('cloudron');
}).then(function () {
return browser.findElement(by.id('q')).sendKeys(Key.RETURN);
}).then(function () {
return browser.wait(until.elementLocated(by.xpath('//span[text()="Cloudron"]')), 5000);
}).then(function () {
return done();
});
async function search() {
await browser.get(`https://${app.fqdn}`);
await browser.wait(until.elementLocated(By.id('q')), 5000);
await browser.findElement(By.id('q')).sendKeys('cloudron');
await browser.findElement(By.id('q')).sendKeys(Key.RETURN);
await browser.wait(until.elementLocated(By.xpath('//span[text()="Cloudron"]')), 5000);
}
var LOCATION = 'test';
var TEST_TIMEOUT = parseInt(process.env.TIMEOUT, 10) || 30000;
var app;
function getAppInfo() {
const inspect = JSON.parse(execSync('cloudron inspect'));
app = inspect.apps.filter(function (a) { return a.location.startsWith(LOCATION); })[0];
expect(app).to.be.an('object');
}
xit('build app', function () {
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
execSync('cloudron build', EXEC_ARGS);
});
it('install app', function () {
execSync('cloudron install --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
execSync('cloudron install --location ' + LOCATION, EXEC_ARGS);
});
it('can get app information', function () {
var inspect = JSON.parse(execSync('cloudron inspect'));
app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0];
expect(app).to.be.an('object');
});
it('can get app information', getAppInfo);
it('can search', search);
it('backup app', function () {
execSync('cloudron backup create --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
execSync('cloudron backup create --app ' + app.id, EXEC_ARGS);
});
it('restore app', function () {
execSync('cloudron restore --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
const backups = JSON.parse(execSync('cloudron backup list --raw'));
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
execSync('cloudron install --location ' + LOCATION, EXEC_ARGS);
getAppInfo();
execSync(`cloudron restore --backup ${backups[0].id} --app ${app.id}`, EXEC_ARGS);
});
it('can search', search);
it('can restart app', function (done) {
it('can restart app', function () {
execSync('cloudron restart --app ' + app.id);
done();
});
it('can search', search);
it('move to different location', function (done) {
execSync('cloudron configure --location ' + LOCATION + '2 --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
var inspect = JSON.parse(execSync('cloudron inspect'));
app = inspect.apps.filter(function (a) { return a.location === LOCATION + '2'; })[0];
expect(app).to.be.an('object');
done();
it('move to different location', function () {
execSync('cloudron configure --location ' + LOCATION + '2 --app ' + app.id, EXEC_ARGS);
getAppInfo();
});
it('can search', search);
it('uninstall app', function () {
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
});
// test update
it('can install from appstore', function () {
execSync(`cloudron install --appstore-id ${app.manifest.id} --location ${LOCATION}`, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
var inspect = JSON.parse(execSync('cloudron inspect'));
app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0];
expect(app).to.be.an('object');
execSync(`cloudron install --appstore-id ${app.manifest.id} --location ${LOCATION}`, EXEC_ARGS);
getAppInfo();
});
it('can update', function () {
execSync('cloudron update --app ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
let inspect = JSON.parse(execSync('cloudron inspect'));
app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0];
execSync('cloudron update --app ' + LOCATION, EXEC_ARGS);
getAppInfo();
});
it('can search', search);
it('uninstall app', function () {
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
});
});