From 9f59dfbcabcbabc699c9ecbe5d5c572ff486ca17 Mon Sep 17 00:00:00 2001 From: b Date: Sun, 4 Dec 2022 18:40:01 +0000 Subject: [PATCH] Fully working online interface; for now bluenh only. --- bluenh.1.htm | 19 +++++++++++++ bluenh.htm | 33 ---------------------- enhance-bottom.htm | 5 ++++ enhance-top.htm | 9 ++++++ enhance.1.conf | 7 +++++ makefile | 44 +++++++++++++++++++++++------ makefile.1.mak | 48 ++++++++++++++++++++++++-------- www/npb-ong1.htm => npb-ong1.htm | 0 online-core.c | 4 +-- settings-release.txt | 6 ++++ settings.txt | 20 +++++++++++-- 11 files changed, 138 insertions(+), 57 deletions(-) create mode 100644 bluenh.1.htm delete mode 100644 bluenh.htm create mode 100644 enhance-bottom.htm create mode 100644 enhance-top.htm create mode 100644 enhance.1.conf rename www/npb-ong1.htm => npb-ong1.htm (100%) diff --git a/bluenh.1.htm b/bluenh.1.htm new file mode 100644 index 0000000..1c87660 --- /dev/null +++ b/bluenh.1.htm @@ -0,0 +1,19 @@ +

ENHANCE!

+
+ parameter explanation picture
+
+ a=, b=, c=,
+ d=, e=, f=.
+ a < b < c
+
+ Enhance by URL
+ URL of image: + +
+
+ Enhance by file upload
+ Upload the image: + + +
+ diff --git a/bluenh.htm b/bluenh.htm deleted file mode 100644 index ef514af..0000000 --- a/bluenh.htm +++ /dev/null @@ -1,33 +0,0 @@ - - - - ENHANCE! • Bicycles on the Moon - - - - - 1190.bicyclesonthemoon.dnsd.info -

ENHANCE!

-
- parameter explanation picture
-
- a=, b=, c=,
- d=, e=, f=.
- a < b < c
-
- Enhance by URL
- URL of image: - -
-
- Enhance by file upload
- Upload the image: - - -
-
-
- Source code available at svn://bicyclesonthemoon.dnsd.info/bluenh (use "e" to login) or http://1190.bicyclesonthemoon.dnsd.info/pro/bluenh. - - - diff --git a/enhance-bottom.htm b/enhance-bottom.htm new file mode 100644 index 0000000..2b9e22c --- /dev/null +++ b/enhance-bottom.htm @@ -0,0 +1,5 @@ +
+
+ Source code available at http://bicyclesonthemoon.info/git-projects/?p=ott/enhance. + + diff --git a/enhance-top.htm b/enhance-top.htm new file mode 100644 index 0000000..df6f770 --- /dev/null +++ b/enhance-top.htm @@ -0,0 +1,9 @@ + + + + ###HTML_TITLE; • Bicycles on the Moon + + + + + 1190.bicyclesonthemoon.dnsd.info diff --git a/enhance.1.conf b/enhance.1.conf new file mode 100644 index 0000000..dc7b2cf --- /dev/null +++ b/enhance.1.conf @@ -0,0 +1,7 @@ +# Enhance tools + +ScriptAlias /enhance/bluenh ###CONF_bluenh; + + + Require all granted + diff --git a/makefile b/makefile index 4c96e89..5d6ad88 100644 --- 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) diff --git a/makefile.1.mak b/makefile.1.mak index 3f5dce3..3ea26f6 100644 --- a/makefile.1.mak +++ b/makefile.1.mak @@ -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) diff --git a/www/npb-ong1.htm b/npb-ong1.htm similarity index 100% rename from www/npb-ong1.htm rename to npb-ong1.htm diff --git a/online-core.c b/online-core.c index fa41b32..92822c9 100644 --- a/online-core.c +++ b/online-core.c @@ -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; diff --git a/settings-release.txt b/settings-release.txt index 0cab3e3..9af4347 100644 --- a/settings-release.txt +++ b/settings-release.txt @@ -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 diff --git a/settings.txt b/settings.txt index 6153dde..85ad2fa 100644 --- a/settings.txt +++ b/settings.txt @@ -19,12 +19,24 @@ _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) -- 2.30.2