Commit 9bfe5d5aaace1cc7d29a628d3c863608d5624055

Authored by Galileo Sanchez
1 parent 0fb610e0

httpd proxy reverso y manejo de errores

1 docker build -t jaikuaamina/server jaikuaamina-server 1 docker build -t jaikuaamina/server jaikuaamina-server
  2 +docker build -t jaikuaamina/proxy jaikuaamina-proxy
2 docker network create jaikuaamina 3 docker network create jaikuaamina
3 docker volume create jaikuaamina-data 4 docker volume create jaikuaamina-data
1 import { Constants } from 'expo' 1 import { Constants } from 'expo'
2 2
3 export const STATUS_BAR_HEIGHT = Constants.statusBarHeight 3 export const STATUS_BAR_HEIGHT = Constants.statusBarHeight
4 -  
5 // PROD 4 // PROD
  5 +// export const BACKEND_URL = 'http://appaip.paraguay.gov.py'
6 // export const SENATICS_URL = 'https://informacionpublica.paraguay.gov.py:443/portal-core/rest/api' 6 // export const SENATICS_URL = 'https://informacionpublica.paraguay.gov.py:443/portal-core/rest/api'
  7 +
  8 +// STAGING
  9 +export const BACKEND_URL = 'http://appaip.paraguay.gov.py'
  10 +export const SENATICS_URL = 'http://appaip.paraguay.gov.py/portal-core/rest/api'
  11 +
7 // DEV 12 // DEV
8 -export const SENATICS_URL = 'http://dev.proxy.py:3128/portal-core/rest/api' 13 +// export const SENATICS_URL = 'http://dev.proxy.py:3128/portal-core/rest/api'
  14 +// export const BACKEND_URL = 'http://dev.proxy.py:15000'
9 15
10 -// export const BACKEND_URL = 'http://appaip.paraguay.gov.py'  
11 -export const BACKEND_URL = 'http://dev.proxy.py:15000'  
12 export const NOTIFICATION_ICON = 'http://ayuda.tesis-jmgo.cnc.una.py/img/jaikuaamina.icon.png' 16 export const NOTIFICATION_ICON = 'http://ayuda.tesis-jmgo.cnc.una.py/img/jaikuaamina.icon.png'
13 export const INFO_PY_URL = 'https://informacionpublica.paraguay.gov.py/portal/' 17 export const INFO_PY_URL = 'https://informacionpublica.paraguay.gov.py/portal/'
14 export const PORTAL_DENUNCIAS_URL = 'http://www.denuncias.gov.py' 18 export const PORTAL_DENUNCIAS_URL = 'http://www.denuncias.gov.py'
  1 +FROM httpd:2.4
  2 +COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf
  1 +# This is the main Apache HTTP server configuration file. It contains the
  2 +# configuration directives that give the server its instructions.
  3 +# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
  4 +# In particular, see
  5 +# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
  6 +# for a discussion of each configuration directive.
  7 +#
  8 +# Do NOT simply read the instructions in here without understanding
  9 +# what they do. They're here only as hints or reminders. If you are unsure
  10 +# consult the online docs. You have been warned.
  11 +#
  12 +# Configuration and logfile names: If the filenames you specify for many
  13 +# of the server's control files begin with "/" (or "drive:/" for Win32), the
  14 +# server will use that explicit path. If the filenames do *not* begin
  15 +# with "/", the value of ServerRoot is prepended -- so "logs/access_log"
  16 +# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
  17 +# server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log"
  18 +# will be interpreted as '/logs/access_log'.
  19 +
  20 +#
  21 +# ServerRoot: The top of the directory tree under which the server's
  22 +# configuration, error, and log files are kept.
  23 +#
  24 +# Do not add a slash at the end of the directory path. If you point
  25 +# ServerRoot at a non-local disk, be sure to specify a local disk on the
  26 +# Mutex directive, if file-based mutexes are used. If you wish to share the
  27 +# same ServerRoot for multiple httpd daemons, you will need to change at
  28 +# least PidFile.
  29 +#
  30 +ServerRoot "/usr/local/apache2"
  31 +
  32 +#
  33 +# Mutex: Allows you to set the mutex mechanism and mutex file directory
  34 +# for individual mutexes, or change the global defaults
  35 +#
  36 +# Uncomment and change the directory if mutexes are file-based and the default
  37 +# mutex file directory is not on a local disk or is not appropriate for some
  38 +# other reason.
  39 +#
  40 +# Mutex default:logs
  41 +
  42 +#
  43 +# Listen: Allows you to bind Apache to specific IP addresses and/or
  44 +# ports, instead of the default. See also the <VirtualHost>
  45 +# directive.
  46 +#
  47 +# Change this to Listen on specific IP addresses as shown below to
  48 +# prevent Apache from glomming onto all bound IP addresses.
  49 +#
  50 +#Listen 12.34.56.78:80
  51 +Listen 80
  52 +
  53 +#
  54 +# Dynamic Shared Object (DSO) Support
  55 +#
  56 +# To be able to use the functionality of a module which was built as a DSO you
  57 +# have to place corresponding `LoadModule' lines at this location so the
  58 +# directives contained in it are actually available _before_ they are used.
  59 +# Statically compiled modules (those listed by `httpd -l') do not need
  60 +# to be loaded here.
  61 +#
  62 +# Example:
  63 +# LoadModule foo_module modules/mod_foo.so
  64 +#
  65 +LoadModule mpm_event_module modules/mod_mpm_event.so
  66 +#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
  67 +#LoadModule mpm_worker_module modules/mod_mpm_worker.so
  68 +LoadModule authn_file_module modules/mod_authn_file.so
  69 +#LoadModule authn_dbm_module modules/mod_authn_dbm.so
  70 +#LoadModule authn_anon_module modules/mod_authn_anon.so
  71 +#LoadModule authn_dbd_module modules/mod_authn_dbd.so
  72 +#LoadModule authn_socache_module modules/mod_authn_socache.so
  73 +LoadModule authn_core_module modules/mod_authn_core.so
  74 +LoadModule authz_host_module modules/mod_authz_host.so
  75 +LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
  76 +LoadModule authz_user_module modules/mod_authz_user.so
  77 +#LoadModule authz_dbm_module modules/mod_authz_dbm.so
  78 +#LoadModule authz_owner_module modules/mod_authz_owner.so
  79 +#LoadModule authz_dbd_module modules/mod_authz_dbd.so
  80 +LoadModule authz_core_module modules/mod_authz_core.so
  81 +#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
  82 +#LoadModule authnz_fcgi_module modules/mod_authnz_fcgi.so
  83 +LoadModule access_compat_module modules/mod_access_compat.so
  84 +LoadModule auth_basic_module modules/mod_auth_basic.so
  85 +#LoadModule auth_form_module modules/mod_auth_form.so
  86 +#LoadModule auth_digest_module modules/mod_auth_digest.so
  87 +#LoadModule allowmethods_module modules/mod_allowmethods.so
  88 +#LoadModule isapi_module modules/mod_isapi.so
  89 +#LoadModule file_cache_module modules/mod_file_cache.so
  90 +#LoadModule cache_module modules/mod_cache.so
  91 +#LoadModule cache_disk_module modules/mod_cache_disk.so
  92 +#LoadModule cache_socache_module modules/mod_cache_socache.so
  93 +#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
  94 +#LoadModule socache_dbm_module modules/mod_socache_dbm.so
  95 +#LoadModule socache_memcache_module modules/mod_socache_memcache.so
  96 +#LoadModule watchdog_module modules/mod_watchdog.so
  97 +#LoadModule macro_module modules/mod_macro.so
  98 +#LoadModule dbd_module modules/mod_dbd.so
  99 +#LoadModule bucketeer_module modules/mod_bucketeer.so
  100 +#LoadModule dumpio_module modules/mod_dumpio.so
  101 +#LoadModule echo_module modules/mod_echo.so
  102 +#LoadModule example_hooks_module modules/mod_example_hooks.so
  103 +#LoadModule case_filter_module modules/mod_case_filter.so
  104 +#LoadModule case_filter_in_module modules/mod_case_filter_in.so
  105 +#LoadModule example_ipc_module modules/mod_example_ipc.so
  106 +#LoadModule buffer_module modules/mod_buffer.so
  107 +#LoadModule data_module modules/mod_data.so
  108 +#LoadModule ratelimit_module modules/mod_ratelimit.so
  109 +LoadModule reqtimeout_module modules/mod_reqtimeout.so
  110 +#LoadModule ext_filter_module modules/mod_ext_filter.so
  111 +#LoadModule request_module modules/mod_request.so
  112 +#LoadModule include_module modules/mod_include.so
  113 +LoadModule filter_module modules/mod_filter.so
  114 +#LoadModule reflector_module modules/mod_reflector.so
  115 +#LoadModule substitute_module modules/mod_substitute.so
  116 +#LoadModule sed_module modules/mod_sed.so
  117 +#LoadModule charset_lite_module modules/mod_charset_lite.so
  118 +#LoadModule deflate_module modules/mod_deflate.so
  119 +#LoadModule xml2enc_module modules/mod_xml2enc.so
  120 +LoadModule proxy_html_module modules/mod_proxy_html.so
  121 +LoadModule mime_module modules/mod_mime.so
  122 +#LoadModule ldap_module modules/mod_ldap.so
  123 +LoadModule log_config_module modules/mod_log_config.so
  124 +#LoadModule log_debug_module modules/mod_log_debug.so
  125 +#LoadModule log_forensic_module modules/mod_log_forensic.so
  126 +#LoadModule logio_module modules/mod_logio.so
  127 +#LoadModule lua_module modules/mod_lua.so
  128 +LoadModule env_module modules/mod_env.so
  129 +#LoadModule mime_magic_module modules/mod_mime_magic.so
  130 +#LoadModule cern_meta_module modules/mod_cern_meta.so
  131 +#LoadModule expires_module modules/mod_expires.so
  132 +LoadModule headers_module modules/mod_headers.so
  133 +#LoadModule ident_module modules/mod_ident.so
  134 +#LoadModule usertrack_module modules/mod_usertrack.so
  135 +#LoadModule unique_id_module modules/mod_unique_id.so
  136 +LoadModule setenvif_module modules/mod_setenvif.so
  137 +LoadModule version_module modules/mod_version.so
  138 +#LoadModule remoteip_module modules/mod_remoteip.so
  139 +LoadModule proxy_module modules/mod_proxy.so
  140 +LoadModule proxy_connect_module modules/mod_proxy_connect.so
  141 +#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
  142 +LoadModule proxy_http_module modules/mod_proxy_http.so
  143 +LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
  144 +LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
  145 +LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so
  146 +LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
  147 +LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
  148 +LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  149 +LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
  150 +LoadModule proxy_express_module modules/mod_proxy_express.so
  151 +LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so
  152 +#LoadModule session_module modules/mod_session.so
  153 +#LoadModule session_cookie_module modules/mod_session_cookie.so
  154 +#LoadModule session_crypto_module modules/mod_session_crypto.so
  155 +#LoadModule session_dbd_module modules/mod_session_dbd.so
  156 +#LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
  157 +#LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
  158 +#LoadModule ssl_module modules/mod_ssl.so
  159 +#LoadModule optional_hook_export_module modules/mod_optional_hook_export.so
  160 +#LoadModule optional_hook_import_module modules/mod_optional_hook_import.so
  161 +#LoadModule optional_fn_import_module modules/mod_optional_fn_import.so
  162 +#LoadModule optional_fn_export_module modules/mod_optional_fn_export.so
  163 +#LoadModule dialup_module modules/mod_dialup.so
  164 +#LoadModule http2_module modules/mod_http2.so
  165 +#LoadModule proxy_http2_module modules/mod_proxy_http2.so
  166 +#LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
  167 +#LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
  168 +#LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
  169 +#LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
  170 +LoadModule unixd_module modules/mod_unixd.so
  171 +#LoadModule heartbeat_module modules/mod_heartbeat.so
  172 +#LoadModule heartmonitor_module modules/mod_heartmonitor.so
  173 +#LoadModule dav_module modules/mod_dav.so
  174 +LoadModule status_module modules/mod_status.so
  175 +LoadModule autoindex_module modules/mod_autoindex.so
  176 +#LoadModule asis_module modules/mod_asis.so
  177 +#LoadModule info_module modules/mod_info.so
  178 +#LoadModule suexec_module modules/mod_suexec.so
  179 +<IfModule !mpm_prefork_module>
  180 + #LoadModule cgid_module modules/mod_cgid.so
  181 +</IfModule>
  182 +<IfModule mpm_prefork_module>
  183 + #LoadModule cgi_module modules/mod_cgi.so
  184 +</IfModule>
  185 +#LoadModule dav_fs_module modules/mod_dav_fs.so
  186 +#LoadModule dav_lock_module modules/mod_dav_lock.so
  187 +#LoadModule vhost_alias_module modules/mod_vhost_alias.so
  188 +#LoadModule negotiation_module modules/mod_negotiation.so
  189 +LoadModule dir_module modules/mod_dir.so
  190 +#LoadModule imagemap_module modules/mod_imagemap.so
  191 +#LoadModule actions_module modules/mod_actions.so
  192 +#LoadModule speling_module modules/mod_speling.so
  193 +#LoadModule userdir_module modules/mod_userdir.so
  194 +LoadModule alias_module modules/mod_alias.so
  195 +#LoadModule rewrite_module modules/mod_rewrite.so
  196 +
  197 +<IfModule unixd_module>
  198 +#
  199 +# If you wish httpd to run as a different user or group, you must run
  200 +# httpd as root initially and it will switch.
  201 +#
  202 +# User/Group: The name (or #number) of the user/group to run httpd as.
  203 +# It is usually good practice to create a dedicated user and group for
  204 +# running httpd, as with most system services.
  205 +#
  206 +User daemon
  207 +Group daemon
  208 +
  209 +</IfModule>
  210 +
  211 +# 'Main' server configuration
  212 +#
  213 +# The directives in this section set up the values used by the 'main'
  214 +# server, which responds to any requests that aren't handled by a
  215 +# <VirtualHost> definition. These values also provide defaults for
  216 +# any <VirtualHost> containers you may define later in the file.
  217 +#
  218 +# All of these directives may appear inside <VirtualHost> containers,
  219 +# in which case these default settings will be overridden for the
  220 +# virtual host being defined.
  221 +#
  222 +
  223 +#
  224 +# ServerAdmin: Your address, where problems with the server should be
  225 +# e-mailed. This address appears on some server-generated pages, such
  226 +# as error documents. e.g. admin@your-domain.com
  227 +#
  228 +ServerAdmin admin@mitic.gov.py
  229 +
  230 +#
  231 +# ServerName gives the name and port that the server uses to identify itself.
  232 +# This can often be determined automatically, but we recommend you specify
  233 +# it explicitly to prevent problems during startup.
  234 +#
  235 +# If your host doesn't have a registered DNS name, enter its IP address here.
  236 +#
  237 +ServerName appaip.senatics.gov.py:80
  238 +
  239 +#
  240 +# Deny access to the entirety of your server's filesystem. You must
  241 +# explicitly permit access to web content directories in other
  242 +# <Directory> blocks below.
  243 +#
  244 +<Directory />
  245 + AllowOverride none
  246 + Require all denied
  247 +</Directory>
  248 +
  249 +#
  250 +# Note that from this point forward you must specifically allow
  251 +# particular features to be enabled - so if something's not working as
  252 +# you might expect, make sure that you have specifically enabled it
  253 +# below.
  254 +#
  255 +
  256 +#
  257 +# DocumentRoot: The directory out of which you will serve your
  258 +# documents. By default, all requests are taken from this directory, but
  259 +# symbolic links and aliases may be used to point to other locations.
  260 +#
  261 +DocumentRoot "/usr/local/apache2/htdocs"
  262 +<Directory "/usr/local/apache2/htdocs">
  263 + #
  264 + # Possible values for the Options directive are "None", "All",
  265 + # or any combination of:
  266 + # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  267 + #
  268 + # Note that "MultiViews" must be named *explicitly* --- "Options All"
  269 + # doesn't give it to you.
  270 + #
  271 + # The Options directive is both complicated and important. Please see
  272 + # http://httpd.apache.org/docs/2.4/mod/core.html#options
  273 + # for more information.
  274 + #
  275 + Options Indexes FollowSymLinks
  276 +
  277 + #
  278 + # AllowOverride controls what directives may be placed in .htaccess files.
  279 + # It can be "All", "None", or any combination of the keywords:
  280 + # AllowOverride FileInfo AuthConfig Limit
  281 + #
  282 + AllowOverride None
  283 +
  284 + #
  285 + # Controls who can get stuff from this server.
  286 + #
  287 + Require all granted
  288 +</Directory>
  289 +
  290 +#
  291 +# DirectoryIndex: sets the file that Apache will serve if a directory
  292 +# is requested.
  293 +#
  294 +<IfModule dir_module>
  295 + DirectoryIndex index.html
  296 +</IfModule>
  297 +
  298 +#
  299 +# The following lines prevent .htaccess and .htpasswd files from being
  300 +# viewed by Web clients.
  301 +#
  302 +<Files ".ht*">
  303 + Require all denied
  304 +</Files>
  305 +
  306 +#
  307 +# ErrorLog: The location of the error log file.
  308 +# If you do not specify an ErrorLog directive within a <VirtualHost>
  309 +# container, error messages relating to that virtual host will be
  310 +# logged here. If you *do* define an error logfile for a <VirtualHost>
  311 +# container, that host's errors will be logged there and not here.
  312 +#
  313 +ErrorLog /proc/self/fd/2
  314 +
  315 +#
  316 +# LogLevel: Control the number of messages logged to the error_log.
  317 +# Possible values include: debug, info, notice, warn, error, crit,
  318 +# alert, emerg.
  319 +#
  320 +LogLevel warn
  321 +
  322 +<IfModule log_config_module>
  323 + #
  324 + # The following directives define some format nicknames for use with
  325 + # a CustomLog directive (see below).
  326 + #
  327 + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  328 + LogFormat "%h %l %u %t \"%r\" %>s %b" common
  329 +
  330 + <IfModule logio_module>
  331 + # You need to enable mod_logio.c to use %I and %O
  332 + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
  333 + </IfModule>
  334 +
  335 + #
  336 + # The location and format of the access logfile (Common Logfile Format).
  337 + # If you do not define any access logfiles within a <VirtualHost>
  338 + # container, they will be logged here. Contrariwise, if you *do*
  339 + # define per-<VirtualHost> access logfiles, transactions will be
  340 + # logged therein and *not* in this file.
  341 + #
  342 + CustomLog /proc/self/fd/1 common
  343 +
  344 + #
  345 + # If you prefer a logfile with access, agent, and referer information
  346 + # (Combined Logfile Format) you can use the following directive.
  347 + #
  348 + #CustomLog "logs/access_log" combined
  349 +</IfModule>
  350 +
  351 +<IfModule alias_module>
  352 + #
  353 + # Redirect: Allows you to tell clients about documents that used to
  354 + # exist in your server's namespace, but do not anymore. The client
  355 + # will make a new request for the document at its new location.
  356 + # Example:
  357 + # Redirect permanent /foo http://www.example.com/bar
  358 +
  359 + #
  360 + # Alias: Maps web paths into filesystem paths and is used to
  361 + # access content that does not live under the DocumentRoot.
  362 + # Example:
  363 + # Alias /webpath /full/filesystem/path
  364 + #
  365 + # If you include a trailing / on /webpath then the server will
  366 + # require it to be present in the URL. You will also likely
  367 + # need to provide a <Directory> section to allow access to
  368 + # the filesystem path.
  369 +
  370 + #
  371 + # ScriptAlias: This controls which directories contain server scripts.
  372 + # ScriptAliases are essentially the same as Aliases, except that
  373 + # documents in the target directory are treated as applications and
  374 + # run by the server when requested rather than as documents sent to the
  375 + # client. The same rules about trailing "/" apply to ScriptAlias
  376 + # directives as to Alias.
  377 + #
  378 + ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
  379 +
  380 +</IfModule>
  381 +
  382 +<IfModule cgid_module>
  383 + #
  384 + # ScriptSock: On threaded servers, designate the path to the UNIX
  385 + # socket used to communicate with the CGI daemon of mod_cgid.
  386 + #
  387 + #Scriptsock cgisock
  388 +</IfModule>
  389 +
  390 +#
  391 +# "/usr/local/apache2/cgi-bin" should be changed to whatever your ScriptAliased
  392 +# CGI directory exists, if you have that configured.
  393 +#
  394 +<Directory "/usr/local/apache2/cgi-bin">
  395 + AllowOverride None
  396 + Options None
  397 + Require all granted
  398 +</Directory>
  399 +
  400 +<IfModule headers_module>
  401 + #
  402 + # Avoid passing HTTP_PROXY environment to CGI's on this or any proxied
  403 + # backend servers which have lingering "httpoxy" defects.
  404 + # 'Proxy' request header is undefined by the IETF, not listed by IANA
  405 + #
  406 + RequestHeader unset Proxy early
  407 +</IfModule>
  408 +
  409 +<IfModule mime_module>
  410 + #
  411 + # TypesConfig points to the file containing the list of mappings from
  412 + # filename extension to MIME-type.
  413 + #
  414 + TypesConfig conf/mime.types
  415 +
  416 + #
  417 + # AddType allows you to add to or override the MIME configuration
  418 + # file specified in TypesConfig for specific file types.
  419 + #
  420 + #AddType application/x-gzip .tgz
  421 + #
  422 + # AddEncoding allows you to have certain browsers uncompress
  423 + # information on the fly. Note: Not all browsers support this.
  424 + #
  425 + #AddEncoding x-compress .Z
  426 + #AddEncoding x-gzip .gz .tgz
  427 + #
  428 + # If the AddEncoding directives above are commented-out, then you
  429 + # probably should define those extensions to indicate media types:
  430 + #
  431 + AddType application/x-compress .Z
  432 + AddType application/x-gzip .gz .tgz
  433 +
  434 + #
  435 + # AddHandler allows you to map certain file extensions to "handlers":
  436 + # actions unrelated to filetype. These can be either built into the server
  437 + # or added with the Action directive (see below)
  438 + #
  439 + # To use CGI scripts outside of ScriptAliased directories:
  440 + # (You will also need to add "ExecCGI" to the "Options" directive.)
  441 + #
  442 + #AddHandler cgi-script .cgi
  443 +
  444 + # For type maps (negotiated resources):
  445 + #AddHandler type-map var
  446 +
  447 + #
  448 + # Filters allow you to process content before it is sent to the client.
  449 + #
  450 + # To parse .shtml files for server-side includes (SSI):
  451 + # (You will also need to add "Includes" to the "Options" directive.)
  452 + #
  453 + #AddType text/html .shtml
  454 + #AddOutputFilter INCLUDES .shtml
  455 +</IfModule>
  456 +
  457 +#
  458 +# The mod_mime_magic module allows the server to use various hints from the
  459 +# contents of the file itself to determine its type. The MIMEMagicFile
  460 +# directive tells the module where the hint definitions are located.
  461 +#
  462 +#MIMEMagicFile conf/magic
  463 +
  464 +#
  465 +# Customizable error responses come in three flavors:
  466 +# 1) plain text 2) local redirects 3) external redirects
  467 +#
  468 +# Some examples:
  469 +#ErrorDocument 500 "The server made a boo boo."
  470 +#ErrorDocument 404 /missing.html
  471 +#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  472 +#ErrorDocument 402 http://www.example.com/subscription_info.html
  473 +#
  474 +
  475 +#
  476 +# MaxRanges: Maximum number of Ranges in a request before
  477 +# returning the entire resource, or one of the special
  478 +# values 'default', 'none' or 'unlimited'.
  479 +# Default setting is to accept 200 Ranges.
  480 +#MaxRanges unlimited
  481 +
  482 +#
  483 +# EnableMMAP and EnableSendfile: On systems that support it,
  484 +# memory-mapping or the sendfile syscall may be used to deliver
  485 +# files. This usually improves server performance, but must
  486 +# be turned off when serving from networked-mounted
  487 +# filesystems or if support for these functions is otherwise
  488 +# broken on your system.
  489 +# Defaults: EnableMMAP On, EnableSendfile Off
  490 +#
  491 +#EnableMMAP off
  492 +#EnableSendfile on
  493 +
  494 +# Supplemental configuration
  495 +#
  496 +# The configuration files in the conf/extra/ directory can be
  497 +# included to add extra features or to modify the default configuration of
  498 +# the server, or you may simply copy their contents here and change as
  499 +# necessary.
  500 +
  501 +# Server-pool management (MPM specific)
  502 +#Include conf/extra/httpd-mpm.conf
  503 +
  504 +# Multi-language error messages
  505 +#Include conf/extra/httpd-multilang-errordoc.conf
  506 +
  507 +# Fancy directory listings
  508 +#Include conf/extra/httpd-autoindex.conf
  509 +
  510 +# Language settings
  511 +#Include conf/extra/httpd-languages.conf
  512 +
  513 +# User home directories
  514 +#Include conf/extra/httpd-userdir.conf
  515 +
  516 +# Real-time info on requests and configuration
  517 +#Include conf/extra/httpd-info.conf
  518 +
  519 +# Virtual hosts
  520 +#Include conf/extra/httpd-vhosts.conf
  521 +
  522 +# Local access to the Apache HTTP Server Manual
  523 +#Include conf/extra/httpd-manual.conf
  524 +
  525 +# Distributed authoring and versioning (WebDAV)
  526 +#Include conf/extra/httpd-dav.conf
  527 +
  528 +# Various default settings
  529 +#Include conf/extra/httpd-default.conf
  530 +
  531 +# Configure mod_proxy_html to understand HTML4/XHTML1
  532 +<IfModule proxy_html_module>
  533 +Include conf/extra/proxy-html.conf
  534 +</IfModule>
  535 +
  536 +# Secure (SSL/TLS) connections
  537 +#Include conf/extra/httpd-ssl.conf
  538 +#
  539 +# Note: The following must must be present to support
  540 +# starting without SSL on platforms with no /dev/random equivalent
  541 +# but a statically compiled-in mod_ssl.
  542 +#
  543 +<IfModule ssl_module>
  544 +SSLRandomSeed startup builtin
  545 +SSLRandomSeed connect builtin
  546 +</IfModule>
  547 +
  548 +
  549 +<VirtualHost *:80>
  550 + ServerName appaip.senatics.gov.py
  551 + SSLProxyEngine On
  552 + Off
  553 +
  554 + ProxyPass /portal-core https://devaip.senatics.gov.py/portal-core
  555 + ProxyPassReverse /portal-core https://devaip.senatics.gov.py/portal-core
  556 +
  557 + ProxyPass / http://jaikuaamina:3000/
  558 + ProxyPassReverse / http://jaikuaamina:3000/
  559 +
  560 +
  561 +</VirtualHost>
@@ -14,8 +14,13 @@ RUN echo "NODE_TLS_REJECT_UNAUTHORIZED=0\n"\ @@ -14,8 +14,13 @@ RUN echo "NODE_TLS_REJECT_UNAUTHORIZED=0\n"\
14 "DB_NONCES=nonces\n"\ 14 "DB_NONCES=nonces\n"\
15 "DB_TOKENS=tokens\n"\ 15 "DB_TOKENS=tokens\n"\
16 "TOKEN_INTERVAL=840000\n"\ 16 "TOKEN_INTERVAL=840000\n"\
  17 +# DATOS PARA USO CON EL SERVIDOR DE PRUEBA
17 "AUTH_TOKEN=4438c469-341d-4887-b2b3-e5c77c09e905\n"\ 18 "AUTH_TOKEN=4438c469-341d-4887-b2b3-e5c77c09e905\n"\
18 "CLIENT_SECRET=56ff88078b9cbb415486aa69d39419cded8baf7f7d54e11f72b68fe490757acb\n"\ 19 "CLIENT_SECRET=56ff88078b9cbb415486aa69d39419cded8baf7f7d54e11f72b68fe490757acb\n"\
19 -"SENATICS_URL=https://informacionpublica.paraguay.gov.py:443/portal-core/rest/api\n" > .env 20 +"SENATICS_URL=https://devaip.senatics.gov.py/portal-core/rest/api\n" > .env
  21 +# REEPLAZAR DATOS DE LAS ULTIMAS TRES LINEAS EN EL SERVIDOR CON DATODS DE PRODUCCION
  22 +#"AUTH_TOKEN=4438c469-341d-4887-b2b3-e5c77c09e905\n"\
  23 +#"CLIENT_SECRET=56ff88078b9cbb415486aa69d39419cded8baf7f7d54e11f72b68fe490757acb\n"\
  24 +#"SENATICS_URL=https://informacionpublica.paraguay.gov.py:443/portal-core/rest/api\n" > .env
20 25
21 CMD ["npm", "start"] 26 CMD ["npm", "start"]
1 require('dotenv').load() 1 require('dotenv').load()
2 const logger = require('./logger') 2 const logger = require('./logger')
3 -const createError = require('http-errors');  
4 -const express = require('express');  
5 -const path = require('path');  
6 -const cookieParser = require('cookie-parser');  
7 -const morgan = require('morgan'); 3 +const createError = require('http-errors')
  4 +const express = require('express')
  5 +const path = require('path')
  6 +const cookieParser = require('cookie-parser')
  7 +const morgan = require('morgan')
8 8
9 const createdb = require('./db/createdb') 9 const createdb = require('./db/createdb')
10 const tokenGetter = require('./daemons/getToken') 10 const tokenGetter = require('./daemons/getToken')
11 const saveToken = require('./lib/saveToken') 11 const saveToken = require('./lib/saveToken')
12 -const indexRouter = require('./routes/index'); 12 +const indexRouter = require('./routes/index')
13 13
14 -const app = express(); 14 +const app = express()
15 15
16 // view engine setup 16 // view engine setup
17 -app.set('views', path.join(__dirname, 'views'));  
18 -app.set('view engine', 'pug'); 17 +app.set('views', path.join(__dirname, 'views'))
  18 +app.set('view engine', 'pug')
19 19
20 20
21 -app.use(morgan('dev'));  
22 -app.use(express.json());  
23 -app.use(express.urlencoded({ extended: false }));  
24 -app.use(cookieParser());  
25 -app.use(express.static(path.join(__dirname, 'public'))); 21 +app.use(morgan('dev'))
  22 +app.use(express.json())
  23 +app.use(express.urlencoded({ extended: false }))
  24 +app.use(cookieParser())
  25 +app.use(express.static(path.join(__dirname, 'public')))
26 26
27 -app.use('/', indexRouter); 27 +app.use('/', indexRouter)
28 28
29 // catch 404 and forward to error handler 29 // catch 404 and forward to error handler
30 -app.use(function(req, res, next) {  
31 - next(createError(404));  
32 -}); 30 +app.use((req, res, next) => {
  31 + next(createError(404))
  32 +})
33 33
34 // error handler 34 // error handler
35 -app.use(function(err, req, res, next) { 35 +
  36 +/* eslint-disable-next-line no-unused-vars */
  37 +app.use((err, req, res, next) => {
36 // render the error page 38 // render the error page
37 logger.error(err) 39 logger.error(err)
38 - res.status(err.status || 500); 40 + res.status(err.status || 500)
39 res.json({ 41 res.json({
40 error: { 42 error: {
41 stack: err.stack, 43 stack: err.stack,
42 message: err.message, 44 message: err.message,
43 status: err.status 45 status: err.status
44 } 46 }
45 - });  
46 -}); 47 + })
  48 +})
47 49
48 -module.exports = app; 50 +module.exports = app
49 51
50 // INICIALIZACIÓN DE LA BASE DE DATOS 52 // INICIALIZACIÓN DE LA BASE DE DATOS
51 -const dbname = process.env.DB_NAME  
52 const dbnames = [ 53 const dbnames = [
53 process.env.DB_VALORACIONES, 54 process.env.DB_VALORACIONES,
54 process.env.DB_UBICACIONES, 55 process.env.DB_UBICACIONES,
@@ -60,7 +61,10 @@ const dbnames = [ @@ -60,7 +61,10 @@ const dbnames = [
60 dbnames.forEach(name => 61 dbnames.forEach(name =>
61 createdb(name) 62 createdb(name)
62 .then((result) => `Create DB "${name}" returned ${JSON.stringify(result)}`) 63 .then((result) => `Create DB "${name}" returned ${JSON.stringify(result)}`)
63 - .catch(logger.error) 64 + .catch(err => {
  65 + logger.error(`No se pudo crear la base de datos ${name}`)
  66 + logger.error(err)
  67 + })
64 ) 68 )
65 69
66 // INICIALIZACIÓN DE LOS DEMONIOS 70 // INICIALIZACIÓN DE LOS DEMONIOS
@@ -68,12 +72,12 @@ dbnames.forEach(name => @@ -68,12 +72,12 @@ dbnames.forEach(name =>
68 const token$ = tokenGetter( 72 const token$ = tokenGetter(
69 process.env.AUTH_TOKEN, 73 process.env.AUTH_TOKEN,
70 process.env.CLIENT_SECRET, 74 process.env.CLIENT_SECRET,
71 - process.env.TOKEN_INTERVAL, 75 + process.env.TOKEN_INTERVAL
72 ) 76 )
73 77
74 token$.onValue(saveToken) 78 token$.onValue(saveToken)
75 token$.onError((err) => { 79 token$.onError((err) => {
76 - console.log(err)  
77 - console.log('el error se manejó correctamente') 80 + logger.error('Error en la recuperación de los tokens')
  81 + logger.error(err)
78 }) 82 })
79 token$.log() 83 token$.log()
1 require('dotenv').load() 1 require('dotenv').load()
2 2
  3 +const logger = require('../logger')
3 const Bacon = require('baconjs') 4 const Bacon = require('baconjs')
4 const getToken = require('../lib/getToken') 5 const getToken = require('../lib/getToken')
5 6
@@ -11,11 +12,6 @@ module.exports = (authToken, clientSecret, interval) => @@ -11,11 +12,6 @@ module.exports = (authToken, clientSecret, interval) =>
11 Bacon.interval(interval, { clientSecret }) 12 Bacon.interval(interval, { clientSecret })
12 .merge(Bacon.once({ clientSecret })) 13 .merge(Bacon.once({ clientSecret }))
13 .map(payload => getToken(authToken, payload)) 14 .map(payload => getToken(authToken, payload))
14 - // .flatMap(promise =>  
15 - // Bacon.fromBinder(sink => promise.then(  
16 - // success=> sink([new Bacon.Next(success), new Bacon.End()]),  
17 - // error => error  
18 - // ))  
19 - // )  
20 .flatMap(Bacon.fromPromise) 15 .flatMap(Bacon.fromPromise)
21 - .log() 16 + .doAction(logger.debug)
  17 + .doError(logger.warning)
@@ -8,7 +8,8 @@ const clientPoint = { @@ -8,7 +8,8 @@ const clientPoint = {
8 module.exports = { 8 module.exports = {
9 serverPrivate, clientPoint 9 serverPrivate, clientPoint
10 } 10 }
11 -const AUTH_TOKEN = '730e9175-c76c-418a-a051-7e2834ed7fd7'  
12 -const CLIENT_SECRET = 'deb7aa26038d0f44a35cd3e1d2f60b5c0e11192ddd0f9430c0d64a1101daa11f' 11 +
  12 +// const AUTH_TOKEN = '730e9175-c76c-418a-a051-7e2834ed7fd7'
  13 +// const CLIENT_SECRET = 'deb7aa26038d0f44a35cd3e1d2f60b5c0e11192ddd0f9430c0d64a1101daa11f'
13 // const AUTH_TOKEN = '0496164f-8de1-449c-9ce9-af0e0a6ce9fe' 14 // const AUTH_TOKEN = '0496164f-8de1-449c-9ce9-af0e0a6ce9fe'
14 // const CLIENT_SECRET = 'a66a1a98eb7059a5c3b446183e214cc2661326c2994b811cb06dd9d3d873a9e9' 15 // const CLIENT_SECRET = 'a66a1a98eb7059a5c3b446183e214cc2661326c2994b811cb06dd9d3d873a9e9'
@@ -1833,8 +1833,7 @@ @@ -1833,8 +1833,7 @@
1833 "ansi-regex": { 1833 "ansi-regex": {
1834 "version": "2.1.1", 1834 "version": "2.1.1",
1835 "bundled": true, 1835 "bundled": true,
1836 - "dev": true,  
1837 - "optional": true 1836 + "dev": true
1838 }, 1837 },
1839 "aproba": { 1838 "aproba": {
1840 "version": "1.2.0", 1839 "version": "1.2.0",
@@ -1855,14 +1854,12 @@ @@ -1855,14 +1854,12 @@
1855 "balanced-match": { 1854 "balanced-match": {
1856 "version": "1.0.0", 1855 "version": "1.0.0",
1857 "bundled": true, 1856 "bundled": true,
1858 - "dev": true,  
1859 - "optional": true 1857 + "dev": true
1860 }, 1858 },
1861 "brace-expansion": { 1859 "brace-expansion": {
1862 "version": "1.1.11", 1860 "version": "1.1.11",
1863 "bundled": true, 1861 "bundled": true,
1864 "dev": true, 1862 "dev": true,
1865 - "optional": true,  
1866 "requires": { 1863 "requires": {
1867 "balanced-match": "^1.0.0", 1864 "balanced-match": "^1.0.0",
1868 "concat-map": "0.0.1" 1865 "concat-map": "0.0.1"
@@ -1877,20 +1874,17 @@ @@ -1877,20 +1874,17 @@
1877 "code-point-at": { 1874 "code-point-at": {
1878 "version": "1.1.0", 1875 "version": "1.1.0",
1879 "bundled": true, 1876 "bundled": true,
1880 - "dev": true,  
1881 - "optional": true 1877 + "dev": true
1882 }, 1878 },
1883 "concat-map": { 1879 "concat-map": {
1884 "version": "0.0.1", 1880 "version": "0.0.1",
1885 "bundled": true, 1881 "bundled": true,
1886 - "dev": true,  
1887 - "optional": true 1882 + "dev": true
1888 }, 1883 },
1889 "console-control-strings": { 1884 "console-control-strings": {
1890 "version": "1.1.0", 1885 "version": "1.1.0",
1891 "bundled": true, 1886 "bundled": true,
1892 - "dev": true,  
1893 - "optional": true 1887 + "dev": true
1894 }, 1888 },
1895 "core-util-is": { 1889 "core-util-is": {
1896 "version": "1.0.2", 1890 "version": "1.0.2",
@@ -2007,8 +2001,7 @@ @@ -2007,8 +2001,7 @@
2007 "inherits": { 2001 "inherits": {
2008 "version": "2.0.3", 2002 "version": "2.0.3",
2009 "bundled": true, 2003 "bundled": true,
2010 - "dev": true,  
2011 - "optional": true 2004 + "dev": true
2012 }, 2005 },
2013 "ini": { 2006 "ini": {
2014 "version": "1.3.5", 2007 "version": "1.3.5",
@@ -2020,7 +2013,6 @@ @@ -2020,7 +2013,6 @@
2020 "version": "1.0.0", 2013 "version": "1.0.0",
2021 "bundled": true, 2014 "bundled": true,
2022 "dev": true, 2015 "dev": true,
2023 - "optional": true,  
2024 "requires": { 2016 "requires": {
2025 "number-is-nan": "^1.0.0" 2017 "number-is-nan": "^1.0.0"
2026 } 2018 }
@@ -2035,7 +2027,6 @@ @@ -2035,7 +2027,6 @@
2035 "version": "3.0.4", 2027 "version": "3.0.4",
2036 "bundled": true, 2028 "bundled": true,
2037 "dev": true, 2029 "dev": true,
2038 - "optional": true,  
2039 "requires": { 2030 "requires": {
2040 "brace-expansion": "^1.1.7" 2031 "brace-expansion": "^1.1.7"
2041 } 2032 }
@@ -2043,14 +2034,12 @@ @@ -2043,14 +2034,12 @@
2043 "minimist": { 2034 "minimist": {
2044 "version": "0.0.8", 2035 "version": "0.0.8",
2045 "bundled": true, 2036 "bundled": true,
2046 - "dev": true,  
2047 - "optional": true 2037 + "dev": true
2048 }, 2038 },
2049 "minipass": { 2039 "minipass": {
2050 "version": "2.2.4", 2040 "version": "2.2.4",
2051 "bundled": true, 2041 "bundled": true,
2052 "dev": true, 2042 "dev": true,
2053 - "optional": true,  
2054 "requires": { 2043 "requires": {
2055 "safe-buffer": "^5.1.1", 2044 "safe-buffer": "^5.1.1",
2056 "yallist": "^3.0.0" 2045 "yallist": "^3.0.0"
@@ -2069,7 +2058,6 @@ @@ -2069,7 +2058,6 @@
2069 "version": "0.5.1", 2058 "version": "0.5.1",
2070 "bundled": true, 2059 "bundled": true,
2071 "dev": true, 2060 "dev": true,
2072 - "optional": true,  
2073 "requires": { 2061 "requires": {
2074 "minimist": "0.0.8" 2062 "minimist": "0.0.8"
2075 } 2063 }
@@ -2150,8 +2138,7 @@ @@ -2150,8 +2138,7 @@
2150 "number-is-nan": { 2138 "number-is-nan": {
2151 "version": "1.0.1", 2139 "version": "1.0.1",
2152 "bundled": true, 2140 "bundled": true,
2153 - "dev": true,  
2154 - "optional": true 2141 + "dev": true
2155 }, 2142 },
2156 "object-assign": { 2143 "object-assign": {
2157 "version": "4.1.1", 2144 "version": "4.1.1",
@@ -2163,7 +2150,6 @@ @@ -2163,7 +2150,6 @@
2163 "version": "1.4.0", 2150 "version": "1.4.0",
2164 "bundled": true, 2151 "bundled": true,
2165 "dev": true, 2152 "dev": true,
2166 - "optional": true,  
2167 "requires": { 2153 "requires": {
2168 "wrappy": "1" 2154 "wrappy": "1"
2169 } 2155 }
@@ -2249,8 +2235,7 @@ @@ -2249,8 +2235,7 @@
2249 "safe-buffer": { 2235 "safe-buffer": {
2250 "version": "5.1.1", 2236 "version": "5.1.1",
2251 "bundled": true, 2237 "bundled": true,
2252 - "dev": true,  
2253 - "optional": true 2238 + "dev": true
2254 }, 2239 },
2255 "safer-buffer": { 2240 "safer-buffer": {
2256 "version": "2.1.2", 2241 "version": "2.1.2",
@@ -2286,7 +2271,6 @@ @@ -2286,7 +2271,6 @@
2286 "version": "1.0.2", 2271 "version": "1.0.2",
2287 "bundled": true, 2272 "bundled": true,
2288 "dev": true, 2273 "dev": true,
2289 - "optional": true,  
2290 "requires": { 2274 "requires": {
2291 "code-point-at": "^1.0.0", 2275 "code-point-at": "^1.0.0",
2292 "is-fullwidth-code-point": "^1.0.0", 2276 "is-fullwidth-code-point": "^1.0.0",
@@ -2306,7 +2290,6 @@ @@ -2306,7 +2290,6 @@
2306 "version": "3.0.1", 2290 "version": "3.0.1",
2307 "bundled": true, 2291 "bundled": true,
2308 "dev": true, 2292 "dev": true,
2309 - "optional": true,  
2310 "requires": { 2293 "requires": {
2311 "ansi-regex": "^2.0.0" 2294 "ansi-regex": "^2.0.0"
2312 } 2295 }
@@ -2350,14 +2333,12 @@ @@ -2350,14 +2333,12 @@
2350 "wrappy": { 2333 "wrappy": {
2351 "version": "1.0.2", 2334 "version": "1.0.2",
2352 "bundled": true, 2335 "bundled": true,
2353 - "dev": true,  
2354 - "optional": true 2336 + "dev": true
2355 }, 2337 },
2356 "yallist": { 2338 "yallist": {
2357 "version": "3.0.2", 2339 "version": "3.0.2",
2358 "bundled": true, 2340 "bundled": true,
2359 - "dev": true,  
2360 - "optional": true 2341 + "dev": true
2361 } 2342 }
2362 } 2343 }
2363 }, 2344 },
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 "version": "0.0.0", 3 "version": "0.0.0",
4 "private": true, 4 "private": true,
5 "scripts": { 5 "scripts": {
6 - "start": "DEBUG=jaikuaamina nodemon ./bin/www" 6 + "start": "DEBUG=jaikuaamina:* nodemon ./bin/www"
7 }, 7 },
8 "dependencies": { 8 "dependencies": {
9 "baconjs": "^2.0.7", 9 "baconjs": "^2.0.7",
1 docker run -d --rm --network jaikuaamina -p 5984:5984 --name couch_server -v jaikuaamina-data:/opt/couchdb/data couchdb 1 docker run -d --rm --network jaikuaamina -p 5984:5984 --name couch_server -v jaikuaamina-data:/opt/couchdb/data couchdb
2 sleep 10 2 sleep 10
3 -docker run -d --rm --network jaikuaamina -p 15000:3000 --name jaikuaamina jaikuaamina/server 3 +docker run -d --rm --network jaikuaamina --name jaikuaamina jaikuaamina/server
  4 +docker run -d --rm --network jaikuaamina -p 15000:80 --name jaikuaamina jaikuaamina/server
Please register or login to post a comment