Merge branch 'v2' of github.com:jc21/nginx-proxy-manager

This commit is contained in:
Jamie Curnow
2018-08-30 14:32:46 +10:00
378 changed files with 18583 additions and 7537 deletions

View File

@@ -1,5 +0,0 @@
<td colspan="10" class="text-center">
<br><br>
<p>It looks like there are no access lists configured.</p>
<p><button type="button" class="btn btn-sm btn-success">Create your first Access List</button></p>
</td>

View File

@@ -1,11 +0,0 @@
<table class="table table-condensed table-striped">
<thead>
<th>Access List Name</th>
<th>User Count</th>
<th>Host Count</th>
<th class="text-right"><button type="button" class="btn btn-xs btn-info">Create Access List</button></th>
</thead>
<tbody>
<!-- items -->
</tbody>
</table>

View File

@@ -1,7 +0,0 @@
<td><%- name %></td>
<td><%- items.length %></td>
<td><%- hosts.length %></td>
<td class="text-right">
<button type="button" class="btn btn-default btn-xs edit" title="Edit"><i class="fa fa-pencil" aria-hidden="true"></i></button>
<button type="button" class="btn btn-default btn-xs delete" title="Delete"><i class="fa fa-times" aria-hidden="true"></i></button>
</td>

View File

@@ -1,24 +0,0 @@
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal">
<div class="modal-header text-left">
<h4 class="modal-title">Delete Access List</h4>
</div>
<div class="modal-body">
<p>Are you sure? You cannot undo this.</p>
<% if (hosts && hosts.length) { %>
<p>The following Hosts are using this Access List and will become publicly available upon deletion:</p>
<ul>
<% _.map(hosts, function (host) { %>
<li><%- host.hostname %></li>
<% }) %>
</ul>
<% } %>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-danger delete">Yes I'm Sure</button>
</div>
</form>
</div>
</div>

View File

@@ -1,30 +0,0 @@
<div class="modal-dialog">
<div class="modal-content">
<form>
<div class="modal-header text-left">
<h4 class="modal-title"><% if (typeof _id !== 'undefined') { %>Edit<% } else { %>Create<% } %> Access List</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="list_name">List Name</label>
<input type="text" class="form-control" placeholder="Cool People" name="name" id="list_name" value="<%- name %>" required>
</div>
<div class="row">
<div class="col-sm-6">
<strong>Username</strong>
</div>
<div class="col-sm-6">
<strong>Password</strong>
</div>
</div>
<div class="items"><!-- items --></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-success save">Save</button>
</div>
</form>
</div>
</div>

View File

@@ -1,94 +0,0 @@
'use strict';
const Mn = require('backbone.marionette');
const _ = require('lodash');
const template = require('./form.ejs');
const Controller = require('../controller');
const Api = require('../api');
const App = require('../main');
const ItemView = require('./item');
const AccessItemModel = require('../../models/access_item');
require('jquery-serializejson');
const ItemsView = Mn.CollectionView.extend({
childView: ItemView
});
module.exports = Mn.View.extend({
template: template,
id: 'access-list-form',
ui: {
items_region: '.items',
form: 'form',
buttons: 'form button'
},
regions: {
items_region: '@ui.items_region'
},
events: {
'submit @ui.form': function (e) {
e.preventDefault();
let form_data = this.ui.form.serializeJSON();
let items_data = [];
_.map(form_data.username, (val, idx) => {
if (val.trim().length) {
items_data.push({
username: val.trim(),
password: form_data.password[idx]
});
}
});
if (!items_data.length) {
alert('You must specify at least 1 Username and Password combination');
return;
}
let data = {
name: form_data.name,
items: items_data
};
this.ui.buttons.prop('disabled', true).addClass('btn-disabled');
let method = Api.Access.create;
if (this.model.get('_id')) {
// edit
method = Api.Access.update;
data._id = this.model.get('_id');
}
method(data)
.then((/*result*/) => {
App.UI.closeModal();
Controller.showAccess();
})
.catch((err) => {
alert(err.message);
this.ui.buttons.prop('disabled', false).removeClass('btn-disabled');
});
}
},
onRender: function () {
let items = this.model.get('items');
// Add empty items to the end of the list. This is cheating but hey I don't have the time to do it right
let items_to_add = 5 - items.length;
if (items_to_add) {
for (let i = 0; i < items_to_add; i++) {
items.push({});
}
}
this.showChildView('items_region', new ItemsView({
collection: new AccessItemModel.Collection(items)
}));
}
});

View File

@@ -1,8 +0,0 @@
<div class="row">
<div class="col-sm-6">
<input type="text" class="form-control" placeholder="" name="username[]" value="<%- typeof username !== 'undefined' ? username : '' %>">
</div>
<div class="col-sm-6">
<input type="password" class="form-control" placeholder="<%- typeof hint !== 'undefined' ? hint : '' %>" name="password[]" value="">
</div>
</div>

View File

@@ -1,5 +0,0 @@
'use strict';
let cache = {};
module.exports = cache;

View File

@@ -1,9 +0,0 @@
<td colspan="10" class="text-center">
<br><br>
<p>It looks like there are no hosts configured.</p>
<p>
<button type="button" class="btn btn-sm btn-success proxy">Create Proxy Host</button>
<button type="button" class="btn btn-sm btn-success redirection">Create Redirection Host</button>
<button type="button" class="btn btn-sm btn-success 404">Create 404 Host</button>
</p>
</td>

View File

@@ -1,24 +0,0 @@
<table class="table table-condensed table-striped">
<thead>
<th>Source</th>
<th>Destination</th>
<th>SSL</th>
<th>Access List</th>
<th class="text-right">
<div class="btn-group">
<button type="button" class="btn btn-xs btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Create Host <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#" class="new-proxy">Proxy Host</a></li>
<li><a href="#" class="new-redirection">Redirection Host</a></li>
<li><a href="#" class="new-404">404 Host</a></li>
<li><a href="#" class="new-stream">Stream Host</a></li>
</ul>
</div>
</th>
</thead>
<tbody>
<!-- items -->
</tbody>
</table>

View File

@@ -1,49 +0,0 @@
<td>
<% if (type === 'stream') { %>
<%- incoming_port %>
<%- protocols.join(', ').toUpperCase() %>
<% } else { %>
<a href="<%- ssl ? 'https' : 'http' %>://<%- hostname %>" target="_blank"><%- hostname %></a>
<% } %>
</td>
<td>
<span class="monospace">
<% if (type === 'proxy' || type === 'stream') { %>
<%- forward_server %>:<%- forward_port %>
<% } else if (type === 'redirection') { %>
<%- forward_host %>
<% } else if (type === '404') { %>
404
<% } %>
</span>
</td>
<td>
<% if (type === 'stream') { %>
-
<% } else { %>
<% if (ssl && force_ssl) { %>
Forced
<% } else if (ssl) { %>
Enabled
<% } else { %>
No
<% } %>
<% } %>
</td>
<td>
<% if (type === 'stream') { %>
-
<% } else { %>
<% if (access_list) { %>
<a href="#" class="access_list"><%- access_list.name %></a>
<% } else { %>
<em>None</em>
<% } %>
<% } %>
</td>
<td class="text-right">
<button type="button" class="btn btn-default btn-xs reconfigure" title="Reconfigure Nginx"><i class="fa fa-refresh" aria-hidden="true"></i></button>
<button type="button" class="btn btn-default btn-xs advanced" title="Advanced Configuration"<%- type === 'stream' ? ' disabled' : '' %>><i class="fa fa-code" aria-hidden="true"></i></button>
<button type="button" class="btn btn-warning btn-xs edit" title="Edit"><i class="fa fa-pencil" aria-hidden="true"></i></button>
<button type="button" class="btn btn-danger btn-xs delete" title="Delete"><i class="fa fa-times" aria-hidden="true"></i></button>
</td>

View File

@@ -1,3 +0,0 @@
<div class="alert alert-danger" role="alert">
<strong><%- getNiceMessage() %></strong> &ndash; <%- getErrorMessage() %>
</div>

View File

@@ -1,50 +0,0 @@
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal">
<div class="modal-header text-left">
<h4 class="modal-title"><% if (typeof _id !== 'undefined') { %>Edit<% } else { %>Create<% } %> 404 Host</h4>
</div>
<div class="modal-body">
<p>A 404 host will simply return a 404 not found page for any hits to any path on the domain.</p>
<div class="form-group">
<label class="col-sm-4 control-label">Hostname</label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="myhost.example.com" name="hostname" value="<%- hostname %>" required>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="ssl" value="true"<%- ssl ? ' checked' : '' %>> Enable SSL with Letsencrypt
</label>
</div>
</div>
</div>
<div class="ssl_options"<%= ssl ? '' : ' style="display: none;"' %>>
<div class="form-group">
<label class="col-sm-4 control-label">Letsencrypt Email</label>
<div class="col-sm-8">
<input type="email" class="form-control" placeholder="" name="letsencrypt_email" value="<%- letsencrypt_email %>"<%- ssl ? ' required' : '' %>>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="accept_tos" value="true"<%- ssl && typeof _id !== 'undefined' ? ' checked' : '' %><%- ssl ? ' required' : '' %>> I accept the <a href="https://letsencrypt.org/repository/" target="_blank">Letsencrypt Terms of Service</a>
</label>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-success save">Save</button>
</div>
</form>
</div>
</div>

View File

@@ -1,23 +0,0 @@
<div class="modal-dialog">
<div class="modal-content">
<form class="form">
<div class="modal-header text-left">
<h4 class="modal-title">Advanced Configuration for <%- hostname %></h4>
</div>
<div class="modal-body">
<p>This section is for advanced users only! If you don't know Nginx configuration backwards, you should abort now.
You might typically use this for configuring additional location sections, ip restrictions or websocket proxying.</p>
<div class="form-group">
<label for="advanced-input">Additional Nginx Configuration (inside server block)</label>
<textarea class="form-control" rows="10" name="advanced" id="advanced-input"><%- advanced %></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-danger save">Save</button>
</div>
</form>
</div>
</div>

View File

@@ -1,16 +0,0 @@
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal">
<div class="modal-header text-left">
<h4 class="modal-title">Delete Host</h4>
</div>
<div class="modal-body">
<p>Are you sure? You cannot undo this.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-danger delete">Yes I'm Sure</button>
</div>
</form>
</div>
</div>

View File

@@ -1,84 +0,0 @@
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal">
<div class="modal-header text-left">
<h4 class="modal-title"><% if (typeof _id !== 'undefined') { %>Edit<% } else { %>Create<% } %> Proxy Host</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label class="col-sm-4 control-label">Hostname</label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="myhost.example.com" name="hostname" value="<%- hostname %>" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Forwarding IP</label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="192.168.0.1" name="forward_server" value="<%- forward_server %>" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Forwarding Port</label>
<div class="col-sm-8">
<input type="number" minimum="1" maximum="65535" class="form-control" placeholder="" name="forward_port" value="<%- forward_port %>" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Access List</label>
<div class="col-sm-8">
<select class="form-control" name="access_list_id">
<option value="">Loading...</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="asset_caching" value="true"<%- asset_caching ? ' checked' : '' %>> Enable Asset Caching
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="block_exploits" value="true"<%- block_exploits ? ' checked' : '' %>> Block Common Exploits
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="ssl" value="true"<%- ssl ? ' checked' : '' %>> Enable SSL with Letsencrypt
</label>
</div>
</div>
</div>
<div class="ssl_options"<%= ssl ? '' : ' style="display: none;"' %>>
<div class="form-group">
<label class="col-sm-4 control-label">Letsencrypt Email</label>
<div class="col-sm-8">
<input type="email" class="form-control" placeholder="" name="letsencrypt_email" value="<%- letsencrypt_email %>"<%- ssl ? ' required' : '' %>>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="accept_tos" value="true"<%- ssl && typeof _id !== 'undefined' ? ' checked' : '' %><%- ssl ? ' required' : '' %>> I accept the <a href="https://letsencrypt.org/repository/" target="_blank">Letsencrypt Terms of Service</a>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="force_ssl" value="true"<%- force_ssl ? ' checked' : '' %>> Redirect HTTP to HTTPS
</label>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-success save">Save</button>
</div>
</form>
</div>
</div>

View File

@@ -1,17 +0,0 @@
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal">
<div class="modal-header text-left">
<h4 class="modal-title">Reconfigure Host</h4>
</div>
<div class="modal-body">
<p>This will simply re-create the Nginx config based on it's settings. You shouldn't need to do this under normal circumstances
but if your host isn't working as expected, this may fix it.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-success reconfigure">Reconfigure</button>
</div>
</form>
</div>
</div>

View File

@@ -1,62 +0,0 @@
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal">
<div class="modal-header text-left">
<h4 class="modal-title"><% if (typeof _id !== 'undefined') { %>Edit<% } else { %>Create<% } %> Redirection Host</h4>
</div>
<div class="modal-body">
<p>A redirection host will forward browser requests on this hostname to the new hostname while keeping the same path.</p>
<div class="form-group">
<label class="col-sm-4 control-label">Hostname</label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="myhost.example.com" name="hostname" value="<%- hostname %>" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Forwarding Hostname</label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="mynewhost.example.com" name="forward_host" value="<%- forward_host %>" required>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="block_exploits" value="true"<%- block_exploits ? ' checked' : '' %>> Block Common Exploits
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="ssl" value="true"<%- ssl ? ' checked' : '' %>> Enable SSL with Letsencrypt
</label>
</div>
</div>
</div>
<div class="ssl_options"<%= ssl ? '' : ' style="display: none;"' %>>
<div class="form-group">
<label class="col-sm-4 control-label">Letsencrypt Email</label>
<div class="col-sm-8">
<input type="email" class="form-control" placeholder="" name="letsencrypt_email" value="<%- letsencrypt_email %>"<%- ssl ? ' required' : '' %>>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="accept_tos" value="true"<%- ssl && typeof _id !== 'undefined' ? ' checked' : '' %><%- ssl ? ' required' : '' %>> I accept the <a href="https://letsencrypt.org/repository/" target="_blank">Letsencrypt Terms of Service</a>
</label>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-success save">Save</button>
</div>
</form>
</div>
</div>

View File

@@ -1,55 +0,0 @@
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal">
<div class="modal-header text-left">
<h4 class="modal-title"><% if (typeof _id !== 'undefined') { %>Edit<% } else { %>Create<% } %> Stream Host</h4>
</div>
<div class="modal-body">
<div class="alert alert-warning" role="alert">
A Stream Host will forward a TCP/UDP connection directly to a another server on your network. <strong>There is no authentication.</strong>
Note you will also have to open the incoming port in your docker configuration for this to work.
<br>
<br>
You will not be able to use port <strong>80</strong>, <strong>81</strong> or <strong>443</strong> or any other previously configured Stream Host incoming port.
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Incoming Port</label>
<div class="col-sm-8">
<input type="number" minimum="1" maximum="65535" class="form-control" placeholder="" name="incoming_port" value="<%- incoming_port ? incoming_port : '' %>" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Forwarding IP</label>
<div class="col-sm-8">
<input type="text" class="form-control" placeholder="192.168.0.1" name="forward_server" value="<%- forward_server %>" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Forwarding Port</label>
<div class="col-sm-8">
<input type="number" minimum="1" maximum="65535" class="form-control" placeholder="" name="forward_port" value="<%- typeof _id === 'undefined' ? '' : forward_port %>" required>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="protocols[]" value="tcp"<%- typeof _id === 'undefined' || hasStreamProtocol('tcp') ? ' checked' : '' %>> TCP Forwarding
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="protocols[]" value="udp"<%- hasStreamProtocol('udp') ? ' checked' : '' %>> UDP Forwarding
</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-success save">Save</button>
</div>
</form>
</div>
</div>

View File

@@ -1,15 +0,0 @@
'use strict';
const Mn = require('../lib/marionette');
const Controller = require('./controller');
module.exports = Mn.AppRouter.extend({
appRoutes: {
access: 'showAccess',
'*default': 'showDashboard'
},
initialize: function () {
this.controller = Controller;
}
});

View File

@@ -1,19 +0,0 @@
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#" title="Nginx Proxy Manager"><img src="/images/favicon/android-chrome-192x192.png" alt="Nginx Proxy Manager"></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="#">Hosts</a></li>
<li><a href="#access">Access Lists</a></li>
</ul>
</div>
</div>
</nav>

View File

@@ -1,2 +0,0 @@
<section id="header"></section>
<section id="main" class="container"></section>