Commit Graph

3200 Commits

Author SHA1 Message Date
Nina fa8e4a71e0 Print error message returned by before_alternc_add_member hook 2023-09-29 10:55:59 +02:00
Nina 0b5725cb86 Fix french message on file creation 2023-09-29 10:55:53 +02:00
Kienan Stewart 1f932fd5ec Issue #526: Fix dovecot quota warnings 2023-09-29 10:55:34 +02:00
Nina 5eac4b375d Restrict password reset requests to username 2023-09-29 10:54:19 +02:00
Kienan Stewart b4062026d9 Allow the help_baseurl to be configured via interface variables 2023-09-29 10:54:01 +02:00
Nina b61c69f007 Remove duplicated DB update to disable sub-domain 2023-09-29 10:53:45 +02:00
Nina 4832594a1e Fix sub-domains activation/deactivation 2023-09-29 10:53:31 +02:00
Kienan Stewart 63b19754b5 Set alterncpanel as group owner of mysql configuration on install
Fixes #504
2023-09-29 10:53:21 +02:00
Kienan Stewart a5d8d6d943 Remove alternc-squirrelmail
* close #502
* close #464
* close #316
2023-09-29 10:51:40 +02:00
Nina c5c087155a Use ORDER BY when querying for things to do on a subdomain in m_dom
close #496
2023-09-29 10:44:48 +02:00
Nina 8dc23ccf06 Add hook before account creation 2023-09-29 10:43:41 +02:00
Kienan Stewart 8b64c144b2 Improve feedback to users when protecting folder with htaccess
The current behaviour of protecting a folder only modifies adds the
relevant .htaccess configuration lines if the file doesn't already
exist. In the case that it exists, no change is made and it appears to
"not work" for users.

This commit improves the feedbackup to users about what is happening,
and gives them the necessary information to modify their custom
.htaccess file with the appropriate configuration lines.
2023-09-29 10:43:31 +02:00
Kienan Stewart da50b32d61 Add variable to control if DNS is enabled for free domains 2023-09-29 10:43:10 +02:00
Kienan Stewart 08bb4af74d Remove dovecot quota entries when mailboxes are truly deleted
Without this, when a mailbox is deleted, the entry in dovecot_quota
persists and the user's see the that the mailbox continues to take
space on the information page.
2023-09-29 10:42:36 +02:00
Kienan Stewart 504e77034f Use a single query to fetch database size
The procedure can use a single query instead of a 1 + N queries, where
N is the number of tables on the server.

There is a minor side-effect in the result: databases with no tables
will not be listed in the output. Before, they would be output but
with an empty size value.

close #452
2023-09-28 09:18:44 +02:00
Nina f56809fd8a Append changes instead of overriding
close #428
2023-09-28 09:16:41 +02:00
Nina 7e05910237 Adding compatibility between url domain type and MX records
Fix indentation
cf #428
2023-09-28 09:15:52 +02:00
Kienan Stewart 40fed101e3 Fixes #441: Correct DMARC entry syntax 2023-09-28 09:08:15 +02:00
Kienan Stewart 6a3af13817 Filter db information searches to limit results to databases owned by current user 2023-09-28 09:05:43 +02:00
Kienan Stewart 20db4fceba Do not re-create sub_domaines unique key compte
New installations haven't had this unique key since 2014
(d9e24d9703) and only old
installations passing through 3.1.0~a would have had it
added.

Given that the unique key constraint was never dropped during
an AlternC upgrade, I think it should just be dropped here.

Re-creating is problematic when merged with other recent changes
because the length of both the key and column size are longer
than what MySQL/MariaDB support.
2023-09-28 09:04:31 +02:00
Km cd123f99f0
Merge pull request #437 from AlternC/415-upgrade_notice
Fixes #415: Add upgrade notice when installing 3.5 if upgrading from a version less than 3.3.12
2023-09-28 09:03:30 +02:00
Kienan Stewart 8cabbc7e50 Fix SQL syntax error in 3.5.0.2.sql upgrade
Refs #435
2023-09-28 09:01:02 +02:00
Kienan Stewart 451ed4c369 Add confirmation to preinstallation to warn about data loss
Refs #415
2023-09-28 09:00:44 +02:00
Kienan Stewart ec143dda02 Update upgrade notice to mention passing through 3.3.12
Refs #415 #416
2023-09-28 09:00:22 +02:00
Kienan Stewart 16ff2ead31 Fix warning when a user has many scheduled tasks to run
When a user has more than m_cron::MAX_SOCKETS actions to run when the
cron script is invoked, it uses a rolling window while running the
batch execution in CURL. The followin warning happens because the
url key isn't being used when getting the information out of the array.
2023-09-28 08:58:44 +02:00
Kienan Stewart c53eda9b9e Limit incrond scripts to watching a specific file
When they both watch the same directory, when a file is touched - eg,
/run/alternc/incron/inotify_do_action.lock both scripts are started
running in children of the top-level /usr/sbin/incrond script. When
those scripts finish, one or the other tends to start watching for all
the incron tables again (created more and more children each time).

Maybe it's a bug in incron.

Test:
 * Check number of running processes with ps faux | grep incron
 * Do an action, eg. chmod a folder in the web interace
 * Re-check the number of running processes, they should stay the same
 not increase
2023-09-28 08:58:27 +02:00
Kienan Stewart d3b1051543 Fix typo in chown command 2023-09-28 08:58:10 +02:00
Kienan Stewart 7957deccba Normalize action return value recorded in database
While working on #424, I discovered that actions that were run were unable
to record their run state into the database because the return code value
being passed to m_action::finish was a string and not an integer.

I added a shim to try to normalize the data passed onwards to m_action::finish,
although in the long term I think a proper cleanup of the cases should be done.
2023-09-28 08:55:54 +02:00
Kienan Stewart 6dc3b0d5a3 Watch a different directory for incrond actions by default
This should help with #424 by switching the watched directories to a
sub-directory of /run/alternc. There are many other scripts create and
handle files in the /run/alternc that were causing incrond to start up
quite often.
2023-09-28 08:55:34 +02:00
Kienan Stewart ef21e3e144 Fix tabs/spacing 2023-09-28 08:53:09 +02:00
Guillaume Est Une Palourde a675041874 Set the disabled flag so its not permanently pending when disabling domains 2023-09-28 08:52:41 +02:00
Guillaume Est Une Palourde 36563f7298 Added a return value so query that sets the result and resets the action to OK don't crash 2023-09-28 08:52:18 +02:00
Kienan Stewart e028b15e7b Hide matomo users who have access to a site but not made by AlternC
Users made in the Matomo interface and given an access to a site
that's in AlternC show up without this restriction. When that happens,
the user is no longer able to modify permissions for any of the Matomo
users from their AlternC account.
2023-09-28 08:49:07 +02:00
Kienan Stewart c95dd63c26 Remove trailing whitespace 2023-09-28 08:48:39 +02:00
Kienan Stewart 95efdafd3d Modify bind9 apparmor profile on installation
If the apparmor configuration file is there, an extra include will be added
and the install/app/usr.sbin.named-alternc file deployed to the apparmor local
configuration directory.

This allows bind to work with AlternC and apparmor enabled out of the box on
Debian Buster.
2023-09-27 18:10:09 +02:00
Kienan Stewart e3a59dd504 Remove trailing '.' from the return values of m_dom::whois()
The answer from dig is typically fully qualified with a trailing '.',
but the callers of whois() expect the nameservers without that trailing dot.
2023-09-27 18:09:56 +02:00
Guillaume Est Une Palourde fc8ce3d487 Made it possible to update a subdomain from vhost https to vhost http 2023-09-27 18:09:37 +02:00
Kienan Stewart c59bdce1f3 Add hook to allow adding bind tokens 2023-09-27 18:08:38 +02:00
Kienan Stewart ba199de626 Remove maxlength specific from e-mail password and confirmation fields
Fixes #382

The maxlength attribute will silently drop all characters after the
indicated limit. Users will not have feedback that their password
is (now) wrong.

There seems to a password policy that is actively checked, and may be
defined by the admin (default: 64 character limit).
2023-09-27 18:07:11 +02:00
Kienan Stewart bbdd2c2a64 Update package requirements for Debian Buster / PHP 7.3
Note: PHPMyAdmin is not available in buster, but is a requirement for AlternC,
so that package will need to be sourced elsewhere.
2023-09-27 18:03:57 +02:00
Kienan Stewart 6e7f751dc5 Mark DKIM records for deletion instead of deleting immediately
Refs #349
2023-09-27 17:55:08 +02:00
Kienan Stewart 9cfc9f359b Handle TXT records longer than 255 characters properly
Refs #349
2023-09-27 17:49:31 +02:00
Kienan Stewart 4687bff96d Bump default DKIM key length to 2048
This matches the Debian default for opendkim-genkey

Refs #337
2023-08-30 12:31:43 +02:00
Kienan Stewart 7523d6bebf Delete the correct private DKIM key during DKIM deletion
Fixes #338
2023-08-30 12:30:53 +02:00
Kienan Stewart a00f4b0d5f Check if domain is being deleted before adding DKIM key entry
Fixes #338
2023-08-30 12:30:23 +02:00
Km 72d0a8e47e
Merge pull request #342 from Koumbit/339_bind_conf_with_multiple_domains
Filter generated bind configuration by current domain
2023-08-30 12:27:44 +02:00
Km d02593e45e
Merge pull request #322 from Koumbit/341-order_enum_domain_mails
Order enumerated mails for a domain by ascending alphabetic order
2023-08-30 12:22:07 +02:00
Kienan Stewart 43d97f1c57 Order enumerated mails for a domain by ascending alphabetic order
Fixes #341

When applying LIMIT X, Y the ordering before the limit and offset do
not seem to be guaranteed. For example, if you have a large number of
e-mail addresses, and you page between the same e-mail address can appear twice.

The case where this was happening there were 2-3 mail boxes and ~90 aliases.

I'm not sure if this tied somehow to the database version used, but making the
desired ordering explicit ensures that all mails will eventually be shown and
shouldn't be shown twice.
2023-08-30 12:17:50 +02:00
Km c80814c4eb
Merge pull request #307 from Koumbit/102-password_recovery
Issue #102: Add password reset via one-time login link
2023-08-30 12:15:45 +02:00
Kienan Stewart afafb3e4f6 Fix script invocation when scanning a directory
Since the directory was not preprended to the filenames, no scripts
could ever be called.
2023-08-30 12:08:30 +02:00