Skip to content

Commit 8183858

Browse files
refactor: change dir permission.
1 parent c468952 commit 8183858

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

apps/common/utils/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ def _get_rotate_dest_filename(source):
2525
os.path.basename(source)
2626
]
2727
filename = os.path.join(*path)
28-
os.makedirs(os.path.dirname(filename), exist_ok=True)
28+
os.makedirs(os.path.dirname(filename), 0o700, exist_ok=True)
2929
return filename

apps/maxkb/settings/logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,4 @@
122122
SYSLOG_ENABLE = CONFIG.SYSLOG_ENABLE
123123

124124
if not os.path.isdir(LOG_DIR):
125-
os.makedirs(LOG_DIR, mode=0o755)
125+
os.makedirs(LOG_DIR, mode=0o700, exist_ok=True)

installer/start-maxkb.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
#!/bin/bash
22

3-
mkdir -p /opt/maxkb/logs
4-
mkdir -p /opt/maxkb/local
3+
if [ ! -d /opt/maxkb/logs ]; then
4+
mkdir -p /opt/maxkb/logs
5+
chmod 700 /opt/maxkb/logs
6+
fi
7+
if [ ! -d /opt/maxkb/local ]; then
8+
mkdir -p /opt/maxkb/local
9+
chmod 700 /opt/maxkb/local
10+
fi
511
mkdir -p /opt/maxkb/python-packages
612

713
rm -f /opt/maxkb-app/tmp/*.pid

installer/start-redis.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
#!/bin/bash
22

3-
mkdir -p /opt/maxkb/data/redis
3+
if [ ! -d /opt/maxkb/data/redis ]; then
4+
mkdir -p /opt/maxkb/data/redis
5+
chmod 700 /opt/maxkb/data/redis
6+
fi
47
mkdir -p /opt/maxkb/logs
58

69
if [ ! -f /opt/maxkb/conf/redis.conf ]; then
710
mkdir -p /opt/maxkb/conf
811
touch /opt/maxkb/conf/redis.conf
12+
chmod 700 /opt/maxkb/conf/redis.conf
913
cat <<EOF > /opt/maxkb/conf/redis.conf
1014
bind 0.0.0.0
1115
port 6379

0 commit comments

Comments
 (0)