diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3e84cda..a03122b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,10 +1,22 @@ --- -on: +name: Build Release +env: + RELEASE_ID: 29469484 +on: push: branches: - master -name: Build Release jobs: + clear-assets: + runs-on: ubuntu-latest + steps: + - name: Delete all assets for the release + run: | + curl "https://api.github.com/repos/rezen/dnese/releases/${RELEASE_ID}/assets" \ + | jq -r '.[].url' \ + | xargs -I{} curl -H "Authorization: Bearer ${GITHUB_TOKEN}" -X DELETE {} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} release: strategy: matrix: @@ -15,16 +27,21 @@ jobs: - uses: actions/setup-go@v2 with: go-version: '^1.13.1' - - name: setup env + - name: Setup env for go run: | echo "::set-env name=GOPATH::$(dirname $GITHUB_WORKSPACE)/go" echo "::set-env name=GOBIN::$(dirname $GITHUB_WORKSPACE)/go/bin" echo "::add-path::$(dirname $GITHUB_WORKSPACE)/bin" shell: bash - uses: actions/checkout@v2 - - run: | - mkdir -p ./artifacts + - name: Get deps + run: | + mkdir -p "${GOBIN}" + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh go get . + - name: Build binary + run: | + mkdir -p ./artifacts GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_ENABLED=0 go build -o artifacts/dnese . sha256sum artifacts/dnese | cut -d " " -f 1 > artifacts/sha256.txt chmod +x artifacts/dnese @@ -35,4 +52,32 @@ jobs: - uses: actions/upload-artifact@v2 with: name: dnese_${{ matrix.goos }}_${{ matrix.goarch }}_sha256.txt - path: ./artifacts/sha256.txt \ No newline at end of file + path: ./artifacts/sha256.txt + + - name: "Creating step output for uploading bin" + run: echo "::set-output name=url::$(echo https://uploads.github.com/repos/rezen/dnese/releases/${RELEASE_ID}/assets?name=dnese_${{ matrix.goos }}_${{ matrix.goarch }})" + id: upload_url_bin + + - name: Update edge assets bin + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.upload_url_bin.outputs.url }} + asset_path: ./artifacts/dnese + asset_name: dnese_${{ matrix.goos }}_${{ matrix.goarch }} + asset_content_type: application/octet-stream + + - name: "Creating step output for uploading sha256" + run: echo "::set-output name=url::$(echo https://uploads.github.com/repos/rezen/dnese/releases/${RELEASE_ID}/assets?name=dnese_${{ matrix.goos }}_${{ matrix.goarch }}_sha256.txt)" + id: upload_url_sha256 + - name: Update edge assets sha256 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.upload_url_sha256.outputs.url }} + asset_path: ./artifacts/sha256.txt + asset_name: dnese_${{ matrix.goos }}_${{ matrix.goarch }}_sha256.txt + asset_content_type: application/octet-stream + diff --git a/README.md b/README.md index 48c3ed9..f7be276 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,25 @@ # dnese An amigo to help you easily serve dns queries with your answers & see what questions are being asked. -Originally built for dns poisoning for testing native/desktop apps. \ No newline at end of file +Originally built for dns spoofing for testing native/desktop apps. + + +## Usage + +```sh +dnese --help +dnese --always 127.0.0.1 --port 5300 +``` + +You can also set the configuration options in `$HOME/.dnese.yaml` which is automatically loaded. You can also use `--config` to specify the path of your config. + +**Example Config** +```yaml +--- +# always: 127.0.0.1 +port: 5300 +resolver: 8.8.8.8:53 +rules: + - pattern: .*\.hey\.com\.?$ + address: 127.0.0.1 +``` \ No newline at end of file