avmtrf1-tools 0.22.0 → 0.22.1

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: d8bccc6c4cb6523d0317726266275394779bc7197c48816818e481f6220179c4
4
- data.tar.gz: 63d1a3ee1390c28b63754fdd843d7c7a16d08a51892aaac5f475db7d29db0f46
3
+ metadata.gz: d14dbd6b203b4738683acb98348b9685d46731756d5ceb8aa10734ae1b5ccced
4
+ data.tar.gz: 004cc12cfcec52e57ce9775fd2daf2ff6947ce499f22e4dfb4a59cc58d3355a5
5
5
  SHA512:
6
- metadata.gz: 64f9b323848fc332198cd8d137c65ee63d521a6a52029739863abe9b9b47d8f0c4ebe5a8a84faf05e2ee82df691cd6a63f248ceaf9f03e3d6b6e2b42fb4f3078
7
- data.tar.gz: 547c3c71463934abdc0a6df478d31c7257e00b1cd6e4602b1b16f42f969928748de21ecc8f6c04a0986a66b74e56abdcd9c5c122434f62d822c35788ab4ce63d
6
+ metadata.gz: 5260afb111628922cab5cdc69ba48c436152b0703b4e9411468782ec8dfd9b3ae86cd1ba53323d6560e40119d0a7cfcce267a1342192402bca837829a1566aee
7
+ data.tar.gz: ea4788f19b07be09d665327ec2dc934d93bd8db281489edfd632ef3b3c6b0c85adba8293713b9a09e1ee72abaabe8d09dcbfee6f3cbb81f842ccd521230cb11b
@@ -32,7 +32,7 @@ module Avmtrf1
32
32
  if content_hash?(data)
33
33
  sanitize_data(data.fetch('content'))
34
34
  else
35
- data.map { |k, v| [k, sanitize_data(v)] }.to_h
35
+ data.transform_values { |v| sanitize_data(v) }
36
36
  end
37
37
  end
38
38
 
@@ -9,7 +9,7 @@ module Avmtrf1
9
9
 
10
10
  lists.add_string :type, :success, :error, :neutral
11
11
 
12
- lists.type.values.each do |type|
12
+ lists.type.values.each do |type| # rubocop:disable Style/HashEachMethods
13
13
  class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
14
14
  def self.#{type}(output)
15
15
  new(TYPE_#{type.upcase}, output)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avmtrf1
4
4
  module Tools
5
- VERSION = '0.22.0'
5
+ VERSION = '0.22.1'
6
6
  end
7
7
  end
@@ -12,5 +12,23 @@ done
12
12
  DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
13
13
  source "$DIR/init.sh"
14
14
 
15
- infom "Alterando ID do usuário Apache..."
16
- usermod -u "$APACHE_USER_ID" "$APACHE_USER_NAME"
15
+ if user_exist_by_id "$APACHE_USER_ID"; then
16
+ infom "ID de usuário \"$APACHE_USER_ID\" já existe"
17
+ elif user_exist_by_name "$APACHE_USER_NAME"; then
18
+ infom "Alterando ID do usuário \"$APACHE_USER_NAME\"..."
19
+ usermod --uid "$APACHE_USER_ID" "$APACHE_USER_NAME"
20
+ else
21
+ infom "Criando usuário \"$APACHE_USER_NAME\"..."
22
+ useradd --uid "$APACHE_USER_ID" "$APACHE_USER_NAME"
23
+ fi
24
+
25
+ if [[ "$APACHE_USER_ID" == '0' ]]; then
26
+ infom "\$APACHE_USER_ID é 0 (root). Apache executará com usuário padrão (Nenhuma alteração)"
27
+ else
28
+ infom "Configurando usuário/grupo de execução do Apache..."
29
+ export APACHE_RUN_USER="$(id -nu "$APACHE_USER_ID")"
30
+ export APACHE_RUN_GROUP="$(id -ng "$APACHE_RUN_USER")"
31
+ infov "Execução do Apache"
32
+ infov ' * $APACHE_RUN_USER' "$APACHE_RUN_USER (ID: $APACHE_USER_ID)"
33
+ infov ' * $APACHE_RUN_GROUP' "$APACHE_RUN_GROUP (ID: $(id -g "$APACHE_RUN_USER"))"
34
+ fi
@@ -12,7 +12,7 @@ export AUX_ROOT="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
12
12
  source "$AUX_ROOT/lib.sh"
13
13
 
14
14
  # Nome do usuário Apache
15
- export APACHE_USER_NAME='www-data'
15
+ export APACHE_USER_NAME='apache_app_user'
16
16
 
17
17
  # Diretório de templates
18
18
  export TEMPLATES_ROOT="$AUX_ROOT/templates"
@@ -50,3 +50,11 @@ function text_set() {
50
50
  fi
51
51
  export $VARIABLE_NAME="$RESULT"
52
52
  }
53
+
54
+ function user_exist_by_id() {
55
+ getent passwd "$1" > /dev/null
56
+ }
57
+
58
+ function user_exist_by_name() {
59
+ id -u "$1" > /dev/null
60
+ }
@@ -13,12 +13,12 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
13
13
  source "$DIR/init.sh"
14
14
 
15
15
  "$AUX_ROOT/config_banner.sh"
16
- "$AUX_ROOT/apache_user.sh"
17
16
  "$AUX_ROOT/setup_apache_site.sh"
18
17
  "$AUX_ROOT/php_values.sh"
19
18
  "$AUX_ROOT/pear.sh"
20
19
  "$AUX_ROOT/php_composer.sh"
21
20
  "$AUX_ROOT/laravel.sh"
21
+ source "$AUX_ROOT/apache_user.sh"
22
22
  if bool_r "$RUN_APACHE"; then
23
23
  "$AUX_ROOT/apache_foreground.sh"
24
24
  else
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.22.0
4
+ version: 0.22.1
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: 2020-03-10 00:00:00.000000000 Z
11
+ date: 2020-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -188,28 +188,28 @@ dependencies:
188
188
  requirements:
189
189
  - - "~>"
190
190
  - !ruby/object:Gem::Version
191
- version: 0.79.0
191
+ version: 0.80.1
192
192
  type: :development
193
193
  prerelease: false
194
194
  version_requirements: !ruby/object:Gem::Requirement
195
195
  requirements:
196
196
  - - "~>"
197
197
  - !ruby/object:Gem::Version
198
- version: 0.79.0
198
+ version: 0.80.1
199
199
  - !ruby/object:Gem::Dependency
200
200
  name: rubocop-rspec
201
201
  requirement: !ruby/object:Gem::Requirement
202
202
  requirements:
203
203
  - - "~>"
204
204
  - !ruby/object:Gem::Version
205
- version: 1.37.1
205
+ version: 1.38.1
206
206
  type: :development
207
207
  prerelease: false
208
208
  version_requirements: !ruby/object:Gem::Requirement
209
209
  requirements:
210
210
  - - "~>"
211
211
  - !ruby/object:Gem::Version
212
- version: 1.37.1
212
+ version: 1.38.1
213
213
  - !ruby/object:Gem::Dependency
214
214
  name: ruby-oci8
215
215
  requirement: !ruby/object:Gem::Requirement