-
Notifications
You must be signed in to change notification settings - Fork 3
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
Completes core feature binaries #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial Review
A few more things I would like to have -
- Currently there is no code documentation whatsoever, it would be really great to document the functions we are implementing as we go.
- There is the hardcoded path in config.rs which reads the config file, make it configurable or atleast some generalized global path like
/opt/watchdog/config.toml
@@ -1,15 +1,21 @@ | |||
use crate::config; | |||
extern crate reqwest; | |||
use log::info; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are planning to open-source watchdog it is better to have a general notification trait, which can be satisfied by the notification provider. Initially, we can target - slack and discord.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fixed in #3
use simplelog::*; | ||
use std::fs::OpenOptions; | ||
|
||
pub fn init(config: &config::Config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any further implementation we are basing on this? If not I would prefer to name it as logger.rs instead of init.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would include all the initialization of databases if we include it in the future. But for now, its just for initialization of logger.
src/environment.rs
Outdated
let env: TempEnvirontment = toml::from_str(&toml_str).unwrap(); | ||
return env; | ||
} | ||
|
||
pub fn clear_temp_env(path: &String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how this is related to the environment? We can have a module utils
and can have functions like this there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are placing some variables in a file so that the binary pam_ssh
can later access this to know the variables which are not passed. What do you suggest naming to?
Includes source for the binaries -
pam_su
- Logsu
activity on slackpam_sudo
- Logsudo
activity on slackpam_ssh
- Log successfulssh
on slackauth_keys_cmd
- Verify keys of thessh
user, and log unsuccessful attempt.@fristonio Reviews