Giter VIP home page Giter VIP logo

agabani / tor-operator Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 1.0 6.11 MB

Tor Operator is a Kubernetes Operator that manages Onion Balances, Onion Keys and Onion Services to provide a highly available, load balanced and fault tolerate Tor Ingress and Tor Proxy.

Home Page: https://agabani.github.io/tor-operator/docs/

License: MIT License

Rust 93.06% Dockerfile 1.53% Starlark 1.87% Smarty 1.50% Just 2.04%
kubernetes kubernetes-operator rust tor kubernetes-controller onion-service onionbalance helm tor-ingress tor-proxy

tor-operator's Introduction

Tor Operator

Tor Operator is a Kubernetes Operator that manages Onion Balances, Onion Keys and Onion Services to provide a highly available, load balanced and fault tolerate Tor Ingress and Tor Proxy.

Documentation

https://agabani.github.io/tor-operator/docs/

Installation

  1. Add the chart repository.

    helm repo add agabani-tor-operator https://agabani.github.io/tor-operator
    
  2. Update the chart repository.

    helm repo update agabani-tor-operator
    
  3. Install the Tor Operator.

    helm upgrade tor-operator agabani-tor-operator/tor-operator \
        --create-namespace \
        --install \
        --namespace tor-operator
    
  4. Test the Tor Operator.

    helm test tor-operator --namespace tor-operator
    

Creating a Tor Ingress

  1. Prepare your existing Onion Key to look like:

    • hostname
    • hs_ed25519_public_key
    • hs_ed25519_secret_key

    or generate a new Onion Key using:

    cargo install --git https://github.com/agabani/tor-operator --tag v0.0.31
    tor-operator onion-key generate
    
  2. Create a Secret containing the Onion Key.

    kubectl create secret generic tor-ingress-example \
        --from-file=hostname=./hostname \
        --from-file=hs_ed25519_public_key=./hs_ed25519_public_key \
        --from-file=hs_ed25519_secret_key=./hs_ed25519_secret_key
    
  3. Create an OnionKey wrapping the Secret.

    # onionkey.yaml
    apiVersion: tor.agabani.co.uk/v1
    kind: OnionKey
    metadata:
      name: tor-ingress-example
    spec:
      secret:
        name: tor-ingress-example
    

    kubectl apply -f onionkey.yaml

  4. Create a TorIngress, changing example:80 to your targets host:port

    # toringress.yaml
    apiVersion: tor.agabani.co.uk/v1
    kind: TorIngress
    metadata:
      name: tor-ingress-example
    spec:
      horizontalPodAutoscaler:
        maxReplicas: 6
        minReplicas: 3
      onionBalance:
        onionKey:
          name: tor-ingress-example
      onionService:
        deployment:
          containers:
            - name: tor
              resources:
                requests:
                  cpu: 100m
        ports:
          - target: example:80
            virtport: 80
    

    kubectl apply -f toringress.yaml

Creating a Tor Proxy

  1. Create a TorProxy

    # torproxy.yaml
    apiVersion: tor.agabani.co.uk/v1
    kind: TorProxy
    metadata:
      name: tor-proxy-example
    spec:
      deployment:
        containers:
          - name: tor
            resources:
              requests:
                cpu: 100m
      horizontalPodAutoscaler:
        maxReplicas: 4
        minReplicas: 2
      service:
        ports:
          - name: http-tunnel
            port: 1080
            protocol: HTTP_TUNNEL
          - name: socks
            port: 9050
            protocol: SOCKS
    

    kubectl apply -f torproxy.yaml

Screenshots

OnionBalance

OnionKey

OnionService

TorIngress

TorProxy

tor-operator's People

Contributors

agabani avatar dependabot[bot] avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

batusonmez

tor-operator's Issues

access to control port of an OnionService / exposing of port inside cluster as service

I already found the comparison sheet of this repo "against" bugfests repo.

I would like to use the control port on an OnionService to be able to kill specific onion curcuits to prevent flooding attacks.
Is it possible to expose this port using this repo / any hints on how to do this?
Using bugfests library it's not possible at the moment.
Seems like this is a requirement for many "nerdy" users of this setup.

Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.