Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mode cron + base config in .example file #28 #46

Closed
wants to merge 26 commits into from

Conversation

Asenar
Copy link

@Asenar Asenar commented Dec 19, 2016

Hi,

I modified your code to add a mode cron : when enabled, you can call ./cron/cron-monitoring which will run every php scripts in libs/ and save the result in a cache directory. The web interface uses theses files.

This way, it's possible to disable exec/shell_exec/passthru/… functions in php.ini

@QuentinCG improvements are included

There is also some optimization (Config class works as singleton).

QuentinCG and others added 26 commits December 19, 2016 16:05
A ping which is not possible resulted in a "0 ms" value which
is not consistent with the reality. A "+Infinity" is more
appropriate.
Since a ping may fail, it is relevant to use the w15p class
in order to show if the ping was successful or not. Moreover,
showing the time of a not valid ping is not relevant and it
means the server is offline.
This will show the IP of the user and the connection date
like this: "Jan 27 2016 16:27:59" which is more appropriate
than the previous version ("Jan Wed +0100 27").
Default json config example should not have the name
of the real file.
+ Make sure config is personal
+ Fix ping and lastlog
    Misc::cache($name, $data = null, $lifetime = 0) is a simple cache filesystem
    which will serialize $data to a file in write operation, or return
    the values in read operation. Writes are made if the argument
    `--save` is used when running the command.

    Misc::exec() and Misc::shellexec() will first check if
    a result is in cache for that command, and return it if exists.
    Otherwise, command will be executed then eventually saved in cache
    for next call (if `--save` argument has been used).
set version 2.6

Changes:
+ Config class is a singleton
+ mode «cron» (datas refreshed by cron, read only access for apache/php)
+ new lib : last_sftp_login
+ new lib : last_cron
+ various fixes (optimized for debian 7/8)
@QuentinCG
Copy link

Nice improvements!

I really appreciate the sftp addition (I will try this soon :) )

@Asenar
Copy link
Author

Asenar commented Dec 22, 2016

I did that a long time ago and don't know if its "generic" enough. Tell me if some things are missing :)

@Asenar Asenar mentioned this pull request Jul 17, 2017
@Asenar
Copy link
Author

Asenar commented Jul 17, 2017

Hi, I close this PR as I rebased everything in #50

@Asenar Asenar closed this Jul 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants