mirror of
https://github.com/funkypenguin/geek-cookbook/
synced 2026-11-05 23:08:18 +00:00
Remove remaining references to oauth-proxy (we now have traefik-forward-auth instead!)
This commit is contained in:
1 parent
f5b1facdd2
commit
5411b1b173
31 files changed
+437
-445
No files matched your search
+30
-27
@@ -10,30 +10,37 @@ description: Terminal in a browser, baby!
|
||||
|
||||
## Why would you need SSH in a browser window?
|
||||
|
||||
Need shell access to a node with no external access? Deploy Wetty behind an [oauth_proxy](/reference/oauth_proxy/) with a SSL-terminating reverse proxy ([traefik](/ha-docker-swarm/traefik/)), and suddenly you have the means to SSH to your private host from any web browser (_protected by your [oauth_proxy](/reference/oauth_proxy/) of course, and your OAuth provider's 2FA_)
|
||||
Need shell access to a node with no external access? Deploy Wetty behind an [traefik-forward-auth](/ha-docker-swarm/traefik-forward-auth/) with a SSL-terminating reverse proxy ([traefik](/ha-docker-swarm/traefik/)), and suddenly you have the means to SSH to your private host from any web browser (_protected by your [traefik-forward-auth](/ha-docker-swarm/traefik-forward-auth/) of course._)
|
||||
|
||||
Here are some other possible use cases:
|
||||
|
||||
1. Access to SSH / CLI from an environment where outgoing SSH is locked down, or SSH client isn't / can't be installed. (_i.e., a corporate network_)
|
||||
2. Access to long-running processes inside a tmux session (_like [irrsi](https://irssi.org/)_)
|
||||
3. Remote access to a VM / [container running Kali linux](https://github.com/offensive-security/kali-linux-docker), for penetration testing
|
||||
3. Remote access to a VM / [container running Kali linux](https://gitlab.com/kalilinux/build-scripts/kali-docker), for penetration testing
|
||||
|
||||
--8<-- "recipe-standard-ingredients.md"
|
||||
|
||||
## Preparation
|
||||
|
||||
### Prepare environment
|
||||
### Setup data locations
|
||||
|
||||
Create wetty.env, and populate with the following variables per the [oauth_proxy](/reference/oauth_proxy/) instructions:
|
||||
First we create a directory to hold the data which wetty will serve:
|
||||
|
||||
```bash
|
||||
OAUTH2_PROXY_CLIENT_ID=
|
||||
OAUTH2_PROXY_CLIENT_SECRET=
|
||||
OAUTH2_PROXY_COOKIE_SECRET=
|
||||
mkdir /var/data/config/wetty
|
||||
cd /var/data/config/wetty
|
||||
```
|
||||
|
||||
### Prepare environment
|
||||
|
||||
Create `/var/data/config/wetty.env`, and populate with the following variables
|
||||
|
||||
```yaml
|
||||
|
||||
# To use WeTTY to SSH to a host besides the (mostly useless) alpine container it comes with
|
||||
SSHHOST=batcomputer.batcave.com
|
||||
SSHUSER=batman
|
||||
|
||||
```
|
||||
|
||||
### Setup Docker Swarm
|
||||
@@ -48,29 +55,24 @@ services:
|
||||
wetty:
|
||||
image: krishnasrinivas/wetty
|
||||
env_file : /var/data/config/wetty/wetty.env
|
||||
networks:
|
||||
- internal
|
||||
proxy:
|
||||
image: funkypenguin/oauth2_proxy:latest
|
||||
env_file: /var/data/config/wetty/wetty.env
|
||||
deploy:
|
||||
labels:
|
||||
# traefik common
|
||||
- traefik.enable=true
|
||||
- traefik.docker.network=traefik_public
|
||||
|
||||
# traefikv1
|
||||
- traefik.frontend.rule=Host:wetty.example.com
|
||||
- traefik.port=3000
|
||||
|
||||
# traefikv2
|
||||
- "traefik.http.routers.wetty.rule=Host(`wetty.example.com`)"
|
||||
- "traefik.http.services.wetty.loadbalancer.server.port=3000"
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.wetty.middlewares=forward-auth@file"
|
||||
networks:
|
||||
- internal
|
||||
- traefik_public
|
||||
deploy:
|
||||
labels:
|
||||
- traefik.frontend.rule=Host:wetty.funkypenguin.co.nz
|
||||
- traefik.docker.network=traefik_public
|
||||
- traefik.port=4180
|
||||
volumes:
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /var/data/config/wetty/authenticated-emails.txt:/authenticated-emails.txt
|
||||
command: |
|
||||
-cookie-secure=false
|
||||
-upstream=http://wetty:3000
|
||||
-redirect-url=https://wetty.funkypenguin.co.nz
|
||||
-http-address=http://0.0.0.0:4180
|
||||
-provider=github
|
||||
-authenticated-emails-file=/authenticated-emails.txt
|
||||
|
||||
networks:
|
||||
traefik_public:
|
||||
@@ -93,6 +95,7 @@ Launch the Wetty stack by running ```docker stack deploy wetty -c <path -to-dock
|
||||
Browse to your new browser-cli-terminal at https://**YOUR-FQDN**. Authenticate with your OAuth provider, and then proceed to login, either to the remote host you specified (_batcomputer.batcave.com, in the example above_), or using user and password "term" to log directly into the Wetty alpine container (_from which you can establish egress SSH_)
|
||||
|
||||
[^1]: You could set SSHHOST to the IP of the "docker0" interface on your host, which is normally 172.17.0.1. (_Or run ```/sbin/ip route|awk '/default/ { print $3 }'``` in the container_) This would then provide you the ability to remote-manage your swarm with only web access to Wetty.
|
||||
|
||||
[^2]: The inclusion of Wetty was due to the efforts of @gpulido in our [Discord server](http://chat.funkypenguin.co.nz). Thanks Gabriel!
|
||||
|
||||
--8<-- "recipe-footer.md"
|
||||
Reference in new issue
Block a user