在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):kragniz/tor-controller开源软件地址(OpenSource Url):https://github.com/kragniz/tor-controller开源编程语言(OpenSource Language):Go 98.6%开源软件介绍(OpenSource Introduction):tor-controllerTor is an anonymity network that provides:
tor-controller allows you to create See this page for more information about onion services. tor-controller creates the following resources for each OnionService:
InstallInstall tor-controller:
Quickstart with random addressCreate an onion service, apiVersion: tor.k8s.io/v1alpha1
kind: OnionService
metadata:
name: basic-onion-service
spec:
version: 2
selector:
app: example
ports:
- publicPort: 80
targetPort: 80 Apply it:
View it: $ kubectl get onionservices -o=custom-columns=NAME:.metadata.name,HOSTNAME:.status.hostname
NAME HOSTNAME
basic-onion-service h7px2yyugjqkztrb.onion Exposing a deployment with a fixed addressCreate some deployment to test against, in this example we'll deploy an echoserver. Create apiVersion: apps/v1
kind: Deployment
metadata:
name: http-app
spec:
replicas: 2
selector:
matchLabels:
app: http-app
template:
metadata:
labels:
app: http-app
spec:
containers:
- name: http-app
image: gcr.io/google_containers/echoserver:1.8
ports:
- containerPort: 8080 Apply it:
For a fixed address, we need a private key. This should be kept safe, since someone can impersonate your onion service if it is leaked. Generate an RSA private key (only valid for v2 onion services, v3 services use Ed25519 instead):
Put your private key into a secret:
Create an onion service, apiVersion: tor.k8s.io/v1alpha1
kind: OnionService
metadata:
name: example-onion-service
spec:
version: 2
selector:
app: http-app
ports:
- targetPort: 8080
publicPort: 80
privateKeySecret:
name: example-onion-key
key: private_key Apply it:
List active OnionServices:
This service should now be accessable from any tor client, for example Tor Browser: Random service namesIf Onion service versionsThe The biggest difference from a user's point of view is the length of addresses. v2
service names are short, like tor-controller defaults to using v3 if Using with nginx-ingresstor-controller on its own simply directs TCP traffic to a backend service. If you want to serve HTTP stuff, you'll probably want to pair it with nginx-ingress or some other ingress controller. To do this, first install nginx-ingress normally. Then point an onion service at the nginx-ingress-controller, for example: apiVersion: tor.k8s.io/v1alpha1
kind: OnionService
metadata:
name: nginx-onion-service
spec:
version: 2
selector:
app: nginx-ingress-controller
name: nginx-ingress-controller
ports:
- publicPort: 80
targetPort: 80
name: http
privateKeySecret:
name: nginx-onion-key
key: private_key This can then be used in the same way any other ingress is. Here's a full example, with a default backend and a subdomain: apiVersion: apps/v1
kind: Deployment
metadata:
name: http-app
spec:
replicas: 2
selector:
matchLabels:
app: http-app
template:
metadata:
labels:
app: http-app
spec:
containers:
- name: http-app
image: gcr.io/google_containers/echoserver:1.8
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: http-app
labels:
app: http-app
spec:
ports:
- port: 80
protocol: TCP
targetPort: 8080
selector:
app: http-app
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: http-app
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
backend:
serviceName: default-http-backend
servicePort: 80
rules:
- host: echoserver.h7px3yyugjqkztrb.onion
http:
paths:
- path: /
backend:
serviceName: http-app
servicePort: 8080 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论