comparison config.urllog.example @ 590:2294b73df2cf

urllog: Massive refactoring to use similar message system as other scripts, and general cleanups to the code. This breaks configuration backwards compatibility completely.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 27 Jan 2021 12:01:20 +0200
parents 148c7553c50f
children 3bd5a5e072ad
comparison
equal deleted inserted replaced
589:b07ff5123baf 590:2294b73df2cf
1 ########################################################################## 1 ##########################################################################
2 # 2 #
3 # URLLog script configuration 3 # URLLog script configuration
4 # 4 #
5 ########################################################################## 5 ##########################################################################
6
7 ###
8 ### Bind commands
9 ###
10 bind pub - !urlfind urllog_cmd_pub_find
11 bind msg - !urlfind urllog_cmd_msg_find
12 bind pubm - *.* urllog_check_line
13 bind topc - *.* urllog_check_line
14
15
16 # Name of the command used for help texts
17 set urllog_cmd_name "!urlfind"
18
6 19
7 ### 20 ###
8 ### General options 21 ### General options
9 ### 22 ###
10 23
13 # You can use * to match substrings or everything 26 # You can use * to match substrings or everything
14 set urllog_log_channels "*" 27 set urllog_log_channels "*"
15 28
16 # Channels where URLLog announces URL titles and so on 29 # Channels where URLLog announces URL titles and so on
17 # By default we set this to same as urllog_log_channels 30 # By default we set this to same as urllog_log_channels
18 set urllog_msg_channels $urllog_log_channels 31 set urllog_pub_channels $urllog_log_channels
32
33 # Channels where !urlfind and other commands can be used.
34 # By default this is set to be the same as urllog_log_channels
35 set urllog_search_channels $urllog_log_channels
19 36
20 37
21 # Filename of the SQLite URL database file 38 # Filename of the SQLite URL database file
22 set urllog_db_file "urllog.sqlite" 39 set urllog_db_file "urllog.sqlite"
23 40
34 51
35 ### Various additional checks for URL validity: (1 = enabled, 0 = disabled) 52 ### Various additional checks for URL validity: (1 = enabled, 0 = disabled)
36 ### This is REQUIRED for document title fetching/storage 53 ### This is REQUIRED for document title fetching/storage
37 set urllog_extra_checks 1 54 set urllog_extra_checks 1
38 55
56
39 ### Set to 1 if you want "strict" extra checking. This will cause 57 ### Set to 1 if you want "strict" extra checking. This will cause
40 ### ftp URLs not being added, and if TLS support is disabled, https URLs 58 ### ftp URLs not being added, and if TLS support is disabled, https URLs
41 ### will not be added either. You probably don't want this set. 59 ### will not be added either. You probably don't want this set.
42 set urllog_extra_strict 0 60 set urllog_extra_strict 0
43 61
48 66
49 67
50 ### 68 ###
51 ### Search related settings 69 ### Search related settings
52 ### 70 ###
53
54 # Channels where !urlfind and other commands can be used.
55 # By default this is set to be the same as urllog_log_channels
56 set urllog_search_channels $urllog_log_channels
57 71
58 # Limit how many URLs should the "!urlfind" command show at most. 72 # Limit how many URLs should the "!urlfind" command show at most.
59 set urllog_showmax_pub 3 73 set urllog_showmax_pub 3
60 74
61 # Same as above, but for private message search. 75 # Same as above, but for private message search.
78 92
79 # 1 = Enable showing of ShortURLs 93 # 1 = Enable showing of ShortURLs
80 # 0 = ShortURLs not shown in any bot actions 94 # 0 = ShortURLs not shown in any bot actions
81 set urllog_shorturl 1 95 set urllog_shorturl 1
82 96
83 # Max length of original URL to be shown, rest is chopped
84 # off if the URL is longer than the specified amount.
85 set urllog_shorturl_orig 30
86 97
87 # Web server URL that handles redirects of ShortURLs 98 # Web server URL that handles redirects of ShortURLs
88 set urllog_shorturl_prefix "https://tnsp.org/u/" 99 set urllog_shorturl_prefix "https://tnsp.org/u/"
89 100
90 101
109 120
110 121
111 ### 122 ###
112 ### Message texts (informal, errors, etc.) 123 ### Message texts (informal, errors, etc.)
113 ### 124 ###
125 # Max length of original URL to be shown, rest is chopped
126 # off if the URL is longer than the specified amount.
127 set urllog_shorturl_max_orig 35
114 128
115 # No such host was found 129 # Max length of title to be shown on search results
116 set urlmsg_nosuchhost "ei tommosta oo!" 130 set urllog_title_max 35
117
118 # Could not connect host (I/O errors etc)
119 set urlmsg_ioerror "kraak, virhe yhdynnässä."
120
121 # HTTP timeout occured
122 set urlmsg_timeout "ei jaksa ootella"
123
124 # No such document was found or other error
125 set urlmsg_errorgettingdoc "siitosvirhe"
126
127 # URL was already known (was in database)
128 set urlmsg_alreadyknown "wanha!"
129 #set urlmsg_alreadyknown "Empiiristen havaintojen perusteella ja tällä sovellutusalueella esiintyneisiin aikaisempiin kontekstuaalisiin ilmaisuihin viitaten uskallan todeta, että sovellukseen ilmoittamasi tietoverkko-osoite oli kronologisti ajatellen varsin postpresentuaalisesti sopimaton ja ennestään hyvin tunnettu."
130
131 # No match was found when searched with !urlfind or other command
132 set urlmsg_nomatch "Ei osumia."
133 131
134 132
133 array set urllog_messages {
134 "err_http_fail" "nyt meni vituix: @3@"
135
136 "err_http_get" "kraak, virhe yhdynnässä: @2@"
137
138 "err_http_status" "voi perse: @2@, @3@"
139
140 "err_url_local_net" "en tykkää #1."
141 "err_url_invalid_net" "en tykkää #2."
142 "err_url_proto_class" "en tykkää #3."
143 "err_url_proto_no_class" "en tykkää #4."
144 "err_url_invalid_port" "en tykkää #5."
145
146 "err_redirect_invalid" "paska redirecti @5@"
147 "err_redirect_fail" "redirekti @5@ feilasi: @1@ / @3@"
148
149 "err_charset" "yhyy, merkistö paske! @3@"
150
151 "url_added_short_has_title" "'@1@' (@4@) @5@"
152 "url_added_short_no_title" "@4@ @5@"
153
154 "url_added_long_has_title" "'@1@' (@4@)"
155 "url_added_long_no_title" "@3@"
156
157 "url_known_short" "wanha!"
158 "url_known_long" "wanha!"
159
160
161 "search_result_title" "'@2@' "
162 "search_result_no_title" ""
163
164 "search_result_short" "#@1@: @4@@5@ @6@ (@2@ @ @3@)"
165 "search_result_long" "#@1@: @4@@5@ (@2@ @ @3@)"
166
167 "search_no_match" "ei osumia."
168 }