avmtrf1-tools 0.38.1 → 0.38.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c87f809a9926218291f4b57af7047d55ca4c612d1dcc034d01775f83d32af80
4
- data.tar.gz: 3484e235b30f179892ad90db5ad2e82da61c457059cf3945004ce7a56cca62c2
3
+ metadata.gz: 037a6ec540a874c12392621c8b3f464d5361d98249b1e9119e8332b061de26ab
4
+ data.tar.gz: b620adfa7a3c73c3624f3333baf0964d4953c8be195d9b7e92a06c6ff0c1c0a9
5
5
  SHA512:
6
- metadata.gz: 1eac41804ec158176af21b06ca3ae8e09941b7e402059eb94038bac2a14f235d8a574b23a01366c82767c6fb1d099022917bc8fcbb51ad4b8db0b9eb88763266
7
- data.tar.gz: 5b14500f85e8b0c8c026b28b37fcd9fc3ba9c3f8e1764a15f69f493134bb8ee1654026fb46b293fccb380bab3c448d5a457af58550d68044c3fc69ef1ad26557
6
+ metadata.gz: 3aa77327c882bf6f591e7cdfed791e226bca9789207ae8bb24040a9d5a959723349f933d1759e02bee96853a900ee282cd0b7199d2ac2c57e732b21a17a4e07b
7
+ data.tar.gz: e4574401f796466b176217b928b6e346f3d19119ba57c03bd98c5c78513c31e4ec58b52ef409202255c82adee9d98e7ca6dad4a2df017cbd07c0c30e3fbf7f3d
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avmtrf1
4
4
  module Tools
5
- VERSION = '0.38.1'
5
+ VERSION = '0.38.2'
6
6
  end
7
7
  end
@@ -39,6 +39,9 @@ RUN docker-php-ext-install ldap
39
39
  RUN apt-get install -y libmcrypt-dev
40
40
  %%MCRYPT_INSTALL%%
41
41
 
42
+ # Extensão PHP "pcntl"
43
+ RUN docker-php-ext-install pcntl
44
+
42
45
  # Extensão PHP "snmp"
43
46
  RUN apt-get install -y libsnmp-dev snmp
44
47
  RUN docker-php-ext-install snmp
@@ -12,23 +12,43 @@ done
12
12
  DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
13
13
  source "$DIR/init.sh"
14
14
 
15
- if user_exist_by_id "$APP_USER_ID"; then
16
- infom "ID de usuário \"$APP_USER_ID\" existe"
17
- elif user_exist_by_name "$APACHE_USER_NAME"; then
18
- infom "Alterando ID do usuário \"$APACHE_USER_NAME\"..."
19
- usermod --uid "$APP_USER_ID" "$APACHE_USER_NAME"
20
- else
21
- infom "Criando usuário \"$APACHE_USER_NAME\"..."
22
- useradd --uid "$APP_USER_ID" "$APACHE_USER_NAME"
23
- fi
15
+ function apache_user_home() {
16
+ getent passwd "$APP_USER_ID" | cut '-d:' '-f6'
17
+ }
24
18
 
25
- if [[ "$APP_USER_ID" == '0' ]]; then
26
- infom "\$APP_USER_ID é 0 (root). Apache executará com usuário padrão (Nenhuma alteração)"
27
- else
19
+ function assert_apache_user() {
20
+ if user_exist_by_id "$APP_USER_ID"; then
21
+ infom "ID de usuário \"$APP_USER_ID\" já existe"
22
+ elif user_exist_by_name "$APACHE_USER_NAME"; then
23
+ infom "Alterando ID do usuário \"$APACHE_USER_NAME\"..."
24
+ usermod --uid "$APP_USER_ID" "$APACHE_USER_NAME"
25
+ else
26
+ infom "Criando usuário \"$APACHE_USER_NAME\"..."
27
+ useradd --uid "$APP_USER_ID" "$APACHE_USER_NAME"
28
+ fi
29
+ }
30
+
31
+
32
+ function assert_apache_user_home() {
33
+ infom 'Assegurando diretório de usuário...'
34
+ mkdir -p "$(apache_user_home)"
35
+ chown --recursive "${APP_USER_ID}:$(id -g "$APP_USER_ID")" "$(apache_user_home)"
36
+ }
37
+
38
+ function setup_apache_user_envvars() {
28
39
  infom "Configurando usuário/grupo de execução do Apache..."
29
40
  export APACHE_RUN_USER="$(id -nu "$APP_USER_ID")"
30
41
  export APACHE_RUN_GROUP="$(id -ng "$APACHE_RUN_USER")"
31
42
  infov "Execução do Apache"
32
43
  infov ' * $APACHE_RUN_USER' "$APACHE_RUN_USER (ID: $APP_USER_ID)"
33
44
  infov ' * $APACHE_RUN_GROUP' "$APACHE_RUN_GROUP (ID: $(id -g "$APACHE_RUN_USER"))"
45
+ }
46
+
47
+ assert_apache_user
48
+
49
+ if [[ "$APP_USER_ID" == '0' ]]; then
50
+ infom "\$APP_USER_ID é 0 (root). Apache executará com usuário padrão (Nenhuma alteração)"
51
+ else
52
+ assert_apache_user_home
53
+ setup_apache_user_envvars
34
54
  fi
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avmtrf1-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.38.1
4
+ version: 0.38.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo H. Bogoni
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-20 00:00:00.000000000 Z
11
+ date: 2022-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-selenium