#foswiki 2015-06-03,Wed

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)

WhoWhatWhen
gac410 [04:40]
***gac410 has left [04:43]
............. (idle for 1h4mn)
ChanServ sets mode: +o CDot [05:47]
ChanServ sets mode: +o MichaelDaum [06:00]
.......................................... (idle for 3h25mn)
ChanServ sets mode: +o Lynnwood [09:25]
.... (idle for 16mn)
GuilainChum... hi all...
I've upgrade my server runnig foswiki from an debian 7 to the last stable debian (jessie, v8.0)
and foswiki doesn't work
jessie is shipped with 2.4 apache version, so I've take care to enable access_compat apache module
I get an 404 error on an foswiki url, what i should have forget ?
my foswiki conf & installation comes from the old debian package, and I'm speaking about the 1.1.9 foswiki version
[09:41]
oh just a precision, when I invoke "apache2ctl configtest" apache says, "config ok" [09:52]
ok ! some progress
debian package of foswiki used the old apache2/conf.d mechanism for configuration of foswiki
according to https://wiki.debian.org/Apache/PackagingFor24 needs to be move into the new conf-{available,enabled} directories
do that, and now obtain an forbiden error (before it was an 404 error)
[09:59]
applaying http://foswiki.org/Tasks/Item13095 produces the same 403 (forbiden error) but log signales that come from the "access_compat" module. [10:12]
great ! progress !
updating Item13095 with more details
so now, i've get the "insecure dependency with the -T switch" error
[10:17]
seems to be the line 3153 of Foswiki.pm who produces the crash [10:26]
ok, just remove the -T option in the view script.
so now, everything seems to be working now
but now, a question to the {foswiki, perl} guru what the risk to not use -T option ?
should i continue to use foswiki like that ? change something ?
thanks in advance for your answer
(script edit, login, needs to suppress the -T option too)
[10:33]
......................... (idle for 2h2mn)
***ChanServ sets mode: +o gac410 [12:40]
gac410Hiya CDot: ls: /home/trunk.foswiki.org/core/tools/develop/detect_encoding.pl: No such file or directory [12:47]
CDothuh? something ate it :-( [12:47]
gac410trunk.foswiki.org does a "git clean -fdx" as part of the update process. [12:48]
CDotthere you go, then [12:49]
gac410Anyway, as you can tell I chickened out last night. I'll poke at the "exceptions" to encoding today, and then give it a go again tonight. [12:49]
CDotI wasn't worried about it, because I'd moved what i thought were the important bits to the charsetconverter :-( [12:49]
gac410oh okay, I did check in some #commented exceptions to charset converter for your consideration.
rather than a bunch of if statements though it should probably be a hash of exceptions EUC-JP => 'utf-8' or whatever we decided.
anyway errands to run this am. I'll be here and there for a while.
[12:51]
GuilainCGuilainC understand the taint trade off with Development/RemoveTaintCheckingFromFoswiki, upgrading Item13443 [13:05]
............... (idle for 1h13mn)
jmk0i'm lost. I'm trying to get the time of the last modification of a topic but it doesn't seem to work. using: %REVINFO{format="$rcs" topic="%BASETOPIC%"}%
rendering the topic that contains that macro, I get the expected date of that topic. But if I %INCLUDE the topic containing the REVINFO macro, i always get 12/31/1969, i.e. "i don't know"
same results with INCLUDINGTOPIC
[14:18]
gac410format="$iso" ??/ isn't that the timestamp? format="$rcs" isn't documented. [14:20]
jmk0it isn't? $iso isn't supported by %CALC [14:20]
gac410%CALC is the spreadsheet plugin %REVINFO is a macro. Completely unrelated I think [14:21]
jmk0i think i see the issue: %BASETOPIC% doesn't include the web. [14:21]
gac410http://foswiki.org/System/VarREVINFO vs http://foswiki.org/System/VarCALC
the $xxxx parameters are just formatting tokens, mostly specific to each macro
Yeah you probably need web="%BASEWEB% topics="%BASETOPIC%
[14:21]
jmk0right, i know that
not sure where I got the $rcs from, honestly. but it is the format that CALC needs
[14:22]
gac410I'm missing something somewhere. what does calc have to do with %REVINFO% [14:23]
jmk0$TIMEDIFF($TIME(%REVINFO%),$TIME(%REVINFO%))
$TIME doesn't know how to parse $iso format
[14:24]
gac410%REVINFO supports $date and $time, or $iso, I don't know of any other way to get a time out of it. [14:24]
jmk0ah i think i see where i got it. at the very end for %REVINFO: $min, $sec, etc. Same date format qualifiers as GMTIME{"format"}
and GMTIME has $rcs
so i tried it and it worked
[14:26]
gac410Ah... learn something every day. ;) [14:26]
jmk0still not getting the results i want, sadly, but oh well :-)
basically trying to make it so that if keyword W is used in topic A, topics X and Y which are associated with keyword W, then topic A will say "hey I'm out of date", if X or Y are newer than A
if that makes any damn sense
the problem right now is triggering that check ONLY if the keyword is used. right now each of the %CALC macros for each keyword get evaluated so it's doing the checks for all of the keywords instead of just those used in the topic
... and because I'm doing that keyword substitution (e.g. W => %CALC) in a plugin's afterCommonTagsHandler, it'll probably never work like that
[14:30]
gac410yeah. %CALC is a common tags handler IIRC. in 1.2 there is a %CALCULATE% macro as well that's a registered macro rather than a common macro.
Actually in 1.1.9, it's there, but commented out. In lib/Foswiki/Plugins/SpreadsheetPlugin.pm a block of code registers a %SSP% macro, but in 1.2 it's enabled and called %CALCULATE%
[14:35]
jmk0heh
either way it's not really available to me :)
what's your opinion? should I continue trying to do this with the macros/plugins available in 1.1.9 or should I just take the plunge and implement a new plugin?
the former is starting to feel like banging my head against a wall, but...
[14:36]
GuilainCjmk0, for what you want to do, I'm not sure you're taking the shortest way... [14:39]
jmk0heh [14:39]
gac410yeah. Sometimes a simple plugin is easier ... lots more control in perl. But tbh, there are wizards around here who are much better than macros than I am. [14:39]
GuilainCas simple user, I'm not able to give you the best answer in one line, but if you want, I can try to take time for prototype something in foswiki sandbox
what you whant to do, seems to be classic (for me, which used foswiki for requirement management for ex)
[14:40]
jmk0I think my macros are fine, finally, the problem is making sure the calc formula.. hum. had an idea: if I do a %SEARCH in the base topic for the keyword instead of trying to do that crazy keyword substitution stuff, it might work [14:41]
GuilainCIf I were you I will work with search
and query
and I think that query should be enought
my pseudo code, perhaps I'm wrong, should be the following:
[14:41]
jmk0o [14:42]
GuilainC%QUERY{"keyword" AND date(UpStreamTopic)>date(DownStreamTopic topic="UpStreamTopic" web="..." ... }%
my aim is to check if I found the keyword and date are matching your rules
[14:43]
jmk0hmmmm ok lemme take a poke around to see if I can get that to work [14:44]
GuilainCAs I say, I'm simple user, but if need be, we can take 3 dummy topic in sand box and try together [14:45]
jmk0... not really sure why there are %SEARCH examples in the QuerySearch page [14:45]
GuilainCwhat I've learn this last 4 years with foswiki, is... there are often an simple foswiki way, and awfull one
;)
hum let me check
[14:45]
jmk0lol [14:46]
GuilainCok I'm probably say something wrong...
;)
be carefull, query search is a type of search
but it's implemented by the %SEARCH macro
but type="query"
[14:47]
jmk0ok [14:48]
gac410%QUERY operates on a single topic. %SEARCH type=query uses the same syntax but across multiple topics. I think I have that right. [14:49]
GuilainCoh yes ! you're right, there is %QUERY too... I'm not using it ! [14:50]
jmk0QUERY seems to be for getting topic metadata whereas SEARCH is a bit more sophisticated :) [14:50]
CDotjmk0: sort of. %SEARCH will trundle off a perform a database query, where %QUERY will just consult the topic fields it already loaded from the DB. So there's an important performance difference. [14:56]
GuilainCargh spreadsheet is disable on f.o ! [15:05]
jmk0:) [15:05]
gac410It is??? I really doubt that.
no, it shows as enabled in http://foswiki.org/System/InstalledPlugins
[15:06]
GuilainCah... so is my code ;)
is so easy to beat the others ;) when it's you (me in this case) who making something wrong
http://foswiki.org/Sandbox/DateTopicComparison for jmk0 if you want follow my progress (or my non-progress at this time)
[15:08]
GithubBot[distro] cdot pushed 3 new commits to master: http://git.io/vkAOK
distro/master 4956591 Crawford Currie: Item13441: two problems; the table parser was confused by having a TABLE and an EDITABLE next to eachother, and the JS table-fixer was reconstructing TFOOT incorrectly
distro/master 0b71187 Crawford Currie: Item13441: need to encode | in format, otherwise the table renderer fails
distro/master 3d27f64 Crawford Currie: Item12888: new store test for search function (currently fails on iso8859 for me. Don't seem to be able to pass an iso-8859-1 high-bit string to a grep command (though it works with rcs) :-/
[15:14]
***GithubBot has left [15:14]
CDotgac410: I found out why it was calling me "Comment" in all my checkins [15:14]
gac410wohoo finally :)
What was it?
[15:14]
CDotthe 4th column in /etc/passwd [15:15]
gac410On your local system? [15:16]
CDoty [15:16]
jmk0blarrrr $iso time barfs on time zone stuff, in %search as in %calc :-P [15:16]
CDotquite why, I have no idea. Another git mystery. [15:16]
gac410Column 4 is the group ID? [15:17]
jmk0"2015-06-03T10:15:24-05:00" %CALC{$TIME()}% tries to turn that into 5am, %search just complains that it's bad syntax [15:17]
gac410jmk0: our time handling is all locally written / custom code inherited from many past generations :( we really should replace all of it with well proven CPAN modules. [15:18]
jmk0:)
so, um, what do i do in the mean-time? is "date" for SEARCH implicitly UTC?
I ran CDot off :)
[15:18]
GuilainCraahh ! lovely syntaxe exception for the %CALC macro doesn't want escape " (\") and prefer plain " when using macro inside it ! [15:22]
gac410Yeah I think we have a task for that. Really annoying.
er, no that's the SEARCH string that has no way to escape " iirc
[15:22]
jmk0yeah, I think that has to do with the fact that wiki isn't a language per se, so much as a text parser [15:23]
gac410I think you can use $quot in some macros
gac410 gets all the escaping stuff confused
[15:23]
jmk0yep, probably more difficult for programmers who are used to having to escape nested quotes than it is for others :)
unless you're actually trying to put a quote into some string parameter, then all bets are off
[15:24]
GuilainCgac410, don't be confused, take my technis
technis = technics
my tips
try the different manner up to one is wokring
wokring = working !
... I've never understand how/when/why/... escaping in foswiki :/
so jmk0, you can check, i can detect wich one topic is newer to an other one
http://foswiki.org/Sandbox/DateTopicComparison
[15:26]
jmk0k, i'll have a look [15:27]
GuilainCto be clear, this solution, is probably not the {best,good} way to do it
but it's works :)
[15:27]
jmk0:D [15:28]
um. d2n doesn't do what it says it does. Docs link to System.TimeSpecifications which indicate that "2015/06/03 10:35:03" should be a valid time format, but it gives a syntax error at :35:03
unless i need quotes or something and i'm missing them. lemme try that
yeah that did it, never mind :)
[15:36]
probably irrelevant GuilainC but %REVINFO{...}% might be faster than those %SEARCH macros for getting a topic's modification date
that's just a guess though, haven't experimented to verify
[15:43]
GuilainCprobably :)
but I've done two way in one hour
:D
and that's works (with search too, at this instant)
[15:43]
jmk0:) [15:44]
GuilainCyou want with revinfo ? [15:44]
jmk0nah it's fine, I was just pointing that out
results should be the same either way
[15:44]
GuilainCfor performance consideration you right, but be careful to take to many times for developpement irrelevant for just what the user want
GuilainC going to write with revinfo...
[15:44]
jmk0heh, there's really no need but if you want to anyway :) [15:45]
GuilainCdone
with comment
and large verbatim for copy/paste
for the performance, my advice:
1) be sure you need performance, i.e. how many times is call, the number of change
2) be smart, and try to test the less case possible if possible
and the then perform test.
[15:54]
jmk0thanks :) [15:56]
GuilainCfor the last one is for me the most difficult, you can do it in several manner:
a) by multiplie the code x100 and mesure between the different methods
b) by measure with your browser one method, and one other (the worst)
c) nytprof... if you are motivated :)
[15:56]
jmk0apache actually can log how long it takes for a request to be fulfilled, fwiw [15:58]
GuilainCbe carefull that some one could be very sensitive to your configuration (for example, cache configuration) [15:58]
jmk0yeah [15:58]
GuilainCwha, how do you do that ? [15:58]
jmk0i think you set LogLevel debug in your virtualhost definition, lemme dig a bit more [16:00]
GuilainCah... [16:01]
jmk0here: http://www.ducea.com/2008/02/06/apache-logs-how-long-does-it-take-to-serve-a-request/
i guess it's more the log format than log level
[16:01]
GuilainCgreat ! happy to have learn something today !
I will be able to track my foswiki (un)performance !
[16:04]
jmk0:) [16:08]
GuilainCnow, I've the evidence that my server serve my foswiki page in... 5 seconds...
so happy :D
;)
[16:09]
................... (idle for 1h30mn)
hum should i used rewriteshebang in tools directory for suppress all taint mode (-T in shebang) ?
if yes, how ?!
[17:39]
gac4101.1.9 or 1.2.x [17:39]
GuilainC1.1.9 [17:40]
gac410bad news then. 1.1.9 doesn't have an option to remove the -T. 1.2.0 does, though its not really needed any more. [17:40]
GuilainCok,
so should i take the 1.2.0 rewriteshebang
and try to use in on my 1.1.9
[17:48]
gac410no, [17:48]
GuilainCah :( [17:48]
gac410It uses some functions from within configure
I hate to say it, probably easiest to just edit the files.
Just remove the -wT from the first line of each file.
[17:48]
GuilainCis what i've started to do...
1.2.0 is not so far now...
dummy but transitionnal manner :)
[17:50]
done :) [17:59]
..... (idle for 24mn)
jmk0grep -l '^#! /usr/bin/perl' /var/www/foswiki/bin/* | xargs sed 's/^#! \/usr\/bin\/perl -wT/#! \/usr\/bin\/perl/
'
no extra newline, but that might get the job done, if i know what you're trying to do
er, make that sed -i ...
that command should strip the -wT out of the shebang of scripts in /var/foswiki/bin
of course you're probably already done by now :D
[18:23]
...
... "[12:59] <GuilainC> done :)" ... indeed
i keep hitting the enter key by accident today :-/
[18:34]
..... (idle for 21mn)
I don't suppose there's a way to use backreferences to regexes in %SEARCH queries?
e.g. something like %SEARCH{"text =~ '\b(something|another|yep)\b'" format="SomeWeb.TopicNamed$1"}%
not sure if that's what I need right now but I can see it being useful :)
maybe $pattern
[18:56]
............ (idle for 58mn)
... $pattern probably will get the job done, but I expect it engenders a second pattern match, which sub-optimal :) [20:00]
GuilainCjmk0, be careful foswiki doesn't support alm
alm = all
regexp
there are docs in system
and for me $pattern is like a kind of magic :)
(because i don't know to use it correctly)
[20:09]
jmk0:) [20:15]
I'm obviously misunderstanding something. If I do something like %SEARCH{...multiple="on" format="$pattern(.*\b(mess1|mess2|mess3).*)"}%, and a topic has more than one of "mess1", "mess2" or "mess3", I'd expect to see each of those matches
instead, I only get one.
[20:25]
GuilainCok don't know backreferences at all
but pattern(...\b\( should be better ?!
and read http://foswiki.org/Development.RegularExpressions
some backreferences seems to be supported and other not (?!)
can't help you more, if even, I'm helping you
[20:30]
jmk0:)
odd that page names backreferences using \1 etc. but perl is odd in that it is the only language (that I know of) that uses $1 etc. instead
[20:32]
GuilainCand if you want hightlight something perhaps SEARCH + jquerychilli could be the best team (http://foswiki.org/System/JQueryChili). JQueryChili support "full javascript regexp, including backreferences" [20:34]
jmk0it's gotta be something with my regex, $text gives me the whole doc instead of "the line found for each search hit" [20:36]
GuilainCnot sure of what I will say... but I think that foswiki doesn't parse one line by line
but by all text in a topic
[20:46]
jmk0yeah, but the multiple="on" options seems to suggest you can do things line-by-line [20:47]
GuilainChum I don't have understood in this way
let me re-read again
[20:50]
jmk0multiple="on" docs: Multiple hits per topic. Each hit can be formatted. The last token is used in case of a regular expression ";" and search
but it doesn't seem to work that way, at least with a query
[20:53]
GuilainCok, very unsure ;)
because is an option i don't use often... even rarely...
perhaps never, ye
yet
so for me is if a search get the following output
topicA
topicB
topicA
then multiple="on" enable the topicA to be written two times
without, double are reduce
but i'm very unsure
please test if i'm wrong
[20:53]
jmk0using a query search, regex, literal or what/
near as I can tell, it doesn't work with type="query", but does with type="regex". Haven't tried others
[20:55]
GuilainCok, so you should have right, and works only with type="regex" [20:58]
............ (idle for 56mn)
jmk0might be related to this comment in Search.pm: "#TODO: well, um, and how does this work for query search?" [21:54]
GuilainCso let do it jmk0
now you have found where put the code :D
[22:02]
jmk0heh, already on it :)
sort of
[22:02]
GuilainCGuilainC get an awfull error after trying to change something in configure...
GuilainC is investigating
ok, googling give any answer
my error, and I will see to solve it tomorrow
"CGI::param called in list context from package Foswiki::Configure::UIs::AUTH line 44, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436."
just try to save change in configure
[22:03]
jmk0gac410: why does search return topics that don't match my regex? And the end result is that $text contains the entire non-matching topic contents :-/ [22:08]
GuilainCbe careful jmk0, you remember my student, "Mister, why my C code doesn't produce what I want but produce what I write" ;) [22:09]
jmk0can't replicate the behavior on foswiki.org, grr [22:15]

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)