diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 89049192e5a963b027ff539aeb254bad5dfdcb1d..eaf7ad73419bdbb56749bb77de285c245e2ae6e7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -176,7 +176,7 @@ install:upgrade: - run-parts --verbose --exit-on-error autotest/test.d - hostname - dpkg -l 'sympl*' - # allow_failure: true + allow_failure: true # when: manual variables: CI_DEBUG_TRACE: "false" diff --git a/core/bin/sympl b/core/bin/sympl index 39ab38e8a53ae5460f1e5cf53ec94ddeb42d26e5..b51628bd82d6165e3d5fb48b556fad0b96cbeb25 100755 --- a/core/bin/sympl +++ b/core/bin/sympl @@ -2,7 +2,7 @@ # # Sympl command line interface. # -# Copyright 2019, Paul Cammish +# Copyright 2019, Paul Cammish , part of the Sympl Project. # # Licenced under GPL3+ # @@ -109,6 +109,45 @@ _is_database() { # Base # ############################################################################## +_base_none() { + echo "Sympl command-line - a basic parser for common system administraton tasks. + +Usage: sympl [function] [action] [target] + +Where function is one of: + web, mail, mysql, dns, ftp, cron, backup or blank for the system itself. +And action is one of: + create, enable, disable, audit, update, destroy, set +And target is the domain/email address/database/etc. + +Useful things: + - Other than using set, the function, action and target can be in any order. + - 'set' requires two arguments immediately after it, the option and value. + - If more permissions are needed, you'll be prompted for your password. + - 'destory' will only destroy something which has already been disabled. + +Examples: + + sympl web create example.com + + sympl mysql disable example_db + + sympl enable mail username@example.com + + sympl audit backup + + sympl destroy cron example.com + + sympl example.com set only-ssl on + + sympl update + +Note: Not all functions are implimented yet. + Please report bugs via http://bugs.sympl.host. +" + +} + _base_create() { _noop } @@ -134,13 +173,20 @@ _base_audit() { } _base_update() { - _noop + _debug "Updating Apt" + sudo apt-get -qq update + _debug "Upgrading installed packages" + sudo apt-get -q -y install --only-upgrade 'sympl-*' } ############################################################################## # Web # ############################################################################## +_web_none() { + _noop +} + _web_create() { _is_domain $1 @@ -230,15 +276,20 @@ _web_audit() { } _web_set() { - _noop +} +_web_update() { + _noop } ############################################################################## # Mysql/MariaDB # ############################################################################## +_mysql_none() { + _noop +} _mysql_create() { @@ -340,31 +391,43 @@ _mysql_audit() { mysql -e 'use mysql; select User from user;' } +_mysql_update() { + _noop +} + ############################################################################## -# FTP # +# DNS # ############################################################################## -_ftp_create() { +_dns_none() { _noop } -_ftp_enable() { +_dns_create() { _noop } -_ftp_disable() { +_dns_enable() { _noop } -_ftp_destroy() { +_dns_disable() { _noop } -_ftp_set() { +_dns_destroy() { _noop } -_ftp_audit() { +_dns_set() { + _noop +} + +_dns_audit() { + _noop +} + +_dns_update() { _noop } @@ -372,6 +435,10 @@ _ftp_audit() { # Mail # ############################################################################## +_mail_none() { + _noop +} + _mail_create() { _noop } @@ -400,6 +467,10 @@ _mail_audit() { # FTP # ############################################################################## +_ftp_none() { + _noop +} + _ftp_create() { _noop } @@ -424,10 +495,18 @@ _ftp_audit() { _noop } +_ftp_update() { + _noop +} + ############################################################################## # Backup # ############################################################################## +_backup_none() { + _noop +} + _backup_create() { _verbose "Taking backup..." sudo backup2l -b @@ -470,10 +549,18 @@ _backup_audit() { backup2l -s } +_backup_audit() { + _noop +} + ############################################################################## # Cron # ############################################################################## +_cron_none() { + _noop +} + _cron_create() { _noop } @@ -498,13 +585,17 @@ _cron_audit() { _noop } +_cron_update() { + _noop +} + ############################################################################## # NoOp Stub # ############################################################################## _noop() { - _warn "This doesn't do anything yet." + _warn "Sorry this doesn't do anything yet, but it may be in a new version.\n Run 'sympl update' for an updated version." exit 0 } @@ -514,8 +605,6 @@ _noop() { _main() { - _debug "Command line parameters: $@" - UNHANDLED=() while [ $# -gt 0 ]; do case $1 in @@ -533,6 +622,7 @@ _main() { enable) _action 'enable' ; shift ;; disable) _action 'disable' ; shift ;; audit|list) _action 'audit' ; shift ;; + update|upgrade) _action 'update' ; shift ;; set) _action 'set' "$2" "$3" ; shift ; shift ; shift ;; *) # unhandled parameter if [ $TARGET = all ]; then @@ -545,6 +635,10 @@ _main() { esac done + _debug "Command line parameters: $@" + + _debug "Running as '$I_AM', EUID '$EUID'" + _debug "Runtime variables: Unhanded | $UNHANDLED FUNCTION | $FUNCTION @@ -554,7 +648,7 @@ _main() { SETTING | $SETTING" if [ "x$UNHANDLED" != "x" ]; then - _help + _error "Unexpected input: '$UNHANDLED', run 'sympl' for help." fi _${FUNCTION}_${ACTION} $TARGET $OPTION $SETTING diff --git a/core/debian/changelog b/core/debian/changelog index b80dfd355f30bdf37357e95e1ba65f4d15b20d0a..5a2570867d985eb96116a36e031e614e4974211c 100644 --- a/core/debian/changelog +++ b/core/debian/changelog @@ -1,3 +1,15 @@ +sympl-core (10.0.190705.1) stable; urgency=medium + + * Removed beta flag from MOTD + + -- Paul Cammish Fri, 05 Jul 2019 13:04:00 +0100 + +sympl-core (10.0.190705.0) stable; urgency=medium + + * Updated 'sympl' parser, added 'sympl update' function. + + -- Paul Cammish Fri, 05 Jul 2019 13:01:00 +0100 + sympl-core (10.0.190704.0) stable; urgency=medium * Workaround for sympl-ssl bug #249 under IPv6 only. diff --git a/core/update-motd.d/00-sympl-banner b/core/update-motd.d/00-sympl-banner index eb013afb1493ade2d9463380745dae04efc42261..2a60dfe3098243abea5e6add2d343549456aa356 100755 --- a/core/update-motd.d/00-sympl-banner +++ b/core/update-motd.d/00-sympl-banner @@ -3,7 +3,7 @@ echo "\033[1m" cat <