Compare commits
44 Commits
Author | SHA1 | Date | |
---|---|---|---|
6a8d5e2166 | |||
d732665a23 | |||
e0748c9bc7 | |||
bfb328238e | |||
64cc4f57d6 | |||
7a3c91c6a4 | |||
508bc62852 | |||
59e8446d47 | |||
d13596d2f7 | |||
9adccfa341 | |||
5cc3b53378 | |||
b62b0a2fb7 | |||
1faac4edf2 | |||
4c60dce169 | |||
771f31f44d | |||
8bedb95e1d | |||
ac4be08df2 | |||
0d6e058e23 | |||
bee2ceb667 | |||
6af13d4f40 | |||
9dd0ebd899 | |||
6e97bfa717 | |||
07b69f41eb | |||
6bd2ac7d6d | |||
528e5ef3bc | |||
bc1c50ac92 | |||
8c2ab42b75 | |||
62053d15d4 | |||
6fed642aba | |||
72ac549a58 | |||
9f38617135 | |||
94eec805df | |||
05a940e732 | |||
1c43cc2181 | |||
657ee73ff1 | |||
4ee5d993cf | |||
70a445e2d7 | |||
2115da210d | |||
540554c4f6 | |||
1337c50d28 | |||
c5ceb3b2b1 | |||
57fc1d8f08 | |||
1518ecd1e9 | |||
6be0343918 |
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"database": {
|
|
||||||
"engine": "mysql",
|
|
||||||
"host": "db",
|
|
||||||
"name": "npm",
|
|
||||||
"user": "npm",
|
|
||||||
"password": "npm",
|
|
||||||
"port": 3306
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"database": {
|
|
||||||
"engine": "knex-native",
|
|
||||||
"knex": {
|
|
||||||
"client": "sqlite3",
|
|
||||||
"connection": {
|
|
||||||
"filename": "/data/database.sqlite"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
26
README.md
26
README.md
@ -1,7 +1,7 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://nginxproxymanager.com/github.png">
|
<img src="https://nginxproxymanager.com/github.png">
|
||||||
<br><br>
|
<br><br>
|
||||||
<img src="https://img.shields.io/badge/version-2.6.2-green.svg?style=for-the-badge">
|
<img src="https://img.shields.io/badge/version-2.7.3-green.svg?style=for-the-badge">
|
||||||
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
|
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
|
||||||
<img src="https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge">
|
<img src="https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge">
|
||||||
</a>
|
</a>
|
||||||
@ -205,6 +205,30 @@ Special thanks to the following contributors:
|
|||||||
<br /><sub><b>Philip Mooney</b></sub>
|
<br /><sub><b>Philip Mooney</b></sub>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<a href="https://github.com/WaterCalm">
|
||||||
|
<img src="https://avatars1.githubusercontent.com/u/23502129?s=400&v=4" width="80px;" alt=""/>
|
||||||
|
<br /><sub><b>WaterCalm</b></sub>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<a href="https://github.com/lebrou34">
|
||||||
|
<img src="https://avatars1.githubusercontent.com/u/16373103?s=460&v=4" width="80px;" alt=""/>
|
||||||
|
<br /><sub><b>lebrou34</b></sub>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<a href="https://github.com/lightglitch">
|
||||||
|
<img src="https://avatars0.githubusercontent.com/u/196953?s=460&v=4" width="80px;" alt=""/>
|
||||||
|
<br /><sub><b>Mário Franco</b></sub>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<a href="https://github.com/klutchell">
|
||||||
|
<img src="https://avatars3.githubusercontent.com/u/20458272?s=460&v=4" width="80px;" alt=""/>
|
||||||
|
<br /><sub><b>Kyle Harding</b></sub>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<!-- markdownlint-enable -->
|
<!-- markdownlint-enable -->
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
const logger = require('./logger').global;
|
const logger = require('./logger').global;
|
||||||
|
|
||||||
function appStart () {
|
async function appStart () {
|
||||||
|
// Create config file db settings if environment variables have been set
|
||||||
|
await createDbConfigFromEnvironment();
|
||||||
|
|
||||||
const migrate = require('./migrate');
|
const migrate = require('./migrate');
|
||||||
const setup = require('./setup');
|
const setup = require('./setup');
|
||||||
const app = require('./app');
|
const app = require('./app');
|
||||||
@ -39,9 +42,92 @@ function appStart () {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function createDbConfigFromEnvironment() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const envMysqlHost = process.env.DB_MYSQL_HOST || null;
|
||||||
|
const envMysqlPort = process.env.DB_MYSQL_PORT || null;
|
||||||
|
const envMysqlUser = process.env.DB_MYSQL_USER || null;
|
||||||
|
const envMysqlName = process.env.DB_MYSQL_NAME || null;
|
||||||
|
const envSqliteFile = process.env.DB_SQLITE_FILE || null;
|
||||||
|
|
||||||
|
if ((envMysqlHost && envMysqlPort && envMysqlUser && envMysqlName) || envSqliteFile) {
|
||||||
|
const fs = require('fs');
|
||||||
|
const filename = (process.env.NODE_CONFIG_DIR || './config') + '/' + (process.env.NODE_ENV || 'default') + '.json';
|
||||||
|
let configData = {};
|
||||||
|
|
||||||
|
try {
|
||||||
|
configData = require(filename);
|
||||||
|
} catch (err) {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configData.database && configData.database.engine && !configData.database.fromEnv) {
|
||||||
|
logger.info('Manual db configuration already exists, skipping config creation from environment variables');
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (envMysqlHost && envMysqlPort && envMysqlUser && envMysqlName) {
|
||||||
|
const newConfig = {
|
||||||
|
fromEnv: true,
|
||||||
|
engine: 'mysql',
|
||||||
|
host: envMysqlHost,
|
||||||
|
port: envMysqlPort,
|
||||||
|
user: envMysqlUser,
|
||||||
|
password: process.env.DB_MYSQL_PASSWORD,
|
||||||
|
name: envMysqlName,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (JSON.stringify(configData.database) === JSON.stringify(newConfig)) {
|
||||||
|
// Config is unchanged, skip overwrite
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info('Generating MySQL db configuration from environment variables');
|
||||||
|
configData.database = newConfig;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
const newConfig = {
|
||||||
|
fromEnv: true,
|
||||||
|
engine: 'knex-native',
|
||||||
|
knex: {
|
||||||
|
client: 'sqlite3',
|
||||||
|
connection: {
|
||||||
|
filename: envSqliteFile
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (JSON.stringify(configData.database) === JSON.stringify(newConfig)) {
|
||||||
|
// Config is unchanged, skip overwrite
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info('Generating Sqlite db configuration from environment variables');
|
||||||
|
configData.database = newConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write config
|
||||||
|
fs.writeFile(filename, JSON.stringify(configData, null, 2), (err) => {
|
||||||
|
if (err) {
|
||||||
|
logger.error('Could not write db config to config file: ' + filename);
|
||||||
|
reject(err);
|
||||||
|
} else {
|
||||||
|
logger.info('Wrote db configuration to config file: ' + filename);
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
appStart();
|
appStart();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error(err.message, err);
|
logger.error(err.message, err);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,6 +216,13 @@ const internalCertificate = {
|
|||||||
return saved_row;
|
return saved_row;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}).catch(async (error) => {
|
||||||
|
// Delete the certificate from the database if it was not created successfully
|
||||||
|
await certificateModel
|
||||||
|
.query()
|
||||||
|
.deleteById(certificate.id);
|
||||||
|
|
||||||
|
throw error;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return certificate;
|
return certificate;
|
||||||
@ -608,17 +615,25 @@ const internalCertificate = {
|
|||||||
checkPrivateKey: (private_key) => {
|
checkPrivateKey: (private_key) => {
|
||||||
return tempWrite(private_key, '/tmp')
|
return tempWrite(private_key, '/tmp')
|
||||||
.then((filepath) => {
|
.then((filepath) => {
|
||||||
let key_type = private_key.includes('-----BEGIN RSA') ? 'rsa' : 'ec';
|
return new Promise((resolve, reject) => {
|
||||||
return utils.exec('openssl ' + key_type + ' -in ' + filepath + ' -check -noout 2>&1 ')
|
const failTimeout = setTimeout(() => {
|
||||||
|
reject(new error.ValidationError('Result Validation Error: Validation timed out. This could be due to the key being passphrase-protected.'));
|
||||||
|
}, 10000);
|
||||||
|
utils
|
||||||
|
.exec('openssl pkey -in ' + filepath + ' -check -noout 2>&1 ')
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (!result.toLowerCase().includes('key ok') && !result.toLowerCase().includes('key valid') ) {
|
clearTimeout(failTimeout);
|
||||||
throw new error.ValidationError('Result Validation Error: ' + result);
|
if (!result.toLowerCase().includes('key is valid')) {
|
||||||
|
reject(new error.ValidationError('Result Validation Error: ' + result));
|
||||||
}
|
}
|
||||||
fs.unlinkSync(filepath);
|
fs.unlinkSync(filepath);
|
||||||
return true;
|
resolve(true);
|
||||||
}).catch((err) => {
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
clearTimeout(failTimeout);
|
||||||
fs.unlinkSync(filepath);
|
fs.unlinkSync(filepath);
|
||||||
throw new error.ValidationError('Certificate Key is not valid (' + err.message + ')', err);
|
reject(new error.ValidationError('Certificate Key is not valid (' + err.message + ')', err));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -106,7 +106,7 @@ const internalHost = {
|
|||||||
response_object.total_count += response_object.redirection_hosts.length;
|
response_object.total_count += response_object.redirection_hosts.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (promises_results[1]) {
|
if (promises_results[2]) {
|
||||||
// Dead Hosts
|
// Dead Hosts
|
||||||
response_object.dead_hosts = internalHost._getHostsWithDomains(promises_results[2], domain_names);
|
response_object.dead_hosts = internalHost._getHostsWithDomains(promises_results[2], domain_names);
|
||||||
response_object.total_count += response_object.dead_hosts.length;
|
response_object.total_count += response_object.dead_hosts.length;
|
||||||
@ -158,7 +158,7 @@ const internalHost = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (promises_results[1]) {
|
if (promises_results[2]) {
|
||||||
// Dead Hosts
|
// Dead Hosts
|
||||||
if (internalHost._checkHostnameRecordsTaken(hostname, promises_results[2], ignore_type === 'dead' && ignore_id ? ignore_id : 0)) {
|
if (internalHost._checkHostnameRecordsTaken(hostname, promises_results[2], ignore_type === 'dead' && ignore_id ? ignore_id : 0)) {
|
||||||
is_taken = true;
|
is_taken = true;
|
||||||
|
@ -1548,9 +1548,9 @@ inherits@2.0.3:
|
|||||||
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
||||||
|
|
||||||
ini@^1.3.4, ini@^1.3.5, ini@~1.3.0:
|
ini@^1.3.4, ini@^1.3.5, ini@~1.3.0:
|
||||||
version "1.3.5"
|
version "1.3.8"
|
||||||
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
|
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
|
||||||
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
|
integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
|
||||||
|
|
||||||
inquirer@^7.0.0:
|
inquirer@^7.0.0:
|
||||||
version "7.3.3"
|
version "7.3.3"
|
||||||
|
@ -5,11 +5,15 @@ services:
|
|||||||
fullstack-mysql:
|
fullstack-mysql:
|
||||||
image: ${IMAGE}:ci-${BUILD_NUMBER}
|
image: ${IMAGE}:ci-${BUILD_NUMBER}
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=development
|
NODE_ENV: "development"
|
||||||
- FORCE_COLOR=1
|
FORCE_COLOR: 1
|
||||||
|
DB_MYSQL_HOST: "db"
|
||||||
|
DB_MYSQL_PORT: 3306
|
||||||
|
DB_MYSQL_USER: "npm"
|
||||||
|
DB_MYSQL_PASSWORD: "npm"
|
||||||
|
DB_MYSQL_NAME: "npm"
|
||||||
volumes:
|
volumes:
|
||||||
- npm_data:/data
|
- npm_data:/data
|
||||||
- ../.jenkins/config-mysql.json:/app/config/development.json
|
|
||||||
expose:
|
expose:
|
||||||
- 81
|
- 81
|
||||||
- 80
|
- 80
|
||||||
@ -20,11 +24,11 @@ services:
|
|||||||
fullstack-sqlite:
|
fullstack-sqlite:
|
||||||
image: ${IMAGE}:ci-${BUILD_NUMBER}
|
image: ${IMAGE}:ci-${BUILD_NUMBER}
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=development
|
NODE_ENV: "development"
|
||||||
- FORCE_COLOR=1
|
FORCE_COLOR: 1
|
||||||
|
DB_SQLITE_FILE: "/data/database.sqlite"
|
||||||
volumes:
|
volumes:
|
||||||
- npm_data:/data
|
- npm_data:/data
|
||||||
- ../.jenkins/config-sqlite.json:/app/config/development.json
|
|
||||||
expose:
|
expose:
|
||||||
- 81
|
- 81
|
||||||
- 80
|
- 80
|
||||||
@ -43,8 +47,8 @@ services:
|
|||||||
cypress-mysql:
|
cypress-mysql:
|
||||||
image: ${IMAGE}-cypress:ci-${BUILD_NUMBER}
|
image: ${IMAGE}-cypress:ci-${BUILD_NUMBER}
|
||||||
build:
|
build:
|
||||||
context: ../
|
context: ../test/
|
||||||
dockerfile: test/cypress/Dockerfile
|
dockerfile: cypress/Dockerfile
|
||||||
environment:
|
environment:
|
||||||
CYPRESS_baseUrl: "http://fullstack-mysql:81"
|
CYPRESS_baseUrl: "http://fullstack-mysql:81"
|
||||||
volumes:
|
volumes:
|
||||||
@ -54,8 +58,8 @@ services:
|
|||||||
cypress-sqlite:
|
cypress-sqlite:
|
||||||
image: ${IMAGE}-cypress:ci-${BUILD_NUMBER}
|
image: ${IMAGE}-cypress:ci-${BUILD_NUMBER}
|
||||||
build:
|
build:
|
||||||
context: ../
|
context: ../test/
|
||||||
dockerfile: test/cypress/Dockerfile
|
dockerfile: cypress/Dockerfile
|
||||||
environment:
|
environment:
|
||||||
CYPRESS_baseUrl: "http://fullstack-sqlite:81"
|
CYPRESS_baseUrl: "http://fullstack-sqlite:81"
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -14,10 +14,16 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- nginx_proxy_manager
|
- nginx_proxy_manager
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=development
|
NODE_ENV: "development"
|
||||||
- FORCE_COLOR=1
|
FORCE_COLOR: 1
|
||||||
- DEVELOPMENT=true
|
DEVELOPMENT: "true"
|
||||||
#- DISABLE_IPV6=true
|
DB_MYSQL_HOST: "db"
|
||||||
|
DB_MYSQL_PORT: 3306
|
||||||
|
DB_MYSQL_USER: "npm"
|
||||||
|
DB_MYSQL_PASSWORD: "npm"
|
||||||
|
DB_MYSQL_NAME: "npm"
|
||||||
|
# DB_SQLITE_FILE: "/data/database.sqlite"
|
||||||
|
# DISABLE_IPV6: "true"
|
||||||
volumes:
|
volumes:
|
||||||
- npm_data:/data
|
- npm_data:/data
|
||||||
- le_data:/etc/letsencrypt
|
- le_data:/etc/letsencrypt
|
||||||
|
@ -84,6 +84,9 @@ http {
|
|||||||
stream {
|
stream {
|
||||||
# Files generated by NPM
|
# Files generated by NPM
|
||||||
include /data/nginx/stream/*.conf;
|
include /data/nginx/stream/*.conf;
|
||||||
|
|
||||||
|
# Custom
|
||||||
|
include /data/nginx/custom/stream[.]conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Custom
|
# Custom
|
||||||
|
@ -45,21 +45,7 @@ footer: MIT Licensed | Copyright © 2016-present jc21.com
|
|||||||
- [Docker Install documentation](https://docs.docker.com/install/)
|
- [Docker Install documentation](https://docs.docker.com/install/)
|
||||||
- [Docker-Compose Install documentation](https://docs.docker.com/compose/install/)
|
- [Docker-Compose Install documentation](https://docs.docker.com/compose/install/)
|
||||||
|
|
||||||
2. Create a config file for example
|
2. Create a docker-compose.yml file similar to this:
|
||||||
```json
|
|
||||||
{
|
|
||||||
"database": {
|
|
||||||
"engine": "mysql",
|
|
||||||
"host": "db",
|
|
||||||
"name": "npm",
|
|
||||||
"user": "npm",
|
|
||||||
"password": "npm",
|
|
||||||
"port": 3306
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Create a docker-compose.yml file similar to this:
|
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
version: '3'
|
version: '3'
|
||||||
@ -70,8 +56,13 @@ services:
|
|||||||
- '80:80'
|
- '80:80'
|
||||||
- '81:81'
|
- '81:81'
|
||||||
- '443:443'
|
- '443:443'
|
||||||
|
environment:
|
||||||
|
DB_MYSQL_HOST: "db"
|
||||||
|
DB_MYSQL_PORT: 3306
|
||||||
|
DB_MYSQL_USER: "npm"
|
||||||
|
DB_MYSQL_PASSWORD: "npm"
|
||||||
|
DB_MYSQL_NAME: "npm"
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.json:/app/config/production.json
|
|
||||||
- ./data:/data
|
- ./data:/data
|
||||||
- ./letsencrypt:/etc/letsencrypt
|
- ./letsencrypt:/etc/letsencrypt
|
||||||
db:
|
db:
|
||||||
@ -85,13 +76,13 @@ services:
|
|||||||
- ./data/mysql:/var/lib/mysql
|
- ./data/mysql:/var/lib/mysql
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Bring up your stack
|
3. Bring up your stack
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Log in to the Admin UI
|
4. Log in to the Admin UI
|
||||||
|
|
||||||
When your docker container is running, connect to it on port `81` for the admin interface.
|
When your docker container is running, connect to it on port `81` for the admin interface.
|
||||||
Sometimes this can take a little bit because of the entropy of keys.
|
Sometimes this can take a little bit because of the entropy of keys.
|
||||||
|
@ -24,6 +24,7 @@ You can add your custom configuration snippet files at `/data/nginx/custom` as f
|
|||||||
|
|
||||||
- `/data/nginx/custom/root.conf`: Included at the very end of nginx.conf
|
- `/data/nginx/custom/root.conf`: Included at the very end of nginx.conf
|
||||||
- `/data/nginx/custom/http.conf`: Included at the end of the main http block
|
- `/data/nginx/custom/http.conf`: Included at the end of the main http block
|
||||||
|
- `/data/nginx/custom/stream.conf`: Included at the end of the main stream block
|
||||||
- `/data/nginx/custom/server_proxy.conf`: Included at the end of every proxy server block
|
- `/data/nginx/custom/server_proxy.conf`: Included at the end of every proxy server block
|
||||||
- `/data/nginx/custom/server_redirect.conf`: Included at the end of every redirection server block
|
- `/data/nginx/custom/server_redirect.conf`: Included at the end of every redirection server block
|
||||||
- `/data/nginx/custom/server_stream.conf`: Included at the end of every stream server block
|
- `/data/nginx/custom/server_stream.conf`: Included at the end of every stream server block
|
||||||
|
@ -1,50 +1,5 @@
|
|||||||
# Full Setup Instructions
|
# Full Setup Instructions
|
||||||
|
|
||||||
### Configuration File
|
|
||||||
|
|
||||||
**The configuration file needs to be provided by you!**
|
|
||||||
|
|
||||||
Don't worry, this is easy to do.
|
|
||||||
|
|
||||||
The app requires a configuration file to let it know what database you're using. By default, this file is called `config.json`
|
|
||||||
|
|
||||||
Here's an example configuration for `mysql` (or mariadb) that is compatible with the docker-compose example below:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"database": {
|
|
||||||
"engine": "mysql",
|
|
||||||
"host": "db",
|
|
||||||
"name": "npm",
|
|
||||||
"user": "npm",
|
|
||||||
"password": "npm",
|
|
||||||
"port": 3306
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively if you would like to use a Sqlite database file:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"database": {
|
|
||||||
"engine": "knex-native",
|
|
||||||
"knex": {
|
|
||||||
"client": "sqlite3",
|
|
||||||
"connection": {
|
|
||||||
"filename": "/data/database.sqlite"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Once you've created your configuration file it's easy to mount it in the docker container.
|
|
||||||
|
|
||||||
**Note:** After the first run of the application, the config file will be altered to include generated encryption keys unique to your installation. These keys
|
|
||||||
affect the login and session management of the application. If these keys change for any reason, all users will be logged out.
|
|
||||||
|
|
||||||
|
|
||||||
### MySQL Database
|
### MySQL Database
|
||||||
|
|
||||||
If you opt for the MySQL configuration you will have to provide the database server yourself. You can also use MariaDB. Here are the minimum supported versions:
|
If you opt for the MySQL configuration you will have to provide the database server yourself. You can also use MariaDB. Here are the minimum supported versions:
|
||||||
@ -61,7 +16,6 @@ When using a `mariadb` database, the NPM configuration file should still use the
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
||||||
### Running the App
|
### Running the App
|
||||||
|
|
||||||
Via `docker-compose`:
|
Via `docker-compose`:
|
||||||
@ -70,7 +24,7 @@ Via `docker-compose`:
|
|||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: jc21/nginx-proxy-manager:2
|
image: 'jc21/nginx-proxy-manager:latest'
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
# Public HTTP Port:
|
# Public HTTP Port:
|
||||||
@ -80,11 +34,18 @@ services:
|
|||||||
# Admin Web Port:
|
# Admin Web Port:
|
||||||
- '81:81'
|
- '81:81'
|
||||||
environment:
|
environment:
|
||||||
|
# These are the settings to access your db
|
||||||
|
DB_MYSQL_HOST: "db"
|
||||||
|
DB_MYSQL_PORT: 3306
|
||||||
|
DB_MYSQL_USER: "npm"
|
||||||
|
DB_MYSQL_PASSWORD: "npm"
|
||||||
|
DB_MYSQL_NAME: "npm"
|
||||||
|
# If you would rather use Sqlite uncomment this
|
||||||
|
# and remove all DB_MYSQL_* lines above
|
||||||
|
# DB_SQLITE_FILE: "/data/database.sqlite"
|
||||||
# Uncomment this if IPv6 is not enabled on your host
|
# Uncomment this if IPv6 is not enabled on your host
|
||||||
# DISABLE_IPV6: 'true'
|
# DISABLE_IPV6: 'true'
|
||||||
volumes:
|
volumes:
|
||||||
# Make sure this config.json file exists as per instructions above:
|
|
||||||
- ./config.json:/app/config/production.json
|
|
||||||
- ./data:/data
|
- ./data:/data
|
||||||
- ./letsencrypt:/etc/letsencrypt
|
- ./letsencrypt:/etc/letsencrypt
|
||||||
depends_on:
|
depends_on:
|
||||||
@ -101,14 +62,14 @@ services:
|
|||||||
- ./data/mysql:/var/lib/mysql
|
- ./data/mysql:/var/lib/mysql
|
||||||
```
|
```
|
||||||
|
|
||||||
|
_Please note, that `DB_MYSQL_*` environment variables will take precedent over `DB_SQLITE_*` variables. So if you keep the MySQL variables, you will not be able to use Sqlite._
|
||||||
|
|
||||||
Then:
|
Then:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
The config file (config.json) must be present in this directory.
|
|
||||||
|
|
||||||
### Running on Raspberry PI / ARM devices
|
### Running on Raspberry PI / ARM devices
|
||||||
|
|
||||||
The docker images support the following architectures:
|
The docker images support the following architectures:
|
||||||
@ -146,3 +107,49 @@ Password: changeme
|
|||||||
```
|
```
|
||||||
|
|
||||||
Immediately after logging in with this default user you will be asked to modify your details and change your password.
|
Immediately after logging in with this default user you will be asked to modify your details and change your password.
|
||||||
|
|
||||||
|
### Configuration File
|
||||||
|
|
||||||
|
::: warning
|
||||||
|
|
||||||
|
This section is meant for advanced users
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
||||||
|
If you would like more control over the database settings you can define a custom config JSON file.
|
||||||
|
|
||||||
|
|
||||||
|
Here's an example for `sqlite` configuration as it is generated from the environment variables:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"database": {
|
||||||
|
"engine": "knex-native",
|
||||||
|
"knex": {
|
||||||
|
"client": "sqlite3",
|
||||||
|
"connection": {
|
||||||
|
"filename": "/data/database.sqlite"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
You can modify the `knex` object with your custom configuration, but note that not all knex clients might be installed in the image.
|
||||||
|
|
||||||
|
Once you've created your configuration file you can mount it to `/app/config/production.json` inside you container using:
|
||||||
|
|
||||||
|
```
|
||||||
|
[...]
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: 'jc21/nginx-proxy-manager:latest'
|
||||||
|
[...]
|
||||||
|
volumes:
|
||||||
|
- ./config.json:/app/config/production.json
|
||||||
|
[...]
|
||||||
|
[...]
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** After the first run of the application, the config file will be altered to include generated encryption keys unique to your installation.
|
||||||
|
These keys affect the login and session management of the application. If these keys change for any reason, all users will be logged out.
|
||||||
|
@ -5125,9 +5125,9 @@ inherits@2.0.3:
|
|||||||
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
|
||||||
|
|
||||||
ini@^1.3.5, ini@~1.3.0:
|
ini@^1.3.5, ini@~1.3.0:
|
||||||
version "1.3.5"
|
version "1.3.8"
|
||||||
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
|
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
|
||||||
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
|
integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
|
||||||
|
|
||||||
internal-ip@^4.3.0:
|
internal-ip@^4.3.0:
|
||||||
version "4.3.0"
|
version "4.3.0"
|
||||||
|
@ -16,6 +16,8 @@ module.exports = Mn.View.extend({
|
|||||||
events: {
|
events: {
|
||||||
'click @ui.save': function (e) {
|
'click @ui.save': function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
this.ui.save.addClass('btn-loading');
|
||||||
|
this.ui.buttons.prop('disabled', true).addClass('btn-disabled');
|
||||||
|
|
||||||
App.Api.Nginx.Certificates.delete(this.model.get('id'))
|
App.Api.Nginx.Certificates.delete(this.model.get('id'))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -25,6 +27,7 @@ module.exports = Mn.View.extend({
|
|||||||
.catch(err => {
|
.catch(err => {
|
||||||
alert(err.message);
|
alert(err.message);
|
||||||
this.ui.buttons.prop('disabled', false).removeClass('btn-disabled');
|
this.ui.buttons.prop('disabled', false).removeClass('btn-disabled');
|
||||||
|
this.ui.save.removeClass('btn-loading');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,6 +129,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<% } else if (provider === 'other') { %>
|
<% } else if (provider === 'other') { %>
|
||||||
<!-- Other -->
|
<!-- Other -->
|
||||||
|
<div class="col-sm-12 col-md-12">
|
||||||
|
<div class="text-blue mb-4"><i class="fe fe-alert-triangle"></i> <%= i18n('ssl', 'passphrase-protection-support-info') %></div>
|
||||||
|
</div>
|
||||||
<div class="col-sm-12 col-md-12">
|
<div class="col-sm-12 col-md-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label"><%- i18n('str', 'name') %> <span class="form-required">*</span></label>
|
<label class="form-label"><%- i18n('str', 'name') %> <span class="form-required">*</span></label>
|
||||||
|
@ -112,7 +112,8 @@
|
|||||||
"stored-as-plaintext-info": "This data will be stored as plaintext in the database and in a file!",
|
"stored-as-plaintext-info": "This data will be stored as plaintext in the database and in a file!",
|
||||||
"propagation-seconds": "Propagation Seconds",
|
"propagation-seconds": "Propagation Seconds",
|
||||||
"propagation-seconds-info": "Leave empty to use the plugins default value. Number of seconds to wait for DNS propagation.",
|
"propagation-seconds-info": "Leave empty to use the plugins default value. Number of seconds to wait for DNS propagation.",
|
||||||
"processing-info": "Processing... This might take a few minutes."
|
"processing-info": "Processing... This might take a few minutes.",
|
||||||
|
"passphrase-protection-support-info": "Key files protected with a passphrase are not supported."
|
||||||
},
|
},
|
||||||
"proxy-hosts": {
|
"proxy-hosts": {
|
||||||
"title": "Proxy Hosts",
|
"title": "Proxy Hosts",
|
||||||
|
@ -20,6 +20,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
aliyun: {
|
||||||
|
display_name: 'Aliyun',
|
||||||
|
package_name: 'certbot-dns-aliyun',
|
||||||
|
package_version: '0.38.1',
|
||||||
|
dependencies: '',
|
||||||
|
credentials: `certbot_dns_aliyun:dns_aliyun_access_key = 12345678
|
||||||
|
certbot_dns_aliyun:dns_aliyun_access_key_secret = 1234567890abcdef1234567890abcdef`,
|
||||||
|
full_plugin_name: 'certbot-dns-aliyun:dns-aliyun',
|
||||||
|
},
|
||||||
|
//####################################################//
|
||||||
cloudflare: {
|
cloudflare: {
|
||||||
display_name: 'Cloudflare',
|
display_name: 'Cloudflare',
|
||||||
package_name: 'certbot-dns-cloudflare',
|
package_name: 'certbot-dns-cloudflare',
|
||||||
@ -110,6 +120,15 @@ certbot_dns_dnspod:dns_dnspod_api_token = "DNSPOD-API-TOKEN"`,
|
|||||||
full_plugin_name: 'certbot-dns-dnspod:dns-dnspod',
|
full_plugin_name: 'certbot-dns-dnspod:dns-dnspod',
|
||||||
},
|
},
|
||||||
//####################################################//
|
//####################################################//
|
||||||
|
gandi: {
|
||||||
|
display_name: 'Gandi Live DNS',
|
||||||
|
package_name: 'certbot_plugin_gandi',
|
||||||
|
package_version: '1.2.5',
|
||||||
|
dependencies: '',
|
||||||
|
credentials: 'certbot_plugin_gandi:dns_api_key = APIKEY',
|
||||||
|
full_plugin_name: 'certbot-plugin-gandi:dns',
|
||||||
|
},
|
||||||
|
//####################################################//
|
||||||
google: {
|
google: {
|
||||||
display_name: 'Google',
|
display_name: 'Google',
|
||||||
package_name: 'certbot-dns-google',
|
package_name: 'certbot-dns-google',
|
||||||
|
1
test/.dockerignore
Normal file
1
test/.dockerignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
node_modules
|
@ -1,6 +1,11 @@
|
|||||||
FROM cypress/included:4.12.1
|
FROM cypress/included:5.6.0
|
||||||
|
|
||||||
COPY --chown=1000 ./test /test
|
COPY --chown=1000 ./ /test
|
||||||
|
|
||||||
|
# mkcert
|
||||||
|
ENV MKCERT=1.4.2
|
||||||
|
RUN wget -O /usr/bin/mkcert "https://github.com/FiloSottile/mkcert/releases/download/v${MKCERT}/mkcert-v${MKCERT}-linux-amd64" \
|
||||||
|
&& chmod +x /usr/bin/mkcert
|
||||||
|
|
||||||
WORKDIR /test
|
WORKDIR /test
|
||||||
RUN yarn install
|
RUN yarn install
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"@jc21/cypress-swagger-validation": "^0.0.9",
|
"@jc21/cypress-swagger-validation": "^0.0.9",
|
||||||
"@jc21/restler": "^3.4.0",
|
"@jc21/restler": "^3.4.0",
|
||||||
"chalk": "^4.1.0",
|
"chalk": "^4.1.0",
|
||||||
"cypress": "^4.12.1",
|
"cypress": "^5.6.0",
|
||||||
"cypress-multi-reporters": "^1.4.0",
|
"cypress-multi-reporters": "^1.4.0",
|
||||||
"cypress-plugin-retries": "^1.5.2",
|
"cypress-plugin-retries": "^1.5.2",
|
||||||
"eslint": "^7.6.0",
|
"eslint": "^7.6.0",
|
||||||
|
@ -1293,9 +1293,9 @@ inherits@2, inherits@^2.0.3, inherits@~2.0.3:
|
|||||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||||
|
|
||||||
ini@^1.3.5:
|
ini@^1.3.5:
|
||||||
version "1.3.5"
|
version "1.3.8"
|
||||||
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
|
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
|
||||||
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
|
integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
|
||||||
|
|
||||||
is-arguments@^1.0.4:
|
is-arguments@^1.0.4:
|
||||||
version "1.0.4"
|
version "1.0.4"
|
||||||
|
Reference in New Issue
Block a user