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

Instance Method Details

#access_log_pathString

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_configsArray<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_pathString

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

#groupString

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_pathString

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_nodejsString

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_pythonString

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_rootString

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_rubyString

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_pathString

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_confirmationString

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
  "    <html>\n    <head>\n      <style>\n        body {\n          font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\n          font-size: 16px;\n          line-height: 1.4;\n          color: #333;\n          font-weight: 300;\n          padding: 15px;\n        }\n        h2 {\n          font-weight: 500;\n          font-size: 30px;\n        }\n        .text-danger {\n          color: #a94442;\n        }\n        .btn-danger {\n          text-decoration: none;\n          font-weight: 400;\n          padding: 10px 16px;\n          border-radius: 6px;\n          color: #fff;\n          background-color: #d9534f;\n        }\n      </style>\n    </head>\n    <body>\n      <h2>\n        App has not been initialized or does not exist\n      </h2>\n      <p class=\"text-danger\">\n        This is the first time this app has been launched in your per-user\n        NGINX (PUN) server. This requires a configuration change followed\n        by a restart of your PUN server. Be sure you save all the work you\n        are doing in other apps that have active websocket connections\n        (i.e., Shell App) and you complete all file uploads/downloads.\n      </p>\n      <p>\n        Clicking the \"Initialize App\" button will apply the configuration\n        change and restart your per-user NGINX (PUN) server.\n      </p>\n      <a href=\"\#{app_init_url}\" class=\"btn-danger\">Initialize App</a>\n    </body>\n    </html>\n  EOF\nend\n".gsub("'", %q{\\\'})

#sendfile_rootString

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_uriString

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_pathString

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_rootString

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