]> git.xolatile.top Git - gorillanest.git/commitdiff
Ratifying Pure Functionality Of Nothing New
authorEmil Williams <emilemilemil@cock.li>
Tue, 19 Aug 2025 11:10:10 +0000 (11:10 +0000)
committerEmil Williams <emilemilemil@cock.li>
Tue, 19 Aug 2025 11:10:10 +0000 (11:10 +0000)
.gitignore
README [new file with mode: 0644]
git-construct.pl [deleted file]
git/.gitkeep [deleted file]
gorillanest
gorillanest.nginx [new file with mode: 0644]
gorillanest.sqlite3 [deleted file]
perl/git-construct.pl [new file with mode: 0755]
static/style.css [new file with mode: 0644]

index f947323a97b4ae8109dab947dbb9f0f0ccfdd2d9..0c4032e603e57c3e8e4d6935840a2e637dedd6b7 100644 (file)
@@ -1,3 +1,4 @@
-*.sqlite
+*.sqlite3
 git/*
-!git/.gitkeep
+!git/public/.gitkeep
+!git/private/.gitkeep
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..2998855
--- /dev/null
+++ b/README
@@ -0,0 +1,60 @@
+                       .  *   % @ - .@-            @:  :    :      @.
+                  :     .     @. -.     -           ++       =     %@ @:
+              .   .       *. -+%-       -- @    ..   +=       =@-    =@-
+          ... :       .:. *                 ::    =   =-       .@+     @=.
+          ::     .-:-:.:=   -                 @*   @@  -=       @@+-   ==
+          **     :-. :--*+=              .     :+   +.           **=-   +::
+       :.==..=+=-:-:.::=+=+               ..     :   :  .   .    :+== = +-
+      .+@%+--:   ..    .:::.                           ..         .*=    =:
+     .=@+    .*==    :==-::.                      ..-::: ..:    .  ::    =
+  ..===-.:.+++-   -+*+==::.         .                  ::           -    =-
+    =. :+++==+@@%%@++-:-....                                        %=   @-
+    .:-+*@@*@@*=---=+-.... .                                        -+   =-
+  *+.   -  +:=  -@@**              =+=%%%@@@@@@+:                   -.   =-
+   ::..+@  :=.  :@%@@@@@@@@*=.  =++--=@@*+-:=**@@*@*=---:::.        @-    -
+  @=:-:=@: +@=+-  .--..-::-*@@@@@%*@@-.    .=-:=+++**+-.=**%@@@@@@  @:  @*:
+  *@*+==@+:*+-----@*-       .:---=@@ :+@@@@@*@**@*@:    :*%@@==-=%@@%:   .:
+  =   +=   +*@%%+.-@=              =        :+*+=  @@@@@@%  --.  +  :-  :--:-::.:...
+  .   *%  :@*@%= :@%%.  ..         @ :**+++++*-    @+  -@**@@@%@@=    @+ .-----.:.::      +-----------------------+
+  @%*-@@  -@@%+    :-.     ..       *  .:-:-..    =@    @+-.      :@@ %%%------=----      |                       |
+  =*=-+@.      %*               :.  *@       .   @@      :=++++: -*@. @:.::-:-:-::::      |                       |
+  :++:::@+             ..    ...:..   ***_      @        -  ..   @-  =-.---:::------______|   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.
diff --git a/git-construct.pl b/git-construct.pl
deleted file mode 100755 (executable)
index 4024ef1..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/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('./') );
diff --git a/git/.gitkeep b/git/.gitkeep
deleted file mode 100644 (file)
index e69de29..0000000
index 508f45f0c7982fa55823c4f87766247ba23181d5..9587ad8a5624e5344b202ca42a11fc76da76c5d0 100755 (executable)
@@ -10,7 +10,6 @@ use Syntax::Keyword::Try;
 use Sys::Syslog;
 use Template;
 use URI::Escape;
-use DBI;
 
 sub info {
     syslog("info", join(' ', @_));
@@ -60,28 +59,12 @@ sub GN::cache { # cache{'/some/path'}
 
 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) {
@@ -95,18 +78,19 @@ try {
         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";
             }
diff --git a/gorillanest.nginx b/gorillanest.nginx
new file mode 100644 (file)
index 0000000..67156c7
--- /dev/null
@@ -0,0 +1,22 @@
+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
diff --git a/gorillanest.sqlite3 b/gorillanest.sqlite3
deleted file mode 100644 (file)
index 2f8a9e4..0000000
Binary files a/gorillanest.sqlite3 and /dev/null differ
diff --git a/perl/git-construct.pl b/perl/git-construct.pl
new file mode 100755 (executable)
index 0000000..4024ef1
--- /dev/null
@@ -0,0 +1,58 @@
+#!/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('./') );
diff --git a/static/style.css b/static/style.css
new file mode 100644 (file)
index 0000000..830e43a
--- /dev/null
@@ -0,0 +1,100 @@
+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;
+}