Commit Graph

89 Commits

Author SHA1 Message Date
Ludovic Poujol 0cb7c54855 Vagrantfile: Add a symlink to /usr/share/scripts/evoadmin, to ensure the latests scripts are used 2019-02-28 15:40:16 +01:00
Ludovic Poujol 3a19d14e3a Introducing a Vagrantfile for testing \o 2019-02-28 13:55:47 +01:00
Ludovic Poujol ead51deca6 Honor the request scheme when redirecting the user 2019-02-28 13:53:00 +01:00
Gregory Colpart 2125055409 Fix when multiples SetHandler lines in VHOST file 2019-02-21 02:31:04 +01:00
Victor LABORIE 6ba1fbcb6e Evoadmin-web is now under AGPLv3 license 2018-12-20 11:47:24 +01:00
Patrick Marchand ea359880cc New check-vhosts command for web-add.sh
Checks whether the enabled vhosts are all symbolic links, also offers the -f flag to fix any problems automatically.
2018-12-13 23:29:06 +01:00
Patrick Marchand 21f5f011da Fixed mistake with getopts(1) in web-add.sh 2018-12-13 13:21:13 -05:00
Ludovic Poujol cc08313e1f Do not display evoadmin in the ftp account creation form 2018-12-11 16:09:08 +01:00
Ludovic Poujol 8429351213 Do not list evoadmin in the vhost list
Fixes #34
2018-12-11 15:30:06 +01:00
Patrick Marchand c135807010 Changed API for web-add.sh fix-vhosts
check-vhosts now only applies changes when it is passed the -f flag,
otherwise it simply lists the suggested fixes.
2018-12-04 11:25:45 -05:00
Patrick Marchand 53335ee4ef Apply first and third benpro review of web-add fix command
Simplify sed(1) command by getting rid of echo(1)

Use a2ensite(1) instead of ln(1) to link vhosts.
2018-11-29 18:42:20 +01:00
Patrick Marchand 5fe9762c53 Inverse userdel(1) calls in scripts/web-add.sh
When a user has the same name as his primary group, userdel(1) tries
to remove it as well, but stops and prints an error message if that
group is being used by any other users as their primary group. By
deleting the www user first, the group is properly deleted. This
means we can get rid of the subsequent call to groupdel(1).

Tested by adding / removing a vhost on my testing vm.
2018-11-29 18:35:17 +01:00
Patrick Marchand 547235ea7e Audited scripts/stats.sh
Shellcheck pass and code cleanup.

Set stricter error handling with sh options.

Removes the for loop and cat(1) in favor of directly calling the
file with cut(1) and piping the output to a while read loop. Read
https://github.com/koalaman/shellcheck/wiki/SC2002 for more info.

Adds proper variable globbing.

Removes the large block of commented code, if this turns out to be
necessary, we can add a condition check to the script instead of
uncommenting on a per case basis.
2018-11-29 17:25:13 +01:00
Patrick Marchand cade94a7bc Merge of README.md and forge wiki 2018-11-26 17:35:46 +01:00
Patrick Marchand b693075f39 Adds command to fix vhost linking problems in web-add.sh
Some people forget to use the --follow-symlinks flag with sed(1),
thus not carrying changes over to /etc/apache2/sites-available.

This new command makes sure all vhosts in /etc/apache2/sites-enabled
are symlinks. It assumes that we always want to overwrite the file in
/etc/apache2/sites-available with the file in /etc/apache2/sites-enabled.
2018-11-22 20:15:06 +01:00
Patrick Marchand d64cfa4e8b Fix problems with web-add.sh add-alias
All uses of the VHOST_PATH variable in the code append a slash to
it, so it is easier to remove the trailing slash in it's instantiation.

Also simplifies the sed(1) invocation.
2018-11-22 20:14:05 +01:00
Patrick Marchand a06f31e80a Merge branch 'shellcheck-ftpadmin' of evolix/evoadmin-web into master 2018-11-13 15:37:21 +01:00
Patrick Marchand 393851d4c6 Removed unecessary argument in ftpadmin.php delete
It caused errors because it wasnt set in some cases, but was never
even checked by the invoked shell script.
2018-11-09 17:50:25 -05:00
Patrick Marchand d3be332ba4 Shellcheck on delete_account in ftpadmin
Removed useless echo and added variable quoting.
2018-11-09 17:48:35 -05:00
Patrick Marchand 58642ec0ac Made ftpadmin more usable from the commandline
Adds more portable bash invocation.

Adds more severe bash evaluation.

Added h flag and made improper use print the usage function.

Added checks that make sure the parameters are okay.

Proper variable quoting, tests and $() use.
2018-11-09 17:45:01 -05:00
Patrick Marchand 2ab5a60906 Shellcheck pass on edit_password in ftpadmin
Removed useless echo and used proper variable quoting.
2018-11-09 17:42:47 -05:00
Patrick Marchand 66c2c8ab35 Shellcheck pass on add_account in ftpadmin
Simple variable quoting and more modern shell constructs.
2018-11-09 17:41:32 -05:00
Patrick Marchand e97ddd8be0 Simplification of list_account_by_UID in ftpadmin
Setting / unsetting IFS variables can be removed by setting it only
in the loop context.

The for cat can be replaced by a simpler while read loop.

Proper variable quoting was added.

Changed the way modif was optionally passed, this removes the
extraneous ':' at the end.

echo(1) the lines as we go instead of building an array, this removes
the possibility of sub-shell screwups.
2018-11-09 17:33:44 -05:00
Patrick Marchand e3a50177c8 Cleanup get_user_login_by_UID() in ftpadmin.sh
Adds proper variable quoting
2018-11-07 17:27:03 -05:00
Patrick Marchand 1e82272487 Clean log_msg() in ftpadmin.sh
Made the code a bit cleaner and added proper variable quoting.
2018-11-07 17:25:12 -05:00
Benoît S. 872f1532d5 Merge branch 'shellcheck-web-add' of evolix/evoadmin-web into master 2018-11-07 15:44:47 +01:00
Patrick Marchand 08ef18bc2d Use ${var:+...} instead of [-n ] and "$@" instead of "$*"
Fixes issue uncovered by proper use of double quotes.
2018-10-25 11:37:21 -04:00
Patrick Marchand 540b7f7278 Use ${var:+...} instead of [-n ] and "$@" instead of "$*"
Fixes issue uncovered by proper use of double quotes
2018-10-17 16:30:58 -04:00
Patrick Marchand e596e3d520 Use $(..) instead of legacy `..`
https://github.com/koalaman/shellcheck/wiki/SC2006
modified:   scripts/web-add.sh
2018-10-16 14:51:50 -04:00
Patrick Marchand 97bad77040 Add -r to read
I'm less certain about the necessity of this, but if it doesnt cause
problems, I dont see why not.
https://github.com/koalaman/shellcheck/wiki/SC2162
modified:   scripts/web-add.sh
2018-10-16 14:49:43 -04:00
Patrick Marchand 05c9525d7e $/${} is unnecessary on arithmetic variables
https://github.com/koalaman/shellcheck/wiki/SC2004
modified:   scripts/web-add.sh
2018-10-16 14:46:16 -04:00
Patrick Marchand f4fae90eb1 Useless cat
https://github.com/koalaman/shellcheck/wiki/SC2002
modified:   scripts/web-add.sh
2018-10-16 14:43:26 -04:00
Patrick Marchand 5d2d8be5ad Prefer explicit escaping
https://github.com/koalaman/shellcheck/wiki/SC1117
modified:   scripts/web-add.sh
2018-10-16 14:39:23 -04:00
Patrick Marchand 2861d90119 Fixes optional group creation
The optional group creation flag in scripts/web-add.sh was never used.
2018-10-16 14:35:23 -04:00
Patrick Marchand 4aa0332639 Use "$@" (with quotes) to prevent whitespace problems
https://github.com/koalaman/shellcheck/wiki/SC2048
modified:   web-add.sh
2018-10-16 14:32:47 -04:00
Patrick Marchand 866f20ef47 Adds double quoting to prevent shell globing
modified:   web-add.sh
2018-10-16 14:28:27 -04:00
Patrick Marchand 3e422bc2bf Adds shellcheck source comments
This will allow someone to use shellcheck(1) to automatically check
any referenced code using `shellcheck -x scripts/web-add.sh`
2018-10-16 14:10:02 -04:00
Benoît S. 2125523cd8 Update suite utilisation en prod 2018-09-06 14:53:41 +02:00
Benoît S. 45ce021a5c For Stretch the awstats Include has changed 2018-06-13 15:22:07 +02:00
Victor LABORIE 353d41a8a6 web_add with php_versions need global var "conf" 2018-05-31 16:38:34 +02:00
Jérémy Lecour 25d9f7e7d4 web-add: use group "evolinux-ssh 2018-04-20 11:20:06 +02:00
Jérémy Lecour 637e72743a web-add.sh: whitespaces 2018-04-19 23:02:15 +02:00
Jérémy Lecour 99ee37b408 web-add.sh: use AllowGroups or AllowUsers as needed 2018-04-19 23:02:15 +02:00
Victor LABORIE 9ff6846c36 Fix indentation for .my.cnf 2017-10-17 10:44:58 +02:00
Ludovic Poujol 580ff1307e Add robots.txt 2017-10-16 11:53:45 +02:00
Gregory Colpart 00e15b32d7 add default_charset exemple in vhost template 2017-09-12 20:15:48 +02:00
Gregory Colpart aaf2316fa5 bye bye php.log 2017-09-08 03:53:53 +02:00
Gregory Colpart 75c341fed9 bye bye pam_auth() 2017-09-08 03:53:42 +02:00
Romain Dessort 882c464405 Fix od_del() when containers are not used 2017-09-07 11:29:31 -04:00
Gregory Colpart 7e804984d1 add gitgnore for local conf 2017-09-01 03:37:39 +02:00