Compare commits
33 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 | ||
|
77e1ba83c5 | ||
|
79ea1fc16e | ||
|
c066df0cb9 | ||
|
f492615de7 | ||
|
a04afb5411 | ||
|
2397fd0d8b | ||
|
c32be4977e | ||
|
c3b2545c04 | ||
|
12bca09526 | ||
|
5ebdc58448 |
13 changed files with 3106 additions and 39 deletions
|
@ -2,4 +2,6 @@
|
|||
.gitignore
|
||||
.dockerignore
|
||||
node_modules
|
||||
screenshots
|
||||
test
|
||||
|
||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
scripts/node_modules
|
||||
test/node_modules/
|
||||
tmp/*
|
||||
|
|
32
CHANGELOG
32
CHANGELOG
|
@ -14,3 +14,35 @@
|
|||
[1.0.0]
|
||||
* Update Searx to 0.16.0
|
||||
|
||||
[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.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 python build-essential libxslt-dev python-dev python-virtualenv zlib1g-dev libffi-dev libssl-dev python-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 pip 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.
|
||||
|
|
BIN
logo.png
BIN
logo.png
Binary file not shown.
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 34 KiB |
185
logo.svg
Normal file
185
logo.svg
Normal file
|
@ -0,0 +1,185 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="512"
|
||||
height="512"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14"
|
||||
sodipodi:docname="logo.svg"
|
||||
inkscape:export-filename="/home/nebulon/projects/yellowtent/apps/searx-app/logo.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient3857">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3859" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop3861" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3790">
|
||||
<stop
|
||||
style="stop-color:#a9a9a9;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3792" />
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3794" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3790"
|
||||
id="radialGradient3798"
|
||||
cx="294.45947"
|
||||
cy="208.37973"
|
||||
fx="294.45947"
|
||||
fy="208.37973"
|
||||
r="107.58125"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3857"
|
||||
id="linearGradient3865"
|
||||
x1="120.68947"
|
||||
y1="239.61774"
|
||||
x2="120.68947"
|
||||
y2="602.17517"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3790"
|
||||
id="linearGradient3912"
|
||||
x1="186.74416"
|
||||
y1="354.42426"
|
||||
x2="255.84358"
|
||||
y2="254.35953"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.2227304,0,0,0.89945099,-289.31433,113.40259)" />
|
||||
<filter
|
||||
inkscape:collect="always"
|
||||
id="filter4024"
|
||||
x="-0.12996517"
|
||||
width="1.2599303"
|
||||
y="-0.14709377"
|
||||
height="1.2941875">
|
||||
<feGaussianBlur
|
||||
inkscape:collect="always"
|
||||
stdDeviation="6.4759344"
|
||||
id="feGaussianBlur4026" />
|
||||
</filter>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.9899495"
|
||||
inkscape:cx="100.20871"
|
||||
inkscape:cy="517.35376"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="2880"
|
||||
inkscape:window-height="1564"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="56"
|
||||
inkscape:window-maximized="1"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-540.36218)">
|
||||
<g
|
||||
id="g4544"
|
||||
transform="matrix(1.4692274,0,0,1.4692274,-77.435488,517.1562)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3814-0-7"
|
||||
d="m 70.523181,34.870671 c -7.11959,15.242893 -10.17798,31.779192 -8.22563,48.814566 5.01677,43.774133 41.675309,79.324503 91.536109,95.162893 -6.62576,-22.40752 -5.34093,-44.9362 2.6395,-65.84431 C 108.73618,98.821131 74.828141,70.195435 70.523181,34.870671 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3814-0"
|
||||
d="m 303.77876,36.21406 c 7.11959,15.242893 10.17798,31.779192 8.22563,48.814566 -5.01677,43.774134 -41.67531,79.324504 -91.53611,95.162894 6.62576,-22.40752 5.34093,-44.9362 -2.6395,-65.84431 47.73698,-14.18269 81.64502,-42.808386 85.94998,-78.13315 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="rect3804"
|
||||
d="M -5.0905523,259.06055 H 13.326205 c 6.220455,0 11.228257,16.68196 11.228257,37.40349 v 172.83701 c 0,20.72153 -5.007802,37.40349 -11.228257,37.40349 H -5.0905523 c -6.2204547,0 -11.2282577,-16.68196 -11.2282577,-37.40349 V 296.46404 c 0,-20.72153 5.007803,-37.40349 11.2282577,-37.40349 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
transform="rotate(-49.03034)" />
|
||||
<circle
|
||||
r="107.58125"
|
||||
cy="208.37973"
|
||||
cx="294.45947"
|
||||
transform="translate(-107.07617,-60.609153)"
|
||||
id="path2987"
|
||||
style="fill:url(#radialGradient3798);fill-opacity:1;fill-rule:nonzero;stroke:none" />
|
||||
<circle
|
||||
r="101.52033"
|
||||
cy="299.29346"
|
||||
cx="131.82491"
|
||||
transform="matrix(0.76865672,0,0,0.76865672,85.80266,-82.535889)"
|
||||
id="path3757"
|
||||
style="fill:url(#linearGradient3865);fill-opacity:1;fill-rule:nonzero;stroke:none" />
|
||||
<circle
|
||||
r="27.274118"
|
||||
cy="156.35687"
|
||||
cx="183.34268"
|
||||
transform="translate(5,-7.1428572)"
|
||||
id="path3800"
|
||||
style="fill:#1a1a1a;fill-opacity:1;fill-rule:nonzero;stroke:none" />
|
||||
<circle
|
||||
r="5.5558391"
|
||||
cy="203.32896"
|
||||
cx="197.9899"
|
||||
transform="translate(1.4847712,-63.564549)"
|
||||
id="path3802"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none" />
|
||||
<rect
|
||||
transform="matrix(0.74466525,-0.84318084,0.84318084,0.74466525,-35.543204,-26.349917)"
|
||||
ry="9.0007057"
|
||||
rx="2.8666623"
|
||||
y="337.8396"
|
||||
x="19.525793"
|
||||
height="159.43797"
|
||||
width="2.2392972"
|
||||
id="rect3916"
|
||||
style="fill:#ffffff;fill-opacity:0.82211531;fill-rule:nonzero;stroke:none;filter:url(#filter4024)" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 6.3 KiB |
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 python /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"
|
||||
|
|
2680
test/package-lock.json
generated
Normal file
2680
test/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
18
test/package.json
Normal file
18
test/package.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "test",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "test.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"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"
|
||||
}
|
||||
}
|
113
test/test.js
Normal file
113
test/test.js
Normal file
|
@ -0,0 +1,113 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
/* jslint node:true */
|
||||
/* global it:false */
|
||||
/* global xit:false */
|
||||
/* global describe:false */
|
||||
/* global before:false */
|
||||
/* global after:false */
|
||||
|
||||
'use strict';
|
||||
|
||||
require('chromedriver');
|
||||
|
||||
const execSync = require('child_process').execSync,
|
||||
expect = require('expect.js'),
|
||||
path = require('path'),
|
||||
{ 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');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
describe('Application life cycle test', function () {
|
||||
this.timeout(0);
|
||||
|
||||
let browser, app;
|
||||
const LOCATION = 'test';
|
||||
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
|
||||
|
||||
before(function () {
|
||||
browser = new Builder().forBrowser('chrome').setChromeOptions(new Options().windowSize({ width: 1280, height: 1024 })).build();
|
||||
});
|
||||
|
||||
after(function () {
|
||||
browser.quit();
|
||||
});
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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', EXEC_ARGS);
|
||||
});
|
||||
|
||||
it('install app', function () {
|
||||
execSync('cloudron install --location ' + LOCATION, EXEC_ARGS);
|
||||
});
|
||||
|
||||
it('can get app information', getAppInfo);
|
||||
|
||||
it('can search', search);
|
||||
|
||||
it('backup app', function () {
|
||||
execSync('cloudron backup create --app ' + app.id, EXEC_ARGS);
|
||||
});
|
||||
|
||||
it('restore app', function () {
|
||||
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 () {
|
||||
execSync('cloudron restart --app ' + app.id);
|
||||
});
|
||||
|
||||
it('can search', search);
|
||||
|
||||
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, EXEC_ARGS);
|
||||
});
|
||||
|
||||
// test update
|
||||
it('can install from appstore', function () {
|
||||
execSync(`cloudron install --appstore-id ${app.manifest.id} --location ${LOCATION}`, EXEC_ARGS);
|
||||
getAppInfo();
|
||||
});
|
||||
|
||||
it('can update', function () {
|
||||
execSync('cloudron update --app ' + LOCATION, EXEC_ARGS);
|
||||
getAppInfo();
|
||||
});
|
||||
|
||||
it('can search', search);
|
||||
|
||||
it('uninstall app', function () {
|
||||
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue