Loading .env +1 −4 Original line number Diff line number Diff line SPOT_HOSTNAME=spot.ecloud.global SPOT_DOCKER_TAG=latest SEARX_MORTY_URL=https://localhost:8089 SEARX_SECRET=":@)%NN0+OqNdy:{prWQlZ{p9|oO9p-UyJq@%V!~G:arrSx6fXz.{jd%=XF44ncj" SEARX_REDIS_HOST=redis SEARX_UI_DEFAULT_THEME=etheme SEARX_PROXY_HTTP=socks5h://tor-socks-proxy:9150 SEARX_PROXY_HTTPS=socks5h://tor-socks-proxy:9150 FILTRON_PORT=8088 NGINX_PORT=8088 NODE_NAME=local CI_REGISTRY_IMAGE=registry.gitlab.e.foundation/e/infra/spot .env.prod +2 −2 Original line number 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_HTTPS=http://proxy01.ecloud.global:1099 WIREGUARD_IP=127.0.0.1 FILTRON_PORT=8088 NGINX_PORT=8088 INTERNAL_NETWORK_NAME=default NODE_NAME=spot11 CI_REGISTRY_IMAGE=image Loading .gitlab-ci.yml +13 −12 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ build:web: tags: - generic_privileged before_script: - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY script: - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG . - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG Loading Loading @@ -62,14 +62,15 @@ test:unit: - echo "$SSH_KNOWN_HOSTS" > $HOME/.ssh/known_hosts - chmod 600 ~/.ssh/id_ed25519 - chmod 644 ~/.ssh/known_hosts ~/.ssh/id_ed25519.pub - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY script: - 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 fetch --tags -f && git checkout $SPOT_COMMIT && git reset --hard && mv docker-compose.prod.yml docker-compose.yml" - scp $ENV_FILE $SSH_USER@$BACKEND_HOST:$DEPLOYMENT_PATH/.env - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH && 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" && sed -i "s/GATEWAY_WG_IP/$GATEWAY_WG_IP/g" etc/nginx/nginx.conf && docker-compose pull && sleep 2 && docker-compose up -d --remove-orphans && docker-compose restart spot-nginx" deploy:spot.murenatest.io.backend1: extends: .deploy:template Loading @@ -84,7 +85,7 @@ deploy:spot.murenatest.io.backend1: variables: DOCKER_HOST: ssh://${SSH_USER}@${BACKEND_HOST} SPOT_DOCKER_TAG: ${CI_COMMIT_REF_SLUG} BRANCH: ${CI_COMMIT_REF_NAME} SPOT_COMMIT: ${CI_COMMIT_SHA} deploy:spot.murenatest.io.backend2: extends: .deploy:template Loading @@ -99,7 +100,7 @@ deploy:spot.murenatest.io.backend2: variables: DOCKER_HOST: ssh://${SSH_USER}@${BACKEND_HOST} SPOT_DOCKER_TAG: ${CI_COMMIT_REF_SLUG} BRANCH: ${CI_COMMIT_REF_NAME} SPOT_COMMIT: ${CI_COMMIT_SHA} deploy:spot.murena.io.backend1: extends: .deploy:template Loading @@ -113,7 +114,7 @@ deploy:spot.murena.io.backend1: variables: DOCKER_HOST: ssh://${SSH_USER}@${BACKEND_HOST} SPOT_DOCKER_TAG: ${CI_COMMIT_REF_SLUG} BRANCH: master SPOT_COMMIT: ${CI_COMMIT_TAG} deploy:spot.murena.io.backend2: extends: .deploy:template Loading @@ -127,4 +128,4 @@ deploy:spot.murena.io.backend2: variables: DOCKER_HOST: ssh://${SSH_USER}@${BACKEND_HOST} SPOT_DOCKER_TAG: ${CI_COMMIT_REF_SLUG} BRANCH: master SPOT_COMMIT: ${CI_COMMIT_TAG} README.md +4 −6 Original line number Diff line number Diff line Loading @@ -14,9 +14,8 @@ Spot was forked from searx: read [documentation](https://asciimoo.github.io/sear ## 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. * Spot the meta search engine. * [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 graph TD A(reverse proxy) --> |http://localhost:8088| B(filtron) B --> C(nginx) A(reverse proxy) --> |http://localhost:8088| C(nginx) C --> |static file| C C --> |API| D(spot) 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 ``` docker-compose up -d docker-compose up -d --build ``` Then go to http://localhost:8088. Then go to http://localhost:8100. ### For developer Loading docker-compose.prod.yml +4 −12 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ services: SEARX_PROXY_HTTP: "${SEARX_PROXY_HTTP}" SEARX_PROXY_HTTPS: "${SEARX_PROXY_HTTPS}" SEARX_REDIS_HOST: "${SEARX_REDIS_HOST}" SEARXNG_REDIS_URL: "redis://${SEARX_REDIS_HOST}:6379" SEARX_UI_DEFAULT_THEME: "${SEARX_UI_DEFAULT_THEME}" GUNICORN_LOGGER: 1 GUNICORN_LEVEL: INFO Loading @@ -43,26 +44,17 @@ services: tag: docker-${ENVIRONMENT_NAME}-spot-nginx networks: - ${INTERNAL_NETWORK_NAME} ports: - ${WIREGUARD_IP}:${NGINX_PORT}:80 volumes: - ./etc/nginx/conf.d/spot.conf:/etc/nginx/conf.d/default.conf - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf - ./etc/nginx/proxy_spot_params:/etc/nginx/proxy_spot_params - ./searx/static:/var/www/spot/static - ${LOG_DIRECTORY}:/var/log/nginx/ labels: - "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: image: containrrr/watchtower volumes: Loading Loading
.env +1 −4 Original line number Diff line number Diff line SPOT_HOSTNAME=spot.ecloud.global SPOT_DOCKER_TAG=latest SEARX_MORTY_URL=https://localhost:8089 SEARX_SECRET=":@)%NN0+OqNdy:{prWQlZ{p9|oO9p-UyJq@%V!~G:arrSx6fXz.{jd%=XF44ncj" SEARX_REDIS_HOST=redis SEARX_UI_DEFAULT_THEME=etheme SEARX_PROXY_HTTP=socks5h://tor-socks-proxy:9150 SEARX_PROXY_HTTPS=socks5h://tor-socks-proxy:9150 FILTRON_PORT=8088 NGINX_PORT=8088 NODE_NAME=local CI_REGISTRY_IMAGE=registry.gitlab.e.foundation/e/infra/spot
.env.prod +2 −2 Original line number 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_HTTPS=http://proxy01.ecloud.global:1099 WIREGUARD_IP=127.0.0.1 FILTRON_PORT=8088 NGINX_PORT=8088 INTERNAL_NETWORK_NAME=default NODE_NAME=spot11 CI_REGISTRY_IMAGE=image Loading
.gitlab-ci.yml +13 −12 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ build:web: tags: - generic_privileged before_script: - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY script: - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG . - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG Loading Loading @@ -62,14 +62,15 @@ test:unit: - echo "$SSH_KNOWN_HOSTS" > $HOME/.ssh/known_hosts - chmod 600 ~/.ssh/id_ed25519 - chmod 644 ~/.ssh/known_hosts ~/.ssh/id_ed25519.pub - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY script: - 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 fetch --tags -f && git checkout $SPOT_COMMIT && git reset --hard && mv docker-compose.prod.yml docker-compose.yml" - scp $ENV_FILE $SSH_USER@$BACKEND_HOST:$DEPLOYMENT_PATH/.env - ssh $SSH_USER@$BACKEND_HOST "cd $DEPLOYMENT_PATH && 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" && sed -i "s/GATEWAY_WG_IP/$GATEWAY_WG_IP/g" etc/nginx/nginx.conf && docker-compose pull && sleep 2 && docker-compose up -d --remove-orphans && docker-compose restart spot-nginx" deploy:spot.murenatest.io.backend1: extends: .deploy:template Loading @@ -84,7 +85,7 @@ deploy:spot.murenatest.io.backend1: variables: DOCKER_HOST: ssh://${SSH_USER}@${BACKEND_HOST} SPOT_DOCKER_TAG: ${CI_COMMIT_REF_SLUG} BRANCH: ${CI_COMMIT_REF_NAME} SPOT_COMMIT: ${CI_COMMIT_SHA} deploy:spot.murenatest.io.backend2: extends: .deploy:template Loading @@ -99,7 +100,7 @@ deploy:spot.murenatest.io.backend2: variables: DOCKER_HOST: ssh://${SSH_USER}@${BACKEND_HOST} SPOT_DOCKER_TAG: ${CI_COMMIT_REF_SLUG} BRANCH: ${CI_COMMIT_REF_NAME} SPOT_COMMIT: ${CI_COMMIT_SHA} deploy:spot.murena.io.backend1: extends: .deploy:template Loading @@ -113,7 +114,7 @@ deploy:spot.murena.io.backend1: variables: DOCKER_HOST: ssh://${SSH_USER}@${BACKEND_HOST} SPOT_DOCKER_TAG: ${CI_COMMIT_REF_SLUG} BRANCH: master SPOT_COMMIT: ${CI_COMMIT_TAG} deploy:spot.murena.io.backend2: extends: .deploy:template Loading @@ -127,4 +128,4 @@ deploy:spot.murena.io.backend2: variables: DOCKER_HOST: ssh://${SSH_USER}@${BACKEND_HOST} SPOT_DOCKER_TAG: ${CI_COMMIT_REF_SLUG} BRANCH: master SPOT_COMMIT: ${CI_COMMIT_TAG}
README.md +4 −6 Original line number Diff line number Diff line Loading @@ -14,9 +14,8 @@ Spot was forked from searx: read [documentation](https://asciimoo.github.io/sear ## 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. * Spot the meta search engine. * [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 graph TD A(reverse proxy) --> |http://localhost:8088| B(filtron) B --> C(nginx) A(reverse proxy) --> |http://localhost:8088| C(nginx) C --> |static file| C C --> |API| D(spot) 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 ``` docker-compose up -d docker-compose up -d --build ``` Then go to http://localhost:8088. Then go to http://localhost:8100. ### For developer Loading
docker-compose.prod.yml +4 −12 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ services: SEARX_PROXY_HTTP: "${SEARX_PROXY_HTTP}" SEARX_PROXY_HTTPS: "${SEARX_PROXY_HTTPS}" SEARX_REDIS_HOST: "${SEARX_REDIS_HOST}" SEARXNG_REDIS_URL: "redis://${SEARX_REDIS_HOST}:6379" SEARX_UI_DEFAULT_THEME: "${SEARX_UI_DEFAULT_THEME}" GUNICORN_LOGGER: 1 GUNICORN_LEVEL: INFO Loading @@ -43,26 +44,17 @@ services: tag: docker-${ENVIRONMENT_NAME}-spot-nginx networks: - ${INTERNAL_NETWORK_NAME} ports: - ${WIREGUARD_IP}:${NGINX_PORT}:80 volumes: - ./etc/nginx/conf.d/spot.conf:/etc/nginx/conf.d/default.conf - ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf - ./etc/nginx/proxy_spot_params:/etc/nginx/proxy_spot_params - ./searx/static:/var/www/spot/static - ${LOG_DIRECTORY}:/var/log/nginx/ labels: - "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: image: containrrr/watchtower volumes: Loading