From 474d7bb8415f1f8291b4d72ceb4dcdd5cafecad0 Mon Sep 17 00:00:00 2001 From: b Date: Mon, 19 Feb 2024 19:59:48 +0000 Subject: [PATCH] Support more than 1 build target --- bb2html.awk => bb2html.1.awk | 52 ++--- bot2.1.awk | 41 ++-- .../template/editor.js => editor.1.js | 2 +- www/ott/end => end.1 | 30 +-- fix.pl | 217 ------------------ www/ott/info.htm => info.1.htm | 42 ++-- install.sh | 5 + makefile | 82 ++++--- makefile.1.mak | 36 ++- mpview.1.c | 7 +- mview.awk => mview.1.awk | 15 +- mview.1.c | 37 +-- www/ott/np/end => np.end.1 | 30 +-- www/ott/np/top => np.top.1 | 26 +-- ottmirror.1.conf | 23 +- post.1.c | 25 +- www/ott/post.htm => post.1.htm | 90 ++++---- posted.awk => posted.1.awk | 9 +- posted.1.c | 6 +- redirect.c => redirect.1.c | 8 +- settings-debug.txt | 85 +++++++ settings-release.txt | 66 +++--- settings.txt | 73 ++++-- .../theme/style.php.css => style.php.1.css | 160 ++++++------- www/ott/top => top.1 | 24 +- update.1.c | 9 +- www/ott/update.htm => update.1.htm | 6 +- view.1.c | 25 +- www/ott/whymirror.htm => whymirror.1.htm | 4 +- 29 files changed, 618 insertions(+), 617 deletions(-) rename bb2html.awk => bb2html.1.awk (86%) rename www/ott/prosilver/template/editor.js => editor.1.js (98%) rename www/ott/end => end.1 (88%) delete mode 100644 fix.pl rename www/ott/info.htm => info.1.htm (81%) create mode 100755 install.sh rename mview.awk => mview.1.awk (60%) rename www/ott/np/end => np.end.1 (87%) rename www/ott/np/top => np.top.1 (81%) rename www/ott/post.htm => post.1.htm (81%) rename posted.awk => posted.1.awk (67%) rename redirect.c => redirect.1.c (85%) create mode 100644 settings-debug.txt rename www/ott/prosilver/theme/style.php.css => style.php.1.css (90%) rename www/ott/top => top.1 (85%) rename www/ott/update.htm => update.1.htm (64%) rename www/ott/whymirror.htm => whymirror.1.htm (80%) diff --git a/bb2html.awk b/bb2html.1.awk similarity index 86% rename from bb2html.awk rename to bb2html.1.awk index fa59002..ccf908a 100644 --- a/bb2html.awk +++ b/bb2html.1.awk @@ -1,8 +1,7 @@ # OTT mirror -# Copyright (C) 2014 Balthasar Szczepański -# bb2html.awk +# Copyright (C) 2014, 2024 Balthasar Szczepański +# bb2html.awk is generated from bb2html.1.awk # translate BBcode to HTML and add to post file. -# 27.10.2014 # This file is part of OTT mirror. # @@ -22,6 +21,7 @@ BEGIN{ FS="=" debug="debug=bb2html.awk:" + ###AWK_cgi_prosilver_path: cgi_prosilver_path = /ott/prosilver }; { eq=index($0,"=") @@ -466,29 +466,29 @@ function bb2html(text, depth,count,bbtree,html,tag,tagstart,taglength,elm,tagv gsub(/https?:\/\/[^\n\r\t<> ]+/,"&",tag) if(argtab["disable_smilies"]=="" && bbtree[indt(count,depth)".t"] !~ /^((code)|(img))$/) { - gsub(/(^|[\n\r\t ]):D($|[\n\r\t ])/," \":D\" ",tag) - gsub(/(^|[\n\r\t ]):\)($|[\n\r\t ])/," \":)\" ",tag) - gsub(/(^|[\n\r\t ]):\(($|[\n\r\t ])/," \":(\" ",tag) - gsub(/(^|[\n\r\t ]):o($|[\n\r\t ])/," \":o\" ",tag) - gsub(/(^|[\n\r\t ]):shock:($|[\n\r\t ])/," \":shock:\" ",tag) - gsub(/(^|[\n\r\t ]):\?($|[\n\r\t ])/," \":?\" ",tag) - gsub(/(^|[\n\r\t ])8-\)($|[\n\r\t ])/," \"8-)\" ",tag) - gsub(/(^|[\n\r\t ]):lol:($|[\n\r\t ])/," \":lol:\" ",tag) - gsub(/(^|[\n\r\t ]):x($|[\n\r\t ])/," \":x\" ",tag) - gsub(/(^|[\n\r\t ]):P($|[\n\r\t ])/," \":P\" ",tag) - gsub(/(^|[\n\r\t ]):oops:($|[\n\r\t ])/," \":oops:\" ",tag) - gsub(/(^|[\n\r\t ]):cry:($|[\n\r\t ])/," \":cry:\" ",tag) - gsub(/(^|[\n\r\t ]):evil:($|[\n\r\t ])/," \":evil:\" ",tag) - gsub(/(^|[\n\r\t ]):twisted:($|[\n\r\t ])/," \":twisted:\" ",tag) - gsub(/(^|[\n\r\t ]):roll:($|[\n\r\t ])/," \":roll:\" ",tag) - gsub(/(^|[\n\r\t ]):wink:($|[\n\r\t ])/," \":wink:\" ",tag) - gsub(/(^|[\n\r\t ]);\)($|[\n\r\t ])/," \":wink:\" ",tag) - gsub(/(^|[\n\r\t ]):!:($|[\n\r\t ])/," \":!:\" ",tag) - gsub(/(^|[\n\r\t ]):\?:($|[\n\r\t ])/," \":?:\" ",tag) - gsub(/(^|[\n\r\t ]):idea:($|[\n\r\t ])/," \":idea:\" ",tag) - gsub(/(^|[\n\r\t ]):arrow:($|[\n\r\t ])/," \":arrow:\" ",tag) - gsub(/(^|[\n\r\t ]):\|($|[\n\r\t ])/," \":|\" ",tag) - gsub(/(^|[\n\r\t ]):mrgreen:($|[\n\r\t ])/," \":mrgreen:\" ",tag) + gsub(/(^|[\n\r\t ]):D($|[\n\r\t ])/," \":D\" ",tag) + gsub(/(^|[\n\r\t ]):\)($|[\n\r\t ])/," \":)\" ",tag) + gsub(/(^|[\n\r\t ]):\(($|[\n\r\t ])/," \":(\" ",tag) + gsub(/(^|[\n\r\t ]):o($|[\n\r\t ])/," \":o\" ",tag) + gsub(/(^|[\n\r\t ]):shock:($|[\n\r\t ])/," \":shock:\" ",tag) + gsub(/(^|[\n\r\t ]):\?($|[\n\r\t ])/," \":?\" ",tag) + gsub(/(^|[\n\r\t ])8-\)($|[\n\r\t ])/," \"8-)\" ",tag) + gsub(/(^|[\n\r\t ]):lol:($|[\n\r\t ])/," \":lol:\" ",tag) + gsub(/(^|[\n\r\t ]):x($|[\n\r\t ])/," \":x\" ",tag) + gsub(/(^|[\n\r\t ]):P($|[\n\r\t ])/," \":P\" ",tag) + gsub(/(^|[\n\r\t ]):oops:($|[\n\r\t ])/," \":oops:\" ",tag) + gsub(/(^|[\n\r\t ]):cry:($|[\n\r\t ])/," \":cry:\" ",tag) + gsub(/(^|[\n\r\t ]):evil:($|[\n\r\t ])/," \":evil:\" ",tag) + gsub(/(^|[\n\r\t ]):twisted:($|[\n\r\t ])/," \":twisted:\" ",tag) + gsub(/(^|[\n\r\t ]):roll:($|[\n\r\t ])/," \":roll:\" ",tag) + gsub(/(^|[\n\r\t ]):wink:($|[\n\r\t ])/," \":wink:\" ",tag) + gsub(/(^|[\n\r\t ]);\)($|[\n\r\t ])/," \":wink:\" ",tag) + gsub(/(^|[\n\r\t ]):!:($|[\n\r\t ])/," \":!:\" ",tag) + gsub(/(^|[\n\r\t ]):\?:($|[\n\r\t ])/," \":?:\" ",tag) + gsub(/(^|[\n\r\t ]):idea:($|[\n\r\t ])/," \":idea:\" ",tag) + gsub(/(^|[\n\r\t ]):arrow:($|[\n\r\t ])/," \":arrow:\" ",tag) + gsub(/(^|[\n\r\t ]):\|($|[\n\r\t ])/," \":|\" ",tag) + gsub(/(^|[\n\r\t ]):mrgreen:($|[\n\r\t ])/," \":mrgreen:\" ",tag) } html = html tag diff --git a/bot2.1.awk b/bot2.1.awk index c455dea..a06b903 100644 --- a/bot2.1.awk +++ b/bot2.1.awk @@ -1,8 +1,7 @@ # OTT mirror -# Copyright (C) 2014-2016, 2022 Balthasar Szczepański +# Copyright (C) 2014-2016, 2022, 2024 Balthasar Szczepański # bot2.awk (bothasar_t) automatically generated from bot2.1.awk # relinking, archiving avatars, attachments, images. -# 29.09.2022 # This file is part of OTT mirror. # @@ -29,17 +28,23 @@ BEGIN { related6=0 np=0 p=0 -###AWK_useragent_2: useragent="\"bothasar_t (http://1190.bicyclesonthemoon.info/ott/; Time thread mirror bot)\"" + ###AWK_useragent_2: useragent="\"bothasar_t (http://1190.bicyclesonthemoon.info/ott/; Time thread mirror bot)\"" arr[0]=0 arr2[0]=0 -###AWK_findpost_path: findpost_path="/eizm/pro/ottmirror/findpost" -###AWK_imgformat_path: imgformat_path="/eizm/pro/ottmirror/image" -###AWK_wayback: wayback="http://web.archive.org/web/" -###AWK_fora: fora="http://forums.xkcd.com" -###AWK_wget: wget=/usr/bin/wget -###AWK_mkdir: mv=/usr/bin/mkdir -###AWK_mv: mv=/usr/bin/mv -###AWK_sleep: mv=/usr/bin/sleep + ###AWK_findpost_path: findpost_path = "/eizm/pro/ottmirror/findpost" + ###AWK_imgformat_path: imgformat_path = "/eizm/pro/ottmirror/image" + ###AWK_wayback: wayback = "http://web.archive.org/web/" + ###AWK_fora: fora = "http://forums.xkcd.com" + ###AWK_wget: wget = /usr/bin/wget + ###AWK_mkdir: mv = /usr/bin/mkdir + ###AWK_mv: mv = /usr/bin/mv + ###AWK_sleep: mv = /usr/bin/sleep + ###AWK_cgi_attachment_path: /ott/attachment + ###AWK_cgi_avatar_path:cgi_avatar_path= /ott/avatar + ###AWK_cgi_image_path: cgi_image_path = /ott/image + ###AWK_cgi_post_path: cgi_post_path = /ott/post + ###AWK_cgi_prosilver_path: /ott/prosilver + ###AWK_cgi_view_path: cgi_view_path = /ott/cgi if (wait=="") { @@ -352,7 +357,7 @@ BEGIN { # apply the prepared changes if (related==1) { - printf("href=\"/ott/view") >> outfile + printf("href=\""cgi_view_path) >> outfile if(np>0) { printf("?np=%s",np) >> outfile @@ -365,23 +370,23 @@ BEGIN { } else if (related2==1) { - printf("%s/ott/prosilver%s",arr[1],arr[2]) >> outfile + printf("%s"cgi_prosilver_path"%s",arr[1],arr[2]) >> outfile } else if (related5==1) { - printf("%s/ott/prosilver/smilies%s",arr[1],arr[2]) >> outfile + printf("%s"cgi_prosilver_path"smilies%s",arr[1],arr[2]) >> outfile } else if (related3==1) { - printf("%s\"/ott/avatar/%s\"%s", arr[1],arr2[2],arr[3]) >> outfile + printf("%s\""cgi_avatar_path"/%s\"%s", arr[1],arr2[2],arr[3]) >> outfile } else if (related4==1) { - printf("%s\"/ott/attachment/%s\"\n",arr[1],arr2[2]) >> outfile + printf("%s\""cgi_attachment_path"/%s\"\n",arr[1],arr2[2]) >> outfile } else if (related6==1) { - printf("%s\"/ott/image/%s\"\n",arr[1],imgdir imgname) >>outfile + printf("%s\""cgi_image_path"/%s\"\n",arr[1],imgdir imgname) >>outfile } else if(noquot != 0) { @@ -402,7 +407,7 @@ BEGIN { { print "" >> outfile } }; diff --git a/www/ott/prosilver/template/editor.js b/editor.1.js similarity index 98% rename from www/ott/prosilver/template/editor.js rename to editor.1.js index ff4d0fd..23b7f01 100644 --- a/www/ott/prosilver/template/editor.js +++ b/editor.1.js @@ -388,7 +388,7 @@ function colorPalette(dir, width, height) { color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]); document.write(''); - document.write('#' + color + ''); + document.write('#' + color + ''); document.writeln(''); } diff --git a/www/ott/end b/end.1 similarity index 88% rename from www/ott/end rename to end.1 index d925ac7..a5fcc7e 100644 --- a/www/ott/end +++ b/end.1 @@ -7,11 +7,11 @@

- +
@@ -30,7 +30,7 @@ go to newpage: diff --git a/ottmirror.1.conf b/ottmirror.1.conf index 125ff6d..442e12a 100644 --- a/ottmirror.1.conf +++ b/ottmirror.1.conf @@ -1,6 +1,6 @@ # The OTT mirror -Alias /ott/log ###CONF_log; +Alias ###CONF_cgi_log; ###CONF_log; Require all granted Options Indexes @@ -12,19 +12,20 @@ Alias /ott/log ###CONF_log; Options Indexes MultiViews -ScriptAlias /ott/index ###CONF_index; -ScriptAlias /ott/mpview ###CONF_mpview; -ScriptAlias /ott/mview ###CONF_mview; -ScriptAlias /ott/post ###CONF_post; -ScriptAlias /ott/posted ###CONF_posted; -ScriptAlias /ott/redirect ###CONF_redirect; -ScriptAlias /ott/update ###CONF_update; -ScriptAlias /ott/view ###CONF_view; -ScriptAliasMatch ^/ott/?$ ###CONF_index; +ScriptAlias ###CONF_cgi_index; ###CONF_bin_index; +ScriptAlias ###CONF_cgi_mpview; ###CONF_bin_mpview; +ScriptAlias ###CONF_cgi_mview; ###CONF_bin_mview; +ScriptAlias ###CONF_cgi_post; ###CONF_bin_post; +ScriptAlias ###CONF_cgi_posted; ###CONF_bin_posted; +ScriptAlias ###CONF_cgi_redirect; ###CONF_bin_redirect; +ScriptAlias ###CONF_cgi_update; ###CONF_bin_update; +ScriptAlias ###CONF_cgi_view; ###CONF_bin_view; +ScriptAliasMatch ^###CONF_cgi;/?$ ###CONF_bin_index; Require all granted # legacy redirections -Redirect permanent /ott/src http://bicyclesonthemoon.info/git-projects?p=ott/mirror; +# TODO: no hardcode here +Redirect permanent ###CONF_cgi_src; http://bicyclesonthemoon.info/git-projects?p=ott/mirror; diff --git a/post.1.c b/post.1.c index 3ab643c..a6ac421 100644 --- a/post.1.c +++ b/post.1.c @@ -48,6 +48,11 @@ // ###C_BOT3NAME_ENCODED: #define BOT3NAME_ENCODED "bothasar_p" // ###C_BOT3_URL: #define BOT3_URL "http://1190.bicyclesonthemoon.info/bothasar_p/" +// ###C_CGI_: #define CGI_ "/ott" +// ###C_CGI_MVIEW: #define CGI_MVIEW "/ott/mview" +// ###C_CGI_PROSILVER: "/ott/prosilver" +// ###C_CGI_POST: #define CGI_POST "/ott/post" + #define N_STRBUF 256 #define N_STRBUF_SH 32 #define MIN_EDIT_TIME 5 @@ -386,30 +391,30 @@ void submit() if(tempfile!=NULL) { fprintf(tempfile,"
  • \n"); - fprintf(tempfile,"
    \n"); - fprintf(tempfile,"
    Mustardtime Otherthread\n"); + fprintf(tempfile,"
    \n"); + fprintf(tempfile,"
    Mustardtime Otherthread\n"); fprintf(tempfile,"
    \nMustardtime posts will be shown here, before they are posted to the OTT.
    \n"); fprintf(tempfile,""); if(lastpage>5) - fprintf(tempfile,"1 ... "); + fprintf(tempfile,"1 ... "); for(unsigned long i=((lastpage>5)?(lastpage-2):1);i%lu, ",i,i); - fprintf(tempfile,"%lu",lastpage,lastpage); - fprintf(tempfile,"\"Attachment(s)\" by %s » Sat Apr 05, 2014 9:40 pm UTC
    \n", BOT3_URL, BOT3NAME_ENCODED); + fprintf(tempfile,"%lu, ",i,i); + fprintf(tempfile,"%lu",lastpage,lastpage); + fprintf(tempfile,"\"Attachment(s)\" by %s » Sat Apr 05, 2014 9:40 pm UTC
    \n", BOT3_URL, BOT3NAME_ENCODED); fprintf(tempfile,"
    %lu Replies
    \n",(unsigned long)((lastpage-1)*40+postslast)); fprintf(tempfile,"
    NaN Views
    \n"); fprintf(tempfile,"
    Last post by "); writeArgH(tempfile,username); - fprintf(tempfile,"\n\"View
    %s
    \n",lastpage,timenumber,timenumber,timetext); + fprintf(tempfile,"\n\"View
    %s\n",lastpage,timenumber,timenumber,timetext); fprintf(tempfile,"
    \n
    \n
  • \n"); } fclose(tempfile); - snprintf(arg1,N_STRBUF,"info=

    This message has been posted successfully.

    View your submitted message

    Return to the ЯOЯЯIM TTO

    ",lastpage,timenumber,timenumber); + snprintf(arg1,N_STRBUF,"info=

    This message has been posted successfully.

    View your submitted message

    Return to the ЯOЯЯIM TTO

    ",lastpage,timenumber,timenumber); } else - snprintf(arg1,N_STRBUF,"info=

    This message has been posted successfully.

    View your submitted message

    Return to the ЯOЯЯIM TTO

    ",timenumber,timenumber); - snprintf(arg2,N_STRBUF,"refresh=",timenumber,timenumber); + snprintf(arg1,N_STRBUF,"info=

    This message has been posted successfully.

    View your submitted message

    Return to the ЯOЯЯIM TTO

    ",timenumber,timenumber); + snprintf(arg2,N_STRBUF,"refresh=",timenumber,timenumber); printf("Content-type: text/html\n\n"); fflush(stdout); diff --git a/www/ott/post.htm b/post.1.htm similarity index 81% rename from www/ott/post.htm rename to post.1.htm index 166e0d8..51e2534 100644 --- a/www/ott/post.htm +++ b/post.1.htm @@ -62,13 +62,13 @@ // ]]> - - - - - - - + + + + + + + @@ -96,8 +96,8 @@
    - -

    the ЯOЯЯIM TTO

    + +

    the ЯOЯЯIM TTO

    Redundant copy of the needle-pulled thing

    @@ -117,7 +117,7 @@
    @@ -135,7 +135,7 @@

    Post during mustardtime.

    - + ###HTML @@ -239,7 +239,7 @@ // ]]> - +