Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Make SWAG Dashboard read ALL logs

License

NotificationsYou must be signed in to change notification settings

FoxxMD/swag-dashboard-archived-logs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

LinuxServer.io's SWAG (nginx reverse proxy) docker imagehas a mod for installingGoaccess.

Unfortunately the default configuration for this only reads the firstaccess.log file generated by nginx and SWAG rotates this file out pretty agressively. If you have a modest amount of trafficaccess.log may only cover the last 24 hours of traffic which makes the dashboard's range pretty limited.

This repo provides a scriptthat leverage LinuxServer.io own private/custom mod infrastructure in order to make SWAG read ALL storedaccess.log.* files from its own log volume.

How Does It Work?

  • The provided folders are set ascustom scripts and services in the SWAG container.
  • preloadLogs.sh is executed by LISO's custom script init when the container starts
    • The scripts checks for default mod settings and that no data has already been persisted to goaccess -- if both conditions are true then it persists rotated/archived logs files into goaccess
  • A custom service makes crontab run
    • Every hour the currentaccess.log file is ingested. This makes sure persisted data does not have any gaps in the event you do not access the dashboard frequently.

Install

  • Copy/swag-custom to your preferred directory. (Best to put it near the same directory SWAG is mounted to for/config).
  • Change the permissions for thefolders (scripts andservices) to be owned byroot.
    • Usually likechown 0:0 swag-custom/scriptschown 0:0 swag-custom/services
  • Changes the permissions for thecontents of each folder to match thePUID/PGID you have set for your SWAG container
  • Mountscripts at/custom-cont-init.d in your SWAG container
  • Mountservices at/custom-services.d in your SWAG container

You're done!

Usage

Modify Number of Preloaded Logs

preloadLogs.sh will be default ingest the last 100 archived (access.log.*.gz) log files found. If you want to ingest less files modify the variableINGEST_LAST_NUM inpreloadLogs.sh.INGEST_LAST_NUM is the number ofmost recent archvied files to ingest.

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp