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.
<root> / TODO (a2a5fd73f172640b75d60c99bab6b37c9ca49b23) (77KiB) (mode 100644) [raw]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404
== Where I stopped last time ==
[ ] 

== BEFORE NEXT RELEASE ==
[ ] Somehow, test if we use rg_xss_safe if a 'HTML:' var is set.
[ ] ssh: not documented in hints
[ ] I do not have rights to del_undel bugs, but I am still getting the
	token (token_get). Not good.
[ ] Plan for webhooks:
	If we do 'include', take care of type to be aonly a-bA-B0-9_!
[ ] Do not show 'webhooks' menu if the login user has no rights.
	This is for when we will allow webhooks per repo.
[ ] Add labels for users and for repos/comments/etc.? [Also] private ones?
[ ] I should add "Labels: " in front of labels.
[ ] last events: gravatar
[ ] last events: 2015-12-27 09:42 	n/a 	Reference refs/heads/master created (290e4f7a70640d79836b3298c47b913484da24de)
	Why we do not have the user?! Ah, because is anonymous.
	Should we just say so?
[ ] rights: store '*' as equivalent for "all rights". Else, when we will add
	more rights, they will not be automatically added to the list.
[ ] http://r1i:9000/op/settings/wh looks wrong!
[ ] "Please login first"/"Login form" are now justified.
[ ] Use rg_repo_has_rights.
[ ] Do we stop event processing when we change the structure?
[ ] wh: add 'listen tcp socket', 'connecting tcp/udp socket', 'ssh', 'mail'
	hooks.
[ ] wh: how to integrate other types of hooks? For example: mail/amazon/etc.
	Now, I broken it by adding certs to the main wh table, things
	that do not make sense for other hooks. Are not generic! Bad!
	Probably I will have to do a 'fix' functin to switch to the new system.
[ ] git: do not try to show binary files.
[ ] css: 'source'/'bug_body'/'notes'/'mess' was with display: table
[ ] css: decide aboud island_row if we do not switch to flex
[ ] Adapt HTML title based on content
[ ] When showing a commit, add the subject, the body, who commited, gravatar,
	itime, treeish, last tag/branch etc.
[ ] readme and vm: add --data-checksums to initdb! Seems the performance hit
	is not too big.
[ ] rights: split into "List" and "Grant".
	When editing, should I show the list? Put the edit form above list.
[ ] path rights: allow add/delete filenames? Maybe also 'rename' right?
	Maybe split "Push" into: "Add files", "Delete files", "Change files"
[ ] link gravatar with user homepage
[ ] add "link" text to the comments, so users can link to comments. and not only.
[ ] db: we may want to run CLUSTER on some tables.
	rights table: type, obj_id, prio, itime
[ ] db: event.php to have more rights on users tables than web access.
	Maybe I can add INSERT/UPDATE on 'users' to web for email column.
	Maybe use views to separate the rights.
[ ] ci: add coccinelle into the mix (next to cppcheck)
	http://thread.gmane.org/gmane.linux.network/390690
[ ] si inca o chestie foarte utila ar fi sa pot accesa fisierul raw, fara line
	number, pentru a putea da copy la mai multe linii deodata (Gabi B)
[ ] o sugestie ar mai fi ca atunci cand sunt deja pe un fisier sa pot accesa
	istoricul lui (Gabi)
[ ] tree: I have no "UP" folder or the list of dirs with links behind.
[ ] If a repo changes from public to private or the other way around,
	I must invalidate the rights cache.
[ ] rights: if a user has 'admin/give_rights' rights, allow push?
[ ] wh: add prios - we may want to have a hook for storing in s3 and a hook for
	deployment. Hm.
[ ] amazon: CodeDeploy a very nice presentation:
	https://confluence.atlassian.com/bamboo/using-the-aws-codedeploy-task-750396059.html
[ ] amazon: allow deploy to multiple regions
[ ] amazon: is clear that i have to use a role and a custom bucket
	Still investigating how to trigger a CodeDeploy task that will fetch
		from repo and do the deploy. Not use if is possible.
[ ] 2fa: m.google.com/authenticator - also for BlackBerry/iPhone/iPad
[ ] At least refs rights are not reorder by priority! Bad!
[ ] When editing rights, it is not clear that we are in edit mode!
[ ] Markdown (Gabi B)
[ ] Editarea bug-urilor pare ca nu merge
	Search for "2015-12-15 08:59:57.328 3a0126"
	repo ladacubasme.html - repo_id = 19
	user DiAngelo - uid 16 - user-ul logat
	08:59:57.328 3a0126 rg_rights_get: obj_id=19 type=repo owner=16 uid=16 right_id=7
[ ] cind rejectez pentru ca nu sint drepturi, ar trebui sa explic ce lipseste.
[ ] clarify rg_base, some users may want to change it, but is not ok.
[ ] README: for manual install: useradd -G rocketgit rocketgit,
	./configure, make, make install, also check rpm spec file.
[ ] README assumes that rocketgit is already installed as package.
[ ] user metadata: description? homepage? picture?
[ ] gravatar: tell user to register!
[ ] get rid of beteen.html (because of css)
[ ] make sure where we use gmdate to add ' UTC'
[ ] rights: "Add bug" should be inserted with prio 30001,
	so user can forbit adding bugs?
[ ] bug: allow private bugs (think about security reports)
[ ] 'creation' => 'itime_nice'
[ ] When a push is done, schedule a disk size rebuild.
	And remove this operation from cron.
[ ] css: add 'position: fixed' to header (still have problems with
	'display: table-row' for header, body, footer)
[ ] about CI: https://opensource.com/business/15/12/git-docker-continuous-integration-tex-documents
[ ] Integrate with https://semaphoreci.com/
[ ] Take a look at cgit interface: http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=123d0ba9b8c92ce00d2a0b2f98c5f329353e70d1
[ ] Configure, first time, if we auto insert a "anon push" rule.
[ ] lock: web: show when a repo is locked
[ ] repo lock by ssh?
[ ] wh: Maybe separate push/create repo/create branch, to be able to have
	custom filtering. For example, a regex for pushed refs, or a regex
	for repo name, or a regex for branch name.
	Seems we have a regex for all...
[ ] watch: really do something with the users watching a user.
	when target created a repo, for example.
	Also when target user is watching something else? Interesting!
[ ] watch: add unit test for user watch
[ ] watch: 'repo': url is not correct! Always redirects to "last events".
[ ] "Clone this repository using ssh (do not forget to upload a key first)"
	Do a link to upload a key.
[ ] Important to state boldly: "You do not have to have an account
	to contribute to a project!"
[ ] Code Deployment for Amazon (Dani).
[ ] Investigate unlogged PostgreSQL tables and hstore. To replace the custom
	cache. (http://bonesmoses.org/2015/12/04/pg-phriday-displaced-durability/)
[ ] Some people may be behind a firewall and webhooks will not work correctly.
	Add another type: socket, but in listen mode, and provide notifications
	on that socket. Socket will remain opened as long as needed. Cool!
[ ] watch: pay attention to not send updates about private repos!
[ ] Tell the user how s/he can get an avatar.
[ ] watch: when a user is watching a user, what notifications should receive?
	Create repo. Else?
[ ] watch: when a user is watching a repo, it already watches bugs?
	Should s/he?
[ ] wh: last_output pollutes too must 'user::' namepsace. => too many data
	loaded => bigger latency. And last_output is not very important
	everywhere.
	Maybe move whole wh outside of 'user' namespace? It is accessed seldom.
[ ] If user is not logged in, do not show "Edit", "Close" or "Delete" buttons.
[ ] Cache how many users watch a repo.
	We should have a cron that recomputes the numbers?
[ ] wh: at push time the triggers are not called!
[ ] Auto subscribe users to blog, but allow them to unsubscribe from e-mail.
[ ] Do a small tutorial on how you can create themes (Gabi).
[ ] rate another repo (Gabi)
[ ] suggestions: at least notify by e-mail.
[ ] For pull requests by anon push, add a button to send an e-mail with an
	authorization code to be able to destroy/edit pr.
	The e-mail can be taken from commits.
	Maybe we should reject pr with wrong e-mail addresses?
[ ] For public repos, we should activate by default anonymous push
	and teach user how to disable it.
[ ] When a php script exists, check that every db res was freed!
	I found one case in keys.inc.php!
[ ] Keep in history also the fetches? Too much data?
[ ] When showing files, show total number of lines, size in bytes, type,
	button for download, history, blame, printable, history.
[ ] https://rocketgit.com/user/user/repo/source/log
	We may want to transform the author into a link to rocketgit user page.
[ ] Binary files show wrong on "Tree" menu.
	Example: https://rocketgit.com/user/catalinux/rocketgit/source/tree/blob/root/favicon.ico
[ ] Landing page: As pune accesul spre rutina de inscriere mai sus, in
	loc de cinste, si explicatiile mai jos, pentru cei care nu stiu
	inca de site si de ce face el (Paul).
[ ] Pricing: as face box-ul cu paid support cu o slightly alta culoare
	ca alea mai free, care ar fi bine sa fie mai vizibile. (Paul)
[ ] Link to a resource to learn more about Git (Paul)
	https://git-scm.com/book/en/v2/Getting-Started-Git-Basics
[ ] Si mai zi si ca apreciezi ajutorul dat pentru traducerea site-ului
	in alte limbi (Paul).
[ ] Lightest: eu inteleg prin light ceva mai soft, asa, ai usurel si
	nu foarte profund; as folosi 'highly professional, yet
	super-lightweight' (Paul)
[ ] AS LASA BARA CU MENIUL GLOBAL MEREU VIZIBILA, SUS (Paul)
	I hope it will work only with css, else I will not do it.
[ ] Tonurile sunt foarte apropiate si e greu de urmarit si greu de citi,
	de-a dreptul (Paul).
[ ] Redo favicon.ico with 3 layes, 16x16, 32x32, 48x48 (Paul).
[ ] Add possibility to change the time reporting (selecting a timezone) (Paul)
[ ] When repo changes, seems we do not send by email what changed.
[ ] What is "Non fast-forwards" - document in hints.
[ ] ip: comma/space: not ENTER?
[ ] admin: button to pause events processing. and a reason?
[ ] pr: Add 'reviewers' to a pull request.
[ ] Set a timezone if not set to avoid stupid php warnings.
[ ] Add a second part, documenting php-fpm.
[ ] Paul: Notify all users (watchers and maybe the ones that had access)
	that a repo was deleted.
[ ] Paul: Add (per project) an "invite" form. The user receiving the e-mail
	will be able to follow the repo link and "create account" link?
[ ] Paul: Allow users to ask for access on a repo?
[ ] Paul: submenus are the same color => they do not seem to stack.
[ ] Paul: More detailed description for repo rights.
[ ] Add phone number for security reasons (if user lost 2fa device etc.)
[ ] Clicking "Discovery" and no repo is present should not invite the user
	to create one...
[ ] Obsolete 'suggestions' and replace them with a link to the bug tracker.
[ ] wh: operation ('event') is not present in the post request!
[ ] Alert admin on any problems (for example if authorized_keys is not
	updated)?
[ ] An attacker can use a webhook (same url) and same repo name
	and, because of ssl caching, will be able to post the notification
	to the victim's server. In C I will be able to use
	CURLOPT_SSL_SESSIONID_CACHE = 0.
[ ] events: add more "threads", so one webhook (for example)
	will not block all requests. Use a pool with a configurable
	number of workers.
[ ] pr: Allow to add a pr even if the repo is not hosted on rocketgit.
	For example, somebody can create a pull request specifying
	an external url and src/dst branch!
[ ] pr: if a ref is a tag/branch, show them nice.
[ ] hint: add a custom hint whenone pull request is loaded.
	Custom = exactly the instructions to pull that request.
[ ] unit test: check if the log is correctly generated after a push.
	I suspect some rights problems.
[ ] pr: I should add also the user who made the pull request
	or anonymous. Also, IP must be shown also to the owner.
[ ] After some releases, remove any trace of q_merge_requests!
[ ] pr: seems now I go through /var/lib/rocketgit/q_merge_requests
	We should use events! And then get rid of this dir.
	What happends now?
	Seems I need to replace rg_mr_queue_add with rg_mr_create.
	Cron loads merge requests from files and calls mr_queue_add.
[ ] Add avatars for notes and bugs.
[ ] Allow an admin to run extra hooks by adding _them_ info
	/var/lib/rocketgit/extra_hooks/{update,post-receive,...}/ folder.
[ ] check 'man git-receive-pack' for gpg (about signed pushes).
[ ] I still have to investigate if I can send git meta messages.
	Not in hooks, but at start. I want to send the welcome message.
[ ] After pushing using anon-push feature, give to the user a link to be able
	to add a proper subject/body. Else, use the first commit for this.
	Or, join all commits messages. I think is better.
[ ] For repo-refs rights, what happens if reference is empty?
	Add a text to tell that it means everything.
	Seems is ok to be empty = allow push - but, check!
[ ] Allow users to hide avatars in config.
[ ] Add a protection against compression vulnerability.
	An attacker will make the victim's browser to do a lot of requests
	trying to guess CSRF tokens inside the HTTP body.
	We should rate limit the requests or somehow change the CSRF token
	with every request. Is enough to use a XOR mask over the token,
	prepended to the token.
[ ] Pull request: I must be able to do the merge from web interface.
	After adding a pull request, and if the src is a fork, we bring
	the commits into the destination repo to be able to test if the
	merge will be ok or not.
	I should inform the user that the merge is ok or not.
	What to do if it is not? Should I notify the owner that the merge
	is not working anymore and put it in a state that is hidden from the
	merge requests that are working?
	Now I think I accept merge requests only by anonymous pushes.
	But I should allow them also from web, at a user request.
	Still have to check how others are doing it.
	Also, we should have the possibility to close the merge request
	(for example when is not needed anymore because a fix was already
	merged); maybe reject with a comment.
	Default, merge with --no-ff, but allow the merge without it.
	Decide if the pull namespace is read only or not.
	GitHub has the following namespace:
		git fetch origin pull/ID/head:BRANCHNAME
	How do I create a pull request?
		- Select the branch from where you want to do the pull request.
			- Where a contributer is allowed to push?
		- Select the target branch.
		- Select "Review" - optional
			- If selected, show the diff
		- Add a commit message
		- Notify commiters?
	Where should the "Pull requests" menu be?
	Show some info about the merge request: authors, files, diffstat etc.
	4 pieces of information: src/dst repo/branch.
	Developers can push in their branch, for example: refs/{USER}/
	and can make a pull request from there.
	Add possibility to notify more people that a pull request was created.
	A user must be able to push other commits next to the ones present
	in the pull request.
	Somehow, close a pull request if a user is pushing the changes.
	Also, close even if a rebase was done. It may be hard.
	rstacruz:
		[alias]
		pr  = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
[ ] Need to add comments for pull requests. Find a way to propagate them in the
	git repo?
[ ] Because I show the pull request id, somebody can change the commits.
	Somehow, it should be locked?
[ ] Add "Pull request" and allow a user to do it from a branch or a fork.
[ ] When a push is taking place, add the repo into a new table to:
	- recalculate disk space
	- redo the stats
[ ] Look into making a open source project like travis-ci.org.
	Seems is GitHub locked (you need an GitHub account)!
[ ] Add a prefetched daemon. Example: When user logins, prefetch repo info
	to be warm in cache. The user for sure will access the repos.
	Maybe set a permanent cookie to encode the uid and when a user visits
	login page, prefetch the user info! Cool. Maybe other stuff.
[ ] webhooks: still to add for: Pushes, tags, comment, bug creation,
	pull requests. Does not make sense to encode a lot of info in
	response because a bot can check by itself by fetching.
[ ] Why I cannot push to r1?
[ ] For events, very probably I have to disable the cache.
	Scenario: adding a webhook1, add a repo1, add a webhook2,
	add a repo2. webhook2 will not trigger on repo2 creating because
	only webhook1 is in cache! Very bad!
	More exactly, disable core cache?
[ ] Add notifications for hook add?
	For the user creating the hook is not absolutely necessary.
	Maybe from a security point of view? But the rest of admins
	may want to know. I think I will drop this for now.
[ ] Send an e-mail if webhook fails? Flag when configuring webhook?
	Store the last curl log in 'wh' table?
[ ] Clean 'tmp' folder.
[ ] Document webhooks, mostly 'PHP serialize' type. But also other things.
[ ] Do not forget that cache.php has its own memory cache!
	I must not update the database and expect it to see good values.
[ ] wh: add also XML, JSON
[ ] wh: add other conection types: websocket, socket (low priority)
[ ] How "Delete selected" button should be aligned?
[ ] Use rg_var_a2s for checkboxes.
[ ] http://www.w3.org/TR/clipboard-apis/
	1. maybe support javascript copy API
	2. The boxes with a border on the left would be nice for hints.
[ ] Evaluate https://www.gnu.org/software/repo-criteria.html
	Also in Compare.txt
[ ] When I am in "My repositories" and I am doing a search, other users'
	repositories are shown.
[ ] In user/home-page.php, in hints section, add a message when the user is
	low on scratch codes. Not hint. Or, notify by e-mail?
[ ] test with "short" (0 prepended) codes in unit testing.
	For scs, done, test for devices? This is a little bit harder.
[ ] totp:ssh: do we need a command to remove a set of scratch codes?
	Something like 'remove-sc [<itime>]'. If <itime> is missing, list the
	sets. The IP must be authorized?
[ ] Apply to become a member of Software Freedom Conservancy?
[ ] totp: add sc for ssh!
	Should I validate one after asking the user to store them safe?
	Think about power down before scratch codes hit the printer.
[ ] Get rid of {{}} stuff.
[ ] Some other menus were added, we must load all this pages in unit tests.
	At least totp/{list,enroll,sc}.
[ ] I inconsistently use /op/repo/create and /user/catab/settings!
	Why not /user/catab/repo/create?
[ ] Git stats are done only on master branch. We must done them per branch.
[ ] Test with an empty commit what happens in rg_git_log with patches == TRUE.
	Can happen? Maybe for a rename?
[ ] Add repo stats to ssh repo command.
[ ] build rg_user_git_stats that will lookup email into stats and resolve them
	to be rg links?
[ ] repo:stats: seems the number of commits is limited somehow!
[ ] repo:stats: do not generate patch, but use '--numstat'.
	I know it was a problem to parse it, in the past, but...
[ ] totp: store last ts used, and do not allow reuse.
	The problem is if both session sends the same token (the attacker and
	the good user). But the attacker  can be the first. In this case,
	the user will be denied access! But, he used the good token also,
	should I invalidate both sessions and send a recover code by e-mail?
	What should I do? We may also just lock the account and let the user
	contact the admin. It is clear that an attacker has access to the
	password and to the token.
	I need to think more.
[ ] NO_DELAY for AF_UNIX socket?
[ ] When we copy the tree to prepare the push, copy in a temp folder and do
	a rename to prevent partial trees? I know I give back an error, but ...
[ ] We must clean somehow the namespace dir; think about pushes that fails
	because of network connections. An idea is to use namespaces with a
	static format: rg_user_xxx, so we allow to recover from a push request.
	Is not working for anonymous push. In this case, name it by the sha?
	Or, server reboots in the middle of the push.
[ ] Why first message says that the tag was deleted? Locally?
	=== Testing annotated tag delete without rights (COPYUuMWDS)...
	Deleted tag 'tag2' (was b7fca5f)
	remote: ==========
	remote: RocketGit: refs/tags/tag2
	remote: RocketGit: No rights to delete an annotated tag.
	remote: ==========
	remote: error: hook declined to update refs/tags/tag2
[ ] Restart the cache daemon when an upgrade takes place.
	Done, test.
[ ] Report number of lines of code (and how much a project worth) and
	number of other type of documents.
[ ] Add some flags for users: "Coming from GitHub", to be able to give
	specific hints.
[ ] totp: warn user that if a token is not validated for 1 month will be deleted?
[ ] totp: allow prefix for IP addresses.
[ ] totp: think about authorizing a push, not the ip (ip may be dynamic).
	Somethig like, allow the push as pending, but ask for authorization
	to be sent back:
	ssh ... totp val-push <push_id> <token>
	and remove the push from pending.
[ ] "repo was changed" mail: nothing interesting?!
	If nothing changed, do not send the mail.
[ ] The URL to the repo present in mail is rocketgit.com. We may want to use
	the http host name in there.
[ ] bugs: if none present, just go to 'Add' page.
[ ] Seems 'push' is denied for owner!
	Seems I have the key on both 'admin' user and 'catab'!
	Do something about this?
[ ] features: 'Lightest': Add a note describing that is lightest also with
	the browser.
[ ] Document how to deny non ascii filenames using repo_path.
[ ] When a right denies access, also output the description of that right.
	Maybe add a new box for the text to be shown to the user?
[ ] Tell clear that rg can be used also for books, articles, documentation etc.
[ ] Include uid in namespace path to avoid clashes with other users?
[ ] ssh: show the fingerprint of the used key?
[ ] Detect when a user is cloning a repo and update stats? Seems I cannot do
	this easily becasue I just call git-shell.
	But, at least the fetch can be recorded in stats.
[ ] Add cache in rg_git_log.
[ ] Unit test for fetching by ssh a public repo regarding TOTP
[ ] history: add 2fa ssh validation.
[ ] Add history for totp enrollment.
[ ] ionut: Check this to not be send X-PHP-Originating-Script: 0:user.inc.php
[ ] When listing repos on user homepage, we should not add also the user.
	Check rg_repo_list.
[ ] totp for ssh is not finished yet. remember, totp for ssh seems to be only
	for write access. for rg, this may not be true.
	Also for https cloning/pushing. But, for ssh, I cannot provide the
	'password/token', right? Also, for https, I cannot provide the token,
	only user/pass. Maybe appending token to the pass.
[ ] Can I remove the redirect after login (that means another request)?
	Adding a user is pretty light, we should allow the redirect.
[ ] In the report, send also stats about the events, especially the failed ones.
[ ] Document backup procedure.
[ ] "Forgot password": rate limit it!
[ ] Add history for logins/logouts/API.
[ ] Add max_requests per hour for plans and enforce them.
[ ] Protect login by country/ua?
[ ] Improve input forms to be friendly with mobile phones: give html5 hints.
[ ] Main web application must not have access to e-mail column, maybe others.
	Only the queue processor must be able to use it. This is to avoid
	XSS and the stealing of sensitive information.
	Check http://www.postgresql.org/docs/9.4/interactive/sql-grant.html
	web user must not be able to create roles/tables/databases/etc.
	Hm. What about the settings?! I must be able to do a select...
[ ] totp: Build an Android application which will be able to authenticate also
	the server to the user.
[ ] totp: switch to 'password' type for login_token (login page)?
[ ] totp: hints:
	AWS asks for two consecutive codes. why?
	Google also provides a list of backup tokens to be printed.
	"If you want to activate the TOTP extra step, follow the instructions:
		show the qr code or the key, wait for user to enter it
		and if everything is ok, just activate it.
	Instruct user to remove the token if the phone is lost. But, remind
	user that the account may not be compromised without pass.
[ ] totp: think about loosing the phone.
[ ] totp: what if I encrypt key with the password and decrypt only at login?
	(If somebody steals the database, will not have the keys).
	Cannot do. We need it also at push by ssh.
[ ] totp: hints for ssh
[ ] totp: Implement 2 factor auth
	(check https://korg.wiki.kernel.org/userdoc/gitolite_2fa). Done!
[ ] Use PAM (man pam_start) to be able to use any type of auth, including LDAP.
[ ] http://www.cybertec.at/shrinking-the-storage-footprint-of-data/
[ ] Allow repo admins/owners to delete notes/bugs/etc.
[ ] Seems that some other unit test is messing with repo.php ids.
	Change ids to be protected from interference.
[ ] Use bintray.com to distribute isos?
[ ] When session expires and I press logout, no message is shown.
[ ] When creating an account, seems the email is used as the username in
	browser cache, not the username!
	Check!
[ ] After login, show the last ip and date of the last login?
[ ] Users should be able to check the plans.
[ ] I should show some plan 'islands' when you create the account
	so the user will know the disk space and bandwidth.
[ ] In a table, if nothing can be deleted, do not show the delete button.
[ ] When giving some users rights to your repo, do not spam them with
	messages. The user must agree to be spammed. Best, no notification
	is ever issued. User may go to project to activate them if s/he wants.
	Better, show some notifications in the top bar?
	Or in a weekly e-mail with the status.
	(see Linus Torvalds post about GitHub)
[ ] Add a cache based on content. For example, if a repo was last changed
	at timestamp t1, add a cache entry 'history''t1' with the content
	to not render it again. Same for 'history''source' and
	'history''logs' etc.
[ ] We should have a daemon which will test the expiration of variables in
	cache and will refresh them. Also, it will receive prefetch
	requests. For example: when a user logs in, we can prefetch the list
	of repos.
[ ] Prefetch of varibles from cache
	Take care of non-existing vars in cache.
	First candidate: first_install.
[ ] admin_delete_rights::delete, was not protected against csrf/ua!
	Other places? Use a unit test for this stuff?
[ ] Some rg_cache_unset may trigger an error. Case by case we have to
	analyze the impact. We may want to give an error to the user.
	I am thinking at tokens. Maybe we do ot want to mark it as used in
	db if we cannot set it as used in the cache. Else, an attacker may
	reuse the token.
[ ] Run the tests also with cache down (on the server side).
[ ] Show who is watching a bug.
[ ] Mess with session_*() functions to achieve some vars persistence.
[ ] Add some area with citations?
	- I find people who think open-source is anti-capitalism to be kind
	of naive and slightly stupid. (bloomberg.com)
[ ] Build a big repo from all hosted projects!
[ ] Add a link to comments to be able to pass that link to others.
[ ] First page can be cached at least 10 minutes? I think not because of
	logout token. What if the user is not logged in?! Yep, we can do it.
	ETag! What about the cookies?!
	Also, we may want to reuse the logout token?
[ ] Why 'not github' articles, should be integrated somewhere:
	http://www.valdyas.org/fading/index.cgi/2015/05/29#no-github
	http://www.adamhyde.net/why-github-is-bad-for-open-source/
[ ] ssh: Show user the entry that must be added for known_hosts
[ ] LDAP: http://mageconfig.blogspot.ro/2014/06/configure-gitgerrit-with-open-ldap-for.html
[ ] Pass only uid to events, we already have it in cache!
[ ] 'confirmed' should be built in the event handlers not in callers.
	It is already checked in rg_mail_template!
[ ] When we push by ssh, we have the user, so we can give more info about
	why the push failed. Carefull, not too much info. For example:
	"You have no key uploaded, go to ..."
	No key uploaded is not working. ssh server will ask for pass...
	Should we set a special shell and use an empty pass for rocketgit account?
[ ] Should we just set no password somehow for ssh access to be able to signal
	the user that has no key uploaded?
[ ] For 'log' and 'tree' we have decorations for links!
[ ] In "Tree" section, seems the path is doubled.
[ ] Hint: where in fs you can find the repo. Only for admins?
[ ] Hints should not call rg_template, let next rg_template_table to do it.
	(to avoid double replace).
	Anyway, we already do double replace for hints)
[ ] Saving fields in forms when session exired to be reused next time.
[ ] Compression off for ssh because objects are already compressed?
[ ] Add a random token in HTTP header to prevent watermarking (this is the name?).
[ ] Add "Spread the word!" on website.
[ ] https://www.kernel.org/pub/software/scm/git/docs/gitworkflows.html
[ ] git-name-rev is nice.
[ ] git pack-redundant should be called after git gc? And then prune-packed?
[ ] git-relink for really cloned repos?
[ ] Allow creating tags/branches on web interface.
[ ] Use a separate template for main rocketgit.com site. The other users
	should not see the same pages.
[ ] git-filter-branch is very powerful: offer it to the users!
[ ] word-break: break-all; pentru tabelele cu cod. asta permite wrap-ul
	oriunde - still needed?!
[ ] Backup for rg2!
[ ] Add uid to events so we can delete old events for tests or abusing users?
[ ] rocketgit.com: When getting another IP, allow ssh on port 443(https)?
[ ] Investigate --decorate/--word-diff for git log.
[ ] client_win.html hint is not used.
[ ] merge.html hint is not used.
[ ] On create repo form if somebody puts a space, the message does not tell
	what chars are invalid/permited (reported by Ionut).
[ ] Security: Link-uri + xss (Ionut)
[ ] I am able to disable merge/pull requests? Anon yes, but the other ones?
	Add a new right to to it, by default, allow.
[ ] report1: add disk space
[ ] Compress logs (when we are short in disk space)?
[ ] Add right 'allow bad commit messages'.
[ ] Add a new section in 'Rights' to enforce a regex on the commit message.
[ ] Merge requests are not ok - still using files.
	But, we also insert entries in database!
[ ] Implement 'clone' because is easy. The mrs will be a little bit harder.
[ ] Maybe we should not allow bug creation as anonymous?
	How do the anonymous person will edit it? A cookie?
[ ] When a user push something, give them some statistics after.
[ ] When a push failes with a non-fastforward error, show who "broke" the flow.
[ ] We should clean anon namespaces if they fail? name them 'something.tmp'
	till after succesfully run receive-pack. Or just compare with
	the db?
[ ] When a user succesfuly log in, generate a signed token to be used in case
	of brute force attack on his account. With that token he will be able
	to bypass rate limitting. By cookie?
[ ] slogan: it is not rocket science
[ ] nofollow for logout; maybe also in other places
[ ] Check if SSL cyphers are ok
[ ] Se pare ca autogenerez drepturi 'All' pentru orice user asupra repo-ului.
	Se pare ca si la "Path rights"!
	Rezolvat. Ramine problema ca am drepturi full dublate. Nu stiu daca e
	ok sau nu.
[ ] Binary files - diff?
[ ] ionut: Nu e usor sa selectezi url-ul de clonare, tu il ai link: ex: git://git.rocketgit.com/user/catalinux/rocketgit
	Pare ca "git://" nu apare in link.
	Sugestia mea: ori faci un textarea, ori folosesti o librarie pentru
	copy/paste, vezi exemplu cum face github:
	https://github.com/blog/1365-a-more-transparent-clipboard-button sau
	http://davidwalsh.name/clipboard
[ ] ionut: Ai sectiuni de dimensiuni fixe 700px,
	gen: http://rocketgit.com/op/features, daca vrei poti incerca sa
	folosesti css3, flex-box, ceva informatii gasesti aici:
	http://www.w3schools.com/cssref/css3_pr_flex-flow.asp
[ ] Add an invite form (only for logged-in people - because of spam) that
	will send mail to a friend with all the details.
[ ] Graph with the server load.
[ ] Warn users on the first page for behind-the-firewall installations
	that a new version is available. Maybe also the severity level.
[ ] Add unit test for 'copy to' into git_log1. There is already one but does
	not trigger the detection. Maybe we need a bigger file.
[ ] Make the blob show nicer and remove rg_template_list (replace
	it with rg_template*).
[ ] If there are a lot of tags/branches, remove oldest ones.
[ ] Add a "Stats" menu per repo: at least disk size.
[ ] Accessing a file with '"' inside, is not working.
	See rocketgit.com/user/catalinux/test1/source/tree/blob/"xx\"yy"
[ ] Present bugs as a git repo, so we easily add a new one by push?
[ ] Configuration: a number of months to keep history (see slaves).
[ ] vagrant install?
[ ] If I generated some activity on an object, do not notify myself.
[ ] Show the age of a repo/user/bug/etc. Hm. This will prevent the caching.
[ ] We should update the size of the repos only if is dirty (something pushed).
[ ] Before custom hooks, allow enforcing a custom regex for a commit.
[ ] rg_repo_delete trebuie sa stearga si rights si bugs si notes si bug files
	si watch-uri.
[ ] Expose "git reflog".
[ ] Should I allow state select when adding a bug? Better to consider it open?
[ ] Add regex for label filtering, maybe for other fields?
[ ] Add regex for search?
[ ] When showing diff, for the list of files, make links to chunks inside page.
	Already done?
[ ] php-opcache in docs?
[ ] Drop OUTPUT to prevent some attacks? Document in README?
[ ] Seems I cache not set values: first_install is still "?"!
[ ] authorized_keys is missing from 'state' table. Is normal?
[ ] Replace -=ROCKETGIT=- with a random generated code.
[ ] La mail-ul de creare repo, las prea mult spatiu intre "Hello!" si "Repo is".
[ ] Seems I cannot reliable kill cache.php. It becomes a zombie!
[ ] Permisiile pentru /home/rocketgit/.ssh nu sint corecte! Sint root!
	Rezolvat cu chown. Poate vreau sa nu mai rulez cu root keys_regen.
	Only add the regen event! Why? At start we have no users and the first
	key added will generate a trigger.
	May be other places where I run as root!
[ ] I must mark that init.php script was not run, and do not start daemons!
	Else, timezone nasty messages will appear in the logs and only a
	restart will fix the problem.
[ ] HTTP_X_FORWARDED_FOR variable as this data is effectively user input and
	therefore susceptible to spoofing.
[ ] Try to remove non critical queries from main page loading. Just schedule
	the operations for later (register_shutdown_function?).
[ ] We should not delete the tokens. They will be cleaned hourly?
[ ] Remove all texts from code and move them to templates.
[ ] Storing password in database must apply multiple hashes. Check owasp.
	They recommend SHA-256(private_key, salt + pass). Think more.
[ ] Regenerate salt on every successful login? Or after some pre-defined time?
[ ] Get rid of sessions table and use only hmac!
	We may change the encryption key with an algo.
[ ] Should we skip SELECT/INSERT steps for logout (in token_valid)?
[ ] Persistent connection to database?
[ ] Check cache socket is protected against other users.
[ ] Ce se intimpla daca un atacator seteaza un cookie pe .com, de exemplu.
El se va trimite si pe rocketgit.com. Deci, daca user-ul viziteaza site-ul
atacatorului, se seteaza acest cookie, care apoi va fi trimis catre rg.com.
astfel, poate controla cookie-ul (sid-ul), deci si token-ul. Cred ca e grav.
Cred ca asta face browser-ul. As putea sa schimb numele cookie-ului, si sa-l
semnez cumva: ma duc pe attack.com si acolo imi pune un cookie pe .com a=b.
Apoi, viziteaza good.com, si catre acesta trimite cookie-ul a=b.
Daca as lega good.com de a/b, as putea elimina cookie-urile rele.
[ ] http://nedbatchelder.com/blog/201405/github_monoculture.html
[ ] mchapman (subscriber, #66589) (http://lwn.net/Articles/623905/)
	With a GitHub pull-request-based work-flow I need a GitHub account
	(I've been resisting getting one for myself), I need to make sure I
	explicitly "fork" the repository within GitHub (simply pushing my copy
	of the repo to my account won't make pull requests work, as far as I
	know, because GitHub doesn't know that the original project and my
	project are "linked"), and I need to use the GitHub web interface to
	actually generate the pull request and take part in its review. If all
	of this isn't vendor lock-in, I don't know what is.
	I've got bigger problems with the GitHub pull request work-flow anyway.
	If you generate a pull request, discover that changes need to be made,
	you have two choices: you can create a new pull request, losing all
	comments from the previous one, or you have to add new commits. If
	you drop the to-be-pulled branch from your repository and replace it
	with a different branch with the same name, the pull request loses all
	of its comments.
	No, I find the bigger problems are with pull-request based work-flow
	that GitHub uses -- specifically, how that work-flow interacts with
	code review. If your branch is reviewed and it needs modifications,
	then these modifications *should* be made to the original commits
	(not just tacked on as extra commits), which necessarily means the
	branch will be rebased. GitHub's workflow breaks completely when you
	rebase branches.
[ ] Should we delete previous session when user calls login if the user is
	already logged-in?
[ ] security_violation_no_exit -> security_violation? To not spend resources?
[ ] We should be able to have multiple logins (think desktop and phone).
[ ] Test if cache is faster than postgres. If not, get rid of cache!
[ ] Investigate use of persistent prepared sessions.
[ ] What happens if we cannot generate a form token?!
[ ] Add User-Agent to session?
[ ] Check "Content security policy"
[ ] htmlspcialchars does not escape '/'. It may be dangerous:
	https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet
[ ] Ar fi fain ca si sesiunile sa nu fie in baza de date. Daca pun uid-ul si
expirarea in ele, as putea sa scap de stocarea in baza de date.
Sa vedem ce stoches in tabela: uid, expire, session_time, ip.
Deci, as putea stoca uid-ul pe 4 bytes, expire pe 4 bytes, session_time
pe 2 bytes, si ip-ul doar pe un bit in cimpul de flag-uri.
As putea sa fac lock si pe user agent daca user-ul vrea asta.
ip-ul si user agent-ul intra in hmac, dar nu se stocheaza in cookie.
Deci, ar fi 2 * (4 + 4 + 2 + 1) + random part + sig = 22 + 8 + 10 = 40
But, we have a problem with the expiration time!
[ ] Still, a lot of things from
	https://www.owasp.org/index.php/Session_Management_Cheat_Sheet
	needs to be implemented.
[ ] Add "Secure" cookie para when using HTTPS.
[ ] Warning if user has not enabled cookies?
[ ] Seems that Etag is not working for main.css!!! At least.
[ ] bad_token.html must not be in user/
[ ] The merge request name is not so good. Maybe include also the user?
[ ] I do at least two times a request to database for uid 22 in hook_update.log
[ ] git update-ref supports "ref:" to update a ref. Should we?
[ ] Document a little bit how a merge request will show up on a repo.
[ ] Limit recursion for regex matches.
[ ] Delete anonymous push must take uid in consideration. Maybe also other ops.
[ ] Add unit test also for paths.
[ ] cache: we may have data with \x0 embedded. Check.
[ ] Do we use users.rights?!
[ ] Add some versioning mechanism to restart the cache daemon when the protocol
	changes.
[ ] What happens when a user adds a non-existing one letter code for rights?
	I should filter it out.
[ ] Log attempts to inject < and > inside vars. Maybe in rg_var_str?
[ ] We should not call cosmetic in rights hl because we anyway load again the
	list. Seems I do not do it.
[ ] Get rid of 'qstats'.
[ ] Do I test somewhere if a commit is bigger than max_commit_size?
[ ] We must test in HL functions if we have rights, not in rg_user_remove & co.
[ ] The caller of rg_user_make_admin must check rights for administering repo.
[ ] If a project is private and the admin gives "Access repo" to a user,
        that user sees the repo as public. Unit test.
[ ] What right is "Access repo"?! I think is for web. Not clear. Check.
	Seems is used on repo-page.php to give access or not to the repo.
	But I should only check if is public.
	No, because the same test is used also for private repos.
[ ] I have to define what means a 'public' repo: fetch + see bug-tracker?
[ ] In loguri, la username, apar unele cu '?'. O fi de la cache
	+ bug-ul in user.inc?
[ ] We should invalidate rights cache when repo goes from public -> private
	and viceversa. This is not so easy. Because the caching is not done by
	repo_id.
	And this is another problem. What about user_id and repo_id clashes?!
	No clashes because we have the type!
	So, when editing the repo and the repo is doing a switch private-repo
	we must to rg_cache_unset("rights_by_obj_id::$repo_id::type
	unde type poate fi "repo", "repo_refs", "repo_path" etc.
[ ] serialize returns a binary string! Not ok to store it like this in db!
	unit test with \0?
[ ] We have big races for cache. But, the same with the database.
[ ] Retest repo rename. Better, add an unit test.
[ ] When changing rights, invalidate/update cache.
[ ] Add unit test for inject functions.
[ ] Description passed in e-mail, may have security implications?
[ ] keywords for search. Really needed?
[ ] check: seems the browser uses 0x0d instead of 0x0a in textareas. unify?
[ ] performance: update session only after the page was flushed to the client!
[ ] ionut: http://blogs.atlassian.com/2014/10/git-summit-2014-video-roundup/?atl_medium=ACE
[ ] Get rid of custom caches in all files!
[ ] Remove rg_menu stuff (replaced with templates).
[ ] Repo owner can e-mail to users that watch?
[ ] Enforce commit messages formats based on a regex.
[ ] Add redirect to HTTPS and enable HSTS
[ ] Should a user see her/his rights?
[ ] Add rights 'allow non-ascii file names'.
[ ] We should not show delete checkboxes/buttons if a user is not allowed
	to delete items.
[ ] Purge deleted bugs (and notes) in background
[ ] Event for bug delete.
[ ] Cineva sterge un bug, si apoi altcineva apasa "delete" pe acelasi bug.
	Va da eroare, dar nu ar trebui sa fie fatala... Eventual sa afisam
	si cine a sters acel bug.
[ ] No expiration for cache?!
[ ] rg_rights_load and rg_rights_get do the same thing. Remove _load.
[ ] Maybe I should disconnect from cache if a "generation number" does not match
	per connection. Think about setting/un-setting a key that fails
	and then issue a get...
[ ] rights_delete_list must invalidate cache.
[ ] Somewhere we must have a section to define the groups and allow rights
	for groups.
[ ] We may allow a list of paths/refs for rights, not only a single one.
[ ] Audit all regular expressions (at least /D). Especially in conf file.
[ ] I should set 'display_errors' to OFF.
[ ] Maybe add db.users.last_ip_failed? Or the history is enough? Yep, log failed logins.
[ ] db.users.last_ip is used for last IP used for login?
[ ] repos.disk_quota_mb must be dropped and do a look-up in plan.
[ ] Integrate max_public/private_repos into HL.
[ ] Allow specifying base language for a project.
[ ] Add country when creating a user?
[ ] When changing db structure, invalidate all caches.
[ ] When we will switch to C, check UTF-8 validation.
[ ] Check http://blog.wikichoon.com/2014/04/github-doesnt-support-pull-request.html
[ ] If path for repo_path rights starts with /, it is anchored.
	Else, can match anywhere.
[ ] refs: if it does not start with refs/, it is assumed that is refs/heads/
	Also, it must be anchored at the begin of the string.
	Really anchored? Why?
[ ] Implement a basic regular expression parser.
[ ] Use an 'indent' string per repo and (optionally) enforce it.
[ ] Should we use a more restrictive umask?
[ ] In some places we have rg_event_add and then COMMIT. The event processing
	loop may loose the last transaction. :(
[ ] Remove rg_repo_rights_*. Seems we cannot because we test if
	ri.uid == login_ui.uid, that we cannot do in rg_rights_get.
	Maybe if we pass the owner of a resource to rg_rights_get.
[ ] $user -> $rg['user']
[ ] $repo -> $rg['repo']
[ ] $org... -> $rg['org...']
[ ] Doar unele functii high-level ar trebui sa aiba pasat $rg-ul.
	Restul, nu!
[ ] rg_re_repopage($rg)?
[ ] We may have a problem creating bugs. We must test for failures at every
	step.
[ ] When listing repos, check the rights!
	For example, a user is allowed to edit a repo, but is not the owner.
	It is not enough to check 'public = 1'. This may generate a lots
	of look-ups for rights. :( Not if we cache the whole rights list.
[ ] Add a reason for suspended accounts? Maybe also for other operations?
[ ] 'users.rights' is still used?!
[ ] Maybe add an indirection level: Projects. Because an admin may use
	rocketgit only for the bug tracker, for example. Or only for mailing
	list. So, "Repositories" will become "Projects". Hm.
[ ] 'first_install' value is not cached in RAM!
[ ] Seems that an annotated tag cannot be overwritten, even with rights.
[ ] Test bug.php is not working. Seems that repo_info is not working right for
	an nonexistent repo_id!
[ ] From arora I cannot login! See a tcpdump.
[ ] Rights management
	- A user USER is trying to push some commits in a branch B,
		for a file F
	- The set of rights may be:
	Branch		File/dir	Rights
	B2		dir/*.png	FPA
	*		dir2		A
	*		*		F
	refs/heads/x/	*		??? - allow to push in private "ns" 'x'
	x/		*		??? - same as above.
	refs/tags/v[0-9]		??? - allow tags that starts with v.
	USER/		*		??? - give rights to any user to a
					private branch (refs/heads/USER/...).
	*		USER/		??? - give rights to any user to a
					private dir.
	- "USER" is the user that is logged in. Maybe find a better string
		because we may have a user "USER".
	- Also limit by time.
	- We have a problem: some rights do not map correctly to the plan above.
	For example, A(admin) etc. Seems we need to have >2 categories.
	- Also, we will have problems classifying a project as public or private.
	Maybe we can compute the rights as an event after any rights change.
	Maybe we should let the user choose what type of project it is, and,
		if is public, to grant fetch right.
	- Should I add "Create users right"?
	- Repo rights: I should split admin into: "edit repo", "delete repo",
		"give rights" (should limit to his rights), "fill bugs",
		"close bugs",
	- Repo rights: allow "*" as user: default rights.
	- Very tempting to give up "register_rights" function and have the
		form as template. But I have to list them, join them etc. Hm.
		Think about translations, some time.
		I could use a rights file: "<right><tab><category><tab><name>"
		but this will duplicate the categories with translations.
		Maybe have two files, one with "<right><tab><category>" and one
		with "<right><tab><text>".
		I decided to let them in php file, but replace text with a
		translation look-up.
[ ] Remove 'admin' stuff. We will give normal rights.
[ ] We will use '*' = all rights, so we can extend the list and some users to
	get them automatically.
[ ] You can grant the rights that you have, no more.
[ ] De scos 'rights' din user/add_edit.html
[ ] Allow comma separated users for grant rights.
[ ] Loading defaults for refs_rights seems to not working.
[ ] Secure transport X in configuratia de apache. Sau in index.php?

== BEFORE NEXT-NEXT RELEASE ==
[ ] mcr@sandelman.ca: It would be nice if github could be told to reject
	and/or mark files that have whitespace errors.
[ ] Transform user/bug/* into high level functions.
[ ] Maybe, when user is not logged in, on the "Repositories" main menu
	show most active projects, the biggest ones, recent ones and
	search form. And remove menu "List" + "Search".
	Or, maybe the first page to contain best repos and search form.
[ ] Add possibility to change user time zone.
[ ] At least for notes, add also y/m/d/h/m/s 'ago' next to exact time
	But, this will prevent caches!
[ ] We need a matrix testing with:
	un-logged in user, logged-in user, owner
	vs
	public_repo, private_repo, private_repo_with_rights for logged in user
	We can use a custom theme dir that contains IDs to be able to
	detect if we give errors. Or just match the English string.
[ ] I may check in the main php if doit == 1 and token is valid!
[ ] I may do a function rg_generic_edit_high_level with an array, as parameter,
	with functions to call for different stuff.
[ ] Do not redirect to login page if the user is logged in!
[ ] 'Contact owner'
[ ] When editing a repo, we should not pass 'master' as parameter!
[ ] Delay events processing if load is too big. Maybe same with crons?
[ ] Test (EXPLAIN) that rights_i_type_obj_id is used.
[ ] Admin should be able to stop queue processing.
[ ] When we delete a repo, we must delete also rights and bugs etc. Same
	for a user deletion.
[ ] rights.misc2 is not used now. Drop it?
[ ] How do we set rg_git_host? Now it shows r1i!
[ ] Do not test if we watch a bug if the bug is new.
[ ] repo-home->"Lock repo" + hint=(options to block fetches/commits/bug/etc.)
	and with reason that is logged in history and shown on access.
	Also, admin must have lock power and a reason.
[ ] When sending mails, add also who did the operation. For example, delete
	repo. It may not be the same person that created it!
[ ] Add a description field for rights and keys. Maybe other places.
[ ] Check http://nvie.com/posts/a-successful-git-branching-model/
[ ] After resetting password, go to the login form, with user pre-filed so
	the user can cache the password.
[ ] Add number of bugs multiplied with a factor to total disk space.
	Same for any row in the database. Should we do it?
[ ] How should I verify repo rights?
	if (admin)
	if (owner)
	if (public)
	pentru fiecare drept din lista ordonata dupa prioritati (putem avea mai multe din cauza ip/time/etc.)
		verifica daca are dreptul
	E valabil si pentru drepturi pe user?
	Cum ar trebui sa arate tabela de drepturi? Cred ca e ok. misc poate
	suporta drepturi ciudate.
	Sa vedem cum arata acum:
	type	uid	obj_id	itime	misc	rights
	Ar trebui sa avem si prioritatea in lista ca sa puetm ordona
	dupa cum vrea user-ul.
	Se pare ca rg_rights_load e folosit doar pentru repo si nu si pentru user.
	rg_rights_set nu are notiunea de prio.
	As vrea ca si owner-ul sa poata sa se limiteze la un anumit set de ip-uri.
	This means that the rule with all allow must have prion 30000?
	Asta inseamna ca, din start, ar trebui sa adaug o regula pentru owner.
	Sa incerc sa schitez partea de admin a user-ilor.

[ ] Do not pass a lot parameters in environment. Because of rights, we must
	do a look-up in cache/db anyway. Or, compute correct rights (take in
	account IP/time/etc.). No, because we need paths.
[ ] 'rg_rights_allow' needs a first parameter that is the set.
[ ] Repo rights were split in two. Check all rights checks! Maybe in check
	function, verify that there is a possible right and if not internal_error.
[ ] Tree rights are a mess. User/Repo mixed rights.
[ ] "Create repositories" user right should not be in repo rights?
	Probably not, because we may have no repo in the beginning.
[ ] I will have a csv document with translations from where I will build
	some hash tables for fast look-ups.
[ ] Check "suspend"/"make admin"/etc. in admin area. Maybe use a checkbox and
	an operation to avoid CSRF and to be consistent with ssh keys forms?
[ ] Fix rights saga on user side. We may remove user_allow and replace with
	rights_check?
[ ] "Reset password" in admin area?
[ ] "Make admin" will be replaced by "Edit"?
[ ] Problems trying to push to rg1 because of SELinux:
	type=SELINUX_ERR msg=audit(1366526640.307:1449979): security_compute_sid:
	invalid context unconfined_u:unconfined_r:rocketgit_t:s0-s0:c0.c1023
	for scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
	tcontext=system_u:object_r:rocketgit_exec_t:s0 tclass=process
[ ] Check if adding/editing a bug generates notifications correctly.
	Maybe use a global function for notify_one.
[ ] When we cannot process an event, mark it as failed and do not touch it again.
[ ] Big confusion! An logged in user has a different ID than the one of the repo
	and it may have admin rights! Audit everything (rg_ui/login_ui/$uid).
[ ] Checking mtime of event.php is not enough. Maybe checking version.
	Think of includes that may change.
[ ] Checking for "rg_ui['uid'] == 0" may not be enough.
	Maybe rg_ui[['uid'] = repo['uid']?
	Or, everywhere add 'uid = ?' in queries.
	Scenario: a user pass a list of ids to be del but s/he's not the owner.
[ ] Check if we can give rights for a non-owning repo!
	We should check if the user that gives rights is the owner or has admin
	rights!
[ ] Add "lock ip" to settings and use them as default.
	Also use it for confirmation.
	But, if the IP changes, the user will have to re-login. Hm.
[ ] The rights should be stored on different rows? Probably not.
[ ] Adding an account seems to just show "Account was created".
	Maybe redirect to user page? Only if there is no need to confirm.
	What about lock_ip?
[ ] Where to check if plan exists (rg_user_edit_high_level)?
[ ] SSH keys: add from what IP the key was uploaded?

== Medium ==
[ ] Add hit/miss stats to caches.
[ ] If we have bug tracker, why not a mailing list?!
[ ] Allow comma separated users in (at least) rights grant.
[ ] Suggest some users on repo's "Grant rights". Maybe contributors?
[ ] Does it makes sense to have a local cache (user/repo/etc.) when we have
	another local cache (cache.inc.php)? Pay attention to
	invalidating/refreshing the cache. Hm.
	Really-local one is faster for big lists. But, do we allow such big
	lists without pagination?
[ ] pg_fetch_assoc returns FALSE if error or no more rows.
	We must know the difference!
[ ] Finish high level sql function.
[ ] No caching for keys.php? If we add one, update first_use only if needed.
[ ] Rate limit at least login operations to prevent brute force passwords.
	Because the attack may come from several IPs, it is tempting to
	use target user for rate limit. But, we will prevent legitimate users
	to login. Maybe just increase the delay for login? Maybe notify user
	how many attempts were before successful login.
[ ] remote.php: call keys_update_use from an event.
[ ] Prea mult spatiu gol la notificarea de schimbare repo.
[ ] @@if: if after {{/}} follows a \n, just remove it? Maybe only if the if
	tokens are the only things on a line.
[ ] Think about moving unused tokens to a new session after login.
[ ] Security: Edit info: user can change the uid behind my back in form!
	This is fixed with rg_user_allow_access. It should be used everywhere.
[ ] Maybe do not deny account creation, but put them on a special state
	and ask admin to allow it?
[ ] info.php shouldn't be converted to high-level function?!
[ ] Move sending e-mails to event.
[ ] Think about renaming repositories to projects. Because they contain also
	the bug tracker. Maybe in the future the admin would want to disable
	some modules (git/bug tracker/etc.).
[ ] When a push/etc. takes places, add an event to recompute disk size!
	Then, remove this from cron.
[ ] Move rg_account_allow_creation and other configuration stuff into admin area.
[ ] How to set default rights for new users? Maybe a section in admin area?
[ ] Computing disk size must invalidate the user cache. Or update it?
[ ] Check in remote.php that for the user connecting we are updating stats.
	Better, update stats for both connecting user and repo is connecting to.
	As an event?
[ ] Allow user to change the plan somehow.
[ ] In documentation, because of SELinux, we may want to restart some services.
	At least: xinetd, cron etc. Probably not, but I must test this.
[ ] Think about generating more tokens. Maybe just sign them to not be forced
	to save them in database. At least generate more than one and cache them.
[ ] Allow upload a ssh key as a file, not only paste it in textarea.
[ ] Merge $more in all places where we add events.
[ ] Invite a friend.
[ ] In a lot of places seems I use rg_log instead of rg_*_set_error!
[ ] Auto login after account creation? What about locking by IP? Maybe just redirect to
	login page with (at least) username pre-filled? Or ask only about "lock ip"?
[ ] sess: just mark it as invalid and store it in cache to not connect to
	database? Cron will clean them up.
[ ] Protect sh scripts to be run as RocketGit user and not other.
[ ] To not have too many keys in authorized_keys, investigate certificates.
[ ] Add cache in:
	- rg_keys_count
	- etc.
[ ] Add transaction in all places where event_add is called.
	Maybe also in other places. Do an audit.
[ ] Remove 'repo/dirty' stuff and replace with events.
[ ] When we delete a user, should we remove from cache the name_to_id/email_to_id?
[ ] Delete repo - check if all is deleted. Seems not.
[ ] Audit all operations to be verified with tokens.
[ ] Create repo on demand when a user pushes.
[ ] Compute how many users are per plan, as an event when a user is
	added/deleted/changed plans. Better, from cron.
[ ] Increment usage on keys should be done by events, with a predefined interval
	to not kill the database.
[ ] Allow user management by ssh:
	ssh rocketgit@host create-account --ssh-key `cat key.pub` <name>.
	ssh rocketgit@host disable-account <name>.
	Of course, check rights.
[ ] Add unit testing for plans and rg_user_over_limit.
[ ] Switch to *_high_level functions.
[ ] When user press submit in a form and session expired, save in a cookie all
	data, invite user to login and redirect to old page will all fields
	filled in! But if the user is in a cafe, s/he will lose that info.
	Better store locally.
[ ] Add rights for "Transform merge request in e-mail".
[ ] Check if all forms keep old values in case of an error.
[ ] Limit the number of e-mails to not flood the inbox.
[ ] Record in some stats how long took a push in terms of cpu/time/etc.
[ ] We should have a log with logins, not only last_login per user.
	So, we should have an event on login and explode it in several queries.
	Also session may be updated from this event, but still with a 1 min gap.
[ ] A script to check if all CSS classes in templates are present in css file.
[ ] Export/import a repo (xml maybe).
[ ] We should warn the user if some users have lower rights than the default!
[ ] Auto-create repos at clone phase, not only at push phase.
[ ] The link to a note should have an anchor to be able to go directly to the note.
[ ] bug tracker is private? If the repo is, it should be also.
[ ] When you watch a project, a note add to a bug will notify that watcher?
	Or we limit to edit/add/close bugs?
[ ] We should also add organization/user next to repo in e-mails.
[ ] Feature to be able to mark a note and the rest under it as read?
[ ] Return error in rg_*_info( when you do not have access?
[ ] SELinux: is not clear how I use SourceX: for .if/.te/.fc.
[ ] SELinux: what about rocketgit_t access to postgresql through apache?
[ ] Check why only 'tageted' policy is installed.
[ ] Should I move the socket to /var/run (using tmp.d)?
[ ] Bug:List: saved searches with spaces inside the name are not correctly escaped.
	Use _ instead of space, or properly escape it (ugly: %20 etc.)?
[ ] "if ($res === FALSE) break" must set the error message!
[ ] Careful order the events. We do not want to build list notifications
	before adding a user to the watch list.
[ ] If description is empty, do not insert a \n in 'new repo' e-mail.
[ ] If the confirmation code is truncated, an internal error is generated
	instead of a user error!
[ ] Third option: anybody can create an account but must be validated by admin.
[ ] After creating the account, keep the user logged in and allow login
	even if is not confirmed (option in config).
[ ] When I close a bug, seems I add myself to the watch table again!
[ ] Should we load the lables in rg_bug_info?
[ ] Do we need a rg_bug_cosmetic for notes/users/repos/etc?
[ ] when rights are revoked, also the watch list must be checked.
[ ] When adding a note, add also a checkbox to watch that bug?
[ ] Integrate remote_add.html.
[ ] When I edit a bug, should I remove notes and add_note form?
[ ] Add possibility to add/remove labels when adding a note?
[ ] Bugs: show what filtering is active.
[ ] Bug: Do not allow adding labels if you do not have admin rights.
[ ] Bug: Do not allow close/assign/etc. if you do not have admin rights.
[ ] Menu must be loaded from template.
[ ] Remove any HTML from code.
[ ] List on the first page the latest commits.
	Do not forget to exclude private repos.
[ ] Should we expire the reset password token? Why?
	Somebody can request another one!
[ ] It is not clear that the owner has full rights (repo->admin->edit).
[ ] Allow editing of bug searches.
[ ] Admin: add a feature to become any user. This way we will not duplicate
	a lot of code for editing users/repos/etc. Allow admin to switch
	identities at will.
[ ] Admin: add a feature to reset all passwords.
[ ] Forgot link must use paras and not a parameter. This way we short the URL.
	Maybe send both HTML and plain e-mails?
[ ] Check best practices for salt/pass/forgot pass etc.
[ ] Create a unique index on users(username,organization)?
[ ] We have a little problem: we need the ssh keyring to regenerate fast but
	we may have a big events queue. We may want to signal directly
	the regeneration script and to not store mark-dirty state. Hm.
[ ] Optimize keyring invalidation. Store in cache the ts of last regenerate and
	ignore request before that timestamp.
[ ] We should make stuff more robust. For example: CREATE REPO + HISTORY_INSERT.
[ ] We have to record the renaming in the repo history.
[ ] Use another home page for logged in users.
[ ] repo_invalidate_cache does an implode that can reorder. Use repo_id as key?
	No. But use some combinations of paras.
[ ] Why we use "FOR UPDATE" on 'events' table?! events.php is the only user.
[ ] We need to parallelize the event processing.
[ ] Check if there are unused parameters after name2base(_path).
[ ] Remove any trace of $rr.
[ ] How to deal with browser accessing an old name (after rename)?
[ ] Functions from util.inc.php set rg_util_error(). Use it.
[ ] Remove all "exit(?)" calls.
[ ] Locking is done in global dirs for tests. Use a local folder!
[ ] We must provide a way to propagate errors from events!
[ ] repo.inc should not depend on user.inc!
[ ] rg_repo_info will have almost the same paras as rg_user_info!
[ ] Add a maximum time to keep logs.
[ ] Do not allow double ssh keys in database! Because when we output them
	in authorized_keys ssh will use the first one!
[ ] Move everything 1 month back to simulate next month for slave tables.
	Better, do a unit test.
[ ] To not wake up many times (for every sub-event), cache what was done
	(or max(id)) and ignore that wake-ups. Of course, W will become W<ev_id>.
[ ] If session expired and the user is trying to access a repo page, PHP errors
	occurs. I think is related to login_ui/repo_ui.
[ ] Unify repo_create with repo_update, as user_*.
[ ] Clean notification inputs before starting to work to not receive a lot of
them after processing is done.
[ ] Description should not be present anywhere (web). Takes space.
[ ] Seems that ls \.\. works. Check from security pov.
[ ] Profiling is not re-entrant. We should use a stack!
[ ] We should not store repo_id0 into cache!
[ ] We are redirecting the user to history page. Do not wait for git dir!
[ ] Set a policy in config.php and do the cleaning/compress of the log files.
[ ] Fix the mail headers (+dkim) to avoid spam.
[ ] http://joeyh.name/blog/entry/git_push_over_XMPP/ (ialbescu)
[ ] Graphics with database/table/index sizes.
[ ] Add history also for user.
[ ] template_table can deal with a FALSE para: load error.html file in list/
[ ] Put in history how many visitors received.
	Maybe only when hitting some limits?
[ ] Run shaX 1000 times for login?
[ ] There is no back button in tree browsing.
[ ] Allow users to have templates repo to be used when creating a new repo.
	Also define global templates.
[ ] GeoIP
[ ] Specify a timeout for push/fetch.
[ ] Describe also the installation.
[ ] Allow search from the first page.
[ ] Detect hexa strings and link them to commits.
[ ] Any user on a machine can look at repositories.
	Any user can connect to database. Fix also the README after fixing this.
[ ] (Commercially) Provide OpenVPN tunnels to be sure you can push/fetch safely.
[ ] Errors should signal what field is not ok.
[ ] Also log errmsg[] array!
[ ] Add possibility to download the "CV" of a user.
[ ] Happy birthday for projects/users/etc.
[ ] Check if we remove rocketgit, the repos stay!
[ ] Bug rights: add note, anonymous add note, add label, add global search.
[ ] Allow user to specify if is on windows/linux/etc. to be able to give
	specific hints. Hm. The user may have multiple OSs.
[ ] http://rg.embedromix.ro:8000/user/catab/a13/admin/rights?edit_uid=19
	should give an error!
[ ] Pay attention to: https://github.com/sitaramc/gitolite/wiki:
	Please DO NOT send me pull requests via github. Instead, send me an
	email saying what URL and what branch to pull. (The pull system forces
	a --no-ff even if the merge is at the top of my branch and doesn't
	need one. It also gives me no chance to fix up minor typos, add any
	more text to the commit message, etc. I can do that afterward, but
	this forces a "push -f" or a trivial "typofix" commit).
[ ] We should have a 'domain' variable for virtual hosting and use them in
	paths for locks/queues/repos etc.
[ ] Merge requests should use a shorter path? What if a merge request is for
	other branch?
[ ] See diff for merge requests.
[ ] On master, list clones.
[ ] Internal mailing list? Or internal mail?
[ ] We should have a cron/q/remote for every config file!
	Or, at least, to be host aware.
[ ] Install text files in /usr/share/doc
[ ] JUNK1/JUNK2: http://rg.embedromix.ro:8000/user/catab/rocketgit/commit/afd1df2..f919c9b
[ ] Add permission to add bug tracker to a project.
[ ] @@branch@@ is not defined for merge requests. Should it? Probably yes, to filter them.
[ ] Check admin creating of an account.
[ ] Add possibility to reject merge requests, to apply, to delete etc.
[ ] Do we need to escape some chars in console (ssh rocketgit@host repo X)?
[ ] We need to switch to a template for the user form to get rid of a lot of
	mambo-jumbo with the _u array passed!
[ ] Show the API on the webpage, exactly like Blender.
[ ] Migrate to a single function to deal with a request so we can do better
	unit testing.
[ ] We should have a 'policy' table where we have something like:
	ID	max_speed	max_users	max_disk_space
	and every user is associated with such a policy, based on payments etc.
	Example: user X paid some money, and we assign it to level 2
	Level 2 has 4 users, max 100MiB disk space, 1Mbit/s speed.
	He creates a repo and assigns 2 users to it.
[ ] Notifications when disk space is low.
[ ] Check webSSO for authentification.
[ ] Check http://gitlist.org/
[ ] Enforce Signoff-by lines per project (a new permission)
	= reject commits without signoff!
	Maybe, do it generic, allow a text field to enumerate what should be in a commit!
	Also, present a list with checkboxex: at least Signoff-by, Reported-by, Acked-by!
[ ] Linus on why GitHub sucks: https://github.com/torvalds/linux/pull/17#issuecomment-5654674
	- Valid name and valid e-mail address
	- Why the destination should pull?
	- A shortlog of the changes (1 line)
	- A proper diffstat
	- changelog should be shown with a monospace font?
	- First line should be <= 50 chars (short log); then an empty line
	- Rest of commit message to be wrap at 72 chars.
	- Use git-request-pull for merge requests?
	- Exemplu de pull request ok: https://groups.google.com/forum/#!topic/linux.kernel/w957vpu3PPU
	- 
[ ] We need to have a link to current comment/etc.
[ ] Warn if commit messages are too long (no wrap).
[ ] Allow the possibility to send an e-mail to maintainer from web with a pull request
[ ] Merge requests e-mail: explanation of why to pull, diffstat! Maybe also the
	patch if is small.
[ ] Check git-request-pull
[ ] Logo for project. Blender?
[ ] Default branch per project[/user].
[ ] Main language of the project.
[ ] Web site for a project.
[ ] 

== Normal priority ==
[ ] 
[ ] Add hint about "ssh rocketgit@server" to quickly find status etc.
[ ] rg_redirect does not record profiling information!
[ ] git bundle
[ ] How to sign merge requests?!
[ ] Store in a cookie the last uid used, and if > 0, look-up e-mail and pre-fill
	forgot password e-mail field. Not good. An attacker may iterate over all
	uids. But, with a token will be nice!
[ ] Yeah BitBucket's pricing is much better they only charge on the number of collaborators.
[ ] Permit "log" to see more rows.
[ ] Make an option to not allow a client to upload keys. Why?
	To restrict this to admin?
[ ] Can we bypass ssh auth to allow pushes?
	This way maybe we can identify client by fingerprint.
[ ] Use rg_git_diff_tree to test for path based restrictions. Also, take care of renames, copies etc.
[ ] See Gerrit: https://codereview.qt-project.org/#change,22764
[ ] user-conf: option: auto-create-repo-on-push
[ ] Use git push to do all kind of commands: create repo, delete repo, update description etc.
[ ] Optionally init a repo with some files (README, TODO etc.)
[ ] Check https://git.wiki.kernel.org/articles/g/i/t/GitHosting_2036.html
[ ] Add RocketGit to https://git.wiki.kernel.org/articles/g/i/t/GitHosting_2036.html
[ ] Add a dependency on sendmail.
[ ] Improve e-mails to not be considered spam.
[ ] Statistics (number, tool etc.) for project access.
[ ] For bug-tracker use BerliOS as a starting point.
[ ] Allow (anonymous) editing files on web and transform them in merge request.
	How to bundle multiple edits in a single commit?
[ ] On the first page no search form! It is useless!
[ ] Add stats for a repo. Some stuff is already in git.inc.php.
[ ] Anti-spam: hide e-mail addresses!
[ ] Check if a merge request was integrated (hm; what integrated means?!) and
	signal this in merge requests list?
[ ] Add rg_branch_allow_chars and rg_tags_allow_chars.
[ ] repo/tag|branch/<name> page should put next to the commit also the tag/branch.
[ ] Order tags by mtime desc.
[ ] rg_repos should be split in rg_repos and rg_var_lib.
[ ] $blocks = explode("@@left@@-=ROCKETGIT=-@@left@@", $a) - seems that \0 is replaced!
[ ] Check XSRF attacks and other types.
[ ] Validate e-mails.
[ ] Take care of PHP's time limit to not interfere with the rest.
[ ] Differentiate between owner of a repository, currently logged in user and admin.
[ ] Warn before deleting a repo!
[ ] Switch all menus to templates.
[ ] Check double slashes in URLs.
[ ] Automatically create user on anonymous push?
[ ] I am not sure I can reload xinetd and httpd from spec file
[ ] Check SELinux context on /var/lib/rocketgit
[ ] admin: "Lock all accounts" and "Reset password for all accounts and send mail".
[ ] Get memory statistics from /proc.
[ ] Add support for refs/notes/ pushes.
[ ] When logging _SERVER variables, log only the ones prefixed by ROCKETGIT_.
[ ] Ask password when doing any critical change of the account and send mail.
[ ] Add a possibility (link shown in push message) to delete/update/etc. the
	merge request.
[ ] Allow a nonstandard port for web.
[ ] Put form error messages next to the label.
[ ] favicon.ico is not in theme! Should we put it in HTML?
[ ] Create unit testing for all functions.
[ ] Test error code for rg_sql_query.
[ ] Log $ret['errmsg'] for rg_exec
[ ] Audit code to replace parts with rg_internal_error.
[ ] Allow SSH keys per repository (only)?
[ ] Allow remote 'gc' of a repo, besides an automatic one.
[ ] Take care of caching of passwords. Maybe allow a purge of a file from browser?
[ ] "Lock" button to temporary block access to repository.
	Only owner will have access.
	We may add also a text that will be output to clients.
[ ] List changes introduced by a merge: git diff-tree --always [--cc] -m -p f7d5b5770f4c6b5a124dad6358bed310d56bf909
[ ] Check pack-protocol.txt!
[ ] When push is executed with success, show a nice message from RocketGit.
[ ] Move is_private member in repo array, not test for empty on default rights
[ ] Move default rights to rights table - I do not remember why.
	Maybe for consistency.
	Ah, yes, also to be able to set rights per branches and per files.
[ ] Log files may be written per repo and per user, with locking...
[ ] Push may be always allowed - but will be done as a merge request! Cool.
	Disk space accounting?
[ ] We should make a repo dirty only if user pushed something with success.
[ ] <link rel="icon" type="image/png" id="favicon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAACGFjVEwAAAASAAAAAJNtBPIAAAAaZmNUTAAAAAAAAAAQAAAAEAAAAAAAAAAALuAD6AABhIDeugAAALhJREFUOI2Nk8sNxCAMRDlGohauXFOMpfTiAlxICqAELltHLqlgctg1InzMRhpFAc%2BLGWTnmoeZYamt78zXdZmaQtQMADlnU0OIAlbmJUBEcO4bRKQY2rUXIPmAGnDuG%2FBx3%2FfvOPVaDUg%2BoAPUf1PArIMCSD5glMEsUGaG%2BkyAFWIBaCsKuA%2BHGCNijLgP133XgOEtaPFMy2vUolEGJoCIzBmoRUR9%2B7rxj16DZaW%2FmgtmxnJ8V3oAnApQwNS5zpcAAAAaZmNUTAAAAAEAAAAQAAAAEAAAAAAAAAAAAB4D6AIB52fclgAAACpmZEFUAAAAAjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9WF%2Bu8QAAABpmY1RMAAAAAwAAABAAAAAQAAAAAAAAAAAAHgPoAgEK8Q9%2FAAAAFmZkQVQAAAAEOI1jYBgFo2AUjAIIAAAEEAAB0xIn4wAAABpmY1RMAAAABQAAABAAAAAQAAAAAAAAAAAAHgPoAgHnO30FAAAAQGZkQVQAAAAGOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVfozYcAAAABpmY1RMAAAABwAAABAAAAAQAAAAAAAAAAAAHgPoAgEKra7sAAAAFmZkQVQAAAAIOI1jYBgFo2AUjAIIAAAEEAABM9s3hAAAABpmY1RMAAAACQAAABAAAAAQAAAAAAAAAAAAHgPoAgHn3p%2BwAAAAKmZkQVQAAAAKOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F1BhPl6AAAAGmZjVEwAAAALAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQpITFkAAAAWZmRBVAAAAAw4jWNrgAWjYBSMArgAAAQQAAHaszpmAAAAGmZjVEwAAAANAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeeCPiMAAABAZmRBVAAAAA44jWNrgJ5gpxrDf2LEcIL%2FpzAVYxPDavP%2FUwz%2FpW79%2F%2F%2F%2FFMP%2FnWoQjC5GOxcgu4QYsVEwCmAAAOE0KxUmBL0KAAAAGmZjVEwAAAAPAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQoU7coAAAAWZmRBVAAAABA4jWNrgAWjYBSMArgAAAQQAAEpOBELAAAAGmZjVEwAAAARAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeYVWtoAAAAqZmRBVAAAABI4jWNrgAVYQXNz839ixHBq3qnG8B9ZAzYx2rlgFIwCcgAA8psX%2FWvpAecAAAAaZmNUTAAAABMAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC4OJMwAAABZmZEFUAAAAFDiNY2AYBaNgFIwCCAAABBAAAcBQHOkAAAAaZmNUTAAAABUAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5kn7SQAAAEBmZEFUAAAAFjiNY2AYnmCnGsN%2FYsRwgv%2BnMBVjE8Nq8%2F9TDP%2Blbv3%2F%2F%2F8Uw%2F%2BdahCMLkY7FyC7hBixUTAKYAAA4TQrFc%2BcEoQAAAAaZmNUTAAAABcAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC98ooAAAABZmZEFUAAAAGDiNY2AYBaNgFIwCCAAABBAAASCZDI4AAAAaZmNUTAAAABkAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5qwZ%2FAAAACpmZEFUAAAAGjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9cjJWbAAAABpmY1RMAAAAGwAAABAAAAAQAAAAAAAAAAAAHgPoAgELOsoVAAAAFmZkQVQAAAAcOI1jYBgFo2AUjAIIAAAEEAAByfEBbAAAABpmY1RMAAAAHQAAABAAAAAQAAAAAAAAAAAAHgPoAgHm8LhvAAAAQGZkQVQAAAAeOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVlxR3%2FgAAABpmY1RMAAAAHwAAABAAAAAQAAAAAAAAAAAAHgPoAgELZmuGAAAAFmZkQVQAAAAgOI1jYBgFo2AUjAIIAAAEEAABHP5cFQAAABpmY1RMAAAAIQAAABAAAAAQAAAAAAAAAAAAHgPoAgHlgtAOAAAAKmZkQVQAAAAiOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F0%2FMvDdAAAAAElFTkSuQmCC"/>
[ ] Allow to recover a deleted repository.
[ ] Deny access in all functions to deleted repositories.
[ ] Count the numbers of clones/pushes/pulls.
[ ] Allow to configure the limit of the patch size to prevent abuses.
[ ] Allow to configure to refuse binary files.
[ ] E-mail aliases section.
[ ] User details section (blog, avatar, mail notifications).
[ ] UTF-8 checks of patches.
[ ] W3C validation on all pages.
[ ] Validate user and repo names. Probably other things.
[ ] What happens if a user is suspended? Do we allow forgot pass sending?
[ ] Do not allow session updates/any command if user is suspended after his/her login.
[ ] Timeout for connections (ssh/git-daemon/etc.)!
[ ] Check if we have to respect 4HEXA also on SSH. I think not.
[ ] Limit number of simultaneously connection per repo and per user.
	Maybe also the time!
[ ] Allow multiple virtual hosts, with different configurations.
[ ] Config file must be able to be set from a env var, to be able to run
	multiple instances of rocketgit on the same server.
[ ] session_time should be set at login time? And/or default s_t should be set
	from database?
[ ] Do not let user upload an already uploaded key.
[ ] Do not permit more than X auth attempts per second.
[ ] See prepare-commit-msg.sample - we can auto add a line to every commit.
[ ] Check http://plathrop.tertiusfamily.net/blog/2010/05/11/git-hooks-branch-acls-and-more/
	to block updates that have not pull - a la SVN
[ ] Maybe we should mark the repository as dirty, only in the post-receive
	hook? Or update is the best place?
[ ] Limit number of commits per push.
[ ] RSS
[ ] Smart HTTP transport
[ ] Move forget pass token into users table.
[ ] Audit all error messages to not propagate useful info to an attacker.
	Split in two error messages: one for logs and one for user.
[ ] git-daemon connection - cannot get IP info? setenv?
[ ] Do not show sub-menus if user is not logged in on repopage (ialbeascu)
	- duplicate menus?! maybe add an admin link in repopage that goes
	to repo.
[ ] Nice graphic (unrelated to git): http://tctechcrunch2011.files.wordpress.com/2011/07/hadoop2.png?w=640
[ ] git-notes may be used to attach messages to commits. Nice.
[ ] Store also the size of the patch along history/commit info.
[ ] Check SELinux MLS
[ ] Deal with empty repositories (rg_git_ls_tree etc.).
[ ] Show age of an user/org/repo. Example: 1 year, 3 months, 4 days.
[ ] The rewrite engine should pass a single op for user and for org, but with
	para org=0 or 1.
	This is to have the same page for both types of users.
[ ] From: http://lwn.net/Articles/460376/
	I can confirm that shortcomings with Gitorious' ACL systems were
	definitely one of the reasons we ended up deciding against it --
	it's just not fine-grained enough and made it impossible to achieve
	the balance of project maintainer / repo manager autonomy and
	fool-proofness we wanted. gitolite makes us super-happy in that regard
	now, though.
	We use a Gitorious instance where I work. One thing that seems
	impossible to do is have custom hooks. Everything must go through
	Gitorious' global hooks. If there's a way around this (new version,
	black magic, whatever), I'd love to hear it.
[ ] Allow git over TLS on a specific port (gits://...).
[ ] KDE: http://news.ycombinator.com/item?id=2972107
[ ] To investigate how gitolite is dealing with pushes without custom daemon.
[ ] Record in notes who pushed a commit first, for trace reasons?
[ ] Add support for hooks/pre-receive-signature
[ ] Work flows: Allow user to edit work-flows. For example:
	- A merge request that is approved in a MR queue will make it
	automatically to the specified queues.
[ ] At push time we may generate some nice informative output (commits,
	last time when current user commited etc.)
[ ] Bulk add users/teams/repos/bugs/etc.

== Low priority ==
[ ] If a user has no push access and creates merge request, but the owner pushed
	nothing, ssh cloning gives errors about HEAD not found.
[ ] Add a "Report a bug on this page" - we already have the log_id!


== Graphics ==
[ ] http://static.phpcloud.com/images/banner/phpcloudcom-spaceship-banner-970x404px.jpg
[ ] 

== Versus ==
* http://www.wikivs.com/wiki/GitHub_vs_Gitorious
* http://unfuddle.com/about/tour/plans
* bitbucket.org
* 


== To recheck ==
* http://techbase.kde.org/Projects/MovetoGit#Post_Update_hooks
* 
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