Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
Nginx Proxy Manager Dark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Jonas Leder
Nginx Proxy Manager Dark
Commits
b7b150a9
Unverified
Commit
b7b150a9
authored
Jun 29, 2021
by
chaptergy
Browse files
Options
Downloads
Patches
Plain Diff
Run logrotation binary from program
parent
fae848bd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/setup.js
+21
-1
21 additions, 1 deletion
backend/setup.js
docker/rootfs/etc/logrotate.d/nginx-proxy-manager
+3
-16
3 additions, 16 deletions
docker/rootfs/etc/logrotate.d/nginx-proxy-manager
with
24 additions
and
17 deletions
backend/setup.js
+
21
−
1
View file @
b7b150a9
...
...
@@ -201,9 +201,29 @@ const setupCertbotPlugins = () => {
});
};
/**
* Starts a timer to call run the logrotation binary every two days
* @returns {Promise}
*/
const
setupLogrotation
=
()
=>
{
const
intervalTimeout
=
1000
*
60
*
60
*
24
*
2
;
// 2 days
const
runLogrotate
=
async
()
=>
{
await
utils
.
exec
(
'
logrotate -f /etc/logrotate.d/nginx-proxy-manager
'
);
logger
.
info
(
'
Logrotate completed.
'
);
};
logger
.
info
(
'
Logrotate Timer initialized
'
);
setInterval
(
runLogrotate
,
intervalTimeout
);
// And do this now as well
return
runLogrotate
();
};
module
.
exports
=
function
()
{
return
setupJwt
()
.
then
(
setupDefaultUser
)
.
then
(
setupDefaultSettings
)
.
then
(
setupCertbotPlugins
);
.
then
(
setupCertbotPlugins
)
.
then
(
setupLogrotation
);
};
This diff is collapsed.
Click to expand it.
docker/rootfs/etc/logrotate.d/nginx-proxy-manager
+
3
−
16
View file @
b7b150a9
/data/logs/*_access.log /data/logs/*/
*_
access.log {
/data/logs/*_access.log /data/logs/*/access.log {
create 0644 root root
weekly
rotate 4
...
...
@@ -11,7 +11,7 @@
endscript
}
/data/logs/*_error.log /data/logs/*/
*_
error.log {
/data/logs/*_error.log /data/logs/*/error.log {
create 0644 root root
weekly
rotate 10
...
...
@@ -23,16 +23,3 @@
/bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
endscript
}
\ No newline at end of file
/data/logs/*.log /data/logs/*[!_error].log /data/logs/*[!_access].log {
create 0644 root root
weekly
rotate 5
missingok
notifempty
compress
sharedscripts
postrotate
/bin/kill -USR1 `cat /run/nginx.pid 2>/dev/null` 2>/dev/null || true
endscript
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment