Compare commits
23 commits
Author | SHA1 | Date | |
---|---|---|---|
2edb8d8e15 | |||
15d4435d80 | |||
9a822af310 | |||
7c7a55c078 | |||
|
b7b5a688a7 | ||
|
73e3ad3341 | ||
|
be87dfccc4 | ||
|
98dd94bd4a | ||
|
10b6dc9962 | ||
|
4c80338eba | ||
|
48776dd2eb | ||
|
0d1b521cd5 | ||
|
d44dcd27f8 | ||
|
838444dc93 | ||
|
bd6a356b13 | ||
|
3348258e40 | ||
|
e0bf22252d | ||
|
35858fb399 | ||
|
969b349508 | ||
|
61c976d7e1 | ||
|
c695e01e46 | ||
|
5e589b172d | ||
|
5d58feb11e |
11 changed files with 2207 additions and 1076 deletions
|
@ -2,4 +2,6 @@
|
|||
.gitignore
|
||||
.dockerignore
|
||||
node_modules
|
||||
screenshots
|
||||
test
|
||||
|
||||
|
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,2 +1,2 @@
|
|||
node_modules/
|
||||
|
||||
test/node_modules/
|
||||
tmp/*
|
||||
|
|
29
CHANGELOG
29
CHANGELOG
|
@ -17,3 +17,32 @@
|
|||
[1.1.0]
|
||||
* Use python3 as python2 support is deprecated
|
||||
|
||||
[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
|
||||
|
||||
|
|
|
@ -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.1.0-1",
|
||||
"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"
|
||||
}
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
This app packages searx version <upstream>1.0.0</upstream>.
|
||||
|
||||
### 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.
|
||||
|
||||
This app packages searx version <upstream>0.16.0</upstream>.
|
||||
|
||||
## 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
|
||||
|
@ -10,19 +12,19 @@ This app packages searx version <upstream>0.16.0</upstream>.
|
|||
|
||||
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 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!
|
||||
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/)
|
||||
|
|
36
Dockerfile
36
Dockerfile
|
@ -1,23 +1,41 @@
|
|||
FROM cloudron/base:1.0.0@sha256:147a648a068a2e746644746bbfb42eb7a50d682437cead3c67c933c546357617
|
||||
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
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
22
start.sh
22
start.sh
|
@ -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' \
|
||||
-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"
|
||||
|
|
3017
test/package-lock.json
generated
3017
test/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -8,17 +8,11 @@
|
|||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"ejs": "^3.0.1",
|
||||
"expect.js": "^0.3.1",
|
||||
"mkdirp": "^1.0.3",
|
||||
"mocha": "^7.1.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"selenium-server-standalone-jar": "^3.141.59",
|
||||
"selenium-webdriver": "^3.6.0",
|
||||
"superagent": "^5.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"chromedriver": "^80.0.1"
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
|
103
test/test.js
103
test/test.js
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue