Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/github-actions-buildelectronmacos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
rm -rf dist/
npm install -g @quasar/cli yarn --force
yarn install
EP_GH_IGNORE_TIME=true quasar build --mode electron --publish always -T darwin
quasar build --mode electron --publish always -T darwin
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ services:
uashield:
build: .
restart: always
container_name: uashield
image: uashield:latest
environment:
WORKERS: '256'
USEPROXY: 'true'
Expand Down
8 changes: 7 additions & 1 deletion quasar.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,13 @@ module.exports = configure(function (ctx) {
]
},
mac: {
target: 'dmg'
target: [ {
target: 'dmg',
arch: [
"x64", "arm64"
]
}
]
},
linux: {
target: ['AppImage', 'tar.gz']
Expand Down
26 changes: 26 additions & 0 deletions tools/terraform-do-uashield/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.PHONY: tf-deploy
tf-deploy: tf-init tf-apply

.PHONY: tf-init
tf-init:
docker-compose -f docker-compose.yml run terraform init

.PHONY: tf-fmt
tf-fmt:
docker-compose -f docker-compose.yml run terraform fmt

.PHONY: tf-validate
tf-validate:
docker-compose -f docker-compose.yml run terraform validate

.PHONY: tf-plan
tf-plan:
docker-compose -f docker-compose.yml run terraform plan

.PHONY: tf-apply
tf-apply:
docker-compose -f docker-compose.yml run terraform apply -auto-approve -auto-approv

.PHONY: tf-destroy
tf-destroy:
docker-compose -f docker-compose.yml run terraform destroy -auto-approve -auto-approv
44 changes: 26 additions & 18 deletions tools/terraform-do-uashield/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,41 @@


## Requirements
- [Instal terraform](https://www.terraform.io/downloads)
- [Add SSH key](https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/to-account/) to DO with name `ssh`

- docker
- docker-compose
- [DO PAT](https://docs.digitalocean.com/reference/api/create-personal-access-token/)
- [Add SSH key](https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/to-account/) to DO with name `ssh` (TODO: hardcoded)

## Export environment vars
Extra logs
```
export TF_LOG=INFO
# Create and export DO PAT
# https://docs.digitalocean.com/reference/api/create-personal-access-token/
export DO_PAT="<your_pat>"

# Provide and export ssh key
export SSH_KEY_PATH="$HOME/.ssh/id_ed25519"

# Logs level
export TF_LOG="INFO"
```
## Create and export DO PAT
- [DO PAT](https://docs.digitalocean.com/reference/api/create-personal-access-token/)
Use DROPLET_INSTANCE_NUMBER and DROPLET_INSTANCE_SIZE environment variables to change droplet number and size.
```
export DO_PAT="<your_pat>"
export DROPLET_INSTANCE_NUMBER=5
```
## Init terraform
### Deploy the uashields infrastructure to DO
```
terraform init
make tf-deploy
```

### Destroy the uashields infrastructure
```
make tf-destroy
```
terraform apply \
-var "do_token=${DO_PAT}" \
-var "pvt_key=$HOME/.ssh/id_ed25519"
>NOTE: Make do not work for Windows user, please use command below:
```
# To deploy
> docker-compose -f docker-compose.yml run terraform init
> docker-compose -f docker-compose.yml run terraform apply

# To destroy
> docker-compose -f docker-compose.yml run terraform destroy
```
terraform destroy \
-var "do_token=${DO_PAT}" \
-var "pvt_key=$HOME/.ssh/id_ed25519"
```
16 changes: 16 additions & 0 deletions tools/terraform-do-uashield/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.8'

services:
terraform:
image: hashicorp/terraform:1.1.7
volumes:
- .:/infra
- ${SSH_KEY_PATH}:/root/.ssh/id_ed25519:ro

working_dir: /infra
environment:
- TF_VAR_do_token=${DO_PAT}
- TF_VAR_pvt_key=/root/.ssh/id_ed25519
- TF_LOG=${TF_LOG}
- TF_VAR_droplet_instance_number=$(DROPLET_INSTANCE_NUMBER)
- TF_VAR_droplet_instance_size=$(DROPLET_INSTANCE_SIZE)
3 changes: 3 additions & 0 deletions tools/terraform-do-uashield/scripts/uashield.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ services:
worker:
image: ghcr.io/opengs/uashield:latest
restart: always
environment:
WORKERS: '256'
USEPROXY: 'true'
command:
- \"7500\"
- \"true\"" >> /home/docker-compose.yaml
Expand Down