Module: NginxStage::PunConfigView
- Included in:
- PunConfigGenerator
- Defined in:
- lib/nginx_stage/views/pun_config_view.rb
Overview
A view used as context for the pun config ERB template file
Instance Method Summary collapse
-
#access_log_path ⇒ String
Path to the user’s personal access.log.
-
#app_configs ⇒ Array<String>
Array of wildcard paths to app configs user has access to.
-
#error_log_path ⇒ String
Path to the user’s personal error.log.
-
#group ⇒ String
Primary group of the user.
-
#mime_types_path ⇒ String
Path to system-installed NGINX mime.types config file.
-
#passenger_nodejs ⇒ String
Path to system-installed NodeJS binary.
-
#passenger_python ⇒ String
Path to system-installed python binary.
-
#passenger_root ⇒ String
Path to system-installed Passenger locations.ini file.
-
#passenger_ruby ⇒ String
Path to system-installed Ruby binary.
-
#pid_path ⇒ String
Path to the user’s per-user NGINX pid file.
-
#restart_confirmation ⇒ String
View used to confirm whether the user wants to restart the PUN to reload configuration changes.
-
#sendfile_root ⇒ String
Path to the filesystem root where files are served from.
-
#sendfile_uri ⇒ String
Internal URI used to access filesystem from apps.
-
#socket_path ⇒ String
Path to the user’s per-user NGINX socket file.
-
#tmp_root ⇒ String
Path to user’s personal tmp root.
Instance Method Details
#access_log_path ⇒ String
Path to the user’s personal access.log
18 19 20 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 18 def access_log_path NginxStage.pun_access_log_path(user: user) end |
#app_configs ⇒ Array<String>
Array of wildcard paths to app configs user has access to
84 85 86 87 88 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 84 def app_configs NginxStage.pun_app_configs(user: user).map do |envmt| NginxStage.app_config_path envmt end end |
#error_log_path ⇒ String
Path to the user’s personal error.log
12 13 14 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 12 def error_log_path NginxStage.pun_error_log_path(user: user) end |
#group ⇒ String
Primary group of the user
6 7 8 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 6 def group user.group end |
#mime_types_path ⇒ String
Path to system-installed NGINX mime.types config file
30 31 32 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 30 def mime_types_path NginxStage.mime_types_path end |
#passenger_nodejs ⇒ String
Path to system-installed NodeJS binary
48 49 50 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 48 def passenger_nodejs NginxStage.passenger_nodejs end |
#passenger_python ⇒ String
Path to system-installed python binary
54 55 56 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 54 def passenger_python NginxStage.passenger_python end |
#passenger_root ⇒ String
Path to system-installed Passenger locations.ini file
36 37 38 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 36 def passenger_root NginxStage.passenger_root end |
#passenger_ruby ⇒ String
Path to system-installed Ruby binary
42 43 44 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 42 def passenger_ruby NginxStage.passenger_ruby end |
#pid_path ⇒ String
Path to the user’s per-user NGINX pid file
24 25 26 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 24 def pid_path NginxStage.pun_pid_path(user: user) end |
#restart_confirmation ⇒ String
View used to confirm whether the user wants to restart the PUN to reload configuration changes
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 93 def restart_confirmation <<-EOF.gsub("'", %q{\\\'}) <html> <head> <style> body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.4; color: #333; font-weight: 300; padding: 15px; } h2 { font-weight: 500; font-size: 30px; } .text-danger { color: #a94442; } .btn-danger { text-decoration: none; font-weight: 400; padding: 10px 16px; border-radius: 6px; color: #fff; background-color: #d9534f; } </style> </head> <body> <h2> App has not been initialized or does not exist </h2> <p class="text-danger"> This is the first time this app has been launched in your per-user NGINX (PUN) server. This requires a configuration change followed by a restart of your PUN server. Be sure you save all the work you are doing in other apps that have active websocket connections (i.e., Shell App) and you complete all file uploads/downloads. </p> <p> Clicking the "Initialize App" button will apply the configuration change and restart your per-user NGINX (PUN) server. </p> <a href="#{app_init_url}" class="btn-danger">Initialize App</a> </body> </html> EOF end |
#sendfile_root ⇒ String
Path to the filesystem root where files are served from
78 79 80 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 78 def sendfile_root NginxStage.pun_sendfile_root(user: user) end |
#sendfile_uri ⇒ String
Internal URI used to access filesystem from apps
72 73 74 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 72 def sendfile_uri NginxStage.pun_sendfile_uri end |
#socket_path ⇒ String
Path to the user’s per-user NGINX socket file
66 67 68 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 66 def socket_path NginxStage.pun_socket_path(user: user) end |
#tmp_root ⇒ String
Path to user’s personal tmp root
60 61 62 |
# File 'lib/nginx_stage/views/pun_config_view.rb', line 60 def tmp_root NginxStage.pun_tmp_root(user: user) end |