Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7158764d2c | |||
| 1f611efed0 | |||
| 935861a107 |
@@ -528,6 +528,9 @@ func (r *ServerManagerReconciler) BrowserPod(s *servermanagerv1alpha1.ServerMana
|
||||
Protocol: port.Protocol,
|
||||
}
|
||||
}
|
||||
var fsGroupValue int64 = 2000
|
||||
var runAsUserValue int64 = 1000
|
||||
policy := corev1.FSGroupChangeOnRootMismatch // Optimizes startup speed
|
||||
|
||||
pod := &corev1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
@@ -536,6 +539,12 @@ func (r *ServerManagerReconciler) BrowserPod(s *servermanagerv1alpha1.ServerMana
|
||||
Labels: map[string]string{"browser": s.Name},
|
||||
},
|
||||
Spec: corev1.PodSpec{
|
||||
SecurityContext: &corev1.PodSecurityContext{
|
||||
FSGroup: &fsGroupValue,
|
||||
RunAsUser: &runAsUserValue,
|
||||
RunAsGroup: &fsGroupValue,
|
||||
FSGroupChangePolicy: &policy,
|
||||
},
|
||||
Volumes: []corev1.Volume{
|
||||
{
|
||||
Name: "volume",
|
||||
@@ -561,7 +570,7 @@ func (r *ServerManagerReconciler) BrowserPod(s *servermanagerv1alpha1.ServerMana
|
||||
ImagePullPolicy: corev1.PullIfNotPresent,
|
||||
Ports: ports,
|
||||
Command: []string{"/bin/sh"},
|
||||
Args: []string{"-c", fmt.Sprintf("rm /tmp/database/filebrowser.db; filebrowser config init -d /tmp/database/filebrowser.db && filebrowser config set --auth.method=noauth --auth.header=%s --perm.admin=true -d /tmp/database/filebrowser.db", r.Config.Browser.AuthHeader)},
|
||||
Args: []string{"-c", fmt.Sprintf("rm /tmp/database/filebrowser.db; filebrowser config init -d /tmp/database/filebrowser.db && filebrowser config set --auth.method=noauth --auth.header=%s -d /tmp/database/filebrowser.db", r.Config.Browser.AuthHeader)},
|
||||
VolumeMounts: []corev1.VolumeMount{
|
||||
{
|
||||
Name: "browser-volume",
|
||||
@@ -576,7 +585,7 @@ func (r *ServerManagerReconciler) BrowserPod(s *servermanagerv1alpha1.ServerMana
|
||||
Image: "filebrowser/filebrowser",
|
||||
ImagePullPolicy: corev1.PullIfNotPresent,
|
||||
Ports: ports,
|
||||
Args: []string{"--noauth", "-d", "/tmp/database/filebrowser.db", "-r", "/tmp/data", "-b", r.GenerateBrowserSubPath(s)},
|
||||
Args: []string{"-d", "/tmp/database/filebrowser.db", "-r", "/tmp/data", "-b", r.GenerateBrowserSubPath(s)},
|
||||
VolumeMounts: []corev1.VolumeMount{
|
||||
{
|
||||
Name: "volume",
|
||||
|
||||
Reference in New Issue
Block a user