-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathsetup-dirs.sh
More file actions
executable file
·48 lines (42 loc) · 1.49 KB
/
Copy pathsetup-dirs.sh
File metadata and controls
executable file
·48 lines (42 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
#
# Setup directories and permissions
# eg. XDG_* directories and some devices permissions
#
# Ensure /dev/uinput usable by all processes, required to properly handle mouse and keyboard
# TODO is this secure ?
chmod 0666 /dev/uinput
# Ensure required directories exist and are usable by Cloudy user (XDG_*, Home directories, etc.)
# As these directories are designed to be mounted from host, we need to ensure they exist and are usable by Cloudy user
# since container runtime like Docker would typically mount them with root:root ownership and unwanted permissions
mkdir -p \
$CLOUDYPAD_DATA_DIR \
$CLOUDYPAD_LOG_DIR \
$XDG_RUNTIME_DIR \
$XDG_CACHE_HOME \
$XDG_CONFIG_HOME \
$XDG_DATA_HOME \
$CLOUDYPAD_USER_HOME \
$CLOUDYPAD_USER_HOME/Desktop
chown $CLOUDYPAD_USER:$CLOUDYPAD_USER \
$CLOUDYPAD_DATA_DIR \
$CLOUDYPAD_LOG_DIR \
$XDG_RUNTIME_DIR \
$XDG_CACHE_HOME \
$XDG_CONFIG_HOME \
$XDG_DATA_HOME \
$CLOUDYPAD_USER_HOME
chmod 0700 \
$CLOUDYPAD_DATA_DIR \
$CLOUDYPAD_LOG_DIR \
$XDG_RUNTIME_DIR \
$XDG_CACHE_HOME \
$XDG_CONFIG_HOME \
$XDG_DATA_HOME \
$CLOUDYPAD_USER_HOME
# Copy desktop shortcuts to user's Desktop
if [ -d "/cloudy/conf/desktop-shortcuts" ]; then
cp /cloudy/conf/desktop-shortcuts/*.desktop $CLOUDYPAD_USER_HOME/Desktop/ 2>/dev/null || true
chown -R $CLOUDYPAD_USER:$CLOUDYPAD_USER $CLOUDYPAD_USER_HOME/Desktop
chmod 755 $CLOUDYPAD_USER_HOME/Desktop/*.desktop 2>/dev/null || true
fi