avmtrf1-tools 0.18.1 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b60215acd55ddb829cd6715af567e261ed1364e77e8ace899df4172b6b363b5e
4
- data.tar.gz: 524c6908f81566907043f828324832e8a1c9d5327181e2e1658f46ef8336b208
3
+ metadata.gz: a424e7a0b85bf3eee88a0d7bc0f9b4284bc084a39f80aa706f199bf5d1abbbc5
4
+ data.tar.gz: 57418723c9b566b56c578bd83d074ba2e284e1da6069a1f2f75470eac07625a2
5
5
  SHA512:
6
- metadata.gz: 5516996e7a05dcfdfe75ffb5de4730760289b4ceefd3a90e1a0e9e0942a28fdb7597b8ffb7a1eeb8ba9c4510142ee7e9baf7e9ad9ad3bf2b68e891b0f30dcbfd
7
- data.tar.gz: a24a139da54faf8d647099fbc6708a0576bda4ee8c6fae741e89ab1db14413e9f159f6c99fca80213d4f481b7dd2fb1260be23a2e71e6477cd3978663bda4298
6
+ metadata.gz: 2732822fdb099ce76ef2f06325aa0199a4044ba509b1bb6569ab7f288620236970472308a269df12c035bc449a85472c87abb5d899beace8aecd3a7a385e9778
7
+ data.tar.gz: 10dea2abd45d22dc1e9697b5a578c542822389e6d8c0086c225c04a706d3f5b0192fb27c933e2a8edcd021a2165deead6d6208e9ebd3c059eb931e38d6c1d9b9
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avmtrf1
4
4
  module Tools
5
- VERSION = '0.18.1'
5
+ VERSION = '0.19.0'
6
6
  end
7
7
  end
@@ -91,7 +91,7 @@ RUN curl -sS https://getcomposer.org/installer | \
91
91
  # Inicializador
92
92
  RUN mkdir '/aux'
93
93
  RUN mkdir '/aux/eac-bash-lib'
94
- RUN wget -qO- https://github.com/esquilo-azul/eac-bash-lib/archive/cb31a3db2e3a6e356bcd0346b7a7b6ebb7d97d36.tar.gz \
94
+ RUN wget -qO- https://github.com/esquilo-azul/eac-bash-lib/archive/v0.6.1.tar.gz \
95
95
  | tar -xzf - --strip-components 1 -C '/aux/eac-bash-lib'
96
96
  ADD aux '/aux'
97
97
  CMD '/aux/start.sh'
@@ -0,0 +1,16 @@
1
+ #!/bin/bash
2
+
3
+ set -u
4
+ set -e
5
+
6
+ SOURCE="${BASH_SOURCE[0]}"
7
+ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
8
+ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
9
+ SOURCE="$(readlink "$SOURCE")"
10
+ [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
11
+ done
12
+ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
13
+ source "$DIR/init.sh"
14
+
15
+ infom "Alterando ID do usuário Apache..."
16
+ usermod -u "$APACHE_USER_ID" "$APACHE_USER_NAME"
@@ -16,4 +16,5 @@ infov 'Application root path ($APP_ROOT)' "$APP_ROOT"
16
16
  infov "Apache\'s document root (\$DOCUMENT_ROOT)" "$DOCUMENT_ROOT"
17
17
  infov 'PHP Composer directories ($COMPOSER_PATH)' "$COMPOSER_PATH"
18
18
  infov 'Laravel directories ($LARAVEL_PATH)' "$LARAVEL_PATH"
19
+ infov 'Apache user ID' "$APACHE_USER_ID"
19
20
  infov 'Run Apache? ($RUN_APACHE)' "$RUN_APACHE"
@@ -11,20 +11,12 @@ export AUX_ROOT="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
11
11
 
12
12
  source "$AUX_ROOT/lib.sh"
13
13
 
14
+ # Nome do usuário Apache
15
+ export APACHE_USER_NAME='www-data'
16
+
14
17
  # Diretório de templates
15
18
  export TEMPLATES_ROOT="$AUX_ROOT/templates"
16
19
 
17
- function text_set() {
18
- VARIABLE_NAME="$1"
19
- DEFAULT_VALUE="$2"
20
-
21
- RESULT="$DEFAULT_VALUE"
22
- if var_present_r "$VARIABLE_NAME"; then
23
- RESULT="${!VARIABLE_NAME}"
24
- fi
25
- export $VARIABLE_NAME="$RESULT"
26
- }
27
-
28
20
  # Caminho raiz da aplicação
29
21
  path_set 'APP_ROOT' '/' '/app'
30
22
 
@@ -42,3 +34,6 @@ text_set 'PEAR_PACKAGES' ''
42
34
 
43
35
  # Execução do Apache
44
36
  bool_set 'RUN_APACHE' true
37
+
38
+ # ID do usuário Apache
39
+ text_set 'APACHE_USER_ID' "$(stat -c '%g' "$APP_ROOT")"
@@ -3,10 +3,6 @@ set -e
3
3
 
4
4
  source "$AUX_ROOT/eac-bash-lib/init.sh"
5
5
 
6
- function var_present_r() {
7
- [[ -v "$1" ]] && [[ -n "${!1}" ]]
8
- }
9
-
10
6
  function bool_set() {
11
7
  VARIABLE_NAME="$1"
12
8
  DEFAULT_VALUE="$2"
@@ -43,3 +39,14 @@ function path_set() {
43
39
  fi
44
40
  export $VARIABLE_NAME="$RESULT"
45
41
  }
42
+
43
+ function text_set() {
44
+ VARIABLE_NAME="$1"
45
+ DEFAULT_VALUE="$2"
46
+
47
+ RESULT="$DEFAULT_VALUE"
48
+ if var_present_r "$VARIABLE_NAME"; then
49
+ RESULT="${!VARIABLE_NAME}"
50
+ fi
51
+ export $VARIABLE_NAME="$RESULT"
52
+ }
@@ -13,6 +13,7 @@ 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"
16
17
  "$AUX_ROOT/setup_apache_site.sh"
17
18
  "$AUX_ROOT/pear.sh"
18
19
  "$AUX_ROOT/php_composer.sh"
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.18.1
4
+ version: 0.19.0
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-02-21 00:00:00.000000000 Z
11
+ date: 2020-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -351,6 +351,7 @@ files:
351
351
  - lib/avmtrf1/trf1_dspace_base0/instance.rb
352
352
  - template/avmtrf1/php/docker_image/Dockerfile.template
353
353
  - template/avmtrf1/php/docker_image/aux/apache_foreground.sh
354
+ - template/avmtrf1/php/docker_image/aux/apache_user.sh
354
355
  - template/avmtrf1/php/docker_image/aux/config_banner.sh
355
356
  - template/avmtrf1/php/docker_image/aux/init.sh
356
357
  - template/avmtrf1/php/docker_image/aux/laravel.sh