-*.sqlite
+*.sqlite3
git/*
-!git/.gitkeep
+!git/public/.gitkeep
+!git/private/.gitkeep
--- /dev/null
+ . * % @ - .@- @: : : @.
+ : . @. -. - ++ = %@ @:
+ . . *. -+%- -- @ .. += =@- =@-
+ ... : .:. * :: = =- .@+ @=.
+ :: .-:-:.:= - @* @@ -= @@+- ==
+ ** :-. :--*+= . :+ +. **=- +::
+ :.==..=+=-:-:.::=+=+ .. : : . . :+== = +-
+ .+@%+--: .. .:::. .. .*= =:
+ .=@+ .*== :==-::. ..-::: ..: . :: =
+ ..===-.:.+++- -+*+==::. . :: - =-
+ =. :+++==+@@%%@++-:-.... %= @-
+ .:-+*@@*@@*=---=+-.... . -+ =-
+ *+. - +:= -@@** =+=%%%@@@@@@+: -. =-
+ ::..+@ :=. :@%@@@@@@@@*=. =++--=@@*+-:=**@@*@*=---:::. @- -
+ @=:-:=@: +@=+- .--..-::-*@@@@@%*@@-. .=-:=+++**+-.=**%@@@@@@ @: @*:
+ *@*+==@+:*+-----@*- .:---=@@ :+@@@@@*@**@*@: :*%@@==-=%@@%: .:
+ = += +*@%%+.-@= = :+*+= @@@@@@% --. + :- :--:-::.:...
+ . *% :@*@%= :@%%. .. @ :**+++++*- @+ -@**@@@%@@= @+ .-----.:.:: +-----------------------+
+ @%*-@@ -@@%+ :-. .. * .:-:-.. =@ @+-. :@@ %%%------=---- | |
+ =*=-+@. %* :. *@ . @@ :=++++: -*@. @:.::-:-:-:::: | |
+ :++:::@+ .. ...:.. ***_ @ - .. @- =-.---:::------______| WELCOME TO GORILLA |
+ *@@ .. .. .... -*@@@@- +@^^* @* NEST , |
+ *%@@+@@@.... ::...:... ..-:-+++ = :==**@@@+= ______, |
+ :-=@ =@ ..:........ ..:-=++**+-+@**++-. .=. *----:----====++== | |
+ --== : .. ....:::::::.:::-=+-:..-@@@@%%%%@@@+=:. +--===-------=++== +-----NIGGER------------+
+ *@%. ...... . ..:::..:..:.. ...----==+*+ :-. @+--========-:-++=-
+ @ ...... .....:: . ::--=:--=+@@%@@+=- :-: ++=
+ +* . ....:--::. :++**=. . : :+*= -+-
+ @= .....:..:....:-. *%@%@@@@@@%@@++++*+++== .==
+ %@+ .-::::.. ....:::.=%%*+- -@@@@%@%@@@@%@%@+ :-==
+ @@@@ .-=-----. . ::--+**-.::. =@@@@@@@=+*%= :%@+
+-*%@@@* .:-:::::-:::.:-==**+=-..++- ==. :== I CAN BELIEVE
+:. . ::...:::..::..:-=--:-:-*%@@%=---====+-:-- TOO YOU
++@@- -.:==::::::--... :. . .:=%%@@@@@@=-=--=+ SOFTWARE WORKS
+--+@@@* . .=-++=------::: .: --=: -==-++
+=+++*%@@@= : *-++=====++++++@+==++-. .. . -=-: !T JUST WORKS ¡
+***+*+=+%@@@= :: @@@*+++++*@@*@%@@@@@**++++++--=-=-
+++++**+++++@@@@% @@@*@@*+@****@@@@%%%%@%%@@@*%*
+===+++********@@@@. . :+**@@@@@@@@@@@@@@@@@@@%@@@%
+++++*+********++*%@@@ ..::=*+****@*%%%%%%%@@@@@= =@
+======++*@++**+****@@@@@ .:-==++====-++*+@%+- :=+ :++
+===+==+++*************@@@@@:.-===++++*****++:.: :@.+@** :++
++++++=++=+=****+*+*****+@@@@@=::--====-----:.:: @:::**@* :++
+*****+++++=++++***@**@*****@@@@@%=-:::.:.. .:. @=-..*@***=:-%
+**+****+++++*****+***********@*@@%@%@+ @+*=- -%++++--*@
++++******++++++*+*+********@******@@%@@@@@- -@@+*+*+ -@*=++=-=%
+*********+*****+*+**+**************++***%@@@@@@@@@+++++*:.*****+=*@ ((( HE COULDN'T GIT CLONE ALWAYS )))
+++admin@chud.cyou***+*********@*****@***+++**+*+**+++==**=:=+++*+=*%@ ((( NO HIM STOPPING NOW )))
+*****+*+*@@*+*******+@@*+********@****@++*++++++++*+**==*++-*+=+++=*%*
+*+++****+@***++***+***+++********+++*+****++*+*+*+++++==+++++*@+++==@%
+
+* WKꓵΓꓕᖉⱯ ACTIVATION TRANMISSION RECIEVED: GO RI LL A_ NE ST *
+* Copyright 2025-∞ People's Republic of Magyarország & Emil's Email Services *
+
+
+Gitea broke so I had a low wage hungarian programmer write this.
+
+Everything runs from this directory via './gorillanest'.
+
+gorillanest will provide GIT & HTTP access for all repos in /public/ unconditionally, and /private/ for authorized connections.
+++ /dev/null
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use Git::Repository;
-use Cwd 'realpath';
-use File::Basename;
-
-use Data::Dumper;
-
-sub new_repository {
- my ($path) = @_;
- $path = realpath($path);
-
- my $name = basename($path);
- my $repo = Git::Repository->new(work_tree => $path);
-
- my @raw_branches = $repo->run('branch');
- my @branches;
-
- for my $b (@raw_branches) {
- chomp $b;
- my $is_active = 0;
-
- if ($b =~ /^\* /) {
- $b =~ s/^\* //;
- $is_active = 1;
- }
-
- my @commits;
- my @logs = $repo->run(log => $b, '--pretty=format:%H;%an;%s');
- for my $line (@logs) {
- my ($hash, $author, $message) = split /;/, $line, 3;
- push @commits, {
- hash => $hash,
- author => $author,
- message => $message,
- };
- }
-
- push @branches, {
- name => $b,
- is_active => $is_active,
- commits => \@commits,
- };
- }
-
- # first commiter as a fallback
- my $owner = ($repo->run('log', '--reverse', '--pretty=format:%an'))[0];
-
- return {
- name => $name,
- owner => $owner,
- branches => \@branches,
- };
-}
-
-print Dumper( new_repository('./') );
use Sys::Syslog;
use Template;
use URI::Escape;
-use DBI;
sub info {
syslog("info", join(' ', @_));
openlog("gorillanest", "ndelay,pid", Sys::Syslog::LOG_DAEMON);
try {
- my $gitroot = 'git';
+ my $public = 'git/public';
my $dbfile = 'gorillanest.sqlite3';
my %data; # useful for minimizing passing and for templating, put default configuration details meant to go on the page in this thing note that it's rw
#
my $request = FCGI::Request();
my $template = Template->new({INCLUDE_PATH => 'template'});
- my $db = DBI->connect("dbi:SQLite:dbname=$dbfile","","", {
- RaiseError => 1,
- AutoCommit => 1,
- sqlite_see_if_its_a_number => 1,
- }) or die $DBI::errstr;
- # $db->do(
- # "CREATE TABLE IF NOT EXISTS users (
- # id INTEGER PRIMARY KEY AUTOINCREMENT,
- # name TEXT NOT NULL CHECK(length(name) <= 32),
- # pass TEXT NOT NULL CHECK(length(pass) <= 128
- # AND length(pass) >= 32),
- # UNIQUE(name))");
- # my $sth = $db->prepare("INSERT INTO users (name, pass) VALUES (?, ?)");
- # $sth->execute("test", "PUM6w22pxoGVB03qlgEUVBumYgPL2RTGqegoz8vZf7jpsqRQahC3d2OXOH3qFnvo");
- # $db->disconnect;
- #
my $head = 0;
my $a_template;
while($request->Accept() >= 0) {
if ($method eq 'HEAD') {
$head = 1;
} elsif ($method eq 'GET') {
- ($data{name}, $data{repository}) = $uri =~ m{/(.*?)/(?:(.*))?};
+ ($data{name}, $data{repository}) = $uri =~ m{/([a-z]*)/(?:([a-z]*(?:.git)?))?};
# info("name:", $data{name} || '', "repo:", $data{repository} || '');
if ($uri eq '/') {
- $data{directories} = GN::index($gitroot, \%data);
+ $data{directories} = GN::index($public, \%data);
$a_template = "index.tt";
} elsif ($data{repository}) {
- $data{directories} = GN::repositories($gitroot, \%data);
+ $data{directories} = GN::repositories($public, \%data);
$a_template = "repository.tt";
} elsif ($data{name}) {
- $data{directories} = GN::user($gitroot, \%data);
+ $data{directories} = GN::user($public, \%data);
$a_template = "index_user.tt";
- } else {
+ }
+ if (!$data{directories}) {
$header{-status} = '404 Not Found';
$a_template = "404.tt";
}
--- /dev/null
+server {
+ server_name gorillanest.example.com;
+ add_header Content-Security-Policy "default-src 'self';" always;
+ root /var/www/gorillanest;
+
+ location = /gorillanest {
+ add_header Cache-Control "max-age=0; must-revalidate; no-cache";
+ include fastcgi_params;
+ fastcgi_pass unix:/run/fcgiwrap.socket;
+ }
+
+ location ~ \.(jpg|png|avif|css)$ {
+ root /var/www/gorillanest/static;
+ }
+
+ rewrite ^/ /gorillanest;
+}
+
+# Notice: AIDS
+# I changed the deployment copy in some critical areas
+# will update this file when things are more ratified server-side, and remove this notice
+# P.S. You VILL constantly backport gorillians of minor improvement tweaks
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Git::Repository;
+use Cwd 'realpath';
+use File::Basename;
+
+use Data::Dumper;
+
+sub new_repository {
+ my ($path) = @_;
+ $path = realpath($path);
+
+ my $name = basename($path);
+ my $repo = Git::Repository->new(work_tree => $path);
+
+ my @raw_branches = $repo->run('branch');
+ my @branches;
+
+ for my $b (@raw_branches) {
+ chomp $b;
+ my $is_active = 0;
+
+ if ($b =~ /^\* /) {
+ $b =~ s/^\* //;
+ $is_active = 1;
+ }
+
+ my @commits;
+ my @logs = $repo->run(log => $b, '--pretty=format:%H;%an;%s');
+ for my $line (@logs) {
+ my ($hash, $author, $message) = split /;/, $line, 3;
+ push @commits, {
+ hash => $hash,
+ author => $author,
+ message => $message,
+ };
+ }
+
+ push @branches, {
+ name => $b,
+ is_active => $is_active,
+ commits => \@commits,
+ };
+ }
+
+ # first commiter as a fallback
+ my $owner = ($repo->run('log', '--reverse', '--pretty=format:%an'))[0];
+
+ return {
+ name => $name,
+ owner => $owner,
+ branches => \@branches,
+ };
+}
+
+print Dumper( new_repository('./') );
--- /dev/null
+body {
+margin: auto;
+width: 50%;
+}
+h1, h2, h3 {
+padding-left: 3em;
+}
+h4 {
+padding-left: 1em;
+}
+p {
+padding-left: 1em;
+}
+pre {
+font-weight: bold;
+}
+a {
+text-decoration: none;
+}
+a:active {
+color: green;
+}
+code {
+white-space: pre-wrap;
+font-size: 0.7em;
+padding: 1em;
+}
+#title {
+padding: 0.5em;
+font-size: 3em;
+}
+
+/* stolen from darkreader static */
+html,
+body,
+:not([style*="background-color:"]):not(iframe) {
+ background-color: black !important;
+}
+html,
+body,
+:not([style*="color:"]),
+.sr-reader *:not([class*='sr-pivot']) {
+ color: rgb(225, 253, 203) !important;
+}
+h1:not([style*="color:"]),
+h2:not([style*="color:"]),
+h3:not([style*="color:"]),
+h4:not([style*="color:"]),
+h5:not([style*="color:"]),
+h6:not([style*="color:"]) {
+ color: rgb(247, 2, 56) !important;
+}
+cite:not([style*="color:"]) {
+ color: rgb(30, 214, 88) !important;
+}
+input:not([style*="background-color:"]),
+textarea:not([style*="background-color:"]),
+button:not([style*="background-color:"]),
+[role="button"] {
+ background-color: rgb(32, 48, 64) !important;
+}
+input:not([style*="background-color:"]):hover,
+textarea:not([style*="background-color:"]):hover,
+button:not([style*="background-color:"]):hover,
+[role="button"]:hover {
+ background-color: rgb(30, 54, 78) !important;
+}
+input:not([style*="background-color:"]):active, input:not([style*="background-color:"]):focus,
+textarea:not([style*="background-color:"]):active, textarea:not([style*="background-color:"]):focus,
+button:not([style*="background-color:"]):active, button:not([style*="background-color:"]):focus,
+[role="button"]:active, [role="button"]:focus {
+ background-color: rgb(29, 56, 83) !important;
+}
+a:not([style*="color:"]) {
+ color: rgb(128, 182, 204) !important;
+}
+a:not([style*="color:"]):hover {
+ color: rgb(142, 193, 217) !important;
+}
+a:not([style*="color:"]):active, a:not([style*="color:"]):focus {
+ color: rgb(155, 203, 230) !important;
+}
+:not([style*="border-color:"]),
+::before,
+::after {
+ border-color: rgb(80, 115, 134) !important;
+}
+div:empty,
+.sr-reader *,
+.sr-backdrop {
+ background-color: rgba(16, 20, 23, 0.5) !important;
+}
+input::placeholder,
+textarea::placeholder {
+ color: rgba(167, 158, 139, 0.5) !important;
+}
+input:not([style*="background-image:"]),
+textarea:not([style*="background-image:"]) {
+ background-image: none !important;
+}