Commit 0ef9788c authored by Ivanq's avatar Ivanq

Install repository before using

parent a750c4d0
<!DOCTYPE html>
<title>Install a repository - Git Center</title>
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<base href="" target="_top" id="base">
<script>base.href = document.location.href.replace("/media", "").replace("index.html", "").replace(/[&?]wrapper=False/, "").replace(/[&?]wrapper_nonce=[A-Za-z0-9]+/, "")</script>
<link rel="stylesheet" type="text/css" href="../css/main.css">
<link rel="stylesheet" type="text/css" href="../css/buttons.css">
<link rel="stylesheet" type="text/css" href="../css/header.css">
<link rel="stylesheet" type="text/css" href="../css/content.css">
<header class="header">
<a href="..">
<img src="../img/logo-white.svg" class="header-logo">
<div class="header-name">Git Center</div>
<a href="../index/">
<div class="header-item">Repository Index</div>
<a href="../myrepos/">
<div class="header-item">My Repos</div>
<main class="content">
<h1>Install a repository</h1>
Each repository has to be installed before usage. Setting up a new repo...
<script type="text/javascript" src="../js/ZeroFrame.js"></script>
<script type="text/javascript" src="../js/ZeroPage.js"></script>
<script type="text/javascript" src="../js/ZeroFS.js"></script>
<script type="text/javascript" src="../js/ZeroAuth.js"></script>
<script type="text/javascript" src="../js/ZeroDB.js"></script>
<script type="text/javascript" src="../js/git.js"></script>
<script type="text/javascript" src="../js/repo.js"></script>
<script type="text/javascript" src="../repo/js/user_common.js"></script>
<script type="text/javascript" src="../repo/js/common.js"></script>
<script type="text/javascript" src="js/main.js"></script>
\ No newline at end of file
.then(() => {
return repo.getContent();
.then(content => {
if(content.installed) {
location.href = "../repo/?" + address;
return repo.install();
.then(() => {
location.href = "../repo/?" + address;
\ No newline at end of file
......@@ -111,6 +111,23 @@ class Repository {
.then(() => this.sign());
install() {
let content;
return this.getContent()
.then(c => {
content = c;
return this.zeroAuth.requestAuth();
.then(auth => {
content.signers = [auth.address];
content.installed = true;
return this.setContent(content);
.then(() => {
return this.signContent("site");
// Git actions
getFiles(branch, dir) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment