-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: misc
action: commit
revision:
path_from:
revision_from: 42d9771ba0c2e3491025e24956c995a7db56372c:
path_to:
revision_to:

git.thebackupbox.net

misc

git://git.thebackupbox.net/misc

commit 42d9771ba0c2e3491025e24956c995a7db56372c
Author: Epoch Qwert <epoch@53flpnlls43fcguy.onion>
Date:   Sun Jan 11 03:01:37 2015 -0600

    fuck if I know. I was just going to add the gateway. >_>

diff --git a/nocompile/libexec/gopherd.sh b/nocompile/libexec/gopherd.sh

index d710f80d90062f4823e76ee6cdde5c24a0cb097e..

index ..78509dc4b7d2b9c236fb8cf0697e42ec3143630f 100755

--- a/nocompile/libexec/gopherd.sh
+++ b/nocompile/libexec/gopherd.sh
@@ -10,6 +10,7 @@
 # "export hostname" down there.
 export PATH=$PATH:/usr/local/bin
 read -t 10 req
+logger -t gopher "$(/usr/local/libexec/peerip|head -n1): ${req}"
 base="$1"
 arg=$(echo "$req" | tr -d '\r' | cut -f2)
 #req=$(echo "$req" | unescape | tr -d '\r' | cut -f1)
@@ -33,14 +34,14 @@ else
    printf ""
 #   echo "fucked off #1"
 #   echo "$myIP != $(gethostbyname $hostname 6)"
-#   logger "hostname (${hostname}) and IP (${myIP}) aren't matching up.";
+#   logger -t gopher "hostname (${hostname}) and IP (${myIP}) aren't matching up.";
 #   exit 2
 #jimmy cracked corn but nobody gives a shit.
   fi
  else
   if [ $(gethostbyname $hostname) != ${myIP} ];then
    echo "fucked off #2"
-   logger "hostname (${hostname}) and IP (${myIP}) aren't matching up.";
+   logger -t gopher "hostname (${hostname}) and IP (${myIP}) aren't matching up.";
    exit 2
   fi
  fi
diff --git a/nocompile/libexec/telnet-gateway.sh b/nocompile/libexec/telnet-gateway.sh
new file mode 100755
index 0000000000000000000000000000000000000000..ca2b90d9b863f967371c15312f4a136c9ab5f8cf
--- /dev/null
+++ b/nocompile/libexec/telnet-gateway.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+grep "^telnet:" /var/www/sites/hacking/links.txt \
+ | cat -n
+printf "Which do you want to connect to?\nnumber: "
+read N
+export N=$(printf "%s" "$N" | sed "s/[^0-9]//g")
+serverURL=$(grep "^telnet:" /var/www/sites/hacking/links.txt \
+ | cut '-d ' -f1 \
+ | head -n${N} \
+ | tail -n1)
+echo "You've selected: $serverURL (#$N)"
+printf "connecting in...\n"
+for i in `seq 5 1`;do
+ printf "\r%d..." $i
+ sleep 1
+done
+nc $(printf "%s" "$serverURL" | cuturl | grep ^domain | cut '-d ' -f2) 23
diff --git a/src/libexec/httpd.c b/src/libexec/httpd.c

index 812e051cffdff284bc3d973b53e28d5631383b16..

index ..41339aed0c22833282da2d0de3b296224c504fca 100644

--- a/src/libexec/httpd.c
+++ b/src/libexec/httpd.c
@@ -5,6 +5,9 @@
 #include <unistd.h>
 #include <syslog.h>
 #include <sys/wait.h>
+#include <sys/socket.h>
+#include <netdb.h>
+#include <netinet/in.h>

 #define VHOST_ROOT "/var/www/vhosts"
 #define SITES_ROOT "/var/www/sites"
@@ -26,8 +29,12 @@ int main(int argc,char *argv[]) {
  char *get_param;
  char line[getpagesize()];
  fgets(line,sizeof(line)-1,stdin);
-// syslog(LOG_INFO,"ADDRESS did a LINE");
-// syslog(LOG_WARNING,"httpd syslog test\n");
+ struct sockaddr_in6 sa6;
+ unsigned int sl=sizeof(sa6);
+ char h[NI_MAXHOST];
+ if(getpeername(0,(struct sockaddr *)&sa6,&sl) == -1) syslog(LOG_WARNING,"getpeername: %m");
+ getnameinfo((struct sockaddr *)&sa6,sl,h,sizeof(h),0,0,NI_NUMERICHOST);
+ setenv("REMOTE_ADDR",h,1);
  if(!strchr(line,'\n')) {
   printf("HTTP/1.1 413 Entity Too Large\r\n");
   standard_headers();
@@ -36,6 +43,7 @@ int main(int argc,char *argv[]) {
   return 0;
  }
  if(strchr(line,'\r')) *strchr(line,'\r')=0;
+ syslog(LOG_WARNING,"%s %s\n",h,line);
  method=strdup(line);
  if((page=strchr(method,' '))) {
   *page=0;

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 14:35:01 2024