From 0a69b0714a483bf816a2e7bd1fee517f69aaa3a6 Mon Sep 17 00:00:00 2001 From: filesite Date: Sat, 5 Nov 2022 23:41:21 +0800 Subject: [PATCH] docker script update to support zh_CN.UTF-8 --- Dockerfile_samba | 9 +++++++-- bin/install.sh | 9 ++++++++- conf/smb.conf | 10 ++++++++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Dockerfile_samba b/Dockerfile_samba index 0efd659..7c047f7 100644 --- a/Dockerfile_samba +++ b/Dockerfile_samba @@ -38,10 +38,15 @@ RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n && chgrp apache /var/www/sambashare/ \ && useradd -M -d /var/www/sambashare/filesite -s /usr/sbin/nologin -G apache filesite \ && chown -R filesite:apache /var/www/sambashare/filesite \ - && chmod -R 770 /var/www/sambashare/filesite \ + && chmod -R 775 /var/www/sambashare/filesite \ && rm -f /etc/samba/smb.conf && cp /var/www/machete/conf/smb.conf /etc/samba/ \ && /var/www/machete/bin/smbpwd.sh filesite 88888888 \ - && ln -s /var/www/machete/bin/smbpwd.sh /usr/bin/smbpwd + && ln -s /var/www/machete/bin/smbpwd.sh /usr/bin/smbpwd \ + && yum -y install kde-l10n-Chinese \ + && yum -y reinstall glibc-common \ + && localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 \ + && echo 'LANG="zh_CN.UTF-8"' >> /etc/locale.conf \ + && echo 'export LC_ALL="zh_CN.UTF-8"' >> ~/.bashrc EXPOSE 80/tcp EXPOSE 445/tcp diff --git a/bin/install.sh b/bin/install.sh index 0a502e3..7dd58c8 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -22,6 +22,13 @@ rpm -ql php82-php-fpm-8.2.0~rc5-18.el7.remi cd /etc/opt/remi/php82/ sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 10M/g' php.ini +## zh_CN support +yum -y install kde-l10n-Chinese +yum -y reinstall glibc-common +localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 +echo 'LANG="zh_CN.UTF-8"' >> /etc/locale.conf +echo 'export LC_ALL="zh_CN.UTF-8"' >> ~/.bashrc + ## start php-fpm in background #php-fpm -D @@ -48,7 +55,7 @@ sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 10M/g' php.ini #chgrp apache /var/www/sambashare/ #useradd -M -d /var/www/sambashare/filesite -s /usr/sbin/nologin -G apache filesite #chown -R filesite:apache /var/www/sambashare/filesite -#chmod -R 770 /var/www/sambashare/filesite +#chmod -R 775 /var/www/sambashare/filesite #smbpasswd -a filesite #smbpasswd -e filesite diff --git a/conf/smb.conf b/conf/smb.conf index 9533263..20211c8 100644 --- a/conf/smb.conf +++ b/conf/smb.conf @@ -1,7 +1,13 @@ +[global] + dos charset = cp866 + unix charset = UTF8 + display charset = UTF8 + [machete] path = /var/www/sambashare/filesite browseable = yes read only = no - force create mode = 0660 - force directory mode = 0777 + force create mode = 0665 + force directory mode = 0775 + force group = apache valid users = filesite @sambashare