2023-11-29 10:58:11 +01:00
|
|
|
#=================================================
|
|
|
|
# SET ALL CONSTANTS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
systemd_match_start_line='Starting new Web server: tcp:127.0.0.1:'
|
|
|
|
ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
|
2018-02-25 21:45:24 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DEFINE ALL COMMON FONCTIONS
|
|
|
|
#=================================================
|
|
|
|
|
2023-11-29 10:58:11 +01:00
|
|
|
_set_permissions() {
|
|
|
|
chown -R "$app:$app" "$install_dir"
|
|
|
|
chmod -R u=rwX,g=rX,o= "$install_dir"
|
|
|
|
chmod +x "$install_dir/gitea"
|
2023-09-09 11:17:52 +02:00
|
|
|
|
|
|
|
chown -R "$app:$app" "$data_dir"
|
2024-02-07 12:08:03 +01:00
|
|
|
find $data_dir \( \! -perm -o= \
|
2023-12-18 14:35:06 +01:00
|
|
|
-o \! -user $app \
|
|
|
|
-o \! -group $app \) \
|
|
|
|
-exec chown $app:$app {} \; \
|
2023-11-29 10:58:11 +01:00
|
|
|
-exec chmod u=rwX,g=rX,o= {} \;
|
|
|
|
chmod -R u=rwX,g=,o= "$data_dir/.ssh"
|
2023-09-09 11:17:52 +02:00
|
|
|
|
|
|
|
chown -R "$app:$app" "/var/log/$app"
|
|
|
|
chmod -R u=rwX,g=rX,o= "/var/log/$app"
|
2018-02-25 21:45:24 +01:00
|
|
|
}
|