diff --git a/.github/workflows/github-actions-docker-master.yml b/.github/workflows/github-actions-docker-master.yml index 57b6f78..3ef5390 100644 --- a/.github/workflows/github-actions-docker-master.yml +++ b/.github/workflows/github-actions-docker-master.yml @@ -30,7 +30,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 push: true tags: | ghcr.io/opengs/uashield:latest \ No newline at end of file diff --git a/.github/workflows/github-actions-docker-tags.yml b/.github/workflows/github-actions-docker-tags.yml index 22c8f73..a8dab67 100644 --- a/.github/workflows/github-actions-docker-tags.yml +++ b/.github/workflows/github-actions-docker-tags.yml @@ -38,8 +38,8 @@ jobs: uses: docker/build-push-action@v2 with: context: . - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 push: true tags: | ghcr.io/opengs/uashield:${{ steps.extract_tag.outputs.tag }} - ghcr.io/opengs/uashield:${{ steps.extract_tag.outputs.tagv }} + ghcr.io/opengs/uashield:${{ steps.extract_tag_v.outputs.tagv }} diff --git a/.github/workflows/github-actions-docker.yml b/.github/workflows/github-actions-docker.yml index aedcab2..5094b5d 100644 --- a/.github/workflows/github-actions-docker.yml +++ b/.github/workflows/github-actions-docker.yml @@ -34,7 +34,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 push: true tags: | ghcr.io/opengs/uashield:${{ steps.extract_branch.outputs.branch }} diff --git a/.yarnrc b/.yarnrc new file mode 100644 index 0000000..9bc2065 --- /dev/null +++ b/.yarnrc @@ -0,0 +1 @@ +network-timeout 600000 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 399a3e7..7a20495 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM node:16.9.0-alpine AS builder WORKDIR /code COPY yarn.lock ./yarn.lock +COPY .yarnrc ./.yarnrc COPY packageheadless.json ./package.json # no need to --frozen-lockfile # from docs - If yarn.lock is present and is enough to satisfy all the dependencies listed in package.json, diff --git a/README-en.md b/README-en.md index 3ec568d..2b6bb1b 100644 --- a/README-en.md +++ b/README-en.md @@ -1,12 +1,12 @@ # UA Cyber SHIELD -*ALERT!!! We not supporting unlawful active attack or malware campaings that are causing technical harms. Use only for educational purposes. You can only try this prlatform on your own website!* +*ALERT!!! We not supporting unlawful active attacks or malware campaigns that are causing technical harm. Use only for educational purposes. You can only try this platform on your own website!* *Дивись цю сторінку [українською](README.md)* [![Release](https://img.shields.io/badge/Release-latest-blue)](https://github.com/opengs/uashield/releases/latest) -**The voluntary Ukrainian cyber defense system** +**The volunteer cyber defense system of Ukraine** - Community: [Discord](https://discord.gg/7BfJ9JKQ98) [Telegram](https://t.me/uashield) - Video Instruction [in Ukrainian](https://youtu.be/snTzpRt7a5k) @@ -21,7 +21,7 @@ ## How it works -Our voluntary defense center works are doing all the hard work: monitoring the targets, running the technical infrastructure, coordinating the attack targets, coordinating with the client applications, etc. +Our volunteer defense center does all the hard work: monitoring the targets, running the technical infrastructure, coordinating the attack targets, coordinating with the client applications, etc. When the attack is performed, the application gets the data that it needs automatically. The only thing you need to do is to install it. Targets being attacked are changed automatically and are downloaded from the control center/server. @@ -70,16 +70,16 @@ docker run -d ghcr.io/opengs/uashield:master 512 true [![Try in PWD](https://raw.githubusercontent.com/play-with-docker/stacks/master/assets/images/button.png)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/opengs/uashield/master/pwd-docker-compose.yml) ## Donations -Donations will be used to fund our operations: +Donations will be used exclusively to fund our operations: 1. Expenses on constantly buying new proxy servers 2. From time to time buying servers for new infastructure -When we will win the war and will be peace in Ukraine, funds will be transfered to voluntary associations to help victims of this war. +When we win the war and there is peace in Ukraine, funds will be transfered to voluntary associations to help victims of this war. You can help us using: - BTC: 11wxDarouPfY6P3misLvFuJ8k8oWhd4qb -Also, here are some variants if you want to help developers with some cofee. So we can continue to skip work and keep invest time in project all nights: +Also, here are some variants if you want to help developers with some coffee, so we can continue to skip work and keep investing time in the project all nights: - BTC: 12CcLYn6zrBcnmvK5fRSAQcJre5jknyTxH We will add more variants in future :) diff --git a/package.json b/package.json index 66c5415..c047e0c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shield", - "version": "0.0.12", + "version": "0.0.13", "description": "Cyber security shield", "productName": "UA Cyber SHIELD", "author": "Mykola Zhyhallo ", diff --git a/tools/ansible/hosts b/tools/ansible/hosts index 1565853..707c89c 100644 --- a/tools/ansible/hosts +++ b/tools/ansible/hosts @@ -1,3 +1,3 @@ [servers] 10.10.10.10 -10.10.10.11 +10.10.10.11 \ No newline at end of file diff --git a/tools/ansible/roles/uashield/tasks/main.yml b/tools/ansible/roles/uashield/tasks/main.yml index ae35d6d..74c8c49 100644 --- a/tools/ansible/roles/uashield/tasks/main.yml +++ b/tools/ansible/roles/uashield/tasks/main.yml @@ -1,52 +1,43 @@ --- -- name: Check if repo is exist - stat: - path: "{{uashield_work_dir}}" - failed_when: false - changed_when: false - register: check_uashield_repo - -- name: Clone repo +- name: Clone uashield repo git: repo: "{{uashield_git_url}}" dest: "{{uashield_work_dir}}" accept_hostkey: true force: true version: "master" - when: not check_uashield_repo.stat.exists -- name: Pull Latest Changes - shell: "git pull" +- name: Stop all containers + shell: "docker-compose down" args: chdir: "{{uashield_work_dir}}" - when: check_uashield_repo.stat.exists -- name: Get Running Docker Containers - shell: "docker ps -aq" - register: docker_info - -- name: Stop Running Docker Containers - shell: "docker stop $(docker ps -aq)" - when: docker_info.stdout - -- name: Remove Docker Containers - shell: "docker rm $(docker ps -aq)" - when: docker_info.stdout - -- name: Remove Old Docker Image +- name: Remove old uashield images shell: "docker rmi -f uashield" -- name: Build Docker Image - shell: "docker build . -t uashield" +- name: Run uashield + shell: "docker-compose up -d" args: chdir: "{{uashield_work_dir}}" -- name: Run Instance - shell: "docker run -d uashield {{ uashield_threads }} {{ uashield_proxy }}" - -- name: Check Docker is started - command: "docker ps" +- name: Check docker started + shell: "docker ps" + args: + chdir: "{{uashield_work_dir}}" register: output - ansible.builtin.debug: - var: output.stdout_lines + var: output + +- name: Chmod bash script for image update + shell: "chmod +x /root/uashield/tools/ansible/update-build.sh" + +- name: Remove /root/cronjob file if exists + shell: "rm /root/cronjob" + ignore_errors: yes + +- name: Add every 30 minutes image update as a cronjob + shell: "sudo echo '*/3 * * * * /root/uashield/tools/ansible/update-build.sh' >> /root/cronjob" + +- name: Add every reboot image update as a cronjob + shell: "sudo echo '@reboot /root/uashield/tools/ansible/update-build.sh' >> /root/cronjob && crontab /root/cronjob" diff --git a/tools/ansible/update-build.sh b/tools/ansible/update-build.sh new file mode 100644 index 0000000..2fdcb56 --- /dev/null +++ b/tools/ansible/update-build.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +cd /root/uashield/ + +if git checkout master && + git fetch origin master && + [ `git rev-list HEAD...origin/master --count` != 0 ] && + git merge origin/master +then + echo 'Updated!' + sudo chmod +x /root/uashield/tools/ansible/update-build.sh + sudo docker-compose down -t 1 + sudo docker rmi -f uashield + sudo docker-compose up -d + docker ps +else + echo 'Not updated.' +fi \ No newline at end of file diff --git a/tools/ansible/vars/vars.yaml b/tools/ansible/vars/vars.yaml index ec4b48b..fc8f673 100644 --- a/tools/ansible/vars/vars.yaml +++ b/tools/ansible/vars/vars.yaml @@ -4,9 +4,7 @@ #Docker docker_version: 5.0.3 -docker_install_compose: true docker_users: [] -docker_pip_executable: pip3 #Uashield