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> / admin / sql.php (bcbc1b1a322c214ef19e6bf20bce26bd2909f33c) (1,254B) (mode 100644) [raw]
<?php
error_reporting(E_ALL);

require_once("/etc/gg/config.php");

$INC = dirname(__FILE__) . "/../inc";
require_once($INC . "/xlog.inc.php");
require_once($INC . "/db.inc.php");
require_once($INC . "/repo.inc.php");

$db = sql_open($gg_db);
if ($db === FALSE)
	fatal("Internal error (db)!");

// create repos table
$sql = "CREATE TABLE repos (repo_id INT PRIMARY KEY, uid INT, itime INT)";
$res = sql_query($db, $sql);
if ($res === FALSE)
	echo "WARN: Cannot create 'repo_access' table!\n";

// create repo_access table
$sql = "CREATE TABLE repo_access (repo_id INT, uid INT, perm CHAR(1), itime INT)";
$res = sql_query($db, $sql);
if ($res === FALSE)
	echo "WARN: Cannot create 'repo_access' table!\n";

$sql = "CREATE TABLE state (var TEXT PRIMARY KEY, value TEXT)";
$res = sql_query($db, $sql);
if ($res === FALSE)
	echo "WARN: Cannot create 'state' table!\n";

$sql = "CREATE TABLE keys (key_id INT PRIMARY KEY, itime INT, uid INT, key TEXT)";
$res = sql_query($db, $sql);
if ($res === FALSE)
	echo "WARN: Cannot create 'keys' table!\n";

$sql = "CREATE TABLE users (uid INT PRIMARY KEY, user TEXT, salt TEXT, pass TEXT, itime INT)";
$res = sql_query($db, $sql);
if ($res === FALSE)
	echo "WARN: Cannot create 'keys' table!\n";

echo "Done!\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