Skip to content

Commit

Permalink
merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoey2936 committed Jul 11, 2024
1 parent 6031647 commit b9c4de0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
20 changes: 10 additions & 10 deletions backend/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ const setupDefaultUser = () => {
.then((row) => {
if (!row.count) {
// Create a new user and set password
let email = process.env.INITIAL_ADMIN_EMAIL || '[email protected]';
let email = process.env.INITIAL_ADMIN_EMAIL || '[email protected]';
let password = process.env.INITIAL_ADMIN_PASSWORD || 'iArhP1j7p1P6TA92FA2FMbbUGYqwcYzxC4AVEe12Wbi94FY9gNN62aKyF1shrvG4NycjjX9KfmDQiwkLZH1ZDR9xMjiG2QmoHXi';

logger.info('Creating a new user: ' + email + ' with password: ' + password);

const data = {
is_deleted: 0,
email: email,
name: 'Administrator',
nickname: 'Admin',
avatar: '',
roles: ['admin'],
email: email,
name: 'Administrator',
nickname: 'Admin',
avatar: '',
roles: ['admin'],
};

return userModel
Expand All @@ -44,9 +44,9 @@ const setupDefaultUser = () => {
.query()
.insert({
user_id: user.id,
type: 'password',
secret: password,
meta: {},
type: 'password',
secret: password,
meta: {},
})
.then(() => {
return userPermissionModel.query().insert({
Expand Down
6 changes: 5 additions & 1 deletion rootfs/usr/local/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ if [ -s /data/nginx/dummykey.pem ]; then
mv -vn /data/nginx/dummykey.pem /data/tls/dummykey.pem
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
mv -vn /data/nginx/html/* /data/etc/html
fi
Expand Down Expand Up @@ -533,10 +537,10 @@ fi

touch /data/etc/html/index.html \
/data/nginx/ip_ranges.conf \
/data/nginx/custom/root.conf \
/data/nginx/custom/events.conf \
/data/nginx/custom/http.conf \
/data/nginx/custom/http_top.conf \
/data/nginx/custom/root_top.conf \
/data/nginx/custom/server_dead.conf \
/data/nginx/custom/server_proxy.conf \
/data/nginx/custom/server_redirect.conf \
Expand Down
2 changes: 1 addition & 1 deletion rootfs/usr/local/nginx/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ worker_processes auto;
worker_cpu_affinity auto;

# Custom
include /data/nginx/custom/root.conf;
include /data/nginx/custom/root_top.conf;

events {
# Custom
Expand Down

0 comments on commit b9c4de0

Please sign in to comment.