disabled skel functionality for now
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
parent
39c969ec51
commit
0e21438cc8
|
@ -8,3 +8,5 @@
|
|||
5533801d-70e3-4c21-9942-82d20930c789
|
||||
5533801d-70e3-4c21-9942-82d20930c789
|
||||
5533801d-70e3-4c21-9942-82d20930c789
|
||||
5533801d-70e3-4c21-9942-82d20930c789
|
||||
5533801d-70e3-4c21-9942-82d20930c789
|
||||
|
|
|
@ -12,6 +12,9 @@ On Debian 12, you will need the following dependencies:
|
|||
apt install -y git wget podman make gcc libgpgme-dev build-essential pkgconf pkgconf-bin libdevmapper-dev libbtrfs-dev
|
||||
```
|
||||
|
||||
## Installing
|
||||
Executing `make install` will install and start podterminal as a systemd service, including an example config file.
|
||||
|
||||
## Running
|
||||
To run the built binary, just execute it as root. You will have to have Podman installed and its socket enabled.
|
||||
Currently you have to set the Image, port etc. directly in the Source Code, however that should be eventually moved into
|
||||
|
|
|
@ -9,7 +9,7 @@ envvars:
|
|||
# HTTP_PROXY: 192.168.0.10
|
||||
|
||||
# Container Image you want to use
|
||||
image: lscr.io/linuxserver/webtop
|
||||
image: git.jmbit.de/jmb/webtop-plus:latest
|
||||
# Maximum age of Session
|
||||
maxage: 10800
|
||||
# Port Podterminal should listen to
|
||||
|
@ -17,9 +17,8 @@ port: 80
|
|||
# Files that will be copied into container on startup
|
||||
skel: /etc/podterminal/skel.tar.gz
|
||||
skel_target: /config
|
||||
skel_chown: true
|
||||
# Currently useless
|
||||
skel_owner: "abc"
|
||||
# Overrides UID/GID from tar archive to container user
|
||||
skel_chown: false
|
||||
ssl: false
|
||||
ssl_cert: /etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||
ssl_cert_key: /etc/ssl/private/ssl-cert-snakeoil.key
|
||||
|
|
32
pods/skel.go
32
pods/skel.go
|
@ -1,10 +1,13 @@
|
|||
package pods
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/containers/podman/v4/pkg/bindings"
|
||||
"github.com/containers/podman/v4/pkg/bindings/containers"
|
||||
|
@ -65,7 +68,36 @@ func CopySkelToContainer(id string) error {
|
|||
return err
|
||||
}
|
||||
log.Println(response.StatusCode, response.Body)
|
||||
if viper.GetString("skel_user") != "" {
|
||||
chownSkel(id)
|
||||
|
||||
}
|
||||
|
||||
// Manually chown the Directory, because podmans chown is sometimes unreliable
|
||||
return response.Process(nil)
|
||||
}
|
||||
|
||||
func chownSkel(id string) {
|
||||
command := fmt.Sprintf(
|
||||
"chown -R %s %s \n\n",
|
||||
viper.GetString("skel_user"),
|
||||
viper.GetString("skel_target"),
|
||||
)
|
||||
done := make(chan bool)
|
||||
detachKeys := "\n\n"
|
||||
commandReader := strings.NewReader(command)
|
||||
var output bytes.Buffer
|
||||
outputWriter := io.Writer(&output)
|
||||
options := &containers.AttachOptions{
|
||||
DetachKeys: &detachKeys,
|
||||
}
|
||||
|
||||
err := containers.Attach(Socket, id, commandReader, outputWriter, outputWriter, done, options)
|
||||
|
||||
if err != nil {
|
||||
log.Printf("Error: %v \n %s\n", err, output.String())
|
||||
} else {
|
||||
log.Println(output.String())
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,14 +12,14 @@ func readConfigFile() {
|
|||
viper.SetConfigFile("/etc/podterminal/config.yaml")
|
||||
viper.SetDefault("port", 80)
|
||||
viper.SetDefault("ip_addr", "0.0.0.0")
|
||||
viper.SetDefault("image", "lscr.io/linuxserver/webtop")
|
||||
viper.SetDefault("image", "git.jmbit.de/jmb/webtop-plus:latest")
|
||||
viper.SetDefault("maxAge", 10800)
|
||||
viper.SetDefault("dri", false)
|
||||
viper.SetDefault("dir_node", "/dev/dri/renderD128")
|
||||
viper.SetDefault("skel", "/etc/podterminal/skel.tar.gz")
|
||||
viper.SetDefault("skel_chown", false)
|
||||
viper.SetDefault("skel_target", "/")
|
||||
viper.SetDefault("skel_owner", "abc")
|
||||
viper.SetDefault("skel_user", "")
|
||||
viper.SetDefault("block_filebrowser", false)
|
||||
viper.SetDefault("envvars",
|
||||
map[string]string{
|
||||
|
|
|
@ -58,7 +58,7 @@ func containerProxy(c *gin.Context) {
|
|||
}
|
||||
|
||||
// Soft fail Skel
|
||||
_ = pods.CopySkelToContainer(ct)
|
||||
// _ = pods.CopySkelToContainer(ct)
|
||||
|
||||
proxies[ct], err = createReverseProxy(fmt.Sprintf("http://%s:3000", ctip))
|
||||
|
||||
|
|
Loading…
Reference in New Issue