File Makefile.in changed (mode: 100644) (index 00feb72..d94a79c) |
... |
... |
install: all |
35 |
35 |
@mkdir -pv $(I_ETC)/logrotate.d |
@mkdir -pv $(I_ETC)/logrotate.d |
36 |
36 |
cp -vd samples/logrotate $(I_ETC)/logrotate.d/$(PRJ) |
cp -vd samples/logrotate $(I_ETC)/logrotate.d/$(PRJ) |
37 |
37 |
@ |
@ |
|
38 |
|
@echo "Installing tools..." |
|
39 |
|
@mkdir -pv $(I_USR_SBIN) |
|
40 |
|
cp -vd tools/* $(I_USR_SBIN)/ |
|
41 |
|
@-chown root:root $(I_USR_SBIN)/rg_* |
|
42 |
|
@ |
38 |
43 |
@echo "Installing log stuff..." |
@echo "Installing log stuff..." |
39 |
44 |
@mkdir -pv $(I_VAR_LOG)/$(PRJ) |
@mkdir -pv $(I_VAR_LOG)/$(PRJ) |
40 |
45 |
@-chown -R rocketgit:rocketgit $(I_VAR_LOG)/$(PRJ) |
@-chown -R rocketgit:rocketgit $(I_VAR_LOG)/$(PRJ) |
File rocketgit.spec.in changed (mode: 100644) (index 10ac459..718f039) |
... |
... |
rm -rf ${RPM_BUILD_ROOT} |
96 |
96 |
%attr(0755,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@/q_merge_requests |
%attr(0755,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@/q_merge_requests |
97 |
97 |
%attr(0755,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@/sockets |
%attr(0755,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@/sockets |
98 |
98 |
%attr(0700,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@/tmp |
%attr(0700,rocketgit,rocketgit) %dir @VAR_LIB@/@PRJ@/tmp |
|
99 |
|
%attr(0700,root,root) @I_USR_SBIN@/* |
99 |
100 |
@USR_SHARE@/@PRJ@/* |
@USR_SHARE@/@PRJ@/* |
100 |
101 |
@USR_SHARE@/selinux/*/@PRJ@.pp |
@USR_SHARE@/selinux/*/@PRJ@.pp |
101 |
102 |
|
|
File tools/rg_change_pass added (mode: 100755) (index 0000000..c79707a) |
|
1 |
|
#!/usr/bin/php |
|
2 |
|
<?php |
|
3 |
|
// Change password for any user |
|
4 |
|
error_reporting(E_ALL); |
|
5 |
|
ini_set("track_errors", "On"); |
|
6 |
|
set_time_limit(0); |
|
7 |
|
|
|
8 |
|
$_s = microtime(TRUE); |
|
9 |
|
|
|
10 |
|
require_once("/etc/rocketgit/config.php"); |
|
11 |
|
|
|
12 |
|
$INC = dirname(__FILE__) . "/../inc"; |
|
13 |
|
require_once($INC . "/init.inc.php"); |
|
14 |
|
require_once($INC . "/log.inc.php"); |
|
15 |
|
require_once($INC . "/sql.inc.php"); |
|
16 |
|
require_once($INC . "/struct.inc.php"); |
|
17 |
|
require_once($INC . "/cache.inc.php"); |
|
18 |
|
require_once($INC . "/repo.inc.php"); |
|
19 |
|
require_once($INC . "/prof.inc.php"); |
|
20 |
|
require_once($INC . "/mr.inc.php"); |
|
21 |
|
require_once($INC . "/keys.inc.php"); |
|
22 |
|
require_once($INC . "/user.inc.php"); |
|
23 |
|
require_once($INC . "/bug.inc.php"); |
|
24 |
|
require_once($INC . "/fixes.inc.php"); |
|
25 |
|
|
|
26 |
|
$uid = posix_getuid(); |
|
27 |
|
if ($uid !== 0) { |
|
28 |
|
echo 'This script must be run with root rights!' . "\n"; |
|
29 |
|
exit(1); |
|
30 |
|
} |
|
31 |
|
|
|
32 |
|
rg_sql_app("rg_change_pass"); |
|
33 |
|
$db = rg_sql_open($rg_sql); |
|
34 |
|
if ($db === FALSE) { |
|
35 |
|
echo 'Cannot connect to db: ' . $rg_sql_error() . "!\n"; |
|
36 |
|
exit(1); |
|
37 |
|
} |
|
38 |
|
|
|
39 |
|
$stdin = fopen('php://stdin', 'r'); |
|
40 |
|
if ($stdin === FALSE) { |
|
41 |
|
echo 'Cannot open stdin!' . "\n"; |
|
42 |
|
exit(1); |
|
43 |
|
} |
|
44 |
|
|
|
45 |
|
if ($_SERVER['argc'] < 2) |
|
46 |
|
$user = 'admin'; |
|
47 |
|
else |
|
48 |
|
$user = trim($_SERVER['argv'][1]); |
|
49 |
|
echo 'Changing password for user ' . $user . "\n"; |
|
50 |
|
|
|
51 |
|
echo "New password (will show on the screen, watch your back!): "; |
|
52 |
|
$pass = fread($stdin, 128); |
|
53 |
|
$pass = trim($pass); |
|
54 |
|
|
|
55 |
|
$ui = rg_user_info($db, 0, $user, ''); |
|
56 |
|
if ($ui['exists'] != 1) { |
|
57 |
|
echo 'User not found!' . "\n"; |
|
58 |
|
exit(1); |
|
59 |
|
} |
|
60 |
|
|
|
61 |
|
$r = rg_user_set_pass($db, $ui['uid'], $pass); |
|
62 |
|
if ($r !== TRUE) { |
|
63 |
|
echo 'Could not change pass: ' . rg_user_error() . "!\n"; |
|
64 |
|
exit(1); |
|
65 |
|
} |
|
66 |
|
|
|
67 |
|
echo 'Password changed with success!' . "\n"; |
|
68 |
|
|
|
69 |
|
if (rg_totp_enrolled($db, $ui['uid'])) { |
|
70 |
|
echo 'Please note that user ' . $user . ' is enrolled in 2fa.' . "\n"; |
|
71 |
|
echo 'Do you want to remove any enrollment (yes/no) [no]: '; |
|
72 |
|
$a = trim(fread($stdin, 128)); |
|
73 |
|
if (strcasecmp($a, 'yes') == 0) { |
|
74 |
|
$r = rg_totp_unenroll($db, $ui['uid']); |
|
75 |
|
if ($r !== TRUE) { |
|
76 |
|
echo 'Cannot unenroll: ' . rg_totp_error() . '!' . "\n"; |
|
77 |
|
exit(1); |
|
78 |
|
} |
|
79 |
|
|
|
80 |
|
echo 'Done unenrolling!' . "\n"; |
|
81 |
|
} |
|
82 |
|
} |
|
83 |
|
|
|
84 |
|
?> |