Loading .env +1 −4 Original line number Original line Diff line number Diff line SPOT_HOSTNAME=spot.ecloud.global SPOT_HOSTNAME=spot.ecloud.global SPOT_DOCKER_TAG=latest SPOT_DOCKER_TAG=latest SEARX_MORTY_URL=https://localhost:8089 SEARX_SECRET=":@)%NN0+OqNdy:{prWQlZ{p9|oO9p-UyJq@%V!~G:arrSx6fXz.{jd%=XF44ncj" SEARX_SECRET=":@)%NN0+OqNdy:{prWQlZ{p9|oO9p-UyJq@%V!~G:arrSx6fXz.{jd%=XF44ncj" SEARX_REDIS_HOST=redis SEARX_REDIS_HOST=redis SEARX_UI_DEFAULT_THEME=etheme SEARX_UI_DEFAULT_THEME=etheme SEARX_PROXY_HTTP=socks5h://tor-socks-proxy:9150 NGINX_PORT=8088 SEARX_PROXY_HTTPS=socks5h://tor-socks-proxy:9150 FILTRON_PORT=8088 NODE_NAME=local NODE_NAME=local CI_REGISTRY_IMAGE=registry.gitlab.e.foundation/e/infra/spot CI_REGISTRY_IMAGE=registry.gitlab.e.foundation/e/infra/spot .env.prod +2 −2 Original line number Original line Diff line number Diff line Loading @@ -6,7 +6,7 @@ SEARX_UI_DEFAULT_THEME=etheme SEARX_PROXY_HTTP=http://proxy01.ecloud.global:1099 SEARX_PROXY_HTTP=http://proxy01.ecloud.global:1099 SEARX_PROXY_HTTPS=http://proxy01.ecloud.global:1099 SEARX_PROXY_HTTPS=http://proxy01.ecloud.global:1099 WIREGUARD_IP=127.0.0.1 WIREGUARD_IP=127.0.0.1 FILTRON_PORT=8088 NGINX_PORT=8088 INTERNAL_NETWORK_NAME=default INTERNAL_NETWORK_NAME=default NODE_NAME=spot11 NODE_NAME=spot11 CI_REGISTRY_IMAGE=image CI_REGISTRY_IMAGE=image Loading .gitlab-ci.yml +6 −6 Original line number Original line Diff line number Diff line Loading @@ -65,11 +65,11 @@ test:unit: - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY script: script: - echo "Deploying to ($SSH_USER@$BACKEND_HOST)" - echo "Deploying to ($SSH_USER@$BACKEND_HOST)" - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH && git stash && git pull && git checkout $BRANCH && rm .env .env.prod && rm docker-compose.yml && mv docker-compose.prod.yml docker-compose.yml" - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH && git stash && git fetch && git checkout $BRANCH && git reset --hard origin/$BRANCH && rm .env .env.prod && rm docker-compose.yml && mv docker-compose.prod.yml docker-compose.yml" - scp $ENV_FILE $SSH_USER@$BACKEND_HOST:$DEPLOYMENT_PATH/.env - scp $ENV_FILE $SSH_USER@$BACKEND_HOST:$DEPLOYMENT_PATH/.env - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH && sed -i 's/SPOT_DOCKER_TAG=master/SPOT_DOCKER_TAG=$SPOT_DOCKER_TAG/g' .env && sed -i 's/SPOT_DOCKER_TAG=master/SPOT_DOCKER_TAG=$SPOT_DOCKER_TAG/g' .env && docker-compose pull && docker-compose stop filtron && sleep 2 && docker-compose up -d && docker-compose restart spot-nginx" && docker-compose pull && sleep 2 && docker-compose up -d && docker-compose restart spot-nginx" deploy:spot.murenatest.io.backend1: deploy:spot.murenatest.io.backend1: extends: .deploy:template extends: .deploy:template Loading README.md +4 −6 Original line number Original line Diff line number Diff line Loading @@ -14,9 +14,8 @@ Spot was forked from searx: read [documentation](https://asciimoo.github.io/sear ## Architecture ## Architecture 6 services are used for production: 3 services are used for production: * [filtron](https://github.com/asciimoo/filtron) as reverse HTTP proxy to filter requests by different rules. * [nginx](https://www.nginx.com/) as http server to serve static files. * [nginx](https://www.nginx.com/) as http server to serve static files. * Spot the meta search engine. * Spot the meta search engine. * [redis](https://redis.io/) as memory storage to cache http requests * [redis](https://redis.io/) as memory storage to cache http requests Loading @@ -24,8 +23,7 @@ Spot was forked from searx: read [documentation](https://asciimoo.github.io/sear ```mermaid ```mermaid graph TD graph TD A(reverse proxy) --> |http://localhost:8088| B(filtron) A(reverse proxy) --> |http://localhost:8088| C(nginx) B --> C(nginx) C --> |static file| C C --> |static file| C C --> |API| D(spot) C --> |API| D(spot) D --> E(proxy service) D --> E(proxy service) Loading Loading @@ -56,10 +54,10 @@ below to run spot for production or local environment. Run the docker-compose to start the project Run the docker-compose to start the project ``` ``` docker-compose up -d docker-compose up -d --build ``` ``` Then go to http://localhost:8088. Then go to http://localhost:8100. ### For developer ### For developer Loading docker-compose.prod.yml +3 −12 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,7 @@ services: SEARX_PROXY_HTTP: "${SEARX_PROXY_HTTP}" SEARX_PROXY_HTTP: "${SEARX_PROXY_HTTP}" SEARX_PROXY_HTTPS: "${SEARX_PROXY_HTTPS}" SEARX_PROXY_HTTPS: "${SEARX_PROXY_HTTPS}" SEARX_REDIS_HOST: "${SEARX_REDIS_HOST}" SEARX_REDIS_HOST: "${SEARX_REDIS_HOST}" SEARXNG_REDIS_URL: "redis://${SEARX_REDIS_HOST}:6379" SEARX_UI_DEFAULT_THEME: "${SEARX_UI_DEFAULT_THEME}" SEARX_UI_DEFAULT_THEME: "${SEARX_UI_DEFAULT_THEME}" GUNICORN_LOGGER: 1 GUNICORN_LOGGER: 1 GUNICORN_LEVEL: INFO GUNICORN_LEVEL: INFO Loading @@ -43,6 +44,8 @@ services: tag: docker-${ENVIRONMENT_NAME}-spot-nginx tag: docker-${ENVIRONMENT_NAME}-spot-nginx networks: networks: - ${INTERNAL_NETWORK_NAME} - ${INTERNAL_NETWORK_NAME} ports: - ${WIREGUARD_IP}:${NGINX_PORT}:80 volumes: volumes: - ./etc/nginx/conf.d/spot.conf:/etc/nginx/conf.d/default.conf - ./etc/nginx/conf.d/spot.conf:/etc/nginx/conf.d/default.conf - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf Loading @@ -51,18 +54,6 @@ services: labels: labels: - "com.centurylinklabs.watchtower.scope=staging-spot" - "com.centurylinklabs.watchtower.scope=staging-spot" filtron: image: dalf/filtron:latest restart: always command: -listen :3000 -rules /etc/filtron/rules.json -target spot-nginx networks: - ${INTERNAL_NETWORK_NAME} - spot-wireguarded ports: - ${WIREGUARD_IP}:${FILTRON_PORT}:3000 volumes: - ./etc/filtron/rules.json:/etc/filtron/rules.json watchtower: watchtower: image: containrrr/watchtower image: containrrr/watchtower volumes: volumes: Loading Loading
.env +1 −4 Original line number Original line Diff line number Diff line SPOT_HOSTNAME=spot.ecloud.global SPOT_HOSTNAME=spot.ecloud.global SPOT_DOCKER_TAG=latest SPOT_DOCKER_TAG=latest SEARX_MORTY_URL=https://localhost:8089 SEARX_SECRET=":@)%NN0+OqNdy:{prWQlZ{p9|oO9p-UyJq@%V!~G:arrSx6fXz.{jd%=XF44ncj" SEARX_SECRET=":@)%NN0+OqNdy:{prWQlZ{p9|oO9p-UyJq@%V!~G:arrSx6fXz.{jd%=XF44ncj" SEARX_REDIS_HOST=redis SEARX_REDIS_HOST=redis SEARX_UI_DEFAULT_THEME=etheme SEARX_UI_DEFAULT_THEME=etheme SEARX_PROXY_HTTP=socks5h://tor-socks-proxy:9150 NGINX_PORT=8088 SEARX_PROXY_HTTPS=socks5h://tor-socks-proxy:9150 FILTRON_PORT=8088 NODE_NAME=local NODE_NAME=local CI_REGISTRY_IMAGE=registry.gitlab.e.foundation/e/infra/spot CI_REGISTRY_IMAGE=registry.gitlab.e.foundation/e/infra/spot
.env.prod +2 −2 Original line number Original line Diff line number Diff line Loading @@ -6,7 +6,7 @@ SEARX_UI_DEFAULT_THEME=etheme SEARX_PROXY_HTTP=http://proxy01.ecloud.global:1099 SEARX_PROXY_HTTP=http://proxy01.ecloud.global:1099 SEARX_PROXY_HTTPS=http://proxy01.ecloud.global:1099 SEARX_PROXY_HTTPS=http://proxy01.ecloud.global:1099 WIREGUARD_IP=127.0.0.1 WIREGUARD_IP=127.0.0.1 FILTRON_PORT=8088 NGINX_PORT=8088 INTERNAL_NETWORK_NAME=default INTERNAL_NETWORK_NAME=default NODE_NAME=spot11 NODE_NAME=spot11 CI_REGISTRY_IMAGE=image CI_REGISTRY_IMAGE=image Loading
.gitlab-ci.yml +6 −6 Original line number Original line Diff line number Diff line Loading @@ -65,11 +65,11 @@ test:unit: - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY script: script: - echo "Deploying to ($SSH_USER@$BACKEND_HOST)" - echo "Deploying to ($SSH_USER@$BACKEND_HOST)" - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH && git stash && git pull && git checkout $BRANCH && rm .env .env.prod && rm docker-compose.yml && mv docker-compose.prod.yml docker-compose.yml" - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH && git stash && git fetch && git checkout $BRANCH && git reset --hard origin/$BRANCH && rm .env .env.prod && rm docker-compose.yml && mv docker-compose.prod.yml docker-compose.yml" - scp $ENV_FILE $SSH_USER@$BACKEND_HOST:$DEPLOYMENT_PATH/.env - scp $ENV_FILE $SSH_USER@$BACKEND_HOST:$DEPLOYMENT_PATH/.env - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH && sed -i 's/SPOT_DOCKER_TAG=master/SPOT_DOCKER_TAG=$SPOT_DOCKER_TAG/g' .env && sed -i 's/SPOT_DOCKER_TAG=master/SPOT_DOCKER_TAG=$SPOT_DOCKER_TAG/g' .env && docker-compose pull && docker-compose stop filtron && sleep 2 && docker-compose up -d && docker-compose restart spot-nginx" && docker-compose pull && sleep 2 && docker-compose up -d && docker-compose restart spot-nginx" deploy:spot.murenatest.io.backend1: deploy:spot.murenatest.io.backend1: extends: .deploy:template extends: .deploy:template Loading
README.md +4 −6 Original line number Original line Diff line number Diff line Loading @@ -14,9 +14,8 @@ Spot was forked from searx: read [documentation](https://asciimoo.github.io/sear ## Architecture ## Architecture 6 services are used for production: 3 services are used for production: * [filtron](https://github.com/asciimoo/filtron) as reverse HTTP proxy to filter requests by different rules. * [nginx](https://www.nginx.com/) as http server to serve static files. * [nginx](https://www.nginx.com/) as http server to serve static files. * Spot the meta search engine. * Spot the meta search engine. * [redis](https://redis.io/) as memory storage to cache http requests * [redis](https://redis.io/) as memory storage to cache http requests Loading @@ -24,8 +23,7 @@ Spot was forked from searx: read [documentation](https://asciimoo.github.io/sear ```mermaid ```mermaid graph TD graph TD A(reverse proxy) --> |http://localhost:8088| B(filtron) A(reverse proxy) --> |http://localhost:8088| C(nginx) B --> C(nginx) C --> |static file| C C --> |static file| C C --> |API| D(spot) C --> |API| D(spot) D --> E(proxy service) D --> E(proxy service) Loading Loading @@ -56,10 +54,10 @@ below to run spot for production or local environment. Run the docker-compose to start the project Run the docker-compose to start the project ``` ``` docker-compose up -d docker-compose up -d --build ``` ``` Then go to http://localhost:8088. Then go to http://localhost:8100. ### For developer ### For developer Loading
docker-compose.prod.yml +3 −12 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,7 @@ services: SEARX_PROXY_HTTP: "${SEARX_PROXY_HTTP}" SEARX_PROXY_HTTP: "${SEARX_PROXY_HTTP}" SEARX_PROXY_HTTPS: "${SEARX_PROXY_HTTPS}" SEARX_PROXY_HTTPS: "${SEARX_PROXY_HTTPS}" SEARX_REDIS_HOST: "${SEARX_REDIS_HOST}" SEARX_REDIS_HOST: "${SEARX_REDIS_HOST}" SEARXNG_REDIS_URL: "redis://${SEARX_REDIS_HOST}:6379" SEARX_UI_DEFAULT_THEME: "${SEARX_UI_DEFAULT_THEME}" SEARX_UI_DEFAULT_THEME: "${SEARX_UI_DEFAULT_THEME}" GUNICORN_LOGGER: 1 GUNICORN_LOGGER: 1 GUNICORN_LEVEL: INFO GUNICORN_LEVEL: INFO Loading @@ -43,6 +44,8 @@ services: tag: docker-${ENVIRONMENT_NAME}-spot-nginx tag: docker-${ENVIRONMENT_NAME}-spot-nginx networks: networks: - ${INTERNAL_NETWORK_NAME} - ${INTERNAL_NETWORK_NAME} ports: - ${WIREGUARD_IP}:${NGINX_PORT}:80 volumes: volumes: - ./etc/nginx/conf.d/spot.conf:/etc/nginx/conf.d/default.conf - ./etc/nginx/conf.d/spot.conf:/etc/nginx/conf.d/default.conf - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf Loading @@ -51,18 +54,6 @@ services: labels: labels: - "com.centurylinklabs.watchtower.scope=staging-spot" - "com.centurylinklabs.watchtower.scope=staging-spot" filtron: image: dalf/filtron:latest restart: always command: -listen :3000 -rules /etc/filtron/rules.json -target spot-nginx networks: - ${INTERNAL_NETWORK_NAME} - spot-wireguarded ports: - ${WIREGUARD_IP}:${FILTRON_PORT}:3000 volumes: - ./etc/filtron/rules.json:/etc/filtron/rules.json watchtower: watchtower: image: containrrr/watchtower image: containrrr/watchtower volumes: volumes: Loading