]> bicyclesonthemoon.info Git - ott/enhance/commitdiff
Fully working online interface; for now bluenh only.
authorb <rowerynaksiezycu@gmail.com>
Sun, 4 Dec 2022 18:40:01 +0000 (18:40 +0000)
committerb <rowerynaksiezycu@gmail.com>
Sun, 4 Dec 2022 18:40:01 +0000 (18:40 +0000)
bluenh.1.htm [new file with mode: 0644]
bluenh.htm [deleted file]
enhance-bottom.htm [new file with mode: 0644]
enhance-top.htm [new file with mode: 0644]
enhance.1.conf [new file with mode: 0644]
makefile
makefile.1.mak
npb-ong1.htm [moved from www/npb-ong1.htm with 100% similarity]
online-core.c
settings-release.txt
settings.txt

diff --git a/bluenh.1.htm b/bluenh.1.htm
new file mode 100644 (file)
index 0000000..1c87660
--- /dev/null
@@ -0,0 +1,19 @@
+               <h1>ENHANCE!</h1>
+               <form method="post" action="/enhance/bluenh" enctype='multipart/form-data'>
+                       <img src="param.png" alt="parameter explanation picture"><br>
+                       <br>
+                       a=<input type="text" name="a" value=  "0">, b=<input type="text" name="b" value= "34">, c=<input type="text" name="c" value= "41">,<br>
+                       d=<input type="text" name="d" value=  "0">, e=<input type="text" name="e" value= "40">, f=<input type="text" name="f" value="255">.<br>
+                       a &lt; b &lt; c<br>
+                       <br>
+                       Enhance by URL<br>
+                       URL of image:
+                       <input type="text" name="inpix">
+                       <input type="submit" value="ENHANCE!"><br>
+                       <br>
+                       Enhance by file upload<br>
+                       Upload the image:
+                       <input type="file" name="inpix2">
+                       <input type="submit" value="ENHANCE!">
+               </form>
+
diff --git a/bluenh.htm b/bluenh.htm
deleted file mode 100644 (file)
index ef514af..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
-<html lang="pl">
-       <head>
-               <title>ENHANCE! &bull; Bicycles on the Moon</title>
-               <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
-               <link rel="icon" type="image/png" href="/img/favicon.png">
-       </head>
-       <body>
-               <a href="/"><img src="/img/botmlogo2.png" alt="1190.bicyclesonthemoon.dnsd.info" border="0"></a>
-               <h1>ENHANCE!</h1>
-               <form method="post" action="/cgi/bluenh/bluenhd" enctype='multipart/form-data'>
-                       <img src="param.png" alt="parameter explanation picture"><br>
-                       <br>
-                       a=<input type="text" name="a" value=  "0">, b=<input type="text" name="b" value= "34">, c=<input type="text" name="c" value= "41">,<br>
-                       d=<input type="text" name="d" value=  "0">, e=<input type="text" name="e" value= "40">, f=<input type="text" name="f" value="255">.<br>
-                       a &lt; b &lt; c<br>
-                       <br>
-                       Enhance by URL<br>
-                       URL of image:
-                       <input type="text" name="inpix">
-                       <input type="submit" value="ENHANCE!"><br>
-                       <br>
-                       Enhance by file upload<br>
-                       Upload the image:
-                       <input type="file" name="inpix2">
-                       <input type="submit" value="ENHANCE!">
-               </form>
-               <br>
-               <br>
-               Source code available at <a href="svn://bicyclesonthemoon.dnsd.info/bluenh">svn://bicyclesonthemoon.dnsd.info/bluenh</a> (use "e" to login) or <a href="http://1190.bicyclesonthemoon.dnsd.info/pro/bluenh">http://1190.bicyclesonthemoon.dnsd.info/pro/bluenh</a>.
-               
-       </body>
-</html>
diff --git a/enhance-bottom.htm b/enhance-bottom.htm
new file mode 100644 (file)
index 0000000..2b9e22c
--- /dev/null
@@ -0,0 +1,5 @@
+               <br>
+               <br>
+               Source code available at <a href="http://bicyclesonthemoon.info/git-projects/?p=ott/enhance">http://bicyclesonthemoon.info/git-projects/?p=ott/enhance</a>.
+       </body>
+</html>
diff --git a/enhance-top.htm b/enhance-top.htm
new file mode 100644 (file)
index 0000000..df6f770
--- /dev/null
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
+<html lang="pl">
+       <head>
+               <title>###HTML_TITLE; &bull; Bicycles on the Moon</title>
+               <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
+               <link rel="icon" type="image/png" href="/img/favicon.png">
+       </head>
+       <body>
+               <a href="/"><img src="/img/botmlogo2.png" alt="1190.bicyclesonthemoon.dnsd.info" border="0"></a>
diff --git a/enhance.1.conf b/enhance.1.conf
new file mode 100644 (file)
index 0000000..dc7b2cf
--- /dev/null
@@ -0,0 +1,7 @@
+# Enhance tools
+
+ScriptAlias /enhance/bluenh ###CONF_bluenh;
+
+<Directory ###CONF_bin;>
+       Require all granted
+</Directory>
index 4c96e89b4c3d0eff1c83f0cea869a343a00b8c84..5d6ad886afacf4d7f0a264379b7d21a1eb346566 100644 (file)
--- a/makefile
+++ b/makefile
@@ -29,6 +29,7 @@ CF   =-g -Wall
 L_IL =-lIL
 L_CGI=-lcgi
 
+CAT  =/usr/bin/cat
 CHMOD=/usr/bin/chmod
 CP   =/usr/bin/cp
 MKDIR=/usr/bin/mkdir
@@ -37,6 +38,9 @@ RM   =/usr/bin/rm
 
 BIN_PATH = /botm/bin/enhance
 TMP_PATH = /botm/tmp/enhance
+WWW_PATH = /botm/www/1190/enhance
+
+CONF = /botm/etc/www/conf/1190/enhance.conf
 
 
 CONFIGFILE = settings-$(TARGET).txt settings.txt
@@ -106,20 +110,26 @@ nh.h
 CGI=\
 bluenh-cgi
 
-#C_CGI=\
-#bluenh-cgi.c
+HTM_CGI=\
+bluenh.htm
+
+HTM_CGI_1=\
+bluenh.1.htm
 
 
 # keep these 2 lists in the same order!:
 GENERATE_FROM=\
-online-core.1.h
+online-core.1.h\
+enhance.1.conf
 
 TO_GENERATE=\
-online-core.h
+online-core.h\
+enhance.conf
 
 DIR=\
 $(BIN_PATH)\
-$(TMP_PATH)
+$(TMP_PATH)\
+$(WWW_PATH)
 
 SETUID=\
 $(CGI)
@@ -129,9 +139,13 @@ enhance\
 $(STANDALONE)\
 $(CGI)
 
+WWW=\
+index.htm\
+$(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)
+all: $(BIN) $(WWW)
        
 
 makefile: makefile.1.mak $(CONFIGFILE)
@@ -162,6 +176,12 @@ $(H_PNG): %.h: %.png f2h
 f2h: f2h.c
        $(CC) $(CF) -o f2h f2h.c
 
+$(HTM_CGI): %.htm: enhance-top.htm enhance-bottom.htm %.1.htm $(CONFIGFILE)
+       $(CAT) enhance-top.htm $*.1.htm enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_$* $(CONFIGFILE) > bluenh.htm
+
+index.htm: enhance-top.htm enhance-bottom.htm $(HTM_CGI_1) $(CONFIGFILE)
+       $(CAT) enhance-top.htm $(HTM_CGI_1) enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_enhance $(CONFIGFILE) > index.htm
+
 
 setuid: $(SETUID)
        $(CHMOD) u+s,g+s $(SETUID)
@@ -176,12 +196,18 @@ cp_bin: $(BIN) setuid | mktree
        $(CP) -p $(BIN) $(BIN_PATH)
 endif
 
-install: cp_bin
+cp_conf: enhance.conf
+       $(CP) enhance.conf $(CONF)
+
+cp_www: $(WWW) | mktree
+       $(CP) -r $(WWW) $(WWW_PATH)
+
+install: cp_bin cp_www cp_conf
 
 clean:
-       $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) $(H_SUBTOOL) $(CGI)
+       $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) $(H_SUBTOOL) $(CGI) index.htm $(HTM_CGI)
 
-PHONY: all clean install setuid mktree cp_bin 
+PHONY: all clean install setuid mktree cp_bin cp_www
 
 #npbd-ong1: npb npbd-ong1.cpp makefile
 #      $(CC) $(CF) -o npbd-ong1 npbd-ong1.cpp $(LF2)
index 3f5dce3bc75306e55f60d128021cc8b760a73fe8..3ea26f608238dcdaa02e85a175fe2c740b12560e 100644 (file)
@@ -29,14 +29,18 @@ endif
 ###MAKE_L_IL:  L_IL=-lIL
 ###MAKE_L_CGI: L_CGI=-lcgi
 
+###MAKE_CAT:   CAT   = cat
 ###MAKE_CHMOD: CHMOD = chmod
 ###MAKE_CP:    CP    = cp
 ###MAKE_MKDIR: MKDIR = mkdir
 ###MAKE_PERL:  PERL  = perl
 ###MAKE_RM:    RM    = rm
 
-###MAKE_BIN_PATH: BIN_PATH = /botm/bin/ottmirror
-###MAKE_TMP_PATH: TMP_PATH = /botm/tmp/ottmirror
+###MAKE_BIN_PATH: BIN_PATH = /botm/bin/enhance
+###MAKE_TMP_PATH: TMP_PATH = /botm/tmp/enhance
+###MAKE_WWW_PATH: WWW_PATH = /botm/www/1190/enhance
+
+###MAKE_CONF: CONF = /botm/etc/www/conf/1190/enhance.conf
 
 
 CONFIGFILE = settings-$(TARGET).txt settings.txt
@@ -106,20 +110,26 @@ nh.h
 CGI=\
 bluenh-cgi
 
-#C_CGI=\
-#bluenh-cgi.c
+HTM_CGI=\
+bluenh.htm
+
+HTM_CGI_1=\
+bluenh.1.htm
 
 
 # keep these 2 lists in the same order!:
 GENERATE_FROM=\
-online-core.1.h
+online-core.1.h\
+enhance.1.conf
 
 TO_GENERATE=\
-online-core.h
+online-core.h\
+enhance.conf
 
 DIR=\
 $(BIN_PATH)\
-$(TMP_PATH)
+$(TMP_PATH)\
+$(WWW_PATH)
 
 SETUID=\
 $(CGI)
@@ -129,9 +139,13 @@ enhance\
 $(STANDALONE)\
 $(CGI)
 
+WWW=\
+index.htm\
+$(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)
+all: $(BIN) $(WWW)
        
 
 makefile: makefile.1.mak $(CONFIGFILE)
@@ -162,6 +176,12 @@ $(H_PNG): %.h: %.png f2h
 f2h: f2h.c
        $(CC) $(CF) -o f2h f2h.c
 
+$(HTM_CGI): %.htm: enhance-top.htm enhance-bottom.htm %.1.htm $(CONFIGFILE)
+       $(CAT) enhance-top.htm $*.1.htm enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_$* $(CONFIGFILE) > bluenh.htm
+
+index.htm: enhance-top.htm enhance-bottom.htm $(HTM_CGI_1) $(CONFIGFILE)
+       $(CAT) enhance-top.htm $(HTM_CGI_1) enhance-bottom.htm | $(CONFIGURE) _HTML_TITLE=\$$title_enhance $(CONFIGFILE) > index.htm
+
 
 setuid: $(SETUID)
        $(CHMOD) u+s,g+s $(SETUID)
@@ -176,12 +196,18 @@ cp_bin: $(BIN) setuid | mktree
        $(CP) -p $(BIN) $(BIN_PATH)
 endif
 
-install: cp_bin
+cp_conf: enhance.conf
+       $(CP) enhance.conf $(CONF)
+
+cp_www: $(WWW) | mktree
+       $(CP) -r $(WWW) $(WWW_PATH)
+
+install: cp_bin cp_www cp_conf
 
 clean:
-       $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) $(H_SUBTOOL) $(CGI)
+       $(RM) -f enhance $(C_STANDALONE) $(STANDALONE) $(TO_GENERATE) f2h $(H_PNG) $(H_SUBTOOL) $(CGI) index.htm $(HTM_CGI)
 
-PHONY: all clean install setuid mktree cp_bin 
+PHONY: all clean install setuid mktree cp_bin cp_www
 
 #npbd-ong1: npb npbd-ong1.cpp makefile
 #      $(CC) $(CF) -o npbd-ong1 npbd-ong1.cpp $(LF2)
similarity index 100%
rename from www/npb-ong1.htm
rename to npb-ong1.htm
index fa41b32e4eb44a35e31eddb3628337011e448131..92822c9e94715f9594b45fa429faa3ec7d4561cd 100644 (file)
@@ -168,7 +168,7 @@ int send_file (char *path, char *content_type, unsigned status)
        if (status != 0)
                fprintf(stdout, "Status: %u\n", status);
        if (content_type!=NULL)
-               fprintf(stdout, "Content-type: %s", content_type);
+               fprintf(stdout, "Content-type: %s\n", content_type);
        fprintf(stdout, "Content-Length: %" PRId64 "\n\n", size);
        
        while (size>0)
@@ -200,7 +200,7 @@ int send_data (const uint8_t *address, size_t size, char *content_type, unsigned
        if (status != 0)
                fprintf(stdout, "Status: %u\n", status);
        if (content_type!=NULL)
-               fprintf(stdout, "Content-type: %s", content_type);
+               fprintf(stdout, "Content-type: %s\n", content_type);
        fprintf(stdout, "Content-Length: %" PRId64 "\n\n", (uint64_t)size);
        
        off = 0;
index 0cab3e35e51545d642a57380cf514396fc20688d..9af43474380077c2ad84067f32673cf4969f6617 100644 (file)
@@ -13,9 +13,15 @@ configure: /botm/bin/config/configure.pl
 
 useragent: ENHANCE!ment tool (http://1190.bicyclesonthemoon.info/enhance)
 
+title_enhance: ENHANCE!
+title_bluenh: ENHANCE!
+
 bin_path: /botm/bin/enhance
+conf_path: /botm/etc/www/conf/1190
 tmp_path: /botm/tmp/enhance
+www_path: /botm/www/1190/enhance
 
+cat: /usr/bin/cat
 cp: /usr/bin/cp
 chmod: /usr/bin/chmod
 mkdir: /usr/bin/mkdir
index 6153ddedb302676555ace23a5043954bb613f9a3..85ad2fa83eadbe5fe9c5c2caf3f092bac3be7942 100644 (file)
 _C_DEFINE_STR: #define $0 "@_ESCAPE($1)"
 # _C_INCLUDE_STR: #include "@_ESCAPE($0)"
 
-_bin_bluenh_path = @_PATH($bin_path, bluenh)
-_bin_npb_path    = @_PATH($bin_path, npb)
+_bin_bluenh_path     = @_PATH($bin_path, bluenh)
+_bin_bluenh_cgi_path = @_PATH($bin_path, bluenh-cgi)
+_bin_npb_path        = @_PATH($bin_path, npb)
+_bin_npb_cgi_path    = @_PATH($bin_path, npb-cgi)
+
+_conf_path = @_PATH($conf_path, $name\.conf)
+
+HTML_TITLE = @_HTML_TITLE()
+
+
+CONF_bin    = $bin_path
+CONF_bluenh = $_bin_bluenh_cgi_path
+
 
 MAKE_CONFIGURE = CONFIGURE = $configure
 MAKE_TARGET    = TARGET    = $target
 
+MAKE_CAT    = CAT  =$cat
 MAKE_CHMOD  = CHMOD=$chmod
 MAKE_CP     = CP   =$cp
 MAKE_MKDIR  = MKDIR=$mkdir
@@ -36,8 +48,12 @@ MAKE_CF    = CF   =$CF
 MAKE_L_IL  = L_IL =$L_IL
 MAKE_L_CGI = L_CGI=$L_CGI
 
+MAKE_CONF = CONF = $_conf_path
+
 MAKE_BIN_PATH = BIN_PATH = $bin_path
 MAKE_TMP_PATH = TMP_PATH = $tmp_path
+MAKE_WWW_PATH = WWW_PATH = $www_path
+
 
 C_USERAGENT = @_C_DEFINE_STR(USERAGENT, $useragent)