now allowes to specify skel target in config
ci/woodpecker/push/woodpecker Pipeline failed Details

why
Johannes Bülow 2024-01-31 09:05:13 +01:00
parent 25eff5ff74
commit 82bccb9d1f
Signed by untrusted user who does not match committer: jmb
GPG Key ID: B56971CF7B8F83A6
3 changed files with 11 additions and 5 deletions

View File

@ -16,6 +16,7 @@ maxage: 10800
port: 80
# Files that will be copied into container on startup
skel: /etc/podterminal/skel.tar.gz
skel_target: /config
ssl: false
ssl_cert: /etc/ssl/certs/ssl-cert-snakeoil.pem
ssl_cert_key: /etc/ssl/private/ssl-cert-snakeoil.key

View File

@ -18,19 +18,23 @@ func CopySkelToContainer(id string) error {
if err != nil {
return err
}
fileInfo, err := os.Stat(viper.GetString("skel"))
if err != nil {
log.Println("Could not access Skel archive")
return err
}
log.Println("Skel Archive is ", fileInfo.Size(), "b")
file, err := os.Open(viper.GetString("skel"))
if err != nil {
log.Println("Could not open skel archive", err)
return err
}
fileInfo, err := os.Stat(viper.GetString("skel"))
log.Println("Skel Archive is ", fileInfo.Size(), "b")
defer file.Close()
params := url.Values{}
params.Set("path", "/")
params.Set("path", viper.GetString("skel_target"))
response, err := conn.DoRequest(
Socket,

View File

@ -17,6 +17,7 @@ func readConfigFile() {
viper.SetDefault("dri", false)
viper.SetDefault("dir_node", "/dev/dri/renderD128")
viper.SetDefault("skel", "/etc/podterminal/skel.tar.gz")
viper.SetDefault("skel_target", "/")
viper.SetDefault("block_filebrowser", false)
viper.SetDefault("envvars",
map[string]string{