Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
95cbc571d7 | |||
d145d4f783 | |||
524e02a136 | |||
aedecbb306 |
@@ -10,6 +10,9 @@ APP_NAME = {{ gitea_app_name }}
|
||||
RUN_USER = git
|
||||
RUN_MODE = prod
|
||||
|
||||
[ui]
|
||||
DEFAULT_THEME = arc-green
|
||||
|
||||
[database]
|
||||
DB_TYPE = sqlite3
|
||||
HOST =
|
||||
|
@@ -1,97 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; My Amazing Gitea Config File
|
||||
;;
|
||||
;; charles reid
|
||||
;; march 2017
|
||||
;; https://github.com/go-gitea/gitea/blob/master/conf/app.ini
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
APP_NAME = charlesreid1.blue code hub
|
||||
RUN_USER = git
|
||||
RUN_MODE = prod
|
||||
|
||||
[database]
|
||||
DB_TYPE = sqlite3
|
||||
HOST =
|
||||
NAME =
|
||||
USER =
|
||||
PASSWD =
|
||||
SSL_MODE = disable
|
||||
PATH = /data/gitea/gitea.db
|
||||
|
||||
[repository]
|
||||
ROOT = /data/git/repositories
|
||||
PREFERRED_LICENSES = MIT License
|
||||
|
||||
; This gets rid of the HTTP option to check out repos...
|
||||
;DISABLE_HTTP_GIT = true
|
||||
[server]
|
||||
PROTOCOL = http
|
||||
DOMAIN = git.charlesreid1.blue
|
||||
#CERT_FILE = /www/gitea/certs/cert.pem
|
||||
#KEY_FILE = /www/gitea/certs/key.pem
|
||||
SSH_DOMAIN = git.charlesreid1.blue
|
||||
HTTP_PORT = 3000
|
||||
HTTP_ADDR = 0.0.0.0
|
||||
;ROOT_URL = http://git.charlesreid1.blue
|
||||
ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
|
||||
DISABLE_SSH = false
|
||||
SSH_PORT = 22
|
||||
OFFLINE_MODE = false
|
||||
|
||||
; Upper level of template and static file path
|
||||
; default is the path where Gitea is executed
|
||||
;;;;STATIC_ROOT_PATH = /www/gitea/static
|
||||
[mailer]
|
||||
ENABLED = false
|
||||
|
||||
[service]
|
||||
REGISTER_EMAIL_CONFIRM = false
|
||||
ENABLE_NOTIFY_MAIL = false
|
||||
DISABLE_REGISTRATION = true
|
||||
ENABLE_CAPTCHA = false
|
||||
REQUIRE_SIGNIN_VIEW = false
|
||||
|
||||
[picture]
|
||||
DISABLE_GRAVATAR = true
|
||||
ENABLE_FEDERATED_AVATAR = false
|
||||
AVATAR_UPLOAD_PATH = /data/gitea/avatars
|
||||
|
||||
[session]
|
||||
PROVIDER = file
|
||||
|
||||
[log]
|
||||
MODE = file
|
||||
; Either "Trace", "Debug", "Info", "Warn", "Error", "Critical", default is "Trace"
|
||||
LEVEL = Info
|
||||
ROOT_PATH = /data/gitea/log
|
||||
|
||||
; For "file" mode only
|
||||
[log.file]
|
||||
LEVEL =
|
||||
; This enables automated log rotate(switch of following options), default is true
|
||||
LOG_ROTATE = true
|
||||
; Max line number of single file, default is 1000000
|
||||
MAX_LINES = 1000000
|
||||
; Max size shift of single file, default is 28 means 1 << 28, 256MB
|
||||
MAX_SIZE_SHIFT = 28
|
||||
; Segment log daily, default is true
|
||||
DAILY_ROTATE = true
|
||||
; Expired days of log file(delete after max days), default is 7
|
||||
MAX_DAYS = 7
|
||||
|
||||
[cron.archive_cleanup]
|
||||
ENABLED = false
|
||||
|
||||
[security]
|
||||
INSTALL_LOCK = true
|
||||
SECRET_KEY = REPLACEME_SECRETKEY_SECRET
|
||||
MIN_PASSWORD_LENGTH = 6
|
||||
INTERNAL_TOKEN = REPLACEME_INTERNALTOKEN_SECRET
|
||||
|
||||
[other]
|
||||
SHOW_FOOTER_BRANDING = false
|
||||
; Show version information about Gitea and Go in the footer
|
||||
SHOW_FOOTER_VERSION = false
|
||||
; Show time of template execution in the footer
|
||||
SHOW_FOOTER_TEMPLATE_LOAD_TIME = false
|
||||
|
@@ -1,87 +0,0 @@
|
||||
import os, re, sys
|
||||
import glob
|
||||
import subprocess
|
||||
from jinja2 import Environment, FileSystemLoader, select_autoescape
|
||||
|
||||
"""
|
||||
Apply Default Values to Jinja Templates
|
||||
|
||||
|
||||
This script applies default values to
|
||||
templates in this folder.
|
||||
|
||||
The templates are used by Ansible,
|
||||
but this script uses the same template
|
||||
engine as Ansible to apply template
|
||||
variable values to the template files
|
||||
and make real files.
|
||||
|
||||
variables are:
|
||||
- `gitea_app_name` - name of gitea app (?)
|
||||
- `server_name_default` - name of server (e.g., charlesreid1.com)
|
||||
- `gitea_secret_key` - secret key for gitea
|
||||
- `gitea_internal_token` - internal token for gitea
|
||||
"""
|
||||
|
||||
|
||||
# Where templates live
|
||||
TEMPLATEDIR = '.'
|
||||
|
||||
# Where rendered templates will go
|
||||
OUTDIR = '.'
|
||||
|
||||
# Should existing (destination) files
|
||||
# be overwritten if they exist?
|
||||
OVERWRITE = True
|
||||
|
||||
# Template variables
|
||||
TV = {
|
||||
'gitea_app_name': 'charlesreid1.red',
|
||||
'server_name_default': 'charlesreid1.red',
|
||||
'gitea_secret_key': 'abc123',
|
||||
'gitea_internal_token': '123abc'
|
||||
}
|
||||
|
||||
|
||||
|
||||
def apply_templates(template_dir, output_dir, template_vars, overwrite=False):
|
||||
"""Apply the template variables
|
||||
to the template files.
|
||||
"""
|
||||
|
||||
if not os.path.exists(output_dir):
|
||||
msg = "Error: output dir %s does not exist!"%(output_dir)
|
||||
raise Exception(msg)
|
||||
|
||||
if not os.path.exists(template_dir):
|
||||
msg = "Error: template dir %s does not exist!"%(output_dir)
|
||||
raise Exception(msg)
|
||||
|
||||
# Jinja env
|
||||
env = Environment(loader=FileSystemLoader('.'))
|
||||
|
||||
# Render templates
|
||||
tfile = 'app.ini.j2'
|
||||
rfile = 'app.ini'
|
||||
|
||||
# Get rendered template content
|
||||
content = env.get_template(tfile).render(**template_vars)
|
||||
|
||||
# Write to file
|
||||
dest = os.path.join(output_dir,rfile)
|
||||
if os.path.exists(dest) and overwrite is False:
|
||||
msg = "Error: template rendering destination %s already exists!"%(dest)
|
||||
raise Exception(msg)
|
||||
|
||||
with open(dest,'w') as f:
|
||||
f.write(content)
|
||||
|
||||
print("Rendered the following templates:%s\nOutput files:%s\n"%(
|
||||
"\n- "+os.path.join(output_dir,tfile),
|
||||
"\n- "+os.path.join(output_dir,rfile)
|
||||
))
|
||||
|
||||
|
||||
if __name__=="__main__":
|
||||
apply_templates(TEMPLATEDIR,OUTDIR,TV,OVERWRITE)
|
||||
|
@@ -1,158 +1,3 @@
|
||||
{{template "base/head" .}}
|
||||
<div class="home">
|
||||
<div class="ui stackable middle very relaxed page grid">
|
||||
<div class="sixteen wide center aligned centered column">
|
||||
</div>
|
||||
<div class="hero">
|
||||
<h1 class="ui icon header title">
|
||||
git.charlesreid1.com
|
||||
</h1>
|
||||
<!--
|
||||
<h2>{{.i18n.Tr "app_desc"}}</h2>
|
||||
-->
|
||||
</div>
|
||||
<div>
|
||||
<!--
|
||||
<img class="logo" src="{{AppSubUrl}}/img/gitea-lg.png" />
|
||||
-->
|
||||
<h3 class="ui icon header title"><b>@charlesreid1 activity graph:</b></h3>
|
||||
<div id="calendar"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- gitea source: templates/base/head -->
|
||||
<script src="https://d3js.org/d3.v4.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
//<script type="text/javascript">
|
||||
|
||||
var width = 700,
|
||||
height = 90,
|
||||
cellSize = 12;
|
||||
|
||||
|
||||
// big integers
|
||||
var formatStuff = d3.format(",");
|
||||
|
||||
|
||||
/*
|
||||
TEH COLORRRZZZZ
|
||||
*/
|
||||
var realBackgroundColor = "#383c4a";//"#272b30";
|
||||
var tileBackgroundColor = realBackgroundColor;//"#3a3a3a";
|
||||
var tileStrokeColor = "#ccc";
|
||||
var monthStrokeColor = "#aaa";
|
||||
|
||||
var color = d3.scaleQuantize()
|
||||
.domain([0, 60])
|
||||
.range([ "#ffeda0", "#fed976", "#feb24c", "#fd8d3c", "#fc4e2a", "#e31a1c", "#bd0026", "#800026" ]);
|
||||
// red and yeller
|
||||
|
||||
|
||||
//.range(["#4d2b4b","#5a3961","#684777","#77558f","#8463a5","#cc9189","#fba25c","#f78e43","#f47b2b","#f16913"]);
|
||||
// purple and orange
|
||||
|
||||
//.range(["#004a4a","#0b6f6f","#169494","#29a8a8","#4c9090","#717777","#945f5f","#b84747","#db2f2f","#ff1717"]);
|
||||
// seafoam green blue to candy red
|
||||
|
||||
|
||||
/*
|
||||
Make the canvas
|
||||
*/
|
||||
var svg = d3.select("div#calendar")
|
||||
.selectAll("svg")
|
||||
.data(d3.range(2014, 2020).reverse())
|
||||
.enter().append("svg")
|
||||
.attr("width", width)
|
||||
.attr("height", height)
|
||||
.append("g")
|
||||
.attr("transform", "translate(" + ((width - cellSize * 53) / 2) + "," + (height - cellSize * 7 - 1) + ")");
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Write the years
|
||||
*/
|
||||
svg.append("text")
|
||||
.attr("transform", "translate(-6," + cellSize * 3.5 + ")rotate(-90)")
|
||||
.attr("font-family", "sans-serif")
|
||||
.attr("font-size", 10)
|
||||
.attr("fill", "#bbb")
|
||||
.attr("text-anchor", "middle")
|
||||
.text(function(d) { return d; });
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Draw the tiles representing days of the year
|
||||
(also draw tile outlines)
|
||||
*/
|
||||
var rect = svg.append("g")
|
||||
.attr("fill", tileBackgroundColor)
|
||||
.attr("stroke", tileStrokeColor)
|
||||
.selectAll("rect")
|
||||
.data(function(d) { return d3.timeDays(new Date(d, 0, 1), new Date(d + 1, 0, 1)); })
|
||||
.enter().append("rect")
|
||||
.attr("width", cellSize)
|
||||
.attr("height", cellSize)
|
||||
.attr("x", function(d) { return d3.timeWeek.count(d3.timeYear(d), d) * cellSize; })
|
||||
.attr("y", function(d) { return d.getDay() * cellSize; })
|
||||
.datum(d3.timeFormat("%Y-%m-%d"));
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Draw outlines of groups representing months
|
||||
*/
|
||||
svg.append("g")
|
||||
.attr("fill", "none")
|
||||
.attr("stroke", monthStrokeColor)
|
||||
.selectAll("path")
|
||||
.data(function(d) { return d3.timeMonths(new Date(d, 0, 1), new Date(d + 1, 0, 1)); })
|
||||
.enter().append("path")
|
||||
.attr("d", pathMonth);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Load up the csv file
|
||||
*/
|
||||
|
||||
d3.csv("/data/charlesreid1-data/raw/branch/master/commit_counts.csv", function(error, csv) {
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
/*
|
||||
This is where you decide what values to plot
|
||||
*/
|
||||
var data = d3.nest()
|
||||
.key(function(d) { return d.date; })
|
||||
.rollup(function(d) {
|
||||
return d[0].commits;
|
||||
})
|
||||
.object(csv);
|
||||
|
||||
rect.filter(function(d) { return d in data; })
|
||||
.attr("fill", function(d) { return color(data[d]); })
|
||||
.append("title")
|
||||
.text(function(d) { return d + ": " + formatStuff(data[d]); });
|
||||
});
|
||||
|
||||
function pathMonth(t0) {
|
||||
var t1 = new Date(t0.getFullYear(), t0.getMonth() + 1, 0),
|
||||
d0 = t0.getDay(), w0 = d3.timeWeek.count(d3.timeYear(t0), t0),
|
||||
d1 = t1.getDay(), w1 = d3.timeWeek.count(d3.timeYear(t1), t1);
|
||||
return "M" + (w0 + 1) * cellSize + "," + d0 * cellSize
|
||||
+ "H" + w0 * cellSize + "V" + 7 * cellSize
|
||||
+ "H" + w1 * cellSize + "V" + (d1 + 1) * cellSize
|
||||
+ "H" + (w1 + 1) * cellSize + "V" + 0
|
||||
+ "H" + (w0 + 1) * cellSize + "Z";
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<meta http-equiv="Refresh" content="0; url=/explore/repos" />
|
||||
{{template "base/footer" .}}
|
||||
|
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
# secret_key and internal_token should be SIMPLE or this
|
||||
# gets screwy, and I don't want to do any more debugging.
|
||||
#
|
||||
cat custom/conf/app.ini.sample \
|
||||
| sed 's/REPLACEME_INTERNALTOKEN_SECRET/'$(cat internal_token.secret)'/g' \
|
||||
| sed 's/REPLACEME_SECRETKEY_SECRET/'$(cat secret_key.secret)'/g' > custom/conf/app.ini
|
Reference in New Issue
Block a user