mirror of
https://github.com/casjaysdevdocker/stikked
synced 2024-11-21 17:23:08 -05:00
🗃️ Committing everything that changed 🗃️
Dockerfile rootfs/tmp/etc/php-fpm/php-fpm.conf rootfs/tmp/etc/php-fpm/php-fpm.d/www.conf rootfs/tmp/etc/php/php.ini rootfs/usr/local/etc/docker/functions/entrypoint.sh
This commit is contained in:
parent
f7653a904e
commit
9acfd4f4aa
12
Dockerfile
12
Dockerfile
@ -24,7 +24,7 @@ ARG IMAGE_REPO="casjaysdevdocker/pastebin"
|
||||
ARG IMAGE_VERSION="latest"
|
||||
ARG CONTAINER_VERSION=""
|
||||
|
||||
ARG PULL_URL="casjaysdev/alpine"
|
||||
ARG PULL_URL="casjaysdevdocker/php8"
|
||||
ARG DISTRO_VERSION="${IMAGE_VERSION}"
|
||||
ARG BUILD_VERSION="${BUILD_DATE}"
|
||||
|
||||
@ -53,15 +53,7 @@ ARG PHP_VERSION
|
||||
ARG PHP_SERVER
|
||||
ARG SHELL_OPTS
|
||||
|
||||
ARG PACK_LIST="${PHP_VERSION}-bcmath ${PHP_VERSION}-bz2 ${PHP_VERSION}-calendar ${PHP_VERSION}-cgi ${PHP_VERSION}-common ${PHP_VERSION}-ctype ${PHP_VERSION}-curl ${PHP_VERSION}-dba ${PHP_VERSION}-dev \
|
||||
${PHP_VERSION}-doc ${PHP_VERSION}-dom ${PHP_VERSION}-embed ${PHP_VERSION}-enchant ${PHP_VERSION}-exif ${PHP_VERSION}-ffi ${PHP_VERSION}-fileinfo ${PHP_VERSION}-fpm ${PHP_VERSION}-ftp ${PHP_VERSION}-gd ${PHP_VERSION}-gettext \
|
||||
${PHP_VERSION}-gmp ${PHP_VERSION}-iconv ${PHP_VERSION}-imap ${PHP_VERSION}-intl ${PHP_VERSION}-ldap ${PHP_VERSION}-litespeed ${PHP_VERSION}-mbstring ${PHP_VERSION}-mysqli ${PHP_VERSION}-mysqlnd ${PHP_VERSION}-odbc ${PHP_VERSION}-opcache \
|
||||
${PHP_VERSION}-openssl ${PHP_VERSION}-pcntl ${PHP_VERSION}-pdo ${PHP_VERSION}-pdo_dblib ${PHP_VERSION}-pdo_mysql ${PHP_VERSION}-pdo_odbc ${PHP_VERSION}-pdo_pgsql ${PHP_VERSION}-pdo_sqlite ${PHP_VERSION}-pear ${PHP_VERSION}-pgsql ${PHP_VERSION}-phar\
|
||||
${PHP_VERSION}-phpdbg ${PHP_VERSION}-posix ${PHP_VERSION}-pspell ${PHP_VERSION}-session ${PHP_VERSION}-shmop ${PHP_VERSION}-simplexml ${PHP_VERSION}-snmp ${PHP_VERSION}-soap ${PHP_VERSION}-sockets ${PHP_VERSION}-sodium ${PHP_VERSION}-sqlite3 ${PHP_VERSION}-sysvmsg \
|
||||
${PHP_VERSION}-sysvsem ${PHP_VERSION}-sysvshm ${PHP_VERSION}-tidy ${PHP_VERSION}-tokenizer ${PHP_VERSION}-xml ${PHP_VERSION}-xmlreader ${PHP_VERSION}-xmlwriter ${PHP_VERSION}-xsl ${PHP_VERSION}-zip ${PHP_VERSION}-pecl-memcached ${PHP_VERSION}-pecl-mcrypt\
|
||||
${PHP_VERSION}-pecl-mongodb ${PHP_VERSION}-pecl-redis composer nginx nginx-mod-http-brotli nginx-mod-http-cache-purge nginx-mod-http-dav-ext nginx-mod-http-echo nginx-mod-http-encrypted-session nginx-mod-http-fancyindex nginx-mod-http-geoip nginx-mod-http-geoip2 \
|
||||
nginx-mod-http-headers-more nginx-mod-http-image-filter nginx-mod-http-js nginx-mod-http-lua nginx-mod-http-perl nginx-mod-http-redis2 nginx-mod-http-set-misc nginx-mod-http-shibboleth nginx-mod-http-untar nginx-mod-http-upload-progress \
|
||||
nginx-mod-http-upstream-fair nginx-mod-http-xslt-filter nginx-mod-http-zip"
|
||||
ARG PACK_LIST=""
|
||||
|
||||
ENV ENV=~/.profile
|
||||
ENV SHELL="/bin/sh"
|
||||
|
@ -1,7 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
pid = /run/php-fpm.pid
|
||||
error_log = REPLACE_LOG_DIR/error_log
|
||||
daemonize = yes
|
||||
|
||||
include=/etc/php-fpm/php-fpm.d/*.conf
|
@ -1,29 +0,0 @@
|
||||
[www]
|
||||
user = REPLACE_WWW_USER
|
||||
group = REPLACE_WWW_GROUP
|
||||
listen = 9000
|
||||
listen.backlog = 65535
|
||||
listen.allowed_clients = 127.0.0.1
|
||||
pm = ondemand
|
||||
pm.max_children = 50
|
||||
pm.start_servers = 5
|
||||
pm.min_spare_servers = 5
|
||||
pm.max_spare_servers = 35
|
||||
pm.status_path = /status
|
||||
ping.path = /ping
|
||||
ping.response = pong
|
||||
access.log = REPLACE_LOG_DIR/access_log
|
||||
access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
|
||||
slowlog = REPLACE_LOG_DIR/error_log
|
||||
clear_env = no
|
||||
env[HOSTNAME] = $HOSTNAME
|
||||
env[PATH] = /usr/local/bin:/usr/bin:/bin
|
||||
env[TMP] = /tmp
|
||||
env[TMPDIR] = /tmp
|
||||
env[TEMP] = /tmp
|
||||
php_flag[display_errors] = off
|
||||
php_admin_flag[log_errors] = on
|
||||
php_admin_value[post_max_size] = 4096M
|
||||
php_admin_value[upload_max_filesize] = 4096M
|
||||
php_admin_value[memory_limit] = 2048M
|
||||
php_admin_value[error_log] = REPLACE_LOG_DIR/error_log
|
@ -1,347 +0,0 @@
|
||||
[PHP]
|
||||
user_ini.filename = "php.ini"
|
||||
user_ini.filename = ".user.ini"
|
||||
user_ini.cache_ttl = 300
|
||||
engine = On
|
||||
short_open_tag = Off
|
||||
asp_tags = Off
|
||||
precision = 14
|
||||
output_buffering = 4096
|
||||
;output_handler =
|
||||
zlib.output_compression = Off
|
||||
;zlib.output_compression_level = -1
|
||||
;zlib.output_handler =
|
||||
implicit_flush = Off
|
||||
unserialize_callback_func =
|
||||
serialize_precision = 17
|
||||
;open_basedir =
|
||||
disable_functions =
|
||||
disable_classes =
|
||||
ignore_user_abort = On
|
||||
realpath_cache_size = 16k
|
||||
realpath_cache_ttl = 120
|
||||
zend.enable_gc = On
|
||||
zend.multibyte = Off
|
||||
zend.script_encoding =
|
||||
expose_php = Off
|
||||
max_execution_time = 3600
|
||||
max_input_time = 3600
|
||||
;max_input_nesting_level = 64
|
||||
; max_input_vars = 1000
|
||||
memory_limit = 10G
|
||||
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
|
||||
display_errors = On
|
||||
display_startup_errors = Off
|
||||
log_errors = On
|
||||
log_errors_max_len = 1024
|
||||
ignore_repeated_errors = Off
|
||||
ignore_repeated_source = Off
|
||||
report_memleaks = On
|
||||
;report_zend_debug = 0
|
||||
track_errors = Off
|
||||
;xmlrpc_errors = 0
|
||||
;xmlrpc_error_number = 0
|
||||
html_errors = On
|
||||
;docref_root = "/phpmanual/"
|
||||
;docref_ext = .html
|
||||
error_prepend_string = "<span style='color: #ff0000'>"
|
||||
error_append_string = "</span>"
|
||||
error_log = REPLACE_LOG_DIR/php.log
|
||||
;arg_separator.input = ";&"
|
||||
variables_order = "GPCS"
|
||||
request_order = "GP"
|
||||
register_argc_argv = Off
|
||||
auto_globals_jit = On
|
||||
;enable_post_data_reading = Off
|
||||
post_max_size = 10G
|
||||
auto_prepend_file =
|
||||
auto_append_file =
|
||||
default_mimetype = "text/html"
|
||||
default_charset = "UTF-8"
|
||||
;internal_encoding =
|
||||
;input_encoding =
|
||||
;output_encoding =
|
||||
always_populate_raw_post_data = -1
|
||||
doc_root =
|
||||
user_dir =
|
||||
enable_dl = Off
|
||||
cgi.force_redirect = 1
|
||||
;cgi.nph = 1
|
||||
cgi.redirect_status_env =
|
||||
cgi.fix_pathinfo = 1
|
||||
fastcgi.impersonate = 1
|
||||
fastcgi.logging = 1
|
||||
;cgi.rfc2616_headers = 0
|
||||
file_uploads = On
|
||||
upload_tmp_dir = REPLACE_TMP_DIR/uploads
|
||||
upload_max_filesize =10G
|
||||
max_file_uploads = 20
|
||||
allow_url_fopen = On
|
||||
allow_url_include = On
|
||||
;from="john@doe.com"
|
||||
;user_agent="PHP"
|
||||
default_socket_timeout = 60
|
||||
;auto_detect_line_endings = Off
|
||||
|
||||
[CLI Server]
|
||||
cli_server.color = On
|
||||
|
||||
[Date]
|
||||
date.timezone = REPLACE_TZ
|
||||
;date.default_latitude = 31.7667
|
||||
;date.default_longitude = 35.2333
|
||||
|
||||
[filter]
|
||||
;filter.default = unsafe_raw
|
||||
;filter.default_flags =
|
||||
|
||||
[iconv]
|
||||
;iconv.input_encoding =
|
||||
;iconv.internal_encoding =
|
||||
;iconv.output_encoding =
|
||||
|
||||
[intl]
|
||||
;intl.default_locale =
|
||||
;intl.error_level = E_WARNING
|
||||
|
||||
[sqlite]
|
||||
;sqlite.assoc_case = 0
|
||||
|
||||
[sqlite3]
|
||||
;sqlite3.extension_dir =
|
||||
|
||||
[Pcre]
|
||||
;pcre.backtrack_limit=100000
|
||||
;pcre.recursion_limit=100000
|
||||
|
||||
[Pdo]
|
||||
;pdo_odbc.connection_pooling=strict
|
||||
;pdo_odbc.db2_instance_name
|
||||
|
||||
[Pdo_mysql]
|
||||
pdo_mysql.cache_size = 2000
|
||||
pdo_mysql.default_socket=
|
||||
|
||||
[Phar]
|
||||
;phar.readonly = On
|
||||
;phar.require_hash = On
|
||||
;phar.cache_list =
|
||||
|
||||
[mail function]
|
||||
sendmail_path = -S localhost -t -i
|
||||
;sendmail_path = /usr/sbin/sendmail -t -i
|
||||
;mail.force_extra_parameters =
|
||||
mail.add_x_header = On
|
||||
;mail.log = syslog
|
||||
|
||||
[SQL]
|
||||
sql.safe_mode = Off
|
||||
|
||||
[ODBC]
|
||||
;odbc.default_db = Not yet implemented
|
||||
;odbc.default_user = Not yet implemented
|
||||
;odbc.default_pw = Not yet implemented
|
||||
;odbc.default_cursortype
|
||||
odbc.allow_persistent = On
|
||||
odbc.check_persistent = On
|
||||
odbc.max_persistent = -1
|
||||
odbc.max_links = -1
|
||||
odbc.defaultlrl = 4096
|
||||
odbc.defaultbinmode = 1
|
||||
;birdstep.max_links = -1
|
||||
|
||||
[Interbase]
|
||||
ibase.allow_persistent = 1
|
||||
ibase.max_persistent = -1
|
||||
ibase.max_links = -1
|
||||
;ibase.default_db =
|
||||
;ibase.default_user =
|
||||
;ibase.default_password =
|
||||
;ibase.default_charset =
|
||||
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
|
||||
ibase.dateformat = "%Y-%m-%d"
|
||||
ibase.timeformat = "%H:%M:%S"
|
||||
|
||||
[MySQL]
|
||||
mysql.allow_local_infile = On
|
||||
mysql.allow_persistent = On
|
||||
mysql.cache_size = 2000
|
||||
mysql.max_persistent = -1
|
||||
mysql.max_links = -1
|
||||
mysql.default_port =
|
||||
mysql.default_socket =
|
||||
mysql.default_host =
|
||||
mysql.default_user =
|
||||
mysql.default_password =
|
||||
mysql.connect_timeout = 60
|
||||
mysql.trace_mode = Off
|
||||
|
||||
[MySQLi]
|
||||
mysqli.max_persistent = -1
|
||||
mysqli.allow_local_infile = On
|
||||
mysqli.allow_persistent = On
|
||||
mysqli.max_links = -1
|
||||
mysqli.cache_size = 2000
|
||||
mysqli.default_port = 3306
|
||||
mysqli.default_socket =
|
||||
mysqli.default_host =
|
||||
mysqli.default_user =
|
||||
mysqli.default_pw =
|
||||
mysqli.reconnect = Off
|
||||
|
||||
[mysqlnd]
|
||||
mysqlnd.collect_statistics = On
|
||||
mysqlnd.collect_memory_statistics = Off
|
||||
;mysqlnd.net_cmd_buffer_size = 2048
|
||||
;mysqlnd.net_read_buffer_size = 32768
|
||||
|
||||
[OCI8]
|
||||
;oci8.privileged_connect = Off
|
||||
;oci8.max_persistent = -1
|
||||
;oci8.persistent_timeout = -1
|
||||
;oci8.ping_interval = 60
|
||||
;oci8.connection_class =
|
||||
;oci8.events = Off
|
||||
;oci8.statement_cache_size = 20
|
||||
;oci8.default_prefetch = 100
|
||||
;oci8.old_oci_close_semantics = Off
|
||||
|
||||
[PostgreSQL]
|
||||
pgsql.allow_persistent = On
|
||||
pgsql.auto_reset_persistent = Off
|
||||
pgsql.max_persistent = -1
|
||||
pgsql.max_links = -1
|
||||
pgsql.ignore_notice = 0
|
||||
pgsql.log_notice = 0
|
||||
|
||||
[Sybase-CT]
|
||||
sybct.allow_persistent = On
|
||||
sybct.max_persistent = -1
|
||||
sybct.max_links = -1
|
||||
sybct.min_server_severity = 10
|
||||
sybct.min_client_severity = 10
|
||||
;sybct.timeout=
|
||||
;sybct.packet_size
|
||||
;sybct.login_timeout=
|
||||
;sybct.hostname=
|
||||
;sybct.deadlock_retry_count=
|
||||
|
||||
[bcmath]
|
||||
bcmath.scale = 0
|
||||
|
||||
[browscap]
|
||||
;browscap = extra/browscap.ini
|
||||
|
||||
[Session]
|
||||
session.save_handler = files
|
||||
session.save_path = "REPLACE_TMP_DIR/seesions"
|
||||
session.use_strict_mode = 0
|
||||
session.use_cookies = 1
|
||||
;session.cookie_secure =
|
||||
session.use_only_cookies = 1
|
||||
session.name = PHP_REPLACE_RANDOM_ID
|
||||
session.auto_start = 0
|
||||
session.cookie_lifetime = 525600
|
||||
session.cookie_path = /
|
||||
session.cookie_domain =
|
||||
session.cookie_httponly =
|
||||
session.serialize_handler = php
|
||||
session.gc_probability = 1
|
||||
session.gc_divisor = 1000
|
||||
session.gc_maxlifetime = 525600
|
||||
session.referer_check =
|
||||
;session.entropy_length = 32
|
||||
;session.entropy_file = /dev/urandom
|
||||
session.cache_limiter = nocache
|
||||
session.cache_expire = 180
|
||||
session.use_trans_sid = 0
|
||||
session.hash_function = 0
|
||||
session.hash_bits_per_character = 5
|
||||
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
|
||||
session.upload_progress.enabled = On
|
||||
session.upload_progress.cleanup = On
|
||||
session.upload_progress.prefix = "upload_progress_"
|
||||
session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS"
|
||||
session.upload_progress.freq = "1%"
|
||||
session.upload_progress.min_freq = "1"
|
||||
|
||||
[MSSQL]
|
||||
mssql.allow_persistent = On
|
||||
mssql.max_persistent = -1
|
||||
mssql.max_links = -1
|
||||
mssql.min_error_severity = 10
|
||||
mssql.min_message_severity = 10
|
||||
mssql.compatibility_mode = Off
|
||||
;mssql.connect_timeout = 5
|
||||
;mssql.timeout = 60
|
||||
;mssql.textlimit = 4096
|
||||
;mssql.textsize = 4096
|
||||
;mssql.batchsize = 0
|
||||
;mssql.datetimeconvert = On
|
||||
mssql.secure_connection = Off
|
||||
;mssql.max_procs = -1
|
||||
;mssql.charset = "ISO-8859-1"
|
||||
|
||||
[Assertion]
|
||||
;assert.active = On
|
||||
;assert.warning = On
|
||||
;assert.bail = Off
|
||||
;assert.callback = 0
|
||||
;assert.quiet_eval = 0
|
||||
|
||||
[mbstring]
|
||||
;mbstring.language = Japanese
|
||||
;mbstring.internal_encoding =
|
||||
;mbstring.http_input =
|
||||
;mbstring.http_output =
|
||||
;mbstring.encoding_translation = Off
|
||||
;mbstring.detect_order = auto
|
||||
;mbstring.substitute_character = none
|
||||
;mbstring.func_overload = 0
|
||||
;mbstring.strict_detection = On
|
||||
;mbstring.http_output_conv_mimetype=
|
||||
|
||||
[gd]
|
||||
;gd.jpeg_ignore_warning = 0
|
||||
|
||||
[exif]
|
||||
;exif.encode_unicode = ISO-8859-15
|
||||
;exif.decode_unicode_motorola = UCS-2BE
|
||||
;exif.decode_unicode_intel = UCS-2LE
|
||||
;exif.encode_jis =
|
||||
;exif.decode_jis_motorola = JIS
|
||||
;exif.decode_jis_intel = JIS
|
||||
|
||||
[Tidy]
|
||||
;tidy.default_config = /usr/local/lib/php/default.tcfg
|
||||
tidy.clean_output = Off
|
||||
|
||||
[soap]
|
||||
soap.wsdl_cache_enabled=1
|
||||
soap.wsdl_cache_dir="REPLACE_TMP_DIR/cache"
|
||||
soap.wsdl_cache_ttl=86400
|
||||
soap.wsdl_cache_limit = 5
|
||||
|
||||
[sysvshm]
|
||||
;sysvshm.init_mem = 10000
|
||||
|
||||
[ldap]
|
||||
ldap.max_links = -1
|
||||
|
||||
[mcrypt]
|
||||
;mcrypt.algorithms_dir=
|
||||
;mcrypt.modes_dir=
|
||||
|
||||
[dba]
|
||||
;dba.default_handler=
|
||||
|
||||
[curl]
|
||||
;curl.cainfo =
|
||||
|
||||
[openssl]
|
||||
;openssl.cafile=
|
||||
;openssl.capath=
|
||||
|
||||
; Local Variables:
|
||||
; tab-width: 4
|
||||
; End:
|
@ -190,8 +190,21 @@ __certbot() {
|
||||
return $statusCode
|
||||
}
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
__display_user_info() {
|
||||
if [ -n "$user_name" ] || [ -n "$user_pass" ] || [ -n "$root_user_name" ] || [ -n "$root_user_pass" ]; then
|
||||
__banner "User info"
|
||||
[ -n "$user_name" ] && __printf_space "40" "username:" "$user_name" && echo "$user_name"
|
||||
[ -n "$user_pass" ] && __printf_space "40" "password:" "saved to ${USER_FILE_PREFIX}/${SERVICE_NAME}_pass" && echo "$user_pass"
|
||||
[ -n "$root_user_name" ] && __printf_space "40" "root username:" "$root_user_name" && echo "$root_user_name"
|
||||
[ -n "$root_user_pass" ] && __printf_space "40" "root password:" "saved to ${ROOT_FILE_PREFIX}/${SERVICE_NAME}_pass" && echo "$root_user_pass"
|
||||
__banner ""
|
||||
fi
|
||||
}
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
__init_config_etc() {
|
||||
if __is_dir_empty "$CONF_DIR" || [ ! -d "$CONF_DIR" ]; then
|
||||
local COPY="no"
|
||||
__is_dir_empty "$CONF_DIR" && COPY=yes
|
||||
if [ ! -d "$CONF_DIR" ] || [ "$COPY" = "yes" ]; then
|
||||
if [ -d "$ETC_DIR" ]; then
|
||||
mkdir -p "$CONF_DIR"
|
||||
__copy_templates "$ETC_DIR/." "$CONF_DIR/"
|
||||
@ -404,25 +417,25 @@ __setup_directories() {
|
||||
if [ "$IS_WEB_SERVER" = "yes" ]; then
|
||||
APPLICATION_DIRS="$APPLICATION_DIRS $WWW_ROOT_DIR"
|
||||
__initialize_www_root
|
||||
(echo "Creating directory $WWW_ROOT_DIR with permissions 755" && mkdir -p "$WWW_ROOT_DIR" && find "$WWW_ROOT_DIR" -type d -exec chmod -f 755 {} \;) 2>/dev/stderr | tee -p -a "$LOG_DIR/init.txt"
|
||||
(echo "Creating directory $WWW_ROOT_DIR with permissions 777" && mkdir -p "$WWW_ROOT_DIR" && find "$WWW_ROOT_DIR" -type d -exec chmod -f 777 {} \;) 2>/dev/stderr | tee -p -a "/data/logs/init.txt"
|
||||
fi
|
||||
# Setup DATABASE_DIR
|
||||
if [ "$IS_DATABASE_SERVICE" = "yes" ] || [ "$USES_DATABASE_SERVICE" = "yes" ]; then
|
||||
APPLICATION_DIRS="$APPLICATION_DIRS $DATABASE_DIR"
|
||||
if __is_dir_empty "$DATABASE_DIR" || [ ! -d "$DATABASE_DIR" ]; then
|
||||
(echo "Creating directory $DATABASE_DIR with permissions 777" && mkdir -p "$DATABASE_DIR" && chmod -f 777 "$DATABASE_DIR") 2>/dev/stderr | tee -p -a "$LOG_DIR/init.txt"
|
||||
(echo "Creating directory $DATABASE_DIR with permissions 777" && mkdir -p "$DATABASE_DIR" && chmod -f 777 "$DATABASE_DIR") 2>/dev/stderr | tee -p -a "/data/logs/init.txt"
|
||||
fi
|
||||
fi
|
||||
# create default directories
|
||||
for filedirs in $ADD_APPLICATION_DIRS $APPLICATION_DIRS; do
|
||||
if [ -n "$filedirs" ] && [ ! -d "$filedirs" ]; then
|
||||
(echo "Creating directory $filedirs with permissions 777" && mkdir -p "$filedirs" && chmod -f 777 "$filedirs") 2>/dev/stderr | tee -p -a "$LOG_DIR/init.txt"
|
||||
(echo "Creating directory $filedirs with permissions 777" && mkdir -p "$filedirs" && chmod -f 777 "$filedirs") 2>/dev/stderr | tee -p -a "/data/logs/init.txt"
|
||||
fi
|
||||
done
|
||||
# create default files
|
||||
for application_files in $ADD_APPLICATION_FILES $APPLICATION_FILES; do
|
||||
if [ -n "$application_files" ] && [ ! -e "$application_files" ]; then
|
||||
(echo "Creating file $application_files with permissions 777" && touch "$application_files" && chmod -Rf 777 "$application_files") 2>/dev/stderr | tee -p -a "$LOG_DIR/init.txt"
|
||||
(echo "Creating file $application_files with permissions 777" && touch "$application_files" && chmod -Rf 777 "$application_files") 2>/dev/stderr | tee -p -a "/data/logs/init.txt"
|
||||
fi
|
||||
done
|
||||
}
|
||||
@ -432,20 +445,20 @@ __fix_permissions() {
|
||||
change_user="${1:-${SERVICE_USER:-root}}"
|
||||
change_group="${2:-${SERVICE_GROUP:-$change_user}}"
|
||||
[ -n "$RUNAS_USER" ] && [ "$RUNAS_USER" != "root" ] && change_user="$RUNAS_USER" && change_group="$change_user"
|
||||
if [ -n "$change_user" ] && [ "$change_user" != "root" ]; then
|
||||
if [ -n "$change_user" ]; then
|
||||
if grep -sq "^$change_user:" "/etc/passwd"; then
|
||||
for permissions in $ADD_APPLICATION_DIRS $APPLICATION_DIRS; do
|
||||
if [ -n "$permissions" ] && [ -e "$permissions" ]; then
|
||||
(chown -Rf $change_user:$change_group "$permissions" && echo "changed ownership on $permissions to user:$change_user and group:$change_group") 2>/dev/stderr | tee -p -a "$LOG_DIR/init.txt"
|
||||
(chown -Rf $change_user "$permissions" && echo "changed ownership on $permissions to user:$change_user") 2>/dev/stderr | tee -p -a "/data/logs/init.txt"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
if [ -n "$change_group" ] && [ "$change_group" != "root" ]; then
|
||||
if [ -n "$change_group" ]; then
|
||||
if grep -sq "^$change_group:" "/etc/group"; then
|
||||
for permissions in $ADD_APPLICATION_DIRS $APPLICATION_DIRS; do
|
||||
if [ -n "$permissions" ] && [ -e "$permissions" ]; then
|
||||
(chgrp -Rf $change_group "$permissions" && echo "changed group ownership on $permissions to group $change_group") 2>/dev/stderr | tee -p -a "$LOG_DIR/init.txt"
|
||||
(chgrp -Rf $change_group "$permissions" && echo "changed group ownership on $permissions to group $change_group") 2>/dev/stderr | tee -p -a "/data/logs/init.txt"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@ -486,10 +499,10 @@ __set_user_group_id() {
|
||||
[ -n "$set_user" ] && [ "$set_user" != "root" ] || return
|
||||
if grep -sq "^$set_user:" "/etc/passwd" "/etc/group"; then
|
||||
if __check_for_guid "$set_gid"; then
|
||||
groupmod -g "${set_gid}" $set_user 2>/dev/stderr | tee -p -a "$LOG_DIR/init.txt" >/dev/null && chown -Rf ":$set_gid"
|
||||
groupmod -g "${set_gid}" $set_user 2>/dev/stderr | tee -p -a "/data/logs/init.txt" >/dev/null && chown -Rf ":$set_gid"
|
||||
fi
|
||||
if __check_for_uid "$set_uid"; then
|
||||
usermod -u "${set_uid}" -g "${set_gid}" $set_user 2>/dev/stderr | tee -p -a "$LOG_DIR/init.txt" >/dev/null && chown -Rf $set_uid:$set_gid
|
||||
usermod -u "${set_uid}" -g "${set_gid}" $set_user 2>/dev/stderr | tee -p -a "/data/logs/init.txt" >/dev/null && chown -Rf $set_uid:$set_gid
|
||||
fi
|
||||
fi
|
||||
export SERVICE_UID="$set_uid"
|
||||
@ -527,11 +540,11 @@ __create_service_user() {
|
||||
done
|
||||
if ! __check_for_group "$create_group"; then
|
||||
echo "creating system group $create_group"
|
||||
groupadd --force --system -g $create_gid $create_group 2>/dev/stderr | tee -p -a "$LOG_DIR/init.txt" >/dev/null
|
||||
groupadd --force --system -g $create_gid $create_group 2>/dev/stderr | tee -p -a "/data/logs/init.txt" >/dev/null
|
||||
fi
|
||||
if ! __check_for_user "$create_user"; then
|
||||
echo "creating system user $create_user"
|
||||
useradd --system -u $create_uid -g $create_group -c "Account for $create_user" -d "$create_home_dir" -s /bin/false $create_user 2>/dev/stderr | tee -p -a "$LOG_DIR/init.txt" >/dev/null
|
||||
useradd --system -u $create_uid -g $create_group -c "Account for $create_user" -d "$create_home_dir" -s /bin/false $create_user 2>/dev/stderr | tee -p -a "/data/logs/init.txt" >/dev/null
|
||||
fi
|
||||
grep -qs "$create_group" "/etc/group" || exitStatus=$((exitCode + 1))
|
||||
grep -qs "$create_user" "/etc/passwd" || exitStatus=$((exitCode + 1))
|
||||
@ -572,7 +585,7 @@ __exec_command() {
|
||||
local cmdExec="${arg:-}"
|
||||
local pre_exec="--login -c"
|
||||
local shell="$(type -P bash 2>/dev/null || type -P sh 2>/dev/null)"
|
||||
bin="$(echo "${arg[@]}" | tr ' ' '\n' | grep -v '^$' | head -n1 || echo 'false')"
|
||||
bin="$(echo "${arg[@]}" | tr ' ' '\n' | grep -v '^$' | head -n1 || echo 'bash')"
|
||||
prog="$(type -P "$bin" 2>/dev/null || echo "$bin")"
|
||||
if [ -f "$prog" ] && [ -x "$prog" ]; then
|
||||
echo "${exec_message:-Executing command: $cmdExec}"
|
||||
@ -834,7 +847,9 @@ __initialize_db_users() {
|
||||
db_normal_pass="${DATABASE_PASS_NORMAL:-$user_pass}"
|
||||
db_admin_user="${DATABASE_USER_ROOT:-$root_user_name}"
|
||||
db_admin_pass="${DATABASE_PASS_ROOT:-$root_user_pass}"
|
||||
export user_name="$db_normal_user" user_pass="$db_normal_pass" root_user_name="$db_admin_user" root_user_pass="$db_admin_pass"
|
||||
export DATABASE_USER="$db_normal_user" DATABASE_PASSWORD="$db_normal_pass"
|
||||
export DATABASE_ROOT_USER="$db_admin_user" DATABASE_ROOT_PASSWORD="$db_admin_pass"
|
||||
export db_normal_user db_normal_pass db_admin_user db_admin_pass
|
||||
}
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
__initialize_system_etc() {
|
||||
|
Loading…
Reference in New Issue
Block a user