Skip to content

Commit

Permalink
Merge branch 'main' into issue-1688
Browse files Browse the repository at this point in the history
  • Loading branch information
ikedas committed Jun 22, 2023
2 parents 9a12e74 + 9bd1a14 commit 40feaa4
Show file tree
Hide file tree
Showing 35 changed files with 182 additions and 146 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/submit-pr-for-release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

env:
GH_PR_BODY: 'This pull request is a workplace for editing release notes `NEWS.md`.'
GH_PR_LABEL: on going,ignore-for-release
GH_PR_LABEL: ready,ignore-for-release
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/submit-pr-for-translation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
env:
GH_PR_TITLE: Update translation
GH_PR_BODY: This pull request was automatically submitted.
GH_PR_LABEL: translation,on going,ignore-for-release
GH_PR_LABEL: translation,ready,ignore-for-release
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
Expand Down
3 changes: 3 additions & 0 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ requires 'Text::LineFold', '>= 2018.012';
# Used to get time with sub-second precision
requires 'Time::HiRes', '>= 1.29';

# Used to get Unix time from local time
requires 'Time::Local', '>= 1.23';

# Used to create URI containing non URI-canonical characters.
# Note: '3.28' is the version included in URI-1.35.
requires 'URI::Escape', '>= 3.28';
Expand Down
14 changes: 10 additions & 4 deletions default/mail_tt2/report.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,6 @@
[%~ ELSIF report_entry == 'auth_msg_failed' ~%]
[%|loc(report_param.key)%]Unable to access the message authenticated with key %1[%END%]

[%~ ELSIF report_entry == 'no_identified_user' ~%]
[%|loc%]Failed to get your email address from the authentication service.[%END%]

[%~ ELSIF report_entry == 'db_error' ~%]
[%|loc%]Database error.[%END%]

Expand Down Expand Up @@ -334,7 +331,13 @@
[%~ END %]

[%~ ELSIF report_entry == 'add_performed' ~%]
[%|loc(report_param.total)%]%1 subscribers added[%END%]
[% IF report_param.role == 'owner' ~%]
[%|loc(report_param.total)%]%1 owners added[%END%]
[%~ ELSIF report_param.role == 'editor' ~%]
[%|loc(report_param.total)%]%1 moderators added[%END%]
[%~ ELSE ~%]
[%|loc(report_param.total)%]%1 subscribers added[%END%]
[%~ END %]

[%~ ELSIF report_entry == 'updated_info' ~%]
[%|loc(report_param.email,report_param.listname)%]Information regarding user %1 has been updated for list %2.[%END%]
Expand Down Expand Up @@ -955,6 +958,9 @@ Warning: this message may already have been sent by one of the list's moderators
[%~ ELSIF report_entry == 'cannot_get_privilege' ~%]
[%|loc()%]You are not allowed to get the privilege of this user.[%END%]

[%~ ELSIF report_entry == 'no_identified_user' ~%]
[%|loc%]Failed to get your email address from the authentication service.[%END%]

[%~ END ~%]

[%~ END ~%]
2 changes: 1 addition & 1 deletion default/scenari/send.publickey
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title.gettext anyone no authentication if DKIM signature is OK
title.gettext need authentication

true() smtp -> request_auth
true() md5,smime -> do_it
16 changes: 12 additions & 4 deletions default/web_tt2/nav.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@
<li class="[% class %]">
<a href="[% 'serveradmin/archives' | url_rel %]">[%|loc%]Archives[%END%]</a>
</li>
[% IF subaction == 'logs' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]">
<a href="[% 'serveradmin/logs' | url_rel %]">[%|loc%]System log[%END%]</a>
</li>
[% IF subaction == 'templates' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]">
<a href="[% 'serveradmin/templates' | url_rel %]">[%|loc%]Templates[%END%]</a>
Expand Down Expand Up @@ -133,6 +129,18 @@
<a href="[% 'serveradmin/families' | url_rel %]">[%|loc%]Families[%END%]</a>
</li>
[% END %]

[% IF subaction == 'stats' %]
[% SET class = 'active' %]
[% ELSE %]
[% SET class = '' %]
[% END %]
<li class="[% class %]">
<a href="[% 'serveradmin/stats' | url_rel %]">
[%|loc%]Statistics[%END%]
</a>
</li>

[% IF subaction == 'translation' %]
[% SET class = 'active' %]
[% ELSE %]
Expand Down
39 changes: 9 additions & 30 deletions default/web_tt2/serveradmin.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -160,28 +160,6 @@
</form>
[% END %]

[% IF subaction == 'logs' %]
<h2>[%|loc%]System log[%END%]</h2>
<h3>[%|loc%]Sympa log level[%END%]</h3>
<p>[%|loc%]Set debug level for logs written to disk. This setting is temporary, applying only for the lifetime of the fastcgi session hosting this interface.[%END%]</p>
<form class="bold_label" action="[% path_cgi %]" method="post">
<fieldset>
[%|loc%]Log level:[%END%]
<input id="log_level_0" type="radio" name="log_level" value="0" [%IF log_level == 0 %]checked="checked"[%END%]/>
<label class="inlineLabel" for="log_level_0">0 </label>
<input id="log_level_1" type="radio" name="log_level" value="1" [%IF log_level == 1 %]checked="checked"[%END%]/>
<label class="inlineLabel" for="log_level_1">1 </label>
<input id="log_level_2" type="radio" name="log_level" value="2" [%IF log_level == 2 %]checked="checked"[%END%]/>
<label class="inlineLabel" for="log_level_2">2 </label>
<input id="log_level_3" type="radio" name="log_level" value="3" [%IF log_level == 3 %]checked="checked"[%END%]/>
<label class="inlineLabel" for="log_level_3">3 </label>
<input id="log_level_4" type="radio" name="log_level" value="4" [%IF log_level == 4 %]checked="checked"[%END%]/>
<label class="inlineLabel" for="log_level_4">4 </label>
<input type="submit" name="action_set_loglevel" value="[%|loc%]Set log level[%END%]" />
</fieldset>
</form>
[% END %]

[% IF subaction == 'templates' %]
<h2>[%|loc%]Templates[%END%]</h2>
<form class="bold_label" action="[% path_cgi %]" method="post">
Expand Down Expand Up @@ -277,6 +255,15 @@
[% close_table %]
</div>
[% END %]

[% IF subaction == 'stats' ~%]
<h2>[%|loc(domain)%]Virtual domain %1 statistics[%END%]</h2>
<p>[%|loc%]This page displays overall information regarding the activity on this virtual domain.[%END%]</p>
<div class="columns">
[% PROCESS stats.tt2 %]
</div>
[%~ END %]

[% IF subaction == 'translation' %]
<h2>[%|loc%]Translating Sympa[%END%]</h2>
<p>[%|loc%]Sympa is designed to allow easy internationalization of its user interface (service email messages and web interface). All translations for a language are gathered into a single PO file that can be manipulated by the standard GNU gettext tools.[%END%]</p>
Expand All @@ -288,12 +275,4 @@
<p>[%|loc%]You can submit a problem or request a new feature: [%END%]<a href="https://github.com/sympa-community/sympa/issues/new/choose">https://github.com/sympa-community/sympa/issues/new/choose</a></p>
[% END %]


[% IF subaction == 'logs' %]
[% IF loop_count %]
<p class="bottom_page">
[%|loc(process_id,loop_count,start_time)%]This FastCGI process (%1) has served %2 pages since %3.[%END%]
</p>
[% END %]
[% END %]
<!-- end serveradmin.tt2 (distrib) -->
9 changes: 7 additions & 2 deletions default/web_tt2/stats.tt2
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<!-- stats.tt2 -->
<h3>[%|loc(listname)%]List %1 statistics[%END%]</h3>
[% IF listconf ~%]
<h3>[%|loc(listname)%]List %1 statistics[%END%]</h3>

<p>[%|loc%]This page displays overall information regarding the list activity[%END%]</p>
<p>[%|loc%]This page displays overall information regarding the list activity[%END%]</p>

<p>
<strong>[%|loc(shared_size)%]Shared document directory size: %1 kB[%END%]</strong><br />
<strong>[%|loc(arc_size)%]Web archives size: %1 kB[%END%]</strong>
</p>
[%~ END %]

[% FOREACH stat_id IN [ 'send_mail', 'add_or_subscribe', 'signoff', 'del', 'auto_del' ] ~%]
[% SET o = stats.$stat_id ~%]
Expand Down Expand Up @@ -37,6 +39,9 @@
}
},
yaxis: {
[% IF o.max_value && o.max_value < 10 ~%]
ticks: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
[% END ~%]
tickOptions: {
angle: 0,
formatString: '%d'
Expand Down
4 changes: 2 additions & 2 deletions doc/auth.conf.pod
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,8 @@ paragraph may also be used for C<generic_sso>.
Note that Sympa will act as a CAS client to validate CAS tickets. During this
exchange, Sympa will check the CAS server X.509 certificate. Therefore you
should ensure that the certificate authority of the CAS server is known by
Sympa ; this should be configured through the L<cafile|sympa.conf(5)/cafile>
or L<capath|sympa.conf(5)/capath> F<sympa.conf> configuration parameters.
Sympa ; this should be configured through the L<cafile|sympa_config(5)/cafile>
or L<C<capath>|sympa_config(5)/capath> F<sympa.conf> configuration parameter.

=over

Expand Down
7 changes: 4 additions & 3 deletions doc/charset.conf.pod
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ directory:

# cp $DEFAULTDIR/charset.conf $SYSCONFDIR/charset.conf

And set the C<legacy_character_support_feature> parameter value in
L<F<sympa.conf>|sympa.conf(5)> to C<on>.
And set the
L<C<legacy_character_support_feature>|sympa_config(5)/legacy_character_support_feature>
parameter value in F<sympa.conf> to C<on>.

=head2 Note

Expand All @@ -42,7 +43,7 @@ Configuration file.

=head1 SEE ALSO

L<sympa.conf(5)>.
L<sympa_config(5)>.

=head1 HISTORY

Expand Down
2 changes: 1 addition & 1 deletion doc/ldap_alias_manager.conf.pod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ldap_alias_manager.conf - Configuration of LDAP alias management
F<ldap_alias_manager.conf> is used by the L<ldap_alias_manager(8)>;
it allows one to manage mail aliases in an LDAP directory.
To make sympa use the ldap_alias_manager.pl script, you should edit the
'alias_manager' L<sympa.conf(5)> parameter.
L<C<alias_manager>|sympa_config(5)/alias_manager> F<sympa.conf> parameter.

Format of F<ldap_alias_manager.conf> is as following:

Expand Down
2 changes: 1 addition & 1 deletion doc/nrcpt_by_domain.conf.pod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Configuration file.
=head1 SEE ALSO

L<bulk(8)>,
L<sympa.conf(5)>.
L<sympa_config(5)>.

=head1 HISTORY

Expand Down
9 changes: 6 additions & 3 deletions doc/sympa_config.podpl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ sub _render_paragraph {
#$parameters .= "=over\n\n" x (scalar @$pnames);

if ($pii->{obsolete}) {
_render_obsolete($pii);
_render_obsolete($pii, $ppi);
} elsif ($pii->{occurrence} =~ /n$/ and ref $pii->{format} eq 'ARRAY')
{
_render_set($pii, $ppi);
Expand Down Expand Up @@ -213,14 +213,17 @@ sub _render_scalar {

sub _render_obsolete {
my $pii = shift;
my $ppi = shift;

return unless $pii->{obsolete};

if ($pii->{obsolete} eq '1') {
$parameters .= "Deprecated.\n\n";
} else {
$parameters .= sprintf "See L<C<%s>|/%s>.\n\n",
$pii->{obsolete}, $pii->{obsolete};
my @parag = @$ppi;
pop @parag;
my $param = join '.', @parag, $pii->{obsolete};
$parameters .= sprintf "See L<C<%s>|/%s>.\n\n", $param, $param;
}
$parameters .= "=over\n\n";
_context($pii);
Expand Down
8 changes: 4 additions & 4 deletions doc/sympa_scenario.pod
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,6 @@ If it is not given, 'C<nobody>' will be set.
Default method.
No actual authentication, and if any, sender of the message is used.

=item C<dkim>

Authenticated by DKIM signature.

=item C<md5>

Authenticated by web authentication (password),
Expand All @@ -235,6 +231,10 @@ or TLS client certificate.

=back

Note:
The C<dkim> authentication method for scenarios was obsoleted
on Sympa 6.2.71b.1. Now it is a synonym of C<smtp> method.

=head3 Actions

An action consists of an action name and optional modifiers.
Expand Down
36 changes: 15 additions & 21 deletions src/cgi/wwsympa.fcgi.in
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ our %comm = (
'arc_download' => 'do_arc_download',
'arc_delete' => 'do_arc_delete',
'serveradmin' => 'do_serveradmin',
'set_loglevel' => 'do_set_loglevel',
'set_dumpvars' => 'do_set_dumpvars',
'show_sessions' => 'do_show_sessions',
'unset_dumpvars' => 'do_unset_dumpvars',
Expand Down Expand Up @@ -708,7 +707,6 @@ our %required_privileges = (
'search_user' => ['listmaster'],
'serveradmin' => ['listmaster'],
'set_dumpvars' => ['listmaster'],
'set_loglevel' => ['listmaster'],
'set_pending_list_request' => ['listmaster'],
'set_session_email' => ['listmaster'],
'show_sessions' => ['listmaster'],
Expand Down Expand Up @@ -804,7 +802,6 @@ my %action_type = (
'show_exclude' => 'admin',
'rebuildarc' => 'serveradmin',
'set_session_email' => 'serveradmin',
'set_loglevel' => 'serveradmin',
'editfile' => 'serveradmin', #FIXME: admin?
'unset_dumpvars' => 'serveradmin',
'set_dumpvars' => 'serveradmin',
Expand Down Expand Up @@ -1049,11 +1046,7 @@ $log->syslog('info', 'WWSympa started, process %d', $PID);
#XXXbinmode STDIN, ":utf8";

# Main loop.
my $loop_count = 0;
my $start_time = time;
while ($query = Sympa::WWW::FastCGI->new) {
$loop_count++;

undef $param;
undef $list;
undef $robot;
Expand Down Expand Up @@ -2758,12 +2751,6 @@ sub check_param_in {
sub check_param_out {
wwslog('debug2', '');

$param->{'loop_count'} = $loop_count;
$param->{'start_time'} =
$language->gettext_strftime("%d %b %Y at %H:%M:%S",
localtime $start_time);
$param->{'process_id'} = $PID;

# listmaster has owner and editor privileges for the list.
$param->{'is_listmaster'} =
Sympa::is_listmaster($robot, $param->{'user'}{'email'}) ? 1 : undef;
Expand Down Expand Up @@ -3623,7 +3610,7 @@ sub do_sso_login {
}

unless ($email) {
add_stash('intern', 'no_identified_user');
add_stash('user', 'no_identified_user');
wwslog(
'err',
'User could not be identified, no %s HTTP header set',
Expand Down Expand Up @@ -5977,6 +5964,9 @@ sub do_serveradmin {

## Checking families and other virtual hosts.
get_server_details();
if ($in{'subaction'} eq 'stats') {
_get_stats();
}

## Server files
foreach my $f (
Expand Down Expand Up @@ -6043,12 +6033,8 @@ sub do_edit_config {
}

## Change log_level for the current session
sub do_set_loglevel {
wwslog('info', '');

$session->{'log_level'} = $in{'log_level'};
return 'serveradmin';
}
# Deprecated.
#sub do_set_loglevel;

## activate dump var feature
sub do_set_dumpvars {
Expand Down Expand Up @@ -15125,6 +15111,12 @@ sub do_stats {
$param->{'arc_size'} =
int((Sympa::Archive->new(context => $list)->get_size + 512) / 1024);

return _get_stats();
}

sub _get_stats {
my $that = (ref $list eq 'Sympa::List') ? $list : $robot;

my $stats = {
send_mail => {title => $language->gettext("Mail sending")},
add_or_subscribe =>
Expand All @@ -15139,7 +15131,7 @@ sub do_stats {
};

foreach my $operation (keys %$stats) {
my $data = $log->aggregate_daily_data($list, $operation);
my $data = $log->aggregate_daily_data($that, $operation);
if (%{$data || {}}) {
$stats->{$operation}{'stats_values'} = '[' . join(
',',
Expand All @@ -15150,6 +15142,8 @@ sub do_stats {
sprintf "['%s',%d]", $formatted_date, $data->{$_}
} sort keys %$data
) . ']';
$stats->{$operation}{'max_value'} =
[sort { $b <=> $a } values %$data]->[0];
}
}
$param->{'stats'} = $stats;
Expand Down
Loading

0 comments on commit 40feaa4

Please sign in to comment.