
name: ngrok
adopt-info: ngrok
summary: ngrok secure introspectable tunnels to localhost.
description: ngrok is a secure ingress platform that enables developers to add global server load balancing, reverse proxy, firewall, API gateway and Kubernetes Ingress to applications and APIs.

base: core22 # Ubuntu 22.04 LTS
grade: stable
confinement: strict

architectures: # github actions uses amd64 as host architecture
  - build-on: [amd64]
    build-for: amd64
  - build-on: [amd64, i386]
    build-for: i386
  - build-on: [amd64, armhf]
    build-for: armhf
  - build-on: [amd64, arm64]
    build-for: arm64
  - build-on: [amd64, s390x]
    build-for: s390x

parts:
  ngrok:
    plugin: dump # used for unpacking the zip files
    source:
      - on amd64 to amd64: https://bin.equinox.io/a/kMNvGk6kudx/ngrok-v3-3.26.0-linux-amd64.zip
      - on amd64 to i386: https://bin.equinox.io/a/ecDXyRz8woZ/ngrok-v3-3.26.0-linux-386.zip
      - on amd64 to armhf: https://bin.equinox.io/a/mNtA4MMHXKq/ngrok-v3-3.26.0-linux-arm.zip
      - on amd64 to arm64: https://bin.equinox.io/a/a145JXb1Xwv/ngrok-v3-3.26.0-linux-arm64.zip
      - on amd64 to s390x: https://bin.equinox.io/a/5TiuGugeekK/ngrok-v3-3.26.0-linux-s390x.zip
    override-pull:
      | # pwd is the part's source directory in parts/<part name>/src/
      craftctl default
      craftctl set version=3.26.0

plugs:
  ngrok-config:
    interface: personal-files
    write:
    - $HOME/.ngrok2

apps:
  ngrok:
    command: ngrok
    plugs: [network, network-bind, home, ngrok-config]
