xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
Commit ee2a01227b36d6e27ae7f81e651f5e241a16a0b0

Add separate e-mail for sending statistics
When RocketGit is used in a self-hosted setup, those e-mails are not
useful, but annoying.
Author: xaizek
Author date (UTC): 2020-07-13 17:00
Committer name: xaizek
Committer date (UTC): 2020-07-30 21:15
Parent(s): cb4bf37be9a40ac50369a48684bf027196fa0c0d
Signing key: 99DC5E4DB05F6BE2
Tree: 6508359201d855b88b7012729cf0ced8646227e8
File Lines added Lines deleted
inc/admin.inc.php 6 2
inc/log.inc.php 6 3
samples/config.php 3 0
File inc/admin.inc.php changed (mode: 100644) (index f8eb44b..de72feb)
... ... function rg_admin_report1_suggestions($db, $from, $to)
408 408 */ */
409 409 function rg_admin_report1($db, $rg) function rg_admin_report1($db, $rg)
410 410 { {
411 global $rg_admin_email;
411 global $rg_service_email;
412
413 if (empty($rg_service_email)) {
414 return;
415 }
412 416
413 417 $body = ''; $body = '';
414 418
 
... ... function rg_admin_report1($db, $rg)
546 550 } }
547 551
548 552 $rg['ui']['ignore_confirmed'] = 1; $rg['ui']['ignore_confirmed'] = 1;
549 $rg['ui']['email'] = $rg_admin_email;
553 $rg['ui']['email'] = $rg_service_email;
550 554 $rg['mail'] = array(); $rg['mail'] = array();
551 555 $rg['mail']['subject'] = 'RocketGit report' $rg['mail']['subject'] = 'RocketGit report'
552 556 . ' [' . $g['users']['yesterday'] . 'u]' . ' [' . $g['users']['yesterday'] . 'u]'
File inc/log.inc.php changed (mode: 100644) (index 615ff5a..8949a4b)
... ... function rg_error_core($msg)
160 160 function rg_log_cron() function rg_log_cron()
161 161 { {
162 162 global $rg_log_dir; global $rg_log_dir;
163 global $rg_admin_email;
163 global $rg_service_email;
164 164 global $rg_state_dir; global $rg_state_dir;
165 165
166 if (empty($rg_service_email))
167 return;
168
166 169 $nd = rg_dir_load_pattern($rg_log_dir, "err-.*"); $nd = rg_dir_load_pattern($rg_log_dir, "err-.*");
167 170 if ($nd === FALSE) if ($nd === FALSE)
168 171 $ncount = "?"; $ncount = "?";
 
... ... function rg_log_cron()
180 183 if ($last_ts + 4 * 3600 > time()) if ($last_ts + 4 * 3600 > time())
181 184 return 0; return 0;
182 185
183 mail($rg_admin_email,
186 mail($rg_service_email,
184 187 $ncount . ' errors are waiting...', $ncount . ' errors are waiting...',
185 188 'Please forward the content of /var/log/rocketgit/err-*' 'Please forward the content of /var/log/rocketgit/err-*'
186 189 . ' to RocketGit developers at rg-bugs@embedromix.ro.\n\n' . ' to RocketGit developers at rg-bugs@embedromix.ro.\n\n'
187 190 . 'Thank you!\n\n', . 'Thank you!\n\n',
188 191 'Content-Type: text/plain;charset=UTF-8', 'Content-Type: text/plain;charset=UTF-8',
189 "-f $rg_admin_email");
192 "-f $rg_service_email");
190 193
191 194 file_put_contents($rg_state_dir . '/tmp/log_cron_last', time()); file_put_contents($rg_state_dir . '/tmp/log_cron_last', time());
192 195 } }
File samples/config.php changed (mode: 100644) (index abd2770..bf7e71b)
... ... $rg_ssh_paras = "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty
41 41 $rg_admin_name = "RocketGit Admin"; $rg_admin_name = "RocketGit Admin";
42 42 $rg_admin_email = ''; $rg_admin_email = '';
43 43
44 // When non-empty, address for sending daily statistics.
45 $rg_service_email = '';
46
44 47 // Set to 1 to allow any visitor to create an account. // Set to 1 to allow any visitor to create an account.
45 48 // Else, only the admin can create accounts. // Else, only the admin can create accounts.
46 49 $rg_account_allow_creation = 1; $rg_account_allow_creation = 1;
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master