Small fixes

master
xSmurf 9 years ago
parent 3f466e9d8e
commit 50556b1bf7

@ -41,7 +41,7 @@ func NewDefaultConfig() *Config {
LogXpra: false, LogXpra: false,
EnvironmentVars: []string{ EnvironmentVars: []string{
"USER", "USERNAME", "LOGNAME", "USER", "USERNAME", "LOGNAME",
"LANG", "LANGUAGE", "_", "LANG", "LANGUAGE", "_", "TZ=UTC",
}, },
DefaultGroups: []string{ DefaultGroups: []string{
"audio", "video", "audio", "video",

@ -260,6 +260,10 @@ func (d *daemonState) sanitizeEnvironment(p *oz.Profile, oldEnv []string) []stri
newEnv := []string{} newEnv := []string{}
for _, EnvItem := range d.config.EnvironmentVars { for _, EnvItem := range d.config.EnvironmentVars {
if strings.Contains(EnvItem, "=") {
newEnv = append(newEnv, EnvItem)
continue
}
for _, OldItem := range oldEnv { for _, OldItem := range oldEnv {
if strings.HasPrefix(OldItem, EnvItem+"=") { if strings.HasPrefix(OldItem, EnvItem+"=") {
newEnv = append(newEnv, EnvItem+"="+strings.Replace(OldItem, EnvItem+"=", "", 1)) newEnv = append(newEnv, EnvItem+"="+strings.Replace(OldItem, EnvItem+"=", "", 1))

@ -545,6 +545,9 @@ func (st *initState) bindWhitelist(fsys *fs.Filesystem, wlist []oz.WhitelistItem
if wl.ReadOnly { if wl.ReadOnly {
flags |= fs.BindReadOnly flags |= fs.BindReadOnly
} }
if wl.Path == "" {
continue
}
if err := fsys.BindPath(wl.Path, flags, st.user); err != nil { if err := fsys.BindPath(wl.Path, flags, st.user); err != nil {
return err return err
} }
@ -557,6 +560,9 @@ func (st *initState) applyBlacklist(fsys *fs.Filesystem, blist []oz.BlacklistIte
return nil return nil
} }
for _, bl := range blist { for _, bl := range blist {
if bl.Path == "" {
continue
}
if err := fsys.BlacklistPath(bl.Path, st.user); err != nil { if err := fsys.BlacklistPath(bl.Path, st.user); err != nil {
return err return err
} }

@ -62,7 +62,7 @@ type XServerConf struct {
WindowIcon string `json:"window_icon"` WindowIcon string `json:"window_icon"`
EnableTray bool `json:"enable_tray"` EnableTray bool `json:"enable_tray"`
EnableNotifications bool `json:"enable_notifications"` EnableNotifications bool `json:"enable_notifications"`
UsePulseAudio bool `json:"use_pulse_audio"` UsePulseaudio bool `json:"use_pulseaudio"`
DisableClipboard bool `json:"disable_clipboard"` DisableClipboard bool `json:"disable_clipboard"`
AudioMode AudioMode `json:"audio_mode"` AudioMode AudioMode `json:"audio_mode"`
} }
@ -124,7 +124,7 @@ func NewDefaultProfile() *Profile {
Enabled: true, Enabled: true,
EnableTray: false, EnableTray: false,
EnableNotifications: false, EnableNotifications: false,
UsePulseAudio: false, UsePulseaudio: false,
AudioMode: PROFILE_AUDIO_NONE, AudioMode: PROFILE_AUDIO_NONE,
}, },
} }

@ -10,7 +10,6 @@ import (
var xpraServerDefaultArgs = []string{ var xpraServerDefaultArgs = []string{
"--no-mdns", "--no-mdns",
//"--pulseaudio", //"--pulseaudio",
"--no-pulseaudio",
"--input-method=keep", "--input-method=keep",
} }
@ -36,5 +35,10 @@ func prepareServerArgs(config *oz.XServerConf, display uint64, workdir string) [
"start", "start",
fmt.Sprintf(":%d", display), fmt.Sprintf(":%d", display),
) )
if config.UsePulseaudio {
args = append(args, "--pulseaudio")
} else {
args = append(args, "--no-pulseaudio")
}
return args return args
} }

@ -38,7 +38,6 @@ var xpraDefaultArgs = []string{
//"--no-xsettings", //"--no-xsettings",
"--cursors", "--cursors",
"--encoding=rgb", "--encoding=rgb",
"--no-pulseaudio",
} }
func getDefaultArgs(config *oz.XServerConf) []string { func getDefaultArgs(config *oz.XServerConf) []string {

Loading…
Cancel
Save