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 6a8679ab22c25fd60504d2b21d57e9f1e2aaa254

Added weeks for ssh IP validity
Author: Catalin(ux) M. BOIE
Author date (UTC): 2015-09-13 08:03
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2015-09-13 08:03
Parent(s): 69912910f5c0bbddc73ced992d8b3a652a8ff526
Signing key:
Tree: c93d6bc8e3258da259809af8087aff1c2798df7f
File Lines added Lines deleted
inc/ssh.inc.php 5 3
File inc/ssh.inc.php changed (mode: 100644) (index bf83dca..4ee6159)
... ... function rg_ssh_totp($db, $ip, $uid, $paras)
144 144 } else { } else {
145 145 $s_expire = array_shift($paras); $s_expire = array_shift($paras);
146 146 $val = intval($s_expire); $val = intval($s_expire);
147 if (stristr($s_expire, 'd'))
147 if (stristr($s_expire, 'w'))
148 $days = 7 * $val;
149 else if (stristr($s_expire, 'd'))
148 150 $days = $val; $days = $val;
149 151 else if (stristr($s_expire, 'h')) else if (stristr($s_expire, 'h'))
150 152 $hours = $val; $hours = $val;
 
... ... function rg_ssh_totp($db, $ip, $uid, $paras)
250 252 default: default:
251 253 echo 'Posible TOTP commands:' . "\n"; echo 'Posible TOTP commands:' . "\n";
252 254 echo ' enroll <token> - adds a new device in the system' . "\n"; echo ' enroll <token> - adds a new device in the system' . "\n";
253 echo ' val [X(m|h|d)] - adds your IP to the allow list for X time' . "\n";
255 echo ' val [X(w|d|h|m|s)] - adds your IP to the allow list for X time' . "\n";
254 256 echo ' the default is 24 hours;' . "\n"; echo ' the default is 24 hours;' . "\n";
255 echo ' you can specify m for minutes, h for hours and d for days' . "\n";
257 echo ' X: w for weeks, d for days, h for hours, m for minutes, and s for seconds' . "\n";
256 258 echo ' list-val - list the already validated IPs' . "\n"; echo ' list-val - list the already validated IPs' . "\n";
257 259 echo ' inval ip|all - Invalidate IP address(es)' . "\n"; echo ' inval ip|all - Invalidate IP address(es)' . "\n";
258 260 echo ' unenroll <token> - remove a device from TOTP system' . "\n"; echo ' unenroll <token> - remove a device from TOTP system' . "\n";
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