Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Run Cockpit from container image #18

Closed
gbraad opened this issue Jun 23, 2023 · 2 comments
Closed

Documentation: Run Cockpit from container image #18

gbraad opened this issue Jun 23, 2023 · 2 comments

Comments

@gbraad
Copy link
Contributor

gbraad commented Jun 23, 2023

Add the following to the description

Run Cockpit

You need to be able to login using a local account. Make sure to give it a password. Note: In the cloud images I use, there is a user gbraad.

$ dnf install -y passwd
$ sudo passwd gbraad

To be able to use the proxy that is created, you need to allow the Origin for the webservice. For this you need to modify the configuration file:

$ sudo vi /etc/cockpit/cockpit.conf 

For example for Codesandbox this would be something like:

[WebService]
Origins=https://jqgnyj-9090.csb.app

After this you can start the webservice from the CLI

$ sudo runuser -u cockpit-wsinstance -- /usr/libexec/cockpit-ws --port=9090 --for-tls-proxy 

Now you can open: https://jqgnyj-9090.csb.app and login using the user and password you set


Make sure to link the dist folder for use with Cockpit:

$ mkdir -p /home/gbraad/.local/share/cockpit
$ ln -s $PWD/dist /home/gbraad/.local/share/cockpit/tailscale

On Codesandbox you can not run Tailscale as TUN=true. You therefore need to modify the start script a little:

/etc/init.d/tailscaled

#!/bin/sh

set -e
test -x /usr/sbin/tailscaled || exit 0
umask 022

export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"

case "$1" in
  start)
        echo "Starting Tailscale VPN"
            tailscaled --tun=userspace-networking \
                --socks5-server=localhost:3215 \
                --outbound-http-proxy-listen=localhost:3214 \
                --state=/var/lib/tailscale/tailscaled.state \
                --socket=/run/tailscale/tailscaled.sock \
                --port 41641 \
                2>/dev/null &
            tailscale up --authkey=${TAILSCALE_AUTHKEY} \
                --netfilter-mode=off \
                --ssh
        ;;
  *)
        echo "Usage: /etc/init.d/tailscaled {start}"
        exit 1
esac

exit 0
@gbraad gbraad changed the title Run Cockpit from container image Documentation: Run Cockpit from container image Jun 23, 2023
@gbraad gbraad pinned this issue Jun 23, 2023
@gbraad
Copy link
Contributor Author

gbraad commented Jun 23, 2023

Screenshot from 2023-06-23 23-31-27

Screenshot from 2023-06-24 00-02-57

Screenshot from 2023-06-24 12-24-06

Screenshot from 2023-06-24 12-35-07

@gbraad
Copy link
Contributor Author

gbraad commented Jul 4, 2023

Incorporated into package.json

@gbraad gbraad closed this as completed Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant