From cbaa0ad0747253174b7d91982ba57cc5d395f4c1 Mon Sep 17 00:00:00 2001 From: b Date: Sun, 4 Dec 2022 22:35:07 +0000 Subject: [PATCH] reveal online --- enhance.1.conf | 1 + makefile | 13 +++-- makefile.1.mak | 13 +++-- nofading-cgi.c | 118 ------------------------------------------- online-core.1.h | 1 + reveal-cgi.c | 96 +++++++++++++++++++++++++++++++++++ reveal.1.htm | 14 +++++ rvl.png | Bin 0 -> 8612 bytes settings-release.txt | 3 +- settings.txt | 4 ++ 10 files changed, 134 insertions(+), 129 deletions(-) create mode 100644 reveal-cgi.c create mode 100644 reveal.1.htm create mode 100644 rvl.png diff --git a/enhance.1.conf b/enhance.1.conf index 47f21d2..8dbf99f 100644 --- a/enhance.1.conf +++ b/enhance.1.conf @@ -2,6 +2,7 @@ ScriptAlias /enhance/bluenh ###CONF_bluenh; ScriptAlias /enhance/nofading ###CONF_nofading; +ScriptAlias /enhance/reveal ###CONF_reveal; Require all granted diff --git a/makefile b/makefile index 9998d0d..1af611e 100644 --- a/makefile +++ b/makefile @@ -106,20 +106,23 @@ npb2.h\ npb_ong1.h\ npb_403.h\ nh.h\ -nf.h +nf.h\ +rvl.h CGI=\ bluenh-cgi\ -nofading-cgi +nofading-cgi\ +reveal-cgi HTM_CGI=\ bluenh.htm\ -nofading.htm +nofading.htm\ +reveal.htm HTM_CGI_1=\ bluenh.1.htm\ nofading.1.htm\ - +reveal.1.htm # keep these 2 lists in the same order!: GENERATE_FROM=\ @@ -149,7 +152,7 @@ $(HTM_CGI)\ param.png #all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd -all: $(BIN) $(WWW) +all: $(BIN) $(WWW) enhance.conf makefile: makefile.1.mak $(CONFIGFILE) diff --git a/makefile.1.mak b/makefile.1.mak index b54178c..58ce7ab 100644 --- a/makefile.1.mak +++ b/makefile.1.mak @@ -106,20 +106,23 @@ npb2.h\ npb_ong1.h\ npb_403.h\ nh.h\ -nf.h +nf.h\ +rvl.h CGI=\ bluenh-cgi\ -nofading-cgi +nofading-cgi\ +reveal-cgi HTM_CGI=\ bluenh.htm\ -nofading.htm +nofading.htm\ +reveal.htm HTM_CGI_1=\ bluenh.1.htm\ nofading.1.htm\ - +reveal.1.htm # keep these 2 lists in the same order!: GENERATE_FROM=\ @@ -149,7 +152,7 @@ $(HTM_CGI)\ param.png #all: 403 npb npbd npb-ong1 npbd-ong1 bluenh bluenhd insert extract seediff insertframe mremapt-1 compare nofading nofadingd -all: $(BIN) $(WWW) +all: $(BIN) $(WWW) enhance.conf makefile: makefile.1.mak $(CONFIGFILE) diff --git a/nofading-cgi.c b/nofading-cgi.c index 5b4f065..1c3c410 100644 --- a/nofading-cgi.c +++ b/nofading-cgi.c @@ -134,121 +134,3 @@ int nofading ( waitpid(sub, &r, 0); return r; } - -/* - - -#include -#include -#include -#include -#include -#include -#include - -#define WGET_PATH "/usr/bin/wget" -#define ENH_PATH "./nofading" -#define RM_PATH "/bin/rm" -#define LOG_PATH "/eizm/log/nofading/nofading.log" -#define USERAGENT "No fading (1190.bicyclesonthemoon.dnsd.info/nofading/nofading.htm)" -#define MSTD_PATH "/pro/nofading/nf.png" - -int main (int argc, char *argv[]); -void mustard(int mustard); - -FILE *pix; - -char url[1024]; -char path[256]; -s_cgi *cgi; -int t; -pid_t sub; - -int main (int argc, char *argv[]) -{ - unsigned char buf[1024]; - struct stat st; - unsigned long p; - unsigned short q; - char **up; - - cgi=cgiInit(); - - up=cgiGetFiles(cgi); - if (up) - { - sprintf(path,"%s",cgiGetFile(cgi,up[0])->tmpfile); - sprintf(url,"%s",cgiGetFile(cgi,up[0])->filename); - } - else - { - sprintf(url,"%s",(cgiGetValue(cgi,"inpix")!=NULL)?(cgiGetValue(cgi,"inpix")):""); - sprintf(path,"/var/tmp/%lu",(unsigned long)getpid()); - - //Why is there no spawnl() in linux? - sub=fork(); - if(sub==0) - { - t=execl(WGET_PATH,WGET_PATH,"-q","-t","2","-U",USERAGENT,"-O",path,url,(char *)0); - exit(t); - } - waitpid(sub,&t,0); - if(t)mustard(t); - } - - sub=fork(); - if(sub==0) - { - t=execl(ENH_PATH,ENH_PATH,path,path,(cgiGetValue(cgi,"f")!=NULL)?(cgiGetValue(cgi,"f")):"0","q",cgiGetValue(cgi,"a")!=NULL?"0":"a",(char *)0); - exit(t); - } - waitpid(sub,&t,0); - if(t)mustard(t); - - pix=fopen(path,"rb"); - if(pix==NULL) - mustard(123); - fstat(fileno(pix),&st); - p=st.st_size/1024; - q=st.st_size%1024; - - printf("Content-Length: %lu\n",(unsigned long)(st.st_size)); - printf("Content-type: image/png\n\n"); - for(unsigned long i=0;i