merge upstream

This commit is contained in:
Zoey 2024-07-11 16:04:25 +02:00
parent 603164791b
commit b9c4de0422
No known key found for this signature in database
GPG key ID: 02A3919EB4F67328
3 changed files with 16 additions and 12 deletions

View file

@ -22,18 +22,18 @@ const setupDefaultUser = () => {
.then((row) => { .then((row) => {
if (!row.count) { if (!row.count) {
// Create a new user and set password // Create a new user and set password
let email = process.env.INITIAL_ADMIN_EMAIL || 'admin@example.com'; let email = process.env.INITIAL_ADMIN_EMAIL || 'admin@example.com';
let password = process.env.INITIAL_ADMIN_PASSWORD || 'iArhP1j7p1P6TA92FA2FMbbUGYqwcYzxC4AVEe12Wbi94FY9gNN62aKyF1shrvG4NycjjX9KfmDQiwkLZH1ZDR9xMjiG2QmoHXi'; let password = process.env.INITIAL_ADMIN_PASSWORD || 'iArhP1j7p1P6TA92FA2FMbbUGYqwcYzxC4AVEe12Wbi94FY9gNN62aKyF1shrvG4NycjjX9KfmDQiwkLZH1ZDR9xMjiG2QmoHXi';
logger.info('Creating a new user: ' + email + ' with password: ' + password); logger.info('Creating a new user: ' + email + ' with password: ' + password);
const data = { const data = {
is_deleted: 0, is_deleted: 0,
email: email, email: email,
name: 'Administrator', name: 'Administrator',
nickname: 'Admin', nickname: 'Admin',
avatar: '', avatar: '',
roles: ['admin'], roles: ['admin'],
}; };
return userModel return userModel
@ -44,9 +44,9 @@ const setupDefaultUser = () => {
.query() .query()
.insert({ .insert({
user_id: user.id, user_id: user.id,
type: 'password', type: 'password',
secret: password, secret: password,
meta: {}, meta: {},
}) })
.then(() => { .then(() => {
return userPermissionModel.query().insert({ return userPermissionModel.query().insert({

View file

@ -444,6 +444,10 @@ if [ -s /data/nginx/dummykey.pem ]; then
mv -vn /data/nginx/dummykey.pem /data/tls/dummykey.pem mv -vn /data/nginx/dummykey.pem /data/tls/dummykey.pem
fi fi
if [ -f /data/nginx/custom/root.conf ]; then
mv -vn /data/nginx/custom/root.conf /data/nginx/custom/root_top.conf
fi
if [ -n "$(ls -A /data/nginx/html 2> /dev/null)" ]; then if [ -n "$(ls -A /data/nginx/html 2> /dev/null)" ]; then
mv -vn /data/nginx/html/* /data/etc/html mv -vn /data/nginx/html/* /data/etc/html
fi fi
@ -533,10 +537,10 @@ fi
touch /data/etc/html/index.html \ touch /data/etc/html/index.html \
/data/nginx/ip_ranges.conf \ /data/nginx/ip_ranges.conf \
/data/nginx/custom/root.conf \
/data/nginx/custom/events.conf \ /data/nginx/custom/events.conf \
/data/nginx/custom/http.conf \ /data/nginx/custom/http.conf \
/data/nginx/custom/http_top.conf \ /data/nginx/custom/http_top.conf \
/data/nginx/custom/root_top.conf \
/data/nginx/custom/server_dead.conf \ /data/nginx/custom/server_dead.conf \
/data/nginx/custom/server_proxy.conf \ /data/nginx/custom/server_proxy.conf \
/data/nginx/custom/server_redirect.conf \ /data/nginx/custom/server_redirect.conf \

View file

@ -6,7 +6,7 @@ worker_processes auto;
worker_cpu_affinity auto; worker_cpu_affinity auto;
# Custom # Custom
include /data/nginx/custom/root.conf; include /data/nginx/custom/root_top.conf;
events { events {
# Custom # Custom