dep updates/close #945 and #940/switch to better-sqlite3/allow to disable nginxbeautifier
Signed-off-by: Zoey <zoey@z0ey.de>
This commit is contained in:
parent
81b8b983e1
commit
a039e7165d
18 changed files with 140 additions and 79 deletions
|
@ -29,10 +29,10 @@ RUN apk upgrade --no-cache -a && \
|
||||||
apk add --no-cache ca-certificates nodejs yarn file && \
|
apk add --no-cache ca-certificates nodejs yarn file && \
|
||||||
yarn global add clean-modules && \
|
yarn global add clean-modules && \
|
||||||
if [ "$TARGETARCH" = "amd64" ]; then \
|
if [ "$TARGETARCH" = "amd64" ]; then \
|
||||||
npm_config_target_platform=linux npm_config_target_arch=x64 yarn install --no-lockfile && \
|
npm_config_arch=x64 npm_config_target_arch=x64 yarn install --no-lockfile && \
|
||||||
for file in $(find /app/node_modules -name "*.node" -type f -exec file {} \; | grep -v "x86-64\|x86_64" | grep "aarch64\|arm64" | sed "s|\([^:]\):.*|\1|g"); do rm -v "$file"; done; \
|
for file in $(find /app/node_modules -name "*.node" -type f -exec file {} \; | grep -v "x86-64\|x86_64" | grep "aarch64\|arm64" | sed "s|\([^:]\):.*|\1|g"); do rm -v "$file"; done; \
|
||||||
elif [ "$TARGETARCH" = "arm64" ]; then \
|
elif [ "$TARGETARCH" = "arm64" ]; then \
|
||||||
npm_config_target_platform=linux npm_config_target_arch=arm64 yarn install --no-lockfile && \
|
npm_config_arch=arm64 npm_config_target_arch=arm64 yarn install --no-lockfile && \
|
||||||
for file in $(find /app/node_modules -name "*.node" -type f -exec file {} \; | grep -v "aarch64\|arm64" | grep "x86-64\|x86_64" | sed "s|\([^:]\):.*|\1|g"); do rm -v "$file"; done; \
|
for file in $(find /app/node_modules -name "*.node" -type f -exec file {} \; | grep -v "aarch64\|arm64" | grep "x86-64\|x86_64" | sed "s|\([^:]\):.*|\1|g"); do rm -v "$file"; done; \
|
||||||
fi && \
|
fi && \
|
||||||
yarn cache clean --all && \
|
yarn cache clean --all && \
|
||||||
|
@ -67,11 +67,11 @@ RUN apk upgrade --no-cache -a && \
|
||||||
sed -i "s|BOUNCING_ON_TYPE=all|BOUNCING_ON_TYPE=ban|g" /src/crowdsec-nginx-bouncer/lua-mod/config_example.conf
|
sed -i "s|BOUNCING_ON_TYPE=all|BOUNCING_ON_TYPE=ban|g" /src/crowdsec-nginx-bouncer/lua-mod/config_example.conf
|
||||||
|
|
||||||
|
|
||||||
FROM zoeyvid/nginx-quic:296-python
|
FROM zoeyvid/nginx-quic:297-python
|
||||||
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
|
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
|
||||||
COPY rootfs /
|
COPY rootfs /
|
||||||
COPY --from=zoeyvid/certbot-docker:43 /usr/local /usr/local
|
COPY --from=zoeyvid/certbot-docker:43 /usr/local /usr/local
|
||||||
COPY --from=zoeyvid/curl-quic:397 /usr/local/bin/curl /usr/local/bin/curl
|
COPY --from=zoeyvid/curl-quic:399 /usr/local/bin/curl /usr/local/bin/curl
|
||||||
|
|
||||||
ARG CRS_VER=v4.4.0
|
ARG CRS_VER=v4.4.0
|
||||||
RUN apk upgrade --no-cache -a && \
|
RUN apk upgrade --no-cache -a && \
|
||||||
|
@ -138,6 +138,7 @@ ENV PUID=0 \
|
||||||
NGINX_LOG_NOT_FOUND=false \
|
NGINX_LOG_NOT_FOUND=false \
|
||||||
NGINX_404_REDIRECT=false \
|
NGINX_404_REDIRECT=false \
|
||||||
NGINX_DISABLE_PROXY_BUFFERING=false \
|
NGINX_DISABLE_PROXY_BUFFERING=false \
|
||||||
|
DISABLE_NGINX_BEAUTIFIER=false \
|
||||||
CLEAN=true \
|
CLEAN=true \
|
||||||
FULLCLEAN=false \
|
FULLCLEAN=false \
|
||||||
SKIP_IP_RANGES=false \
|
SKIP_IP_RANGES=false \
|
||||||
|
|
|
@ -806,9 +806,8 @@ const internalCertificate = {
|
||||||
logger.info(`Requesting Certbot certificates via ${dnsPlugin.name} for Cert #${certificate.id}: ${certificate.domain_names.join(', ')}`);
|
logger.info(`Requesting Certbot certificates via ${dnsPlugin.name} for Cert #${certificate.id}: ${certificate.domain_names.join(', ')}`);
|
||||||
|
|
||||||
const credentialsLocation = '/data/tls/certbot/credentials/credentials-' + certificate.id;
|
const credentialsLocation = '/data/tls/certbot/credentials/credentials-' + certificate.id;
|
||||||
// Escape single quotes and backslashes
|
fs.mkdirSync('/data/tls/certbot/credentials', { recursive: true });
|
||||||
const escapedCredentials = certificate.meta.dns_provider_credentials.replaceAll("'", "\\'").replaceAll('\\', '\\\\');
|
fs.writeFileSync(credentialsLocation, certificate.meta.dns_provider_credentials, { mode: 0o600 });
|
||||||
const credentialsCmd = `echo '${escapedCredentials}' | tee '${credentialsLocation}'`;
|
|
||||||
|
|
||||||
let mainCmd = certbotCommand + ' certonly ' + '--config "' + certbotConfig + '" ' + '--cert-name "npm-' + certificate.id + '" ' + '--domains "' + certificate.domain_names.join(',') + '" ' + '--authenticator ' + dnsPlugin.full_plugin_name + ' ' + '--' + dnsPlugin.full_plugin_name + '-credentials "' + credentialsLocation + '"' + (certificate.meta.propagation_seconds !== undefined ? ' --' + dnsPlugin.full_plugin_name + '-propagation-seconds ' + certificate.meta.propagation_seconds : '');
|
let mainCmd = certbotCommand + ' certonly ' + '--config "' + certbotConfig + '" ' + '--cert-name "npm-' + certificate.id + '" ' + '--domains "' + certificate.domain_names.join(',') + '" ' + '--authenticator ' + dnsPlugin.full_plugin_name + ' ' + '--' + dnsPlugin.full_plugin_name + '-credentials "' + credentialsLocation + '"' + (certificate.meta.propagation_seconds !== undefined ? ' --' + dnsPlugin.full_plugin_name + '-propagation-seconds ' + certificate.meta.propagation_seconds : '');
|
||||||
|
|
||||||
|
@ -818,17 +817,15 @@ const internalCertificate = {
|
||||||
mainCmd = mainCmd + ' --email "' + certificate.meta.letsencrypt_email + '" ';
|
mainCmd = mainCmd + ' --email "' + certificate.meta.letsencrypt_email + '" ';
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info('Command:', `${credentialsCmd} && ${mainCmd}`);
|
logger.info('Command:', mainCmd);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await utils.exec(credentialsCmd);
|
|
||||||
const result = await utils.exec(mainCmd);
|
const result = await utils.exec(mainCmd);
|
||||||
logger.info(result);
|
logger.info(result);
|
||||||
return result;
|
return result;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Don't fail if file does not exist
|
// Don't fail if file does not exist, so no need for action in the callback
|
||||||
const delete_credentialsCmd = `rm -f '${credentialsLocation}' || true`;
|
fs.unlink(credentialsLocation, () => {});
|
||||||
await utils.exec(delete_credentialsCmd);
|
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const logger = require('../logger').access;
|
const logger = require('../logger').access;
|
||||||
const validator = require('ajv');
|
|
||||||
const error = require('./error');
|
const error = require('./error');
|
||||||
const userModel = require('../models/user');
|
const userModel = require('../models/user');
|
||||||
const proxyHostModel = require('../models/proxy_host');
|
const proxyHostModel = require('../models/proxy_host');
|
||||||
|
@ -18,6 +17,9 @@ const TokenModel = require('../models/token');
|
||||||
const roleSchema = require('./access/roles.json');
|
const roleSchema = require('./access/roles.json');
|
||||||
const permsSchema = require('./access/permissions.json');
|
const permsSchema = require('./access/permissions.json');
|
||||||
|
|
||||||
|
const Ajv = require('ajv');
|
||||||
|
const addFormats = require('ajv-formats');
|
||||||
|
|
||||||
module.exports = function (token_string) {
|
module.exports = function (token_string) {
|
||||||
const Token = new TokenModel();
|
const Token = new TokenModel();
|
||||||
let token_data = null;
|
let token_data = null;
|
||||||
|
@ -272,15 +274,15 @@ module.exports = function (token_string) {
|
||||||
// logger.info('permissionSchema', JSON.stringify(permissionSchema, null, 2));
|
// logger.info('permissionSchema', JSON.stringify(permissionSchema, null, 2));
|
||||||
// logger.info('data_schema', JSON.stringify(data_schema, null, 2));
|
// logger.info('data_schema', JSON.stringify(data_schema, null, 2));
|
||||||
|
|
||||||
const ajv = validator({
|
const ajv = new Ajv({
|
||||||
verbose: true,
|
verbose: true,
|
||||||
allErrors: true,
|
allErrors: true,
|
||||||
format: 'full',
|
|
||||||
missingRefs: 'fail',
|
|
||||||
breakOnError: true,
|
breakOnError: true,
|
||||||
coerceTypes: true,
|
coerceTypes: true,
|
||||||
schemas: [roleSchema, permsSchema, objectSchema, permissionSchema],
|
schemas: [roleSchema, permsSchema, objectSchema, permissionSchema],
|
||||||
|
strict: false,
|
||||||
});
|
});
|
||||||
|
addFormats(ajv);
|
||||||
|
|
||||||
return ajv.validate('permissions', data_schema).then(() => {
|
return ajv.validate('permissions', data_schema).then(() => {
|
||||||
return data_schema[permission];
|
return data_schema[permission];
|
||||||
|
|
|
@ -55,7 +55,7 @@ const configure = () => {
|
||||||
database: {
|
database: {
|
||||||
engine: 'knex-native',
|
engine: 'knex-native',
|
||||||
knex: {
|
knex: {
|
||||||
client: 'sqlite3',
|
client: 'better-sqlite3',
|
||||||
connection: {
|
connection: {
|
||||||
filename: envSqliteFile,
|
filename: envSqliteFile,
|
||||||
},
|
},
|
||||||
|
@ -145,7 +145,7 @@ module.exports = {
|
||||||
*/
|
*/
|
||||||
isSqlite: function () {
|
isSqlite: function () {
|
||||||
instance === null && configure();
|
instance === null && configure();
|
||||||
return instance.database.knex && instance.database.knex.client === 'sqlite3';
|
return instance.database.knex && instance.database.knex.client === 'better-sqlite3';
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,7 +10,7 @@ module.exports = function (req, res, next) {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'string',
|
type: 'string',
|
||||||
pattern: '^[a-z\\-]+:\\/\\/(?:\\[([a-z0-9]{0,4}\\:?)+\\])?/?(:[0-9]+)?$',
|
pattern: '^[a-z\\-]+:\\/\\/(?:\\[([a-z0-9]{0,4}:?)+\\])?/?(:[0-9]+)?$',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,13 +2,16 @@ const error = require('../error');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const parser = require('@apidevtools/json-schema-ref-parser');
|
const parser = require('@apidevtools/json-schema-ref-parser');
|
||||||
|
|
||||||
const ajv = require('ajv')({
|
const Ajv = require('ajv');
|
||||||
|
const addFormats = require('ajv-formats');
|
||||||
|
const ajv = new Ajv({
|
||||||
verbose: true,
|
verbose: true,
|
||||||
validateSchema: true,
|
validateSchema: true,
|
||||||
allErrors: false,
|
allErrors: false,
|
||||||
format: 'full',
|
|
||||||
coerceTypes: true,
|
coerceTypes: true,
|
||||||
|
strict: false,
|
||||||
});
|
});
|
||||||
|
addFormats(ajv);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Object} schema
|
* @param {Object} schema
|
||||||
|
|
|
@ -4,13 +4,16 @@ const definitions = require('../../schema/definitions.json');
|
||||||
|
|
||||||
RegExp.prototype.toJSON = RegExp.prototype.toString;
|
RegExp.prototype.toJSON = RegExp.prototype.toString;
|
||||||
|
|
||||||
const ajv = require('ajv')({
|
const Ajv = require('ajv');
|
||||||
|
const addFormats = require('ajv-formats');
|
||||||
|
const ajv = new Ajv({
|
||||||
verbose: true,
|
verbose: true,
|
||||||
allErrors: true,
|
allErrors: true,
|
||||||
format: 'full', // strict regexes for format checks
|
|
||||||
coerceTypes: true,
|
coerceTypes: true,
|
||||||
schemas: [definitions],
|
schemas: [definitions],
|
||||||
|
strict: false,
|
||||||
});
|
});
|
||||||
|
addFormats(ajv);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
const migrate_name = 'change_incoming_port_to_string';
|
||||||
|
const logger = require('../logger').migrate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Migrate
|
||||||
|
*
|
||||||
|
* @see http://knexjs.org/#Schema
|
||||||
|
*
|
||||||
|
* @param {Object} knex
|
||||||
|
* @param {Promise} Promise
|
||||||
|
* @returns {Promise}
|
||||||
|
*/
|
||||||
|
exports.up = function (knex /*, Promise */) {
|
||||||
|
logger.info('[' + migrate_name + '] Migrating Up...');
|
||||||
|
|
||||||
|
return knex.schema
|
||||||
|
.alterTable('stream', (table) => {
|
||||||
|
table.string('incoming_port', 11).notNull().alter();
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
logger.info('[' + migrate_name + '] stream Table altered');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Undo Migrate
|
||||||
|
*
|
||||||
|
* @param {Object} knex
|
||||||
|
* @param {Promise} Promise
|
||||||
|
* @returns {Promise}
|
||||||
|
*/
|
||||||
|
exports.down = function (knex /*, Promise */) {
|
||||||
|
logger.info('[' + migrate_name + '] Migrating Down...');
|
||||||
|
|
||||||
|
return knex.schema
|
||||||
|
.alterTable('stream', (table) => {
|
||||||
|
table.integer('incoming_port').notNull().unsigned().alter();
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
logger.info('[' + migrate_name + '] stream Table altered');
|
||||||
|
});
|
||||||
|
};
|
|
@ -5,10 +5,11 @@
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apidevtools/json-schema-ref-parser": "11.6.4",
|
"@apidevtools/json-schema-ref-parser": "11.6.4",
|
||||||
"ajv": "6.12.6",
|
"ajv": "8.16.0",
|
||||||
"archiver": "7.0.1",
|
"archiver": "7.0.1",
|
||||||
"batchflow": "0.4.0",
|
"batchflow": "0.4.0",
|
||||||
"bcrypt": "5.1.1",
|
"bcrypt": "5.1.1",
|
||||||
|
"better-sqlite3": "11.1.2",
|
||||||
"body-parser": "1.20.2",
|
"body-parser": "1.20.2",
|
||||||
"compression": "1.7.4",
|
"compression": "1.7.4",
|
||||||
"express": "4.19.2",
|
"express": "4.19.2",
|
||||||
|
@ -16,15 +17,14 @@
|
||||||
"gravatar": "1.8.2",
|
"gravatar": "1.8.2",
|
||||||
"jsonwebtoken": "9.0.2",
|
"jsonwebtoken": "9.0.2",
|
||||||
"knex": "3.1.0",
|
"knex": "3.1.0",
|
||||||
"liquidjs": "10.14.0",
|
"liquidjs": "10.15.0",
|
||||||
"lodash": "4.17.21",
|
"lodash": "4.17.21",
|
||||||
"moment": "2.30.1",
|
"moment": "2.30.1",
|
||||||
"mysql": "2.18.1",
|
"mysql": "2.18.1",
|
||||||
"node-rsa": "1.1.1",
|
"node-rsa": "1.1.1",
|
||||||
"objection": "3.1.4",
|
"objection": "3.1.4",
|
||||||
"path": "0.12.7",
|
"path": "0.12.7",
|
||||||
"signale": "1.4.0",
|
"signale": "1.4.0"
|
||||||
"sqlite3": "5.1.6"
|
|
||||||
},
|
},
|
||||||
"author": "Jamie Curnow <jc@jc21.com> and ZoeyVid <zoeyvid@zvcdn.de>",
|
"author": "Jamie Curnow <jc@jc21.com> and ZoeyVid <zoeyvid@zvcdn.de>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
"eslint": "9.6.0",
|
"eslint": "9.6.0",
|
||||||
"eslint-config-prettier": "9.1.0",
|
"eslint-config-prettier": "9.1.0",
|
||||||
"eslint-plugin-prettier": "5.1.3",
|
"eslint-plugin-prettier": "5.1.3",
|
||||||
"globals": "15.6.0",
|
"globals": "15.8.0",
|
||||||
"prettier": "3.3.2"
|
"prettier": "3.3.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const bcrypt = require('bcrypt');
|
const bcrypt = require('bcrypt');
|
||||||
const sqlite3 = require('sqlite3');
|
const Database = require('better-sqlite3');
|
||||||
|
|
||||||
function usage() {
|
function usage() {
|
||||||
console.log(`usage: node ${process.argv[1]} USER_EMAIL PASSWORD
|
console.log(`usage: node ${process.argv[1]} USER_EMAIL PASSWORD
|
||||||
|
@ -39,21 +39,33 @@ if (fs.existsSync(process.env.DB_SQLITE_FILE)) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
const db = new Database(process.env.DB_SQLITE_FILE);
|
||||||
|
|
||||||
const db = new sqlite3.Database(process.env.DB_SQLITE_FILE);
|
try {
|
||||||
db.run(
|
const stmt = db.prepare(`
|
||||||
`UPDATE auth SET secret = ? WHERE EXISTS
|
UPDATE auth
|
||||||
(SELECT * FROM user WHERE user.id = auth.user_id AND user.email = ?)`,
|
SET secret = ?
|
||||||
[PASSWORD_HASH, USER_EMAIL],
|
WHERE EXISTS (
|
||||||
function (err) {
|
SELECT *
|
||||||
if (err) {
|
FROM user
|
||||||
console.error(err);
|
WHERE user.id = auth.user_id AND user.email = ?
|
||||||
process.exit(1);
|
)
|
||||||
}
|
`);
|
||||||
|
|
||||||
|
const result = stmt.run(PASSWORD_HASH, USER_EMAIL);
|
||||||
|
|
||||||
|
if (result.changes > 0) {
|
||||||
console.log(`Password for user ${USER_EMAIL} has been reset.`);
|
console.log(`Password for user ${USER_EMAIL} has been reset.`);
|
||||||
process.exit(0);
|
} else {
|
||||||
},
|
console.log(`No user found with email ${USER_EMAIL}.`);
|
||||||
);
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
process.exit(1);
|
||||||
|
} finally {
|
||||||
|
db.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
process.exit(0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
"$ref": "../definitions.json#/definitions/modified_on"
|
"$ref": "../definitions.json#/definitions/modified_on"
|
||||||
},
|
},
|
||||||
"incoming_port": {
|
"incoming_port": {
|
||||||
"type": "integer",
|
"type": "string",
|
||||||
"minimum": 1,
|
"pattern": "^([0-9]+|[0-9]+-[0-9]+)$",
|
||||||
"maximum": 65535
|
"maxLength": 11
|
||||||
},
|
},
|
||||||
"forwarding_host": {
|
"forwarding_host": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
|
|
@ -1,23 +1,9 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
const fs = require('fs');
|
const Database = require('better-sqlite3');
|
||||||
const sqlite3 = require('sqlite3');
|
const db = new Database(process.env.DB_SQLITE_FILE);
|
||||||
|
|
||||||
if (fs.existsSync(process.env.DB_SQLITE_FILE)) {
|
db.pragma('journal_mode = WAL');
|
||||||
const db = new sqlite3.Database(process.env.DB_SQLITE_FILE, sqlite3.OPEN_READWRITE, (err) => {
|
db.pragma('auto_vacuum = 1');
|
||||||
if (err) {
|
db.exec('VACUUM;');
|
||||||
console.error(err.message);
|
db.close();
|
||||||
} else {
|
|
||||||
db.run('VACUUM; PRAGMA auto_vacuum = 1;', [], (err) => {
|
|
||||||
if (err) {
|
|
||||||
console.error(err.message);
|
|
||||||
}
|
|
||||||
db.close((err) => {
|
|
||||||
if (err) {
|
|
||||||
console.error(err.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ services:
|
||||||
# - "NGINX_LOG_NOT_FOUND=true" # Allow logging of 404 errors, default false
|
# - "NGINX_LOG_NOT_FOUND=true" # Allow logging of 404 errors, default false
|
||||||
# - "NGINX_404_REDIRECT=true" # Redirect to / instead of showing a 404 error page, default false
|
# - "NGINX_404_REDIRECT=true" # Redirect to / instead of showing a 404 error page, default false
|
||||||
# - "NGINX_DISABLE_PROXY_BUFFERING=true" # Disables the proxy-buffering option of nginx, default false
|
# - "NGINX_DISABLE_PROXY_BUFFERING=true" # Disables the proxy-buffering option of nginx, default false
|
||||||
|
# - "DISABLE_NGINX_BEAUTIFIER=true" # disables nginxbeautifier, useful when it fails parsing non-standard configs, default false
|
||||||
# - "CLEAN=false" # Clean folders, default true
|
# - "CLEAN=false" # Clean folders, default true
|
||||||
# - "FULLCLEAN=true" # Clean unused config folders, default false
|
# - "FULLCLEAN=true" # Clean unused config folders, default false
|
||||||
# - "SKIP_IP_RANGES=true" # Skip feteching/whitelisting ip ranges from aws and cloudflare, default false
|
# - "SKIP_IP_RANGES=true" # Skip feteching/whitelisting ip ranges from aws and cloudflare, default false
|
||||||
|
@ -43,7 +44,7 @@ services:
|
||||||
# - "GOA=true" # Enables goaccess, requires LOGROTATE, default false --- if you download the GeoLite2-Country.mmdb, GeoLite2-City.mmdb AND GeoLite2-ASN.mmdb file from MaxMind and place them in /opt/npm/etc/goaccess/geoip it will automatically enable GeoIP in goaccess after restarting NPMplus (no need to change GOACLA below), you may also use the compose.geoip.yaml
|
# - "GOA=true" # Enables goaccess, requires LOGROTATE, default false --- if you download the GeoLite2-Country.mmdb, GeoLite2-City.mmdb AND GeoLite2-ASN.mmdb file from MaxMind and place them in /opt/npm/etc/goaccess/geoip it will automatically enable GeoIP in goaccess after restarting NPMplus (no need to change GOACLA below), you may also use the compose.geoip.yaml
|
||||||
# - "GOACLA=--agent-list --real-os --double-decode --anonymize-ip --anonymize-level=2 --keep-last=7 --with-output-resolver --no-query-string" # Arguments that should be passed to goaccess, default: https://github.com/ZoeyVid/NPMplus/blob/develop/rootfs/usr/local/bin/launch.sh#L50 and: --agent-list --real-os --double-decode --anonymize-ip --anonymize-level=1 --keep-last=30 --with-output-resolver --no-query-string
|
# - "GOACLA=--agent-list --real-os --double-decode --anonymize-ip --anonymize-level=2 --keep-last=7 --with-output-resolver --no-query-string" # Arguments that should be passed to goaccess, default: https://github.com/ZoeyVid/NPMplus/blob/develop/rootfs/usr/local/bin/launch.sh#L50 and: --agent-list --real-os --double-decode --anonymize-ip --anonymize-level=1 --keep-last=30 --with-output-resolver --no-query-string
|
||||||
# - "PHP82=true" # Activate PHP82, default false
|
# - "PHP82=true" # Activate PHP82, default false
|
||||||
# - "PHP82_APKS=php82-curl php-82-openssl" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=community&arch=x86_64&name=php82-*, default none, requires PHP82
|
# - "PHP82_APKS=php82-curl php82-openssl" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=community&arch=x86_64&name=php82-*, default none, requires PHP82
|
||||||
# - "PHP83=true" # Activate PHP83, default false
|
# - "PHP83=true" # Activate PHP83, default false
|
||||||
# - "PHP83_APKS=php83-curl php83-openssl" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=community&arch=x86_64&name=php83-*, default none, requires PHP83
|
# - "PHP83_APKS=php83-curl php83-openssl" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=community&arch=x86_64&name=php83-*, default none, requires PHP83
|
||||||
# - "PHP_APKS=php-pecl-apcu php-pecl-redis" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=community&arch=x86_64&name=php-*, default none, requires PHP82 and/or PHP83, not recommended, please use PHP82_APKS or PHP83_APKS
|
# - "PHP_APKS=php-pecl-apcu php-pecl-redis" # Add php extensions, see available packages here: https://pkgs.alpinelinux.org/packages?branch=v3.20&repo=community&arch=x86_64&name=php-*, default none, requires PHP82 and/or PHP83, not recommended, please use PHP82_APKS or PHP83_APKS
|
||||||
|
@ -57,4 +58,4 @@ services:
|
||||||
# ports:
|
# ports:
|
||||||
# - "80:80"
|
# - "80:80"
|
||||||
# environment:
|
# environment:
|
||||||
# - "TZ=Europe/Berlin"
|
# - "TZ=Europe/Berlin"
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
<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('streams', 'incoming-port') %> <span class="form-required">*</span></label>
|
<label class="form-label"><%- i18n('streams', 'incoming-port') %> <span class="form-required">*</span></label>
|
||||||
<input name="incoming_port" type="number" class="form-control text-monospace" placeholder="eg: 8080" min="1" max="65535" value="<%- incoming_port %>" required>
|
<input name="incoming_port" type="text" class="form-control text-monospace" placeholder="eg: 8080 or 2000-2020" value="<%- incoming_port %>" autocomplete="off" maxlength="11" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-8 col-md-8">
|
<div class="col-sm-8 col-md-8">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label"><%- i18n('streams', 'forwarding-host') %><span class="form-required">*</span></label>
|
<label class="form-label"><%- i18n('streams', 'forwarding-host') %><span class="form-required">*</span></label>
|
||||||
<input type="text" name="forwarding_host" class="form-control text-monospace" placeholder="example.com or 10.0.0.1 or 2001:db8:3333:4444:5555:6666:7777:8888" value="<%- forwarding_host %>" autocomplete="off" maxlength="255" required>
|
<input name="forwarding_host" type="text" class="form-control text-monospace" placeholder="example.com or 10.0.0.1 or 2001:db8:3333:4444:5555:6666:7777:8888" value="<%- forwarding_host %>" autocomplete="off" maxlength="255" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4 col-md-4">
|
<div class="col-sm-4 col-md-4">
|
||||||
|
|
|
@ -43,7 +43,6 @@ module.exports = Mn.View.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
// Manipulate
|
// Manipulate
|
||||||
data.incoming_port = parseInt(data.incoming_port, 10);
|
|
||||||
data.forwarding_port = parseInt(data.forwarding_port, 10);
|
data.forwarding_port = parseInt(data.forwarding_port, 10);
|
||||||
data.tcp_forwarding = !!data.tcp_forwarding;
|
data.tcp_forwarding = !!data.tcp_forwarding;
|
||||||
data.udp_forwarding = !!data.udp_forwarding;
|
data.udp_forwarding = !!data.udp_forwarding;
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
"messageformat-loader": "0.8.1",
|
"messageformat-loader": "0.8.1",
|
||||||
"mini-css-extract-plugin": "1.6.2",
|
"mini-css-extract-plugin": "1.6.2",
|
||||||
"moment": "2.30.1",
|
"moment": "2.30.1",
|
||||||
"node-sass": "7.0.3",
|
"node-sass": "9.0.0",
|
||||||
"nodemon": "3.1.4",
|
"nodemon": "3.1.4",
|
||||||
"numeral": "2.0.6",
|
"numeral": "2.0.6",
|
||||||
"sass-loader": "10.5.2",
|
"sass-loader": "10.5.2",
|
||||||
|
|
|
@ -113,6 +113,12 @@
|
||||||
"credentials": "dns_domeneshop_client_token=YOUR_DOMENESHOP_CLIENT_TOKEN\ndns_domeneshop_client_secret=YOUR_DOMENESHOP_CLIENT_SECRET",
|
"credentials": "dns_domeneshop_client_token=YOUR_DOMENESHOP_CLIENT_TOKEN\ndns_domeneshop_client_secret=YOUR_DOMENESHOP_CLIENT_SECRET",
|
||||||
"full_plugin_name": "dns-domeneshop"
|
"full_plugin_name": "dns-domeneshop"
|
||||||
},
|
},
|
||||||
|
"dreamhost": {
|
||||||
|
"name": "Dreamhost",
|
||||||
|
"package_name": "certbot-dns-dreamhost",
|
||||||
|
"credentials": "dns_dreamhost_baseurl=API_BASE_URL\ndns_dreamhost_api_key=API_KEY",
|
||||||
|
"full_plugin_name": "dns-dreamhost"
|
||||||
|
},
|
||||||
"dynu": {
|
"dynu": {
|
||||||
"name": "Dynu",
|
"name": "Dynu",
|
||||||
"package_name": "certbot-dns-dynu",
|
"package_name": "certbot-dns-dynu",
|
||||||
|
|
|
@ -180,6 +180,11 @@ if ! echo "$NGINX_DISABLE_PROXY_BUFFERING" | grep -q "^true$\|^false$"; then
|
||||||
sleep inf
|
sleep inf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! echo "$DISABLE_NGINX_BEAUTIFIER" | grep -q "^true$\|^false$"; then
|
||||||
|
echo "DISABLE_NGINX_BEAUTIFIER needs to be true or false."
|
||||||
|
sleep inf
|
||||||
|
fi
|
||||||
|
|
||||||
if ! echo "$CLEAN" | grep -q "^true$\|^false$"; then
|
if ! echo "$CLEAN" | grep -q "^true$\|^false$"; then
|
||||||
echo "CLEAN needs to be true or false."
|
echo "CLEAN needs to be true or false."
|
||||||
sleep inf
|
sleep inf
|
||||||
|
@ -737,7 +742,7 @@ sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen
|
||||||
sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $IPV4_BINDING:\2/g" /app/templates/default.conf
|
sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $IPV4_BINDING:\2/g" /app/templates/default.conf
|
||||||
sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\({{ incoming_port }}\)/listen $IPV4_BINDING:\2/g" /app/templates/stream.conf
|
sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\({{ incoming_port }}\)/listen $IPV4_BINDING:\2/g" /app/templates/stream.conf
|
||||||
find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $IPV4_BINDING:\2/g" {} \;
|
find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $IPV4_BINDING:\2/g" {} \;
|
||||||
find /data/nginx -type f -name '*.conf' -not -path "/data/nginx/custom/*" -exec sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $IPV4_BINDING:\2/g" {} \;
|
find /data/nginx -type f -name '*.conf' -not -path "/data/nginx/custom/*" -exec sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9-]\+\)/listen $IPV4_BINDING:\2/g" {} \;
|
||||||
|
|
||||||
if [ "$DISABLE_IPV6" = "true" ]; then
|
if [ "$DISABLE_IPV6" = "true" ]; then
|
||||||
sed -i "s|ipv6=on;|ipv6=off;|g" /usr/local/nginx/conf/nginx.conf
|
sed -i "s|ipv6=on;|ipv6=off;|g" /usr/local/nginx/conf/nginx.conf
|
||||||
|
@ -745,14 +750,14 @@ if [ "$DISABLE_IPV6" = "true" ]; then
|
||||||
sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/#listen \[\1\]:\2/g" /app/templates/default.conf
|
sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/#listen \[\1\]:\2/g" /app/templates/default.conf
|
||||||
sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\({{ incoming_port }}\)/#listen \[\1\]:\2/g" /app/templates/stream.conf
|
sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\({{ incoming_port }}\)/#listen \[\1\]:\2/g" /app/templates/stream.conf
|
||||||
find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/#listen \[\1\]:\2/g" {} \;
|
find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/#listen \[\1\]:\2/g" {} \;
|
||||||
find /data/nginx -type f -name '*.conf' -not -path "/data/nginx/custom/*" -exec sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/#listen \[\1\]:\2/g" {} \;
|
find /data/nginx -type f -name '*.conf' -not -path "/data/nginx/custom/*" -exec sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9-]\+\)/#listen \[\1\]:\2/g" {} \;
|
||||||
else
|
else
|
||||||
sed -i "s|ipv6=off;|ipv6=on;|g" /usr/local/nginx/conf/nginx.conf
|
sed -i "s|ipv6=off;|ipv6=on;|g" /usr/local/nginx/conf/nginx.conf
|
||||||
sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $IPV6_BINDING:\2/g" /app/templates/_listen.conf
|
sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $IPV6_BINDING:\2/g" /app/templates/_listen.conf
|
||||||
sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $IPV6_BINDING:\2/g" /app/templates/default.conf
|
sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $IPV6_BINDING:\2/g" /app/templates/default.conf
|
||||||
sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\({{ incoming_port }}\)/listen $IPV6_BINDING:\2/g" /app/templates/stream.conf
|
sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\({{ incoming_port }}\)/listen $IPV6_BINDING:\2/g" /app/templates/stream.conf
|
||||||
find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $IPV6_BINDING:\2/g" {} \;
|
find /usr/local/nginx/conf/conf.d -type f -name '*.conf' -exec sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $IPV6_BINDING:\2/g" {} \;
|
||||||
find /data/nginx -type f -name '*.conf' -not -path "/data/nginx/custom/*" -exec sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9]\+\)/listen $IPV6_BINDING:\2/g" {} \;
|
find /data/nginx -type f -name '*.conf' -not -path "/data/nginx/custom/*" -exec sed -i "s/#\?listen \[\([0-9a-f:]\+\)\]:\([0-9-]\+\)/listen $IPV6_BINDING:\2/g" {} \;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $NPM_IPV4_BINDING:$NPM_PORT/g" /usr/local/nginx/conf/conf.d/npm.conf
|
sed -i "s/#\?listen \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+:\)\?\([0-9]\+\)/listen $NPM_IPV4_BINDING:$NPM_PORT/g" /usr/local/nginx/conf/conf.d/npm.conf
|
||||||
|
@ -883,7 +888,9 @@ elif [ "$FULLCLEAN" = "true" ]; then
|
||||||
rm -vrf /data/etc/goaccess
|
rm -vrf /data/etc/goaccess
|
||||||
fi
|
fi
|
||||||
|
|
||||||
nginxbeautifier -s 4 -r /data/nginx
|
if [ "$DISABLE_NGINX_BEAUTIFIER" = "false" ]; then
|
||||||
|
nginxbeautifier -s 4 -r /data/nginx
|
||||||
|
fi
|
||||||
|
|
||||||
#find /data/nginx -type f -name '*.conf' -not -path "/data/nginx/custom/*" -exec sed -i "s|add_header alt-svc 'h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400';|add_header Alt-Svc 'h3=\":443\"; ma=86400';|g" {} \;
|
#find /data/nginx -type f -name '*.conf' -not -path "/data/nginx/custom/*" -exec sed -i "s|add_header alt-svc 'h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400';|add_header Alt-Svc 'h3=\":443\"; ma=86400';|g" {} \;
|
||||||
#find /data/nginx -type f -name '*.conf' -not -path "/data/nginx/custom/*" -exec sed -i "s|add_header alt-svc 'h3=\":443\";|add_header Alt-Svc 'h3=\":443\"; ma=86400';|g" {} \;
|
#find /data/nginx -type f -name '*.conf' -not -path "/data/nginx/custom/*" -exec sed -i "s|add_header alt-svc 'h3=\":443\";|add_header Alt-Svc 'h3=\":443\"; ma=86400';|g" {} \;
|
||||||
|
@ -920,11 +927,12 @@ if [ "$PUID" != "0" ]; then
|
||||||
echo "ERROR: Unable to set group against the user properly"
|
echo "ERROR: Unable to set group against the user properly"
|
||||||
sleep inf
|
sleep inf
|
||||||
fi
|
fi
|
||||||
find /usr/local \
|
find /proc/self/fd \
|
||||||
|
/usr/local \
|
||||||
/data \
|
/data \
|
||||||
/run \
|
/run \
|
||||||
/tmp \
|
/tmp \
|
||||||
-not \( -uid "$PUID" -and -gid "$PGID" \) \
|
-not \( -uid "$PUID" -and -gid "$PGID" \) \
|
||||||
-exec chown "$PUID:$PGID" {} \;
|
-exec chown "$PUID:$PGID" {} \;
|
||||||
if [ "$PHP82" = "true" ]; then
|
if [ "$PHP82" = "true" ]; then
|
||||||
sed -i "s|user =.*|;user = root|" /data/php/82/php-fpm.d/www.conf
|
sed -i "s|user =.*|;user = root|" /data/php/82/php-fpm.d/www.conf
|
||||||
|
@ -937,11 +945,12 @@ if [ "$PUID" != "0" ]; then
|
||||||
sed -i "s|user root;|#user root;|g" /usr/local/nginx/conf/nginx.conf
|
sed -i "s|user root;|#user root;|g" /usr/local/nginx/conf/nginx.conf
|
||||||
exec su-exec "$PUID:$PGID" launch.sh
|
exec su-exec "$PUID:$PGID" launch.sh
|
||||||
else
|
else
|
||||||
find /usr/local \
|
find /proc/self/fd \
|
||||||
|
/usr/local \
|
||||||
/data \
|
/data \
|
||||||
/run \
|
/run \
|
||||||
/tmp \
|
/tmp \
|
||||||
-not \( -uid 0 -and -gid 0 \) \
|
-not \( -uid 0 -and -gid 0 \) \
|
||||||
-exec chown 0:0 {} \;
|
-exec chown 0:0 {} \;
|
||||||
if [ "$PHP82" = "true" ]; then
|
if [ "$PHP82" = "true" ]; then
|
||||||
sed -i "s|;user =.*|user = root|" /data/php/82/php-fpm.d/www.conf
|
sed -i "s|;user =.*|user = root|" /data/php/82/php-fpm.d/www.conf
|
||||||
|
|
Loading…
Reference in a new issue