Compare commits

...

224 Commits

Author SHA1 Message Date
CyberShell 62ac2934dc v0.12.1
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline was successful
ci/woodpecker/push/go-lint Pipeline failed
2026-03-23 11:30:32 -05:00
CyberShell c078632691 remove shell history boolean
ci/woodpecker/push/publish-docs Pipeline was successful
2026-02-14 18:57:37 -06:00
CyberShell 52e25aad77 v0.12.0
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline was successful
2026-02-11 13:18:46 -06:00
CyberShell 9f996f60c6 internal logic handling for cron webserver 2026-02-11 13:18:06 -06:00
CyberShell 4c152f8089 internal logic handling for cron webserver 2026-02-11 13:17:15 -06:00
CyberShell 4d2e4ce533 v0.11.5
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline was successful
2026-02-10 12:01:11 -06:00
CyberShell 9e3960ce9f Command.Type: scriptFile no longer requests psudoterminal
ci/woodpecker/push/go-lint Pipeline failed
2026-02-10 12:00:08 -06:00
CyberShell b2d89352a3 v0.11.4
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline was successful
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
2026-02-01 07:21:20 -06:00
CyberShell 765ef2ee36 v0.11.3
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline was successful
2026-01-31 01:06:18 -06:00
CyberShell 995e4f91b5 update docs
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline was successful
2025-12-27 00:59:57 -06:00
CyberShell fa62bc1ec6 v0.11.2
ci/woodpecker/push/publish-docs Pipeline failed
2025-12-27 00:45:54 -06:00
CyberShell 2766ac997a update CI Configs
ci/woodpecker/push/go-lint Pipeline failed
2025-12-27 00:03:39 -06:00
CyberShell d0b4c0b9df update CI Configs
ci/woodpecker/push/go-lint Pipeline failed
2025-12-26 23:55:13 -06:00
CyberShell beabe9f041 Upgraded GoCron; web ui viewer for viewing cron jobs
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
2025-12-26 23:04:25 -06:00
CyberShell 3a038eeab4 Upgraded GoCron; web ui viewer for viewing cron jobs
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
2025-12-26 22:58:08 -06:00
CyberShell a95f903e72 more work on integration testing
ci/woodpecker/push/go-lint Pipeline failed
2025-12-15 13:50:20 -06:00
CyberShell 61add23efb v0.11.1
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline was successful
ci/woodpecker/push/go-lint Pipeline failed
2025-12-08 18:17:48 -06:00
CyberShell b228fca371 update docs
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
2025-12-08 18:15:40 -06:00
CyberShell e5a9003ed6 start integration testing
ci/woodpecker/push/go-lint Pipeline failed
2025-12-08 18:13:58 -06:00
CyberShell 803b039849 start integration testing
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline failed
2025-12-08 18:12:31 -06:00
CyberShell 2824f8c703 inject ssh env vars by apppending them to the script
ci/woodpecker/push/go-lint Pipeline failed
2025-12-08 10:08:44 -06:00
CyberShell cfc00262ff inject ssh env vars by apppending them to the script
ci/woodpecker/push/go-lint Pipeline failed
2025-11-29 20:55:11 -06:00
CyberShell fd019bc407 v0.11.0
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline is pending
ci/woodpecker/tag/publish-docs Pipeline was successful
2025-11-24 17:51:56 -06:00
CyberShell febc2680f4 Update docs
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
2025-11-17 16:46:54 -06:00
CyberShell caf2397349 Update docs
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline failed
2025-11-17 16:27:33 -06:00
CyberShell 172ca8712e Update docs
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline failed
2025-11-17 16:12:02 -06:00
CyberShell bda16bcbb5 Update docs
ci/woodpecker/push/go-lint Pipeline failed
2025-11-17 16:08:42 -06:00
CyberShell b5d069112f Update docs
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline failed
2025-11-17 15:56:28 -06:00
CyberShell f56393c84c fix small things 2025-11-17 15:55:51 -06:00
CyberShell 55ef8e1733 Update docs
ci/woodpecker/push/go-lint Pipeline failed
2025-11-17 15:43:47 -06:00
CyberShell 075fc16ec9 Update docs
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline failed
2025-11-15 22:54:02 -06:00
CyberShell 0d6a13c1cf Cmd Type script now correctly appends arguments
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
2025-11-15 17:37:17 -06:00
CyberShell e57939f858 add files
ci/woodpecker/push/go-lint Pipeline failed
2025-10-21 23:19:00 -05:00
CyberShell d45b1562fc started refactoring into executors using interfaces 2025-09-07 20:44:48 -05:00
CyberShell 7fe07f86a9 CLI: added exec hosts subcommand list 2025-07-23 22:05:44 -05:00
CyberShell 14c81a00a7 CLI: added exec hosts subcommand list 2025-07-23 22:04:48 -05:00
CyberShell 3eced64453 CLI: Exec subcommand host 2025-07-15 20:24:30 -05:00
CyberShell c284d928fd CLI: Exec subcommand host 2025-07-15 20:24:06 -05:00
CyberShell dd9da9452b CLI: Exec subcommand host 2025-07-15 20:23:58 -05:00
CyberShell 11d5121954 update deps 2025-07-14 20:48:53 -05:00
CyberShell 66d622b474 Improved error message for remote version package output 2025-07-09 23:21:46 -05:00
CyberShell 47b2aabd9f Improved error message for remote version package output 2025-07-09 23:20:11 -05:00
CyberShell b91cf18b04 change file 2025-07-04 10:22:37 -05:00
CyberShell 305b504ca1 tests: beginning of tests using Docker 2025-07-04 09:02:27 -05:00
CyberShell 7be2679b91 change: Commands: host can now be localhost or 127.0.0.1 to run commands locally
ci/woodpecker/push/go-lint Pipeline was successful
2025-03-21 09:09:56 -05:00
CyberShell 3c6e3ed914 v0.10.2
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline was successful
2025-03-19 22:42:49 -05:00
CyberShell 02bc040e2a v0.10.2
ci/woodpecker/push/go-lint Pipeline was successful
2025-03-19 22:41:18 -05:00
CyberShell 9f1f36215a v0.10.2 2025-03-19 22:40:06 -05:00
CyberShell ff75f4bbcd feat: add variable support
ci/woodpecker/push/go-lint Pipeline was successful
2025-03-16 23:43:12 -05:00
CyberShell 5f40713e98 feat: add variable support 2025-03-16 23:42:54 -05:00
CyberShell cd5f7611a9 notifications: add http service
ci/woodpecker/push/go-lint Pipeline was successful
2025-03-13 23:35:00 -05:00
CyberShell b542711078 notifications: add http service 2025-03-13 23:34:37 -05:00
CyberShell 52dbc353e5 change: update go toolchain
ci/woodpecker/push/go-lint Pipeline was successful
2025-03-12 23:22:52 -05:00
CyberShell 6bef0c3e5b notifications: add http config
ci/woodpecker/push/go-lint Pipeline was successful
2025-03-12 10:10:45 -05:00
CyberShell 4d705d78fb fix: golang-ci-lint version
ci/woodpecker/push/go-lint Pipeline failed
2025-03-11 22:22:39 -05:00
CyberShell 62d47ecfa7 fix: pipeline errors
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline was successful
2025-03-11 22:08:59 -05:00
CyberShell 32444ff82e fix: docs and pipeline errors
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline failed
2025-03-11 21:55:51 -05:00
CyberShell a5a7c05640 v0.10.1
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline was successful
2025-03-11 21:37:58 -05:00
CyberShell bfb81e11b2 version bump
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
2025-03-11 21:36:53 -05:00
CyberShell fd4c83f9c0 Vault: keys are now referenced by name, and the actual data by data
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline failed
2025-03-11 21:33:06 -05:00
CyberShell fe27c6396a LinuxUserManager: correct parameters for AddUser()
ci/woodpecker/push/go-lint Pipeline failed
2025-03-11 16:13:29 -05:00
CyberShell c89dde186a UserCommands: change field name
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
2025-03-11 15:37:12 -05:00
CyberShell 18a64de0de UserCommands: change field name 2025-03-11 15:36:43 -05:00
CyberShell 99c622b69f UserCommands: add field CreateUserHome 2025-03-11 15:30:07 -05:00
CyberShell 95e85e8b45 UserCommands: add ssh public keys when running locally
ci/woodpecker/push/go-lint Pipeline failed
2025-03-11 15:21:02 -05:00
CyberShell 1a48c7bca5 change: create temp file when modifing password over SSH 2025-03-11 14:55:02 -05:00
CyberShell 5d21764ef1 fix: don't test empty env files
ci/woodpecker/push/go-lint Pipeline failed
2025-03-11 13:42:40 -05:00
CyberShell c7302f0e17 update docs
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
2025-03-10 12:34:33 -05:00
CyberShell fb1c8ec4fb v0.10.0
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline was successful
ci/woodpecker/push/go-lint Pipeline failed
2025-03-08 00:25:44 -06:00
CyberShell fe9462dac0 version bump
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
2025-03-08 00:24:23 -06:00
CyberShell d8453d1fb0 added external directives to Notifications, change case of keys in host, and update docs 2025-03-08 00:23:08 -06:00
CyberShell 65c46a1e26 add password change
ci/woodpecker/push/go-lint Pipeline failed
2025-03-06 23:35:45 -06:00
CyberShell f859b5961f add password change 2025-03-06 23:35:29 -06:00
CyberShell 25ddd65f25 v0.10.0
ci/woodpecker/push/go-lint Pipeline failed
2025-03-05 00:35:14 -06:00
CyberShell bcba6b2086 v0.10.0
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
2025-03-03 23:46:26 -06:00
CyberShell 753b03861f v0.10.0 2025-03-03 23:45:28 -06:00
CyberShell 80a45cd595 v0.9.1
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline was successful
2025-03-01 01:57:51 -06:00
CyberShell 551c8ad441 get S3 profile using env AWS_PROFILE 2025-03-01 01:57:33 -06:00
CyberShell 3823b1bf44 get S3 profile using env AWS_PROFILE 2025-03-01 01:57:05 -06:00
CyberShell f777c78aad v0.9.0
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline was successful
2025-02-28 17:52:28 -06:00
CyberShell bb693dbb97 bump version
ci/woodpecker/push/go-lint Pipeline failed
2025-02-28 17:49:51 -06:00
CyberShell 7beda281e0 fixed constant typo
ci/woodpecker/push/go-lint Pipeline failed
2025-02-28 17:49:01 -06:00
CyberShell 1143d2850b added beginning of tests
ci/woodpecker/push/go-lint Pipeline failed
2025-02-28 17:40:32 -06:00
CyberShell 8900bd70a4 changed PackageOperation to enums 2025-02-28 17:39:08 -06:00
CyberShell 6db5f73bc0 fetch env file where config file is stored
ci/woodpecker/push/go-lint Pipeline failed
2025-02-25 21:19:17 -06:00
CyberShell a163c11129 v0.9.0
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
2025-02-23 22:10:42 -06:00
CyberShell 2b4d191271 v0.9.0
ci/woodpecker/push/go-lint Pipeline is pending
2025-02-23 21:18:46 -06:00
CyberShell 417088c32b v0.9.0
ci/woodpecker/push/go-lint Pipeline is pending
2025-02-23 21:16:00 -06:00
CyberShell 4fa5efa5b6 v0.9.0 2025-02-23 21:02:23 -06:00
CyberShell a0bf51636c v0.8.1
ci/woodpecker/push/go-lint Pipeline is pending
2025-02-23 20:57:41 -06:00
CyberShell 684edd7985 v0.8.1
ci/woodpecker/push/go-lint Pipeline is pending
2025-02-23 15:43:38 -06:00
CyberShell 3acb20a40f v0.8.1 2025-02-23 15:42:50 -06:00
CyberShell 0007c8696a v0.8.1 WIP 2025-02-23 15:40:09 -06:00
CyberShell cf2baf3601 v0.8.1 WIP 2025-02-23 15:37:40 -06:00
CyberShell e6b9f8e6e6 v0.8.1 WIP 2025-02-23 15:35:08 -06:00
CyberShell 2eefc59cf7 v0.8.1 WIP 2025-02-23 15:34:28 -06:00
CyberShell 98d8b8e8f2 v0.8.1 WIP 2025-02-23 15:33:17 -06:00
CyberShell 1ad50ebcf8 v0.8.1 WIP
ci/woodpecker/push/go-lint Pipeline failed
2025-02-20 14:53:44 -06:00
CyberShell c483a1056f v0.8.0
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/release/publish-docs Pipeline was successful
2025-02-15 23:00:10 -06:00
CyberShell 3b9f569310 CI config changed
ci/woodpecker/push/publish-docs Pipeline failed
2025-02-15 22:54:11 -06:00
CyberShell 843be7968b CI config changed 2025-02-15 22:50:44 -06:00
CyberShell d477d850ac CI config changed 2025-02-15 22:46:49 -06:00
CyberShell 8eb3229af7 v0.8.0 2025-02-15 22:29:19 -06:00
CyberShell d89a208bbd v0.8.0 2025-02-15 22:28:01 -06:00
CyberShell 0d28d6afcf breaking changes to keys 2025-02-15 22:27:11 -06:00
CyberShell 7c42a9a7cd v0.7.8
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline failed
2025-02-14 14:46:10 -06:00
CyberShell 31339fb4d8 v0.7.7
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
2025-02-14 14:31:24 -06:00
CyberShell c642e827f5 v0.7.6
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline was successful
2025-02-14 14:18:02 -06:00
CyberShell a328239021 v0.7.5
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline was successful
2025-02-14 13:39:18 -06:00
CyberShell 4ee60184bf v0.7.4
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline was successful
2025-02-14 13:11:08 -06:00
CyberShell 161ad31577 v0.7.3
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline was successful
2025-02-14 12:54:05 -06:00
CyberShell 7c5f4a95da v0.7.2
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline was successful
2025-02-14 12:21:21 -06:00
CyberShell 4981acbf9d update CI configs 2025-02-14 12:19:21 -06:00
CyberShell 932d5c380f v0.7.1
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline was successful
2025-02-14 11:56:46 -06:00
CyberShell f84d76badf updat GitHube workflow file
ci/woodpecker/push/publish-docs Pipeline was successful
2025-02-11 23:05:08 -06:00
CyberShell 6ee6e10621 v0.7.0 update docs
ci/woodpecker/push/publish-docs Pipeline was successful
2025-02-11 22:00:10 -06:00
CyberShell 127d38c076 v0.7.0 make changes to release script 2025-02-11 21:48:40 -06:00
CyberShell 0218dee76d v0.7.0 change GoReleaser file
ci/woodpecker/push/publish-docs Pipeline failed
2025-02-11 21:47:23 -06:00
CyberShell 67a1eab908 v0.7.0 make changes to release script
ci/woodpecker/push/publish-docs Pipeline failed
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline failed
2025-02-11 21:37:42 -06:00
CyberShell c618ca33f8 v0.7.0 make changes to release script
ci/woodpecker/push/publish-docs Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline is pending
ci/woodpecker/tag/gitea Pipeline failed
2025-02-11 21:30:13 -06:00
CyberShell 6e7d912fa2 v0.7.0 bump version
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline is pending
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/push/publish-docs Pipeline failed
2025-02-11 21:19:57 -06:00
CyberShell b90d1958b2 [WIP] v0.7.0 fix comments
ci/woodpecker/push/go-lint Pipeline failed
2025-02-11 12:19:09 -06:00
CyberShell c187fbb735 [WIP] v0.7.0 almost ready to release
ci/woodpecker/push/go-lint Pipeline failed
2025-02-10 17:00:02 -06:00
CyberShell c3de4386ab [WIP] v0.7.0 almost ready to release
ci/woodpecker/push/go-lint Pipeline failed
2025-02-10 16:55:54 -06:00
CyberShell e20141043c Merge branch 'remoteResources' into develop
ci/woodpecker/push/go-lint Pipeline failed
2025-02-08 16:14:37 -06:00
CyberShell 11ec1a98d8 [WIP] v0.7.0 almost ready to release 2025-02-08 15:17:34 -06:00
CyberShell 8788d473a5 [WIP] v0.7.0 fixes and changes to cache and remotefetcher 2025-01-28 15:45:06 -06:00
CyberShell edc669b340 [WIP] v0.7.0 fixes and changes to cache and remotefetcher 2025-01-28 15:43:57 -06:00
CyberShell 086835453b [WIP] v0.7.0 fixes and changes to cache and remotefetcher 2025-01-28 15:42:50 -06:00
CyberShell 5d3c265ce9 add comments
ci/woodpecker/push/go-lint Pipeline failed
2025-01-23 16:47:43 -06:00
CyberShell 8c633fd4b2 [WIP] v0.7.0 getCommandType first
ci/woodpecker/push/go-lint Pipeline failed
2025-01-15 23:33:55 -06:00
CyberShell a664edaed7 [WIP] v0.7.0 run go mod tidy
ci/woodpecker/push/go-lint Pipeline failed
2025-01-14 19:14:23 -06:00
CyberShell e88773e289 [WIP] v0.7.0 added functional options to configfetcher
ci/woodpecker/push/go-lint Pipeline failed
2025-01-14 19:13:05 -06:00
CyberShell 5c2bfcc940 [WIP] v0.7.0
ci/woodpecker/push/go-lint Pipeline failed
2025-01-14 09:42:43 -06:00
CyberShell aee513f786 Update CHANGELOG.md
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/push/go-lint Pipeline failed
2025-01-04 18:29:39 +00:00
CyberShell 6b99cfa196 update CI config
ci/woodpecker/push/publish-docs Pipeline was successful
2025-01-04 10:30:33 -06:00
CyberShell c24e8086e9 v0.6.1
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
2025-01-04 09:51:44 -06:00
CyberShell c12bbe3bee v0.6.1 2025-01-04 09:51:19 -06:00
CyberShell 33febd662e v0.6.1 2025-01-04 09:51:08 -06:00
CyberShell 5635c1edd0 v0.6.1 2025-01-04 09:50:45 -06:00
CyberShell e169778c82 update changelog
ci/woodpecker/push/publish-docs Pipeline was successful
2025-01-04 01:23:31 -06:00
CyberShell c838bfe815 pipeline changes
ci/woodpecker/push/publish-docs Pipeline was successful
2025-01-04 01:18:06 -06:00
CyberShell e81a5def47 docs changes
ci/woodpecker/push/publish-docs Pipeline failed
2025-01-04 01:10:39 -06:00
CyberShell 18884c640d docs changes
ci/woodpecker/push/publish-docs Pipeline failed
2025-01-04 01:03:03 -06:00
CyberShell ee2256bfb2 docs changes
ci/woodpecker/push/publish-docs Pipeline failed
2025-01-04 00:39:11 -06:00
CyberShell 82d79c520a docs and pipeline changes
ci/woodpecker/push/publish-docs Pipeline failed
2025-01-04 00:36:53 -06:00
CyberShell c30ae2ac3e docs and pipeline changes 2025-01-04 00:35:32 -06:00
CyberShell fc738597ff docs and pipeline changes 2025-01-04 00:26:53 -06:00
CyberShell aebef21eb4 docs
ci/woodpecker/push/publish-docs Pipeline was successful
2025-01-04 00:21:37 -06:00
CyberShell c660e97434 v0.6.0
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
ci/woodpecker/release/publish-docs Pipeline was successful
2025-01-04 00:18:21 -06:00
CyberShell d35fdc890d v0.6.0
ci/woodpecker/push/publish-docs Pipeline was successful
2025-01-04 00:16:53 -06:00
CyberShell 6fe1f26c71 modify .gitmodules
ci/woodpecker/push/publish-docs Pipeline was successful
2025-01-04 00:14:38 -06:00
CyberShell 5b5568910d v0.6.0
ci/woodpecker/push/publish-docs Pipeline failed
2025-01-03 23:46:38 -06:00
CyberShell 3425330890 v0.6.0
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline failed
2025-01-03 23:31:48 -06:00
CyberShell b5f7c3fd72 v0.6.0 2025-01-03 23:30:07 -06:00
CyberShell 01efeab13f update CI config
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/push/publish-docs Pipeline was successful
2024-11-20 00:21:50 -06:00
CyberShell 9a663f4260 update docs
ci/woodpecker/push/publish-docs Pipeline was successful
2024-11-20 00:19:40 -06:00
CyberShell 7c635c36e0 update docs 2024-11-20 00:18:15 -06:00
CyberShell fff33849da update docs and CI config
ci/woodpecker/push/publish-docs Pipeline was successful
2024-11-20 00:13:20 -06:00
CyberShell 3391ffa4e6 Revert "update docs and CI config"
This reverts commit b7d1be495e.
2024-11-20 00:10:29 -06:00
CyberShell b7d1be495e update docs and CI config 2024-11-20 00:08:16 -06:00
CyberShell 2daf2f130d update docs
ci/woodpecker/push/publish-docs Pipeline was successful
2024-11-20 00:00:14 -06:00
CyberShell d120c2ca8f update changelog and add link in docs
ci/woodpecker/push/publish-docs Pipeline was successful
2024-11-19 23:56:09 -06:00
CyberShell 02fd04930d update CI config
ci/woodpecker/push/publish-docs Pipeline was successful
2024-11-19 23:52:14 -06:00
CyberShell 10b0abe707 update CI config 2024-11-19 23:49:00 -06:00
CyberShell 291a954e9c update CI config
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/go-lint Pipeline failed
ci/woodpecker/release/go-lint Pipeline failed
2024-11-19 23:30:33 -06:00
CyberShell e43eecf383 update CI config
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/go-lint Pipeline failed
2024-11-19 23:22:00 -06:00
CyberShell ea676fe0da add version to CI configs
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/go-lint Pipeline failed
2024-11-19 23:08:34 -06:00
CyberShell e73bd9ff3b update docs
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/go-lint Pipeline failed
2024-11-19 22:49:11 -06:00
CyberShell fd9426181f update changelog 2024-11-19 20:22:20 -06:00
CyberShell c25edc5d78 add changelog 2024-11-19 20:19:48 -06:00
CyberShell aebfbda64e add changelog 2024-11-19 20:19:38 -06:00
CyberShell 5fe0629b0f update version and docs 2024-11-19 20:17:03 -06:00
CyberShell 7d6acd77b5 update version 2024-11-19 14:25:00 -06:00
CyberShell 9d646297c7 fix: check for nil Command.Hooks in ExecuteHooks [#12] 2024-11-15 10:46:27 -06:00
CyberShell bf8d261cf3 added timeout to golangci-lint command 2024-11-14 21:18:14 -06:00
CyberShell 686cd0019a Added Changie files 2024-11-14 21:13:40 -06:00
CyberShell b7b002bd72 Added: Hooks for Commands.[name]: error, success, and final. Closes [#12]
Added Command.generateLogger() method.

Fixed: make command logger be used for errors, not just when running the command.
2024-11-14 21:10:49 -06:00
CyberShell b8a63f39f5 add working command hooks
ci/woodpecker/push/go-lint Pipeline failed
2024-11-11 22:44:28 -06:00
CyberShell feacb83274 new commands.[name].type: script; update templates
ci/woodpecker/push/go-lint Pipeline failed
2024-10-15 08:49:23 -05:00
CyberShell 2aeb435167 new commands.[name].type: script; update templates 2024-10-15 08:49:13 -05:00
CyberShell 51f5084dd0 more work on env variable parsing 2024-09-13 20:47:59 -05:00
CyberShell cf04e4456a run go mod tidy 2024-09-03 16:25:12 -05:00
CyberShell 25dc6225b3 [CI SKIP] add change files 2024-08-28 21:52:23 -05:00
CyberShell a300f696d3 add list config file and relevant config in main config file. other minor changes
ci/woodpecker/push/go-lint Pipeline failed
2024-08-28 15:06:25 -05:00
CyberShell 8161aaa0a9 fix CI config
ci/woodpecker/push/gitea Pipeline was successful
ci/woodpecker/push/go-lint Pipeline failed
2023-09-09 10:03:17 -05:00
CyberShell a6bfabe22f v0.4.0
ci/woodpecker/push/gitea Pipeline was successful
ci/woodpecker/push/go-lint Pipeline failed
2023-09-09 10:00:55 -05:00
CyberShell a5466fc121 v0.4.0
ci/woodpecker/push/gitea Pipeline was successful
ci/woodpecker/push/go-lint Pipeline failed
2023-09-09 10:00:00 -05:00
CyberShell fbf2d9cbbc v0.4.0
ci/woodpecker/push/gitea Pipeline was successful
ci/woodpecker/push/go-lint Pipeline failed
2023-09-09 01:11:05 -05:00
CyberShell 437642608b v0.4.0
ci/woodpecker/push/gitea Pipeline is pending
ci/woodpecker/push/go-lint Pipeline is running
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/go-lint Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline was successful
2023-09-09 00:21:42 -05:00
CyberShell a4214b2b3f v0.4.0
ci/woodpecker/push/gitea Pipeline was successful
ci/woodpecker/push/go-lint Pipeline failed
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/go-lint Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline is running
ci/woodpecker/push/publish-docs Pipeline was successful
2023-09-08 23:42:13 -05:00
CyberShell 6ccb75f4fa added scriptEnvFile to command.commandName object
ci/woodpecker/push/go-lint Pipeline failed
2023-08-06 22:27:51 -05:00
CyberShell b8a82b2836 update mongo methods
ci/woodpecker/push/go-lint Pipeline failed
2023-07-29 21:23:31 -05:00
CyberShell 78428a49fc update Go Deps, change log size to 50 MBs, clarify messages 2023-07-29 21:20:53 -05:00
CyberShell 42bc11bf1a remove files
ci/woodpecker/push/go-lint Pipeline is pending
2023-07-22 01:12:29 -05:00
CyberShell 44e3d534f6 update CI configs
ci/woodpecker/push/go-lint Pipeline failed
2023-07-21 22:49:23 -05:00
CyberShell 1fbe3282c8 add golangci-lint CI config
ci/woodpecker/push/gitea unknown status
ci/woodpecker/push/publish-docs unknown status
ci/woodpecker/push/go-lint Pipeline failed
2023-07-21 20:42:14 -05:00
CyberShell 10a6342233 update error message 2023-07-21 20:29:07 -05:00
CyberShell a35db2e05d make remote commands run and not fail if an SSH session failed to be created
ci/woodpecker/push/gitea Pipeline was successful
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
2023-07-20 21:22:03 -05:00
CyberShell 7c4868ee4b Revert "Revert "make remote commands run and not fail if an SSH session failed to be created""
This reverts commit affdd0abfd.
2023-07-20 21:21:40 -05:00
CyberShell affdd0abfd Revert "make remote commands run and not fail if an SSH session failed to be created"
This reverts commit 7224661c71.
2023-07-20 21:20:54 -05:00
CyberShell 7224661c71 make remote commands run and not fail if an SSH session failed to be created 2023-07-20 21:20:16 -05:00
CyberShell e353ed0225 update docs
ci/woodpecker/push/gitea Pipeline was successful
ci/woodpecker/push/publish-docs Pipeline was successful
2023-07-02 05:32:33 -05:00
CyberShell 37bd69b675 update CI configs
ci/woodpecker/push/gitea Pipeline was successful
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline was successful
ci/woodpecker/tag/publish-docs Pipeline was successful
2023-07-01 23:07:31 -05:00
CyberShell 14bca64657 update CI configs
ci/woodpecker/push/gitea Pipeline was successful
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline was successful
2023-07-01 22:49:34 -05:00
CyberShell d9baf44199 update repo URLs
ci/woodpecker/push/gitea Pipeline was successful
ci/woodpecker/push/publish-docs Pipeline was successful
ci/woodpecker/tag/gitea Pipeline failed
ci/woodpecker/tag/publish-docs Pipeline was successful
2023-07-01 22:35:22 -05:00
CyberShell 6de94d038f update CI configs
ci/woodpecker/push/gitea Pipeline was successful
ci/woodpecker/push/publish-docs Pipeline was successful
2023-07-01 22:31:13 -05:00
CyberShell a04d1db077 update CI configs 2023-07-01 22:18:36 -05:00
CyberShell 62942540b5 update CI configs 2023-07-01 22:10:19 -05:00
CyberShell 904a579994 fix version subcommand 2023-07-01 22:02:32 -05:00
CyberShell 4b382bddd9 v0.3.0
* Getting environment variables and passwords from Vault (not tested
yet)
* Vault configuration to config (not tested yet)
* Ability to run scripts from file on local machine on the remote host
* Ability to get ouput in the notification of a list for individual
commands or all commands
* Make SSH connections close after all commands have been run; reuse
previous connections if needed
2023-07-01 21:46:54 -05:00
CyberShell 5e7c52997c added getting ENV vars from Vault 2023-05-12 00:42:14 -05:00
CyberShell f7676e73ba Make host connections close last 2023-03-13 20:25:27 -05:00
CyberShell 2ca5f193e4 Close host connections after all command have been run, added some flags to version subcommand 2023-03-10 16:01:02 -06:00
CyberShell 9ffa2e473e update readme [CI SKIP] 2023-02-19 22:13:43 -06:00
CyberShell 9fd60b6bf7 fix for GitHub Actions 2023-02-18 23:32:26 -06:00
CyberShell 951bf97eb2 fix for CI scripts 2023-02-18 22:52:10 -06:00
CyberShell a2a89011fe fix for release 2023-02-18 22:49:05 -06:00
CyberShell d893a2684e fix for CI scripts 2023-02-18 22:48:15 -06:00
CyberShell ee83586072 Version 0.2.4
* Notifications now display errors and the output of the failed command.
* CI configs for GitHub and Woodpecker
* Added `version` subcommand
* Console logging can be disabled by setting `console-disabled` in the
`logging` object
* If Host was not defined for an incomplete `hosts` object, any commands
would fail as they could not look up the values in the SSH config files.
2023-02-18 22:42:15 -06:00
CyberShell 02321870b5 fix for remote host ports 2023-02-12 08:48:46 -06:00
CyberShell 3e9138e05a fix for remote host ports 2023-02-12 08:29:55 -06:00
CyberShell 51f9e9a776 Merge branch 'develop' 2023-02-11 23:52:00 -06:00
CyberShell 37c20aaafa added new features
- expanding `environment` vars in cmd section
- support for connecting to one proxy/bastion host
- better notification text layout
- better error message on private key failing to open
2023-02-11 23:50:19 -06:00
172 changed files with 10104 additions and 1598 deletions
+9
View File
@@ -0,0 +1,9 @@
## 0.2.4 - 2023-02-18
### Added
* Notifications now display errors and the output of the failed command.
* CI configs for GitHub and Woodpecker
* Added `version` subcommand
### Changed
* Console logging can be disabled by setting `console-disabled` in the `logging` object
## Fixed
* If Host was not defined for an incomplete `hosts` object, any commands would fail as they could not look up the values in the SSH config files.
+6
View File
@@ -0,0 +1,6 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).
+1
View File
@@ -0,0 +1 @@
*.yaml
+16
View File
@@ -0,0 +1,16 @@
## v0.10.0 - 2025-03-08
### Added
* Hooks: improved logging when executing
* User commands: adding SSH keys using config key `userSshPubKeys`
* directives: added support for fetching values using directive `%{externalSource:key}%`
### Changed
* Commands: if dir is not specified, run in config dir
* FileDirective: use the config directory if path is not absolute
* Host: changes to case of some keys
* Notifications: added external directive to sensitive keys
### Fixed
* LocalFetcher: return fetch error
* Lists: load file key before attempting to load from current file
* fix: host not in config file, but in ssh config, properly added to hosts struct
* SSH: password authentication bugs
* User commands: change user password works
+8
View File
@@ -0,0 +1,8 @@
## v0.10.1 - 2025-03-11
### Added
* UserCommands: add ssh public keys when running locally
* UserCommands: add field CreateUserHome
### Changed
* UserCommands: create temp file when modifing password over SSH
* UserCommands: change field name
* Vault: keys are now referenced by `name`, and the actual data by `data`
+6
View File
@@ -0,0 +1,6 @@
## v0.10.2 - 2025-03-19
### Added
* Notifications: http service added
* Variable support. Can be referenced with `%{var:nameOfVar}%` in select string fields.
### Changed
* vault: initialize vault before validating config
+21
View File
@@ -0,0 +1,21 @@
## v0.11.0 - 2025-11-24
### Added
* feat: Package operation `versionCheck` supports regular expressions (see [regexp](https://pkg.go.dev/regexp) package for docs)
* Command lists: added `cmdLists.[name].notify` object
* Testing setup with Docker
* CLI: add global flag --hostsConfig that allows hosts to be dynamic in relation to the main config
* CLI: Exec subcommand `hosts`. See documentation for more details.
* CLI: added `exec hosts` subcommand `list`
* Add support for hosts in parallel
### Changed
* Commands: `host` can now be `localhost` or `127.0.0.1` to run commands locally
* lists loaded from external files only if no list config present in current file
* `PackageManager.Parse` renamed to `ParseRemotePackageManagerVersionOutput`. This now returns arrays of PackageManagerCommon.Package and errors.
* Internal: refactoring and renaming functions
* Commands: moved output-prefixed keys to the `commands.[name].output` object
* Change internal method name for better understanding
* Improved error message for remote version package output
### Fixed
* Command Lists: hooks now run correctly when commands finish
* Log file passed using `--log-file` correctly used
* Cmd Type `script` now correctly appends arguments
+6
View File
@@ -0,0 +1,6 @@
## v0.11.1 - 2025-12-08
### Added
* Started integration testing
### Changed
* inject ssh env vars by apppending them to the script/command if SSH setenv fails
* fix local command injection by running in a shell
+3
View File
@@ -0,0 +1,3 @@
## v0.11.2 - 2025-12-27
### Added
* Upgraded GoCron; web ui viewer for viewing cron jobs
+7
View File
@@ -0,0 +1,7 @@
## v0.11.3 - 2026-01-31
### Added
* Command: saveShellHistory for scriptFile commands over SSH
* Starting on Variables and Templates
### Changed
* File output for commands now adds hostname to beginning of filename
* Testing: docker testing infra
+3
View File
@@ -0,0 +1,3 @@
## v0.11.4 - 2026-02-01
### Changed
* Command.[name].output.file: now appends correctly to the beginning of file in an absolute path
+3
View File
@@ -0,0 +1,3 @@
## v0.11.5 - 2026-02-10
### Changed
* Command.Type: scriptFile no longer requests psudoterminal
+3
View File
@@ -0,0 +1,3 @@
## v0.12.0 - 2026-02-11
### Changed
* internal logic handling for cron webserver
+8
View File
@@ -0,0 +1,8 @@
## v0.12.1 - 2026-03-23
### Added
* Command output respects `command.[name].output.toLog` when standard output is enabled
### Changed
* SSH: revert scriptFile to before 0.11.3
* Output: tabs print as 4 spaces instead of '\t'
### Fixed
* Internal: output buffer will be copied to temporary buffer
+8
View File
@@ -0,0 +1,8 @@
## v0.3.0 - 2023-01-07
### Added
* Getting environment variables and passwords from Vault (not tested yet)
* Vault configuration to config (not tested yet)
* Ability to run scripts from file on local machine on the remote host
* Ability to get ouput in the notification of a list for individual commands or all commands
### Changed
* Make SSH connections close after all commands have been run; reuse previous connections if needed
+3
View File
@@ -0,0 +1,3 @@
## v0.3.1 - 2023-07-20
### Changed
* If an SSH session failed to be created, the command would fail. This would be caused when restarting the SSH host. The SSH connection is attempted to be created again. If successful, the command is executed normally.
+13
View File
@@ -0,0 +1,13 @@
## v0.4.0 - 2023-09-08
### Added
* Added `scriptEnvFile` to command object that allows one to specify an environment file (or any file really) when a `scriptFile` is run. Inspired by the practice of keeping environment variables and scripts or commands seperate.
* Basis for listing commands
### Changed
* BREAKING: Notifications object now takes the form of service.id, where service can be "mail" or "matrix" and id is a unique id for the service.
* BREAKING: Since the change to the notifications object, cmd-lists' inner map key 'notifications' must be of the form service.id. id must be defined for that service. See notifications docs for aviliable services.
* Config parser is now the simpler Koanf - Keys are now case-sensitive
* Log size limited to 50 Mb
+9
View File
@@ -0,0 +1,9 @@
## v0.5.0 - 2024-11-19
### Added
* Lists can now go in a file. See docs for more information.
* commands.[name].type: script now opens `scriptEnvFile`.
* Hooks for Commands.[name]. Error, success, and final. [#12]
### Changed
* GetKnownHosts is now a method of Host
### Fixed
* make command logger be used for errors, not just when running the command
+4
View File
@@ -0,0 +1,4 @@
## v0.6.0 - 2025-01-04
### Added
* Command Type Package - allows one to perform package operations [docs](https://backy.cybershell.xyz/config/packages/)
* Exec subcommand `host` allows for parallel execution of commands on hosts. [See docs](https://backy.cybershell.xyz/cli/exec)
+3
View File
@@ -0,0 +1,3 @@
## v0.6.1 - 2025-01-04
### Fixed
* When running a list, hooks now run explicitly after the command executes. Fixed panic due to improper logic.
+16
View File
@@ -0,0 +1,16 @@
## v0.7.0 - 2025-02-11
### Added
* [feat]: package `packageOperation` option `checkVersion` implemented
* user management added - see docs
* Support for remote config sources. Only config file and list can be used for now.
* Cache functionality - still a WIP
* Flag `--s3-endpoint` for config file fetching from S3
### Changed
* Internal refactoring of config setup
* Formatting and sending for notifications
* name of `configfetcher` to `remotefetcher`
* Flags that took comma-separated lists now have to be passed multiple times for each argument.
* Hosts passed to `exec host` now checked against default SSH config files
### Fixed
* Parsing of remote URLs when determining list config file path
* Incorrect error notification template value
+3
View File
@@ -0,0 +1,3 @@
## v0.7.1 - 2025-02-14
### Fixed
* Incorrect local config file loading logic caused files to not be detected
+3
View File
@@ -0,0 +1,3 @@
## v0.7.2 - 2025-02-14
### Fixed
* CI configs
+3
View File
@@ -0,0 +1,3 @@
## v0.7.3 - 2025-02-14
### Changed
* GoReleaser configs
+5
View File
@@ -0,0 +1,5 @@
## v0.7.4 - 2025-02-14
### Changed
* CI configs
### Fixed
* v0.7.1: Incorrect local config file loading logic caused files to not be detected
+5
View File
@@ -0,0 +1,5 @@
## v0.7.5 - 2025-02-14
### Changed
* CI configs
### Fixed
* v0.7.1: Incorrect local config file loading logic caused files to not be detected
+4
View File
@@ -0,0 +1,4 @@
## v0.7.6 - 2025-02-14
### Fixed
* v0.7.1: Incorrect local config file loading logic caused files to not be detected
* CI configs
+4
View File
@@ -0,0 +1,4 @@
## v0.7.7 - 2025-02-14
### Fixed
* v0.7.1: Incorrect local config file loading logic caused files to not be detected
* CI configs
+4
View File
@@ -0,0 +1,4 @@
## v0.7.8 - 2025-02-14
### Fixed
* Github CI config
* v0.7.1: Incorrect local config file loading logic caused files to not be detected
+6
View File
@@ -0,0 +1,6 @@
## v0.8.0 - 2025-02-15
### Changed
* Breaking: `cmd-lists` key changed to `cmdLists`
* Properly load list config
* Config file loading properly errors
* CI Configs
+12
View File
@@ -0,0 +1,12 @@
## v0.9.0 - 2025-02-28
### Added
* `list` command with subcommands `cmds` and `lists`
* Deprecation and unsupported warnings for old config keys
* CLI flag `--cmdStdOut` to output command's stdout/stderr to stdout
* Command type `remoteScript`. See docs for more info.
### Changed
* change to enums for Command type
* Cache now stores resources by URL hash for ease-of-lookup
* Changed PackageOperation to enums
### Fixed
* Local command's `dir` full path is now found with home directory
+3
View File
@@ -0,0 +1,3 @@
## v0.9.1 - 2025-03-01
### Changed
* Use EnvVar AWS_PROFILE to get S3 profile
Executable
+26
View File
@@ -0,0 +1,26 @@
changesDir: .changes
unreleasedDir: unreleased
headerPath: header.tpl.md
changelogPath: CHANGELOG.md
versionExt: md
versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}'
kindFormat: '### {{.Kind}}'
changeFormat: '* {{.Body}}'
kinds:
- label: Added
auto: minor
- label: Changed
auto: major
- label: Deprecated
auto: minor
- label: Removed
auto: major
- label: Fixed
auto: patch
- label: Security
auto: patch
newlines:
afterChangelogHeader: 1
beforeChangelogVersion: 1
endOfVersion: 1
envPrefix: CHANGIE_
+1
View File
@@ -0,0 +1 @@
{}
+1
View File
@@ -0,0 +1 @@
{}
+40
View File
@@ -0,0 +1,40 @@
name: goreleaser
on:
push:
# run only against tags
tags:
- '*'
permissions:
contents: write
packages: write
# issues: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: true
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- uses: olegtarasov/get-tag@v2.1.4
id: tagName
with:
# tagRegex: "foobar-(.*)" # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined.
tagRegexGroup: 1 # Optional. Default is 1.
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: 2.7.0
args: release --release-notes=".changes/${{ env.GIT_TAG_NAME }}.md" -f .goreleaser/github.yml --clean
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}
GIT_TAG_NAME: ${{ steps.tagName.outputs.tag }}
Regular → Executable
+8
View File
@@ -1,2 +1,10 @@
!.changie.yaml
!.changes/**
dist/
.codegpt
*.log
/*.sh
/*.yaml
/*.yml
Executable
+7
View File
@@ -0,0 +1,7 @@
[submodule "docs/themes/hugo-theme-relearn"]
path = docs/themes/hugo-theme-relearn
url = https://github.com/McShelby/hugo-theme-relearn.git
[submodule "docs/themes/plausible-hugo"]
path = docs/themes/plausible-hugo
url = https://github.com/divinerites/plausible-hugo.git
+45
View File
@@ -0,0 +1,45 @@
version: 2
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- freebsd
- linux
goarch:
- "386"
- amd64
- arm64
archives:
- formats: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_{{ .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
formats: [zip]
checksum:
name_template: 'checksums.txt'
snapshot:
version_template: "{{ incpatch .Version }}-next"
changelog:
disable: false
release:
prerelease: auto
gitea_urls:
api: https://git.andrewnw.xyz/api/v1
download: https://git.andrewnw.xyz
# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
+43
View File
@@ -0,0 +1,43 @@
# Make sure to check the documentation at https://goreleaser.com
version: 2
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- freebsd
- linux
goarch:
- "386"
- amd64
- arm64
archives:
- formats: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_{{ .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
formats: [zip]
checksum:
name_template: 'checksums.txt'
release:
prerelease: auto
snapshot:
version_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
+9 -6
View File
@@ -1,5 +1,3 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
# You may remove this if you don't use go modules.
@@ -8,13 +6,18 @@ builds:
- env:
- CGO_ENABLED=0
goos:
- freebsd
- linux
goarch:
- "386"
- amd64
- arm64
archives:
- format: tar.gz
- format: binary
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}
{{ .ProjectName }}_{{ .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
@@ -36,8 +39,8 @@ changelog:
- '^test:'
gitea_urls:
api: https://git.andrewnw.xyz/api/v1
download: https://git.andrewnw.xyz
api: https://git.vern.cc/api/v1
download: https://git.vern.cc
# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
Vendored Regular → Executable
+20 -2
View File
@@ -1,5 +1,23 @@
{
"cSpell.words": [
"Cmds"
]
"Cmds",
"remotefetcher",
"knadh",
"koanf",
"mattn",
"maunium",
"mautrix",
"nikoksr",
"Strs"
],
"CodeGPT.apiKey": "CodeGPT Plus Beta",
"yaml.schemas": {
"file:///c%3A/Users/anw12/.vscode/extensions/continue.continue-1.2.14-win32-x64/config-yaml-schema.json": [
".continue/**/*.yaml"
],
"file:///c%3A/Users/anw12/.vscode/extensions/continue.continue-1.2.16-win32-x64/config-yaml-schema.json": [
".continue/**/*.yaml"
],
"file:///c:/Users/anw12/.vscode/extensions/continue.continue-1.2.16-win32-x64/config-yaml-schema.json": "vscode-local:/c%3A/Users/anw12/.continue/config.yaml"
}
}
+19
View File
@@ -0,0 +1,19 @@
steps:
golang:
image: golang:1.24
commands:
- go install github.com/goreleaser/goreleaser/v2@v2.7.0
- goreleaser release -f .goreleaser/gitea.yml --release-notes=".changes/$(go run backy.go version -V).md"
environment:
GITEA_TOKEN:
from_secret: gitea_token
when:
event: tag
# release:
# image: goreleaser/goreleaser
# commands:
when:
- event: tag
branch: master
+14
View File
@@ -0,0 +1,14 @@
steps:
build:
image: golang:1.24
commands:
- go build
- go test
release:
image: golangci/golangci-lint:v1.64.7
commands:
- golangci-lint run -v --timeout 5m
when:
- event: push
branch: develop
+36
View File
@@ -0,0 +1,36 @@
steps:
build:
image: hugomods/hugo:debian-ci-0.147.2
commands:
- git submodule foreach 'git fetch origin; git checkout $(git describe --tags `git rev-list --tags --max-count=1`);'
- cd docs
- hugo mod get -u github.com/divinerites/plausible-hugo
- hugo mod get -u github.com/McShelby/hugo-theme-relearn@8.2.0
- hugo
deploy:
image: codingkoopa/git-rsync-openssh
commands:
- cd docs
- echo "nameserver 1.1.1.1" > /etc/resolv.conf
- mkdir ~/.ssh && chmod -R 700 ~/.ssh
# - apt update -y && apt install openssh-client rsync -y
- echo "$SSH_HOST_KEY" > ~/.ssh/known_hosts
- echo -e '#!/bin/sh\necho "$SSH_PASSPHRASE"' | tr -d '\r' > ~/.ssh/.print_ssh_password
# - cat ~/.ssh/.print_ssh_password
- chmod 700 ~/.ssh/.print_ssh_password
- eval $(ssh-agent -s)
- echo "$SSH_DEPLOY_KEY" | tr -d '\r' | DISPLAY=":0.0" SSH_ASKPASS=~/.ssh/.print_ssh_password setsid ssh-add -
- rsync -atv --delete --progress public/ backy@backy.cybershell.xyz:docs
- rsync -atv --delete --progress vangen/ backy@backy.cybershell.xyz:vangen-go
environment:
SSH_HOST_KEY:
from_secret: ssh_host_key
SSH_DEPLOY_KEY:
from_secret: ssh_deploy_key
SSH_PASSPHRASE:
from_secret: ssh_passphrase
when:
- branch: master
- path: 'docs/**'
+19
View File
@@ -0,0 +1,19 @@
steps:
golang:
image: golang:1.24
commands:
- go install github.com/goreleaser/goreleaser/v2@v2.7.0
- goreleaser release -f .goreleaser/github.yml --release-notes=".changes/$(go run backy.go version -V).md"
environment:
GITHUB_TOKEN:
from_secret: github_token
when:
event: tag
# release:
# image: goreleaser/goreleaser
# commands:
when:
- event: tag
branch: master
Executable
+237
View File
@@ -0,0 +1,237 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).
## v0.12.1 - 2026-03-23
### Added
* Command output respects `command.[name].output.toLog` when standard output is enabled
### Changed
* SSH: revert scriptFile to before 0.11.3
* Output: tabs print as 4 spaces instead of '\t'
### Fixed
* Internal: output buffer will be copied to temporary buffer
## v0.12.0 - 2026-02-11
### Changed
* internal logic handling for cron webserver
## v0.11.5 - 2026-02-10
### Changed
* Command.Type: scriptFile no longer requests psudoterminal
## v0.11.4 - 2026-02-01
### Changed
* Command.[name].output.file: now appends correctly to the beginning of file in an absolute path
## v0.11.3 - 2026-01-31
### Added
* Command: saveShellHistory for scriptFile commands over SSH
* Starting on Variables and Templates
### Changed
* File output for commands now adds hostname to beginning of filename
* Testing: docker testing infra
## v0.11.2 - 2025-12-27
### Added
* Upgraded GoCron; web ui viewer for viewing cron jobs
## v0.11.1 - 2025-12-08
### Added
* Started integration testing
### Changed
* inject ssh env vars by apppending them to the script/command if SSH setenv fails
* fix local command injection by running in a shell
## v0.11.0 - 2025-11-24
### Added
* feat: Package operation `versionCheck` supports regular expressions (see [regexp](https://pkg.go.dev/regexp) package for docs)
* Command lists: added `cmdLists.[name].notify` object
* Testing setup with Docker
* CLI: add global flag --hostsConfig that allows hosts to be dynamic in relation to the main config
* CLI: Exec subcommand `hosts`. See documentation for more details.
* CLI: added `exec hosts` subcommand `list`
* Add support for hosts in parallel
### Changed
* Commands: `host` can now be `localhost` or `127.0.0.1` to run commands locally
* lists loaded from external files only if no list config present in current file
* `PackageManager.Parse` renamed to `ParseRemotePackageManagerVersionOutput`. This now returns arrays of PackageManagerCommon.Package and errors.
* Internal: refactoring and renaming functions
* Commands: moved output-prefixed keys to the `commands.[name].output` object
* Change internal method name for better understanding
* Improved error message for remote version package output
### Fixed
* Command Lists: hooks now run correctly when commands finish
* Log file passed using `--log-file` correctly used
* Cmd Type `script` now correctly appends arguments
## v0.10.2 - 2025-03-19
### Added
* Notifications: http service added
* Variable support. Can be referenced with `%{var:nameOfVar}%` in select string fields.
### Changed
* vault: initialize vault before validating config
## v0.10.1 - 2025-03-11
### Added
* UserCommands: add ssh public keys when running locally
* UserCommands: add field CreateUserHome
### Changed
* UserCommands: create temp file when modifing password over SSH
* UserCommands: change field name
* Vault: keys are now referenced by `name`, and the actual data by `data`
## v0.10.0 - 2025-03-08
### Added
* Hooks: improved logging when executing
* User commands: adding SSH keys using config key `userSshPubKeys`
* directives: added support for fetching values using directive `%{externalSource:key}%`
### Changed
* Commands: if dir is not specified, run in config dir
* FileDirective: use the config directory if path is not absolute
* Host: changes to case of some keys
* Notifications: added external directive to sensitive keys
### Fixed
* LocalFetcher: return fetch error
* Lists: load file key before attempting to load from current file
* fix: host not in config file, but in ssh config, properly added to hosts struct
* SSH: password authentication bugs
* User commands: change user password works
## v0.9.1 - 2025-03-01
### Changed
* Use EnvVar AWS_PROFILE to get S3 profile
## v0.9.0 - 2025-02-28
### Added
* `list` command with subcommands `cmds` and `lists`
* Deprecation and unsupported warnings for old config keys
* CLI flag `--cmdStdOut` to output command's stdout/stderr to stdout
* Command type `remoteScript`. See docs for more info.
### Changed
* change to enums for Command type
* Cache now stores resources by URL hash for ease-of-lookup
* Changed PackageOperation to enums
### Fixed
* Local command's `dir` full path is now found with home directory
## v0.8.0 - 2025-02-15
### Changed
* Breaking: `cmd-lists` key changed to `cmdLists`
* Properly load list config
* Config file loading properly errors
* CI Configs
## v0.7.8 - 2025-02-14
### Fixed
* Github CI config
* v0.7.1: Incorrect local config file loading logic caused files to not be detected
## v0.7.7 - 2025-02-14
### Fixed
* v0.7.1: Incorrect local config file loading logic caused files to not be detected
* CI configs
## v0.7.6 - 2025-02-14
### Fixed
* v0.7.1: Incorrect local config file loading logic caused files to not be detected
* CI configs
## v0.7.5 - 2025-02-14
### Changed
* CI configs
### Fixed
* v0.7.1: Incorrect local config file loading logic caused files to not be detected
## v0.7.4 - 2025-02-14
### Changed
* CI configs
### Fixed
* v0.7.1: Incorrect local config file loading logic caused files to not be detected
## v0.7.3 - 2025-02-14
### Changed
* GoReleaser configs
## v0.7.2 - 2025-02-14
### Fixed
* CI configs
## v0.7.1 - 2025-02-14
### Fixed
* Incorrect local config file loading logic caused files to not be detected
## v0.7.0 - 2025-02-11
### Added
* [feat]: package `packageOperation` option `checkVersion` implemented
* user management added - see docs
* Support for remote config sources. Only config file and list can be used for now.
* Cache functionality - still a WIP
* Flag `--s3-endpoint` for config file fetching from S3
### Changed
* Internal refactoring of config setup
* Formatting and sending for notifications
* name of `configfetcher` to `remotefetcher`
* Flags that took comma-separated lists now have to be passed multiple times for each argument.
* Hosts passed to `exec host` now checked against default SSH config files
### Fixed
* Parsing of remote URLs when determining list config file path
* Incorrect error notification template value
## v0.6.1 - 2025-01-04
### Fixed
* When running a list, hooks now run explicitly after the command executes. Fixed panic due to improper logic.
## v0.6.0 - 2025-01-04
### Added
* Command Type Package - allows one to perform package operations [docs](https://backy.cybershell.xyz/config/packages/)
* Exec subcommand `host` allows for parallel execution of commands on hosts. [See docs](https://backy.cybershell.xyz/cli/exec)
## v0.5.0 - 2024-11-19
### Added
* Lists can now go in a file. See docs for more information.
* commands.[name].type: script now opens `scriptEnvFile`.
* Hooks for Commands.[name]. Error, success, and final. [#12]
### Changed
* GetKnownHosts is now a method of Host
### Fixed
* make command logger be used for errors, not just when running the command
## v0.4.0 - 2023-09-08
### Added
* Added `scriptEnvFile` to command object that allows one to specify an environment file (or any file really) when a `scriptFile` is run. Inspired by the practice of keeping environment variables and scripts or commands seperate.
* Basis for listing commands
### Changed
* BREAKING: Notifications object now takes the form of service.id, where service can be "mail" or "matrix" and id is a unique id for the service.
* BREAKING: Since the change to the notifications object, cmd-lists' inner map key 'notifications' must be of the form service.id. id must be defined for that service. See notifications docs for aviliable services.
* Config parser is now the simpler Koanf - Keys are now case-sensitive
* Log size limited to 50 Mb
## v0.3.1 - 2023-07-20
### Changed
* If an SSH session failed to be created, the command would fail. This would be caused when restarting the SSH host. The SSH connection is attempted to be created again. If successful, the command is executed normally.
## v0.3.0 - 2023-01-07
### Added
* Getting environment variables and passwords from Vault (not tested yet)
* Vault configuration to config (not tested yet)
* Ability to run scripts from file on local machine on the remote host
* Ability to get ouput in the notification of a list for individual commands or all commands
### Changed
* Make SSH connections close after all commands have been run; reuse previous connections if needed
## 0.2.4 - 2023-02-18
### Added
* Notifications now display errors and the output of the failed command.
* CI configs for GitHub and Woodpecker
* Added `version` subcommand
### Changed
* Console logging can be disabled by setting `console-disabled` in the `logging` object
## Fixed
* If Host was not defined for an incomplete `hosts` object, any commands would fail as they could not look up the values in the SSH config files.
Regular → Executable
View File
-5
View File
@@ -1,5 +0,0 @@
build:
go build
gorealeaser-build:
goreleaser release --snapshot --rm-dist
-3
View File
@@ -1,3 +0,0 @@
# Plan
Find auth method, possibly using another package
Regular → Executable
+10 -100
View File
@@ -1,112 +1,22 @@
# Backy - an application to manage backups
This app is in development, and is currently not stable. Expect core functionality to possiblly break.
See the [install documentation](https://backy.cybershell.xyz/getting-started/install/index.html)
## Installing
## Security
To install:
`go install git.andrewnw.xyz/CyberShell/backy@master`
This assumes you already have a working Go environment, if not please see [this page](https://golang.org/doc/install) first.
You can also download binaries [here](https://git.andrewnw.xyz/CyberShell/backy/releases) and [here](https://github.com/CybersShell/backy/releases).
The latest version is currently the only supported version.
## Features
- Define lists of commands and run them
- Allows easy configuration of executable commands
- Execute commands over SSH
- Allows for commands to be run on many hosts over SSH
- More to come.
- Commands can be grouped in list to run in specific order
To run a config:
- Notifications on completion and failure
`backy backup`
- Run in cron mode
Or to use a specific file:
```backy backup -f /path/to/file```
If you leave the config path blank, the following paths will be searched in order:
- `./backy.yaml`
- `~/.config/backy.yaml`
Create a file at `~/.config/backy.yaml`:
```yaml
commands:
stop-docker-container:
cmd: docker
Args:
- compose
- -f /some/path/to/docker-compose.yaml
- down
# if host is not defined, cmd will be run locally
host: some-host
backup-docker-container-script:
cmd: /path/to/script
# The host has to be defined in the config file
host: some-host
shell-cmd:
cmd: rsync
shell: bash
Args:
- -av some-host:/path/to/data ~/Docker/Backups/docker-data
hostname:
cmd: hostname
cmd-configs:
cmds-to-run: # this can be any name you want
# all commands have to be defined
order:
- stop-docker-container
- backup-docker-container-script
- shell-cmd
- hostname
notifications:
- matrix
name: backup-some-server
hostname:
name: hostname
order:
- hostname
notifications:
- prod-email
hosts:
some-host:
hostname: some-hostname
config: ~/.ssh/config
user: user
privatekeypath: /path/to/private/key
port: 22
password:
logging:
verbose: true
file: /path/to/logs/commands.log
console: false
cmd-std-out: false
notifications:
prod-email:
id: prod-email
type: mail
host: yourhost.tld:port
senderAddress: email@domain.tld
to:
- admin@domain.tld
username: smtp-username@domain.tld
password: your-password-here
matrix:
id: matrix
type: matrix
home-server: your-home-server.tld
room-id: room-id
access-token: your-access-token
user-id: your-user-id
```
- For any command, especially backup commands
+27
View File
@@ -0,0 +1,27 @@
{
"folders": [
{
"name": "backy",
"path": "."
}
],
"settings": {
"cSpell.words": [
"Autorestic",
"changie",
"Cmds",
"CMDSTDOUT",
"goreleaser",
"knadh",
"koanf",
"mattn",
"maunium",
"mautrix",
"nikoksr",
"packagemanagercommon",
"rawbytes",
"remotefetcher",
"Strs"
]
}
}
Regular → Executable
View File
Regular → Executable
+1
View File
@@ -1 +1,2 @@
*.yaml
*.yml
Regular → Executable
+19 -8
View File
@@ -12,10 +12,9 @@ import (
var (
backupCmd = &cobra.Command{
Use: "backup [--lists==list1,list2]",
Short: "Runs commands defined in config file.",
Long: `Backup executes commands defined in config file.
Use the --lists flag to execute the specified commands.`,
Use: "backup [--lists=list1 --lists list2 ... | -l list1 -l list2 ...]",
Short: "Runs commands defined in config file. Use -l flag multiple times to run multiple lists.",
Long: "Backup executes commands defined in config file.\nUse the --lists or -l flag to execute the specified lists. If not flag is not given, all lists will be executed.",
Run: Backup,
}
)
@@ -24,14 +23,26 @@ var (
var cmdLists []string
func init() {
parseS3Config()
backupCmd.Flags().StringSliceVarP(&cmdLists, "lists", "l", nil, "Accepts a comma-separated names of command lists to execute.")
backupCmd.Flags().StringArrayVarP(&cmdLists, "lists", "l", nil, "Accepts comma-separated names of command lists to execute.")
}
func Backup(cmd *cobra.Command, args []string) {
backyConfOpts := backy.NewOpts(cfgFile, backy.AddCommandLists(cmdLists))
backyConfOpts := backy.NewConfigOptions(configFile,
backy.AddCommandLists(cmdLists),
backy.SetLogFile(logFile),
backy.EnableCommandStdOut(cmdStdOut),
backy.SetHostsConfigFile(hostsConfigFile))
backyConfOpts.InitConfig()
config := backy.ReadConfig(backyConfOpts)
config.RunBackyConfig("")
backyConfOpts.ParseConfigurationFile()
backyConfOpts.RunListConfig("")
for _, host := range backyConfOpts.Hosts {
if host.SshClient != nil {
host.SshClient.Close()
}
}
}
+54
View File
@@ -0,0 +1,54 @@
package cmd
// import (
// "bufio"
// "encoding/json"
// "os"
// "os/exec"
// "strings"
// "testing"
// "github.com/stretchr/testify/assert"
// )
// // TestConfigOptions tests the configuration options for the backy package.
// func Test_ErrorHook(t *testing.T) {
// configFile := "-f ../../tests/ErrorHook.yml"
// logFile := "--log-file=ErrorHook.log"
// backyCommand := exec.Command("go", "run", "../../backy.go", configFile, logFile, "backup")
// backyCommand.Stderr = os.Stdout
// backyCommand.Stdout = os.Stdout
// err := backyCommand.Run()
// assert.Nil(t, err)
// os.Remove("ErrorHook.log")
// logFileData, logFileErr := os.ReadFile("ErrorHook.log")
// if logFileErr != nil {
// assert.FailNow(t, logFileErr.Error())
// }
// var JsonData []map[string]interface{}
// jsonScanner := bufio.NewScanner(strings.NewReader(string(logFileData)))
// for jsonScanner.Scan() {
// var jsonDataLine map[string]interface{}
// err = json.Unmarshal(jsonScanner.Bytes(), &jsonDataLine)
// assert.Nil(t, err)
// JsonData = append(JsonData, jsonDataLine)
// }
// for _, v := range JsonData {
// _, ok := v["error"]
// if !ok {
// assert.FailNow(t, "error does not exist\n")
// // return
// }
// }
// // t.Logf("%s", logFileData)
// // t.Logf("%v", JsonData)
// }
// func TestBackupErrorHook(t *testing.T) {
// logFile = "ErrorHook.log"
// configFile = "../tests/ErrorHook.yml"
// }
Executable
+31
View File
@@ -0,0 +1,31 @@
package cmd
// import (
// "git.andrewnw.xyz/CyberShell/backy/pkg/backy"
// "github.com/spf13/cobra"
// )
// var (
// configCmd = &cobra.Command{
// Use: "config list ...",
// Short: "Runs commands defined in config file.",
// Long: `Cron executes commands at the time defined in config file.`,
// Run: config,
// }
// cmds []string
// lists []string
// )
// func config(cmd *cobra.Command, args []string) {
// opts := backy.NewConfigOptions(configFile, backy.cronEnabled())
// opts.InitConfig()
// }
// func init() {
// configCmd.PersistentFlags().StringArrayVarP(&cmds, "cmds", "c", nil, "Accepts comma-seperated list of commands to list")
// }
Regular → Executable
+12 -5
View File
@@ -8,17 +8,24 @@ import (
var (
cronCmd = &cobra.Command{
Use: "cron command ...",
Short: "Runs commands defined in config file.",
Long: `Cron executes commands at the time defined in config file.`,
Use: "cron [flags]",
Short: "Starts a scheduler that runs lists defined in config file.",
Long: `Cron starts a scheduler that executes command lists at the time defined in config file.`,
Run: cron,
}
)
func cron(cmd *cobra.Command, args []string) {
parseS3Config()
opts := backy.NewConfigOptions(configFile,
backy.EnableCron(),
backy.SetLogFile(logFile),
backy.EnableCommandStdOut(cmdStdOut),
backy.SetHostsConfigFile(hostsConfigFile))
opts := backy.NewOpts(cfgFile, backy.UseCron())
opts.InitConfig()
opts.ParseConfigurationFile()
backy.ReadConfig(opts).Cron()
opts.Cron()
}
Regular → Executable
+21 -12
View File
@@ -14,21 +14,30 @@ import (
var (
execCmd = &cobra.Command{
Use: "exec command ...",
Short: "Runs commands defined in config file.",
Long: `Exec executes commands defined in config file.`,
Short: "Runs commands defined in config file in order given.",
Long: `Exec executes commands defined in config file in order given.`,
Run: execute,
}
)
func execute(cmd *cobra.Command, args []string) {
if len(args) < 1 {
logging.ExitWithMSG("Please provide a command to run. Pass --help to see options.", 0, nil)
}
opts := backy.NewOpts(cfgFile, backy.AddCommands(args))
opts.InitConfig()
// opts.InitMongo()
backy.ReadConfig(opts).ExecuteCmds()
func init() {
execCmd.AddCommand(hostExecCommand, hostsExecCommand)
}
func execute(cmd *cobra.Command, args []string) {
parseS3Config()
if len(args) < 1 {
logging.ExitWithMSG("Please provide a command to run. Pass --help to see options.", 1, nil)
}
opts := backy.NewConfigOptions(configFile,
backy.AddCommands(args),
backy.SetLogFile(logFile),
backy.EnableCommandStdOut(cmdStdOut),
backy.SetHostsConfigFile(hostsConfigFile))
opts.InitConfig()
opts.ParseConfigurationFile()
opts.ExecuteCmds()
}
Executable
+81
View File
@@ -0,0 +1,81 @@
package cmd
import (
"git.andrewnw.xyz/CyberShell/backy/pkg/backy"
"git.andrewnw.xyz/CyberShell/backy/pkg/logging"
"github.com/spf13/cobra"
)
var (
hostExecCommand = &cobra.Command{
Use: "host [--command=command1 --command=command2 ... | -c command1 -c command2 ...] [--hosts=host1 --hosts=hosts2 ... | -m host1 -m host2 ...] ",
Short: "Runs command defined in config file on the hosts in order specified.",
Long: "Host executes specified commands on the hosts defined in config file.\nUse the --commands or -c flag to choose the commands.",
Run: Host,
}
)
// Holds list of hosts to run commands on
var hostsList []string
// Holds command list to run
var cmdList []string
func init() {
hostExecCommand.Flags().StringArrayVarP(&hostsList, "hosts", "m", nil, "Accepts space-separated names of hosts. Specify multiple times for multiple hosts.")
hostExecCommand.Flags().StringArrayVarP(&cmdList, "command", "c", nil, "Accepts space-separated names of commands. Specify multiple times for multiple commands.")
parseS3Config()
}
// cli input should be hosts and commands. Hosts are defined in config files.
// commands can be passed by the following mutually exclusive options:
// 1. as a list of commands defined in the config file
// 2. stdin (on command line) (TODO)
func Host(cmd *cobra.Command, args []string) {
backyConfOpts := backy.NewConfigOptions(configFile,
backy.SetLogFile(logFile),
backy.EnableCommandStdOut(cmdStdOut),
backy.SetHostsConfigFile(hostsConfigFile))
backyConfOpts.InitConfig()
backyConfOpts.ParseConfigurationFile()
// check CLI input
if hostsList == nil {
logging.ExitWithMSG("error: hosts must be specified", 1, &backyConfOpts.Logger)
}
for _, h := range hostsList {
if backy.IsHostLocal(h) {
continue
}
// check if h exists in the config file
_, hostFound := backyConfOpts.Hosts[h]
if !hostFound {
// check if h exists in the SSH config file
hostFoundInConfig, s := backy.DoesHostHaveHostName(h)
if !hostFoundInConfig {
logging.ExitWithMSG("host "+h+" not found", 1, &backyConfOpts.Logger)
}
if backyConfOpts.Hosts == nil {
backyConfOpts.Hosts = make(map[string]*backy.Host)
}
// create host with hostname and host
backyConfOpts.Hosts[h] = &backy.Host{Host: h, HostName: s}
}
}
if cmdList == nil {
logging.ExitWithMSG("error: commands must be specified", 1, &backyConfOpts.Logger)
}
for _, c := range cmdList {
_, cmdFound := backyConfOpts.Cmds[c]
if !cmdFound {
logging.ExitWithMSG("cmd "+c+" not found", 1, &backyConfOpts.Logger)
}
}
backyConfOpts.ExecCmdsOnHosts(cmdList, hostsList)
}
Executable
+93
View File
@@ -0,0 +1,93 @@
package cmd
import (
"maps"
"slices"
"git.andrewnw.xyz/CyberShell/backy/pkg/backy"
"git.andrewnw.xyz/CyberShell/backy/pkg/logging"
"github.com/spf13/cobra"
)
var (
runCommandsInParallel bool
hostsExecCommand = &cobra.Command{
Use: "hosts [--command=command1 --command=command2 ... | -c command1 -c command2 ...]",
Short: "Runs command defined in config file on the hosts in order specified.",
Long: "Hosts executes specified commands on all the hosts defined in config file.\nUse the --commands or -c flag to choose the commands.",
Run: Hosts,
}
hostsListExecCommand = &cobra.Command{
Use: "list list1 list2 ...",
Short: "Runs lists in order specified defined in config file on all hosts.",
Long: "Lists executes specified lists on all the hosts defined in hosts config.\nPass the names of lists as arguments after command.",
Run: HostsList,
}
)
func init() {
hostsExecCommand.AddCommand(hostsListExecCommand)
hostsListExecCommand.Flags().BoolVarP(&runCommandsInParallel, "parallel", "p", false, "Run commands in parallel on hosts")
parseS3Config()
}
// cli input should be hosts and commands. Hosts are defined in config files.
// commands can be passed by the following mutually exclusive options:
// 1. as a list of commands defined in the config file
// 2. stdin (on command line) (TODO)
func Hosts(cmd *cobra.Command, args []string) {
backyConfOpts := backy.NewConfigOptions(configFile,
backy.SetLogFile(logFile),
backy.EnableCommandStdOut(cmdStdOut),
backy.SetHostsConfigFile(hostsConfigFile))
backyConfOpts.InitConfig()
backyConfOpts.ParseConfigurationFile()
for _, h := range backyConfOpts.Hosts {
hostsList = append(hostsList, h.Host)
}
if cmdList == nil {
logging.ExitWithMSG("error: commands must be specified", 1, &backyConfOpts.Logger)
}
for _, c := range cmdList {
_, cmdFound := backyConfOpts.Cmds[c]
if !cmdFound {
logging.ExitWithMSG("cmd "+c+" not found", 1, &backyConfOpts.Logger)
}
}
backyConfOpts.ExecCmdsOnHosts(cmdList, hostsList)
}
func HostsList(cmd *cobra.Command, args []string) {
backyConfOpts := backy.NewConfigOptions(configFile,
backy.SetLogFile(logFile),
backy.EnableCommandStdOut(cmdStdOut),
backy.SetHostsConfigFile(hostsConfigFile))
backyConfOpts.InitConfig()
backyConfOpts.ParseConfigurationFile()
if len(args) == 0 {
logging.ExitWithMSG("error: no lists specified", 1, &backyConfOpts.Logger)
}
for _, l := range args {
_, listFound := backyConfOpts.CmdConfigLists[l]
if !listFound {
logging.ExitWithMSG("list "+l+" not found", 1, &backyConfOpts.Logger)
}
}
maps.DeleteFunc(backyConfOpts.CmdConfigLists, func(k string, v *backy.CmdList) bool {
return !slices.Contains(args, k)
})
backyConfOpts.ExecuteListOnHosts(args, runCommandsInParallel)
}
Executable
+90
View File
@@ -0,0 +1,90 @@
// backup.go
// Copyright (C) Andrew Woodlee 2023
// License: Apache-2.0
package cmd
import (
"git.andrewnw.xyz/CyberShell/backy/pkg/backy"
"git.andrewnw.xyz/CyberShell/backy/pkg/logging"
"github.com/spf13/cobra"
)
var (
listCmd = &cobra.Command{
Use: "list [command]",
Short: "List commands, lists, or hosts defined in config file.",
Long: "List commands, lists, or hosts defined in config file",
}
listCmds = &cobra.Command{
Use: "cmds [cmd1 cmd2 cmd3...]",
Short: "List commands defined in config file.",
Long: "List commands defined in config file",
Run: ListCommands,
}
listCmdLists = &cobra.Command{
Use: "lists [list1 list2 ...]",
Short: "List lists defined in config file.",
Long: "List lists defined in config file",
Run: ListCommandLists,
}
)
var listsToList []string
var cmdsToList []string
func init() {
listCmd.AddCommand(listCmds, listCmdLists)
}
func ListCommands(cmd *cobra.Command, args []string) {
// setup based on whats passed in:
// - cmds
// - lists
// - if none, list all commands
if len(args) > 0 {
cmdsToList = args
} else {
logging.ExitWithMSG("Error: list cmds subcommand needs commands to list", 1, nil)
}
parseS3Config()
opts := backy.NewConfigOptions(configFile,
backy.SetLogFile(logFile),
backy.SetHostsConfigFile(hostsConfigFile))
opts.InitConfig()
opts.ParseConfigurationFile()
for _, v := range cmdsToList {
opts.ListCommand(v)
}
}
func ListCommandLists(cmd *cobra.Command, args []string) {
parseS3Config()
if len(args) > 0 {
listsToList = args
} else {
logging.ExitWithMSG("Error: lists subcommand needs lists", 1, nil)
}
opts := backy.NewConfigOptions(configFile,
backy.SetLogFile(logFile),
backy.SetHostsConfigFile(hostsConfigFile))
opts.InitConfig()
opts.ParseConfigurationFile()
for _, v := range listsToList {
opts.ListCommandList(v)
}
}
Regular → Executable
+17 -4
View File
@@ -13,8 +13,12 @@ import (
var (
// Used for flags.
cfgFile string
configFile string
hostsConfigFile string
verbose bool
cmdStdOut bool
logFile string
s3Endpoint string
rootCmd = &cobra.Command{
Use: "backy",
@@ -32,9 +36,18 @@ func Execute() {
}
func init() {
rootCmd.PersistentFlags().StringVar(&logFile, "logFile", "", "log file to write to")
rootCmd.PersistentFlags().BoolVar(&cmdStdOut, "cmdStdOut", false, "Pass to print command output to stdout")
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "f", "", "config file to read from")
rootCmd.PersistentFlags().StringVarP(&configFile, "config", "f", "", "config file to read from")
rootCmd.PersistentFlags().StringVar(&hostsConfigFile, "hostsConfig", "", "yaml hosts file to read from")
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Sets verbose level")
rootCmd.AddCommand(backupCmd, execCmd, cronCmd)
rootCmd.PersistentFlags().StringVar(&s3Endpoint, "s3Endpoint", "", "Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.")
rootCmd.AddCommand(backupCmd, execCmd, cronCmd, versionCmd, listCmd)
}
func parseS3Config() {
if s3Endpoint != "" {
os.Setenv("S3_ENDPOINT", s3Endpoint)
}
}
+20
View File
@@ -0,0 +1,20 @@
package cmd
import "testing"
// validate checks commands passed in from the command line
/*
*args:
* -t - type of cmd
* -c
*/
func TestUserCmd(t *testing.T) {
/*
*/
}
Executable
+39
View File
@@ -0,0 +1,39 @@
package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
const versionStr = "0.12.1"
var (
versionCmd = &cobra.Command{
Use: "version [flags]",
Short: "Prints the version and exits",
Long: "Prints the version and exits. No arguments just prints the version number only.",
Run: version,
}
numOnly bool
vPre bool
)
func init() {
versionCmd.PersistentFlags().BoolVarP(&numOnly, "num", "n", false, "Output the version number only.")
versionCmd.PersistentFlags().BoolVarP(&vPre, "vpre", "V", false, "Output the version with v prefixed.")
}
func version(cmd *cobra.Command, args []string) {
if numOnly && !vPre {
fmt.Printf("%s\n", versionStr)
} else if vPre && !numOnly {
fmt.Printf("v%s\n", versionStr)
} else {
fmt.Printf("Backy version: %s\n", versionStr)
}
os.Exit(0)
}
+2
View File
@@ -0,0 +1,2 @@
public/
resources/_gen
View File
+6
View File
@@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---
+79
View File
@@ -0,0 +1,79 @@
baseURL: https://backy.cybershell.xyz/
languageCode: en-us
title: A tool for commands
theme:
- hugo-theme-relearn
- plausible-hugo
outputs:
home:
- HTML
- RSS
- PRINT
module:
imports:
- path: github.com/divinerites/plausible-hugo
- path: github.com/McShelby/hugo-theme-relearn
version: "v8.2.0"
params:
themeVariant:
- auto: []
identifier: relearn-auto
name: Relearn Light/Dark
- identifier: relearn-light
- identifier: relearn-dark
- identifier: relearn-bright
- auto:
- zen-light
- zen-dark
identifier: zen-auto
name: Zen Light/Dark
- identifier: zen-light
- identifier: zen-dark
- auto:
- learn
- neon
identifier: retro-auto
name: Retro Learn/Neon
- identifier: neon
- identifier: learn
plausible:
enable: true
domain: backy.cybershell.xyz
outbound_link: true
gitstar: false
selfhosted_domain: stats.andrewnw.com
author:
name: Andrew Woodlee
alwaysopen: false
editURL: ""
description: ""
showVisitedLinks: false
disableSearch: false
disableSearchHiddenPages: false
disableSeoHiddenPages: false
disableTagHiddenPages: false
disableAssetsBusting: false
disableGeneratorVersion: false
disableInlineCopyToClipBoard: false
disableShortcutsTitle: false
disableLandingPageButton: true
disableLanguageSwitchingButton: false
disableBreadcrumb: true
disableToc: false
math: true
customMathJaxURL: https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
mathJaxInitialize: "{}"
mermaid: true
customMermaidURL: https://unpkg.com/mermaid/dist/mermaid.min.js
mermaidInitialize: '{ "theme": "default" }'
disableSwagger: false
customSwaggerURL: https://unpkg.com/rapidoc/dist/rapidoc-min.js
swaggerInitialize: '{ "theme": "light" }'
disableNextPrev: true
ordersectionsby: weight
titleSeparator: "-"
collapsibleMenu: true
additionalContentLanguage:
- en
disableExplicitIndexURLs: false
externalLinkTarget: _blank
+32
View File
@@ -0,0 +1,32 @@
+++
archetype = "home"
title = "Backy"
+++
Backy is a tool for automating data backup and remote command execution. It can work over SSH, and provides completion and failure notifications, error reporting, and more.
Why the name Backy? Because I wanted an app for backups.
View the [changelog here](https://git.andrewnw.xyz/CyberShell/backy/src/branch/master/CHANGELOG.md).
{{% notice tip %}}
Feel free to open a [PR](https://git.andrewnw.xyz/CyberShell/backy/pulls), raise an [issue](https://git.andrewnw.xyz/CyberShell/backy/issues "Open a Gitea Issue")(s), or request new feature(s).
{{% /notice %}}
## Features
- Allows easy configuration of executable commands
- Allows for running package operations
- Allows configuring failure, success, and final hooks
- Allows for commands to be run on many hosts over SSH
- Commands can be grouped in list to run in specific order
- Notifications on completion and failure
- Run in cron mode
- For any command, especially backup commands
+215
View File
@@ -0,0 +1,215 @@
---
title: CLI
weight: 4
---
This page lists documentation for the CLI.
## Backy
```
Backy is a command-line application useful for configuring backups, or any commands run in sequence.
Usage:
backy [command]
Available Commands:
backup Runs commands defined in config file. Use -l flag multiple times to run multiple lists.
completion Generate the autocompletion script for the specified shell
cron Starts a scheduler that runs lists defined in config file.
exec Runs commands defined in config file in order given.
help Help about any command
list List commands, lists, or hosts defined in config file.
version Prints the version and exits
Flags:
--cmdStdOut Pass to print command output to stdout
-f, --config string config file to read from
-h, --help help for backy
--hostsConfig string yaml hosts file to read from
--logFile string log file to write to
--s3Endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
-v, --verbose Sets verbose level
Use "backy [command] --help" for more information about a command.
```
# Subcommands
## backup
```
Backup executes commands defined in config file.
Use the --lists or -l flag to execute the specified lists. If not flag is not given, all lists will be executed.
Usage:
backy backup [--lists=list1 --lists list2 ... | -l list1 -l list2 ...] [flags]
Flags:
-h, --help help for backup
-l, --lists stringArray Accepts comma-separated names of command lists to execute.
Global Flags:
--cmdStdOut Pass to print command output to stdout
-f, --config string config file to read from
--hostsConfig string yaml hosts file to read from
--logFile string log file to write to
--s3Endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
-v, --verbose Sets verbose level
```
## cron
```
Cron starts a scheduler that executes command lists at the time defined in config file.
Usage:
backy cron [flags]
Flags:
-h, --help help for cron
Global Flags:
--cmdStdOut Pass to print command output to stdout
-f, --config string config file to read from
--hostsConfig string yaml hosts file to read from
--logFile string log file to write to
--s3Endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
-v, --verbose Sets verbose level
```
## exec
```
Exec executes commands defined in config file in order given.
Usage:
backy exec command ... [flags]
backy exec [command]
Available Commands:
host Runs command defined in config file on the hosts in order specified.
hosts Runs command defined in config file on the hosts in order specified.
Flags:
-h, --help help for exec
Global Flags:
--cmdStdOut Pass to print command output to stdout
-f, --config string config file to read from
--hostsConfig string yaml hosts file to read from
--logFile string log file to write to
--s3Endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
-v, --verbose Sets verbose level
Use "backy exec [command] --help" for more information about a command.
```
### exec host
```
Host executes specified commands on the hosts defined in config file.
Use the --commands or -c flag to choose the commands.
Usage:
backy exec host [--command=command1 --command=command2 ... | -c command1 -c command2 ...] [--hosts=host1 --hosts=hosts2 ... | -m host1 -m host2 ...] [flags]
Flags:
-c, --command stringArray Accepts space-separated names of commands. Specify multiple times for multiple commands.
-h, --help help for host
-m, --hosts stringArray Accepts space-separated names of hosts. Specify multiple times for multiple hosts.
Global Flags:
--cmdStdOut Pass to print command output to stdout
-f, --config string config file to read from
--hostsConfig string yaml hosts file to read from
--logFile string log file to write to
--s3Endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
-v, --verbose Sets verbose level
```
## version
```
Prints the version and exits. No arguments just prints the version number only.
Usage:
backy version [flags]
Flags:
-h, --help help for version
-n, --num Output the version number only.
-V, --vpre Output the version with v prefixed.
Global Flags:
--cmdStdOut Pass to print command output to stdout
-f, --config string config file to read from
--hostsConfig string yaml hosts file to read from
--logFile string log file to write to
--s3Endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
-v, --verbose Sets verbose level
```
## list
```
List commands, lists, or hosts defined in config file
Usage:
backy list [command]
Available Commands:
cmds List commands defined in config file.
lists List lists defined in config file.
Flags:
-h, --help help for list
Global Flags:
--cmdStdOut Pass to print command output to stdout
-f, --config string config file to read from
--hostsConfig string yaml hosts file to read from
--logFile string log file to write to
--s3Endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
-v, --verbose Sets verbose level
Use "backy list [command] --help" for more information about a command.
```
## list cmds
```
List commands defined in config file
Usage:
backy list cmds [cmd1 cmd2 cmd3...] [flags]
Flags:
-h, --help help for cmds
Global Flags:
--cmdStdOut Pass to print command output to stdout
-f, --config string config file to read from
--hostsConfig string yaml hosts file to read from
--logFile string log file to write to
--s3Endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
-v, --verbose Sets verbose level
```
## list lists
```
List lists defined in config file
Usage:
backy list lists [list1 list2 ...] [flags]
Flags:
-h, --help help for lists
Global Flags:
--cmdStdOut Pass to print command output to stdout
-f, --config string config file to read from
--hostsConfig string yaml hosts file to read from
--logFile string log file to write to
--s3Endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
-v, --verbose Sets verbose level
```
+19
View File
@@ -0,0 +1,19 @@
---
title: Exec
---
The `exec` subcommand can do some things that the configuration file can't do yet. The command `exec host` can execute commands on many hosts.
`exec host` takes the following arguments:
```sh
-c, --commands strings Accepts space-separated names of commands.
-h, --help help for host
-m, --hosts strings Accepts space-separated names of hosts.
```
The commands have to be defined in the config file. The hosts need to at least be in the ssh_config(5) file.
```sh
backy exec host [--commands=command1 -commands=command2 ... | -c command1 -c command2 ...] [--hosts=host1 --hosts=hosts2 ... | -m host1 -m host2 ...] [flags]
```
+29
View File
@@ -0,0 +1,29 @@
---
title: List
---
List commands, lists, or hosts defined in config file
Usage:
```
backy list [command]
```
Available Commands:
cmds List commands defined in config file.
lists List lists defined in config file.
Flags:
```
-h, --help help for list
```
Global Flags:
```
--cmdStdOut Pass to print command output to stdout
-f, --config string config file to read from
--log-file string log file to write to
--s3-endpoint string Sets the S3 endpoint used for config file fetching. Overrides S3_ENDPOINT env variable.
-v, --verbose Sets verbose level
```
+40
View File
@@ -0,0 +1,40 @@
---
title: "Configuring Backy"
weight: 3
description: >
This page tells you how to configure Backy.
---
This is the section on the config file.
To use a specific file:
```backy [command] -f /path/to/file```
You can also use a remote file:
```
backy [command] -f `s3/http source`
```
See remote resources docs for specific info.
If you leave the config path blank, the following paths will be searched in order:
1. `./backy.yml`
2. `./backy.yaml`
3. The same two files above contained in a `backy` subdirectory under in what is returned by Go's `os` package function `UserConfigDir()`.
{{% expand title="`UserConfigDir()` documentation:" %}}
Up-to date documentation for this function may be found on [GoDoc](https://pkg.go.dev/os#UserConfigDir).
>UserConfigDir returns the default root directory to use for user-specific configuration data. Users should create their own application-specific subdirectory within this one and use that.
>On Unix systems, it returns $XDG_CONFIG_HOME as specified by https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html if non-empty, else $HOME/.config. On Darwin, it returns $HOME/Library/Application Support. On Windows, it returns %AppData%. On Plan 9, it returns $home/lib.
>If the location cannot be determined (for example, $HOME is not defined), then it will return an error.
{{% /expand %}}
See the rest of the documentation, titles included below, in this section to configure it.
{{% children description="true" %}}
+99
View File
@@ -0,0 +1,99 @@
---
title: "Command Lists"
weight: 2
description: >
This page tells you how to use command lists.
---
Command lists are for executing commands in sequence and getting notifications from them.
The top-level object key can be anything you want but not the same as another.
Lists can go in a separate file. Command lists should be in a separate file if:
1. key 'cmdLists.file' is specified
2. lists.yml or lists.yaml is found in the same directory as the backy config file (this includes remote config files as of v0.7.0)
{{% notice info %}}
The lists file is also checked in remote resources.
The lists file is ignored under the following condition:
If a remote config file is specified (on the command-line using `-f`) and the lists file is not found in the same directory, the lists file is assumed to not exist.
{{% /notice %}}
```yaml {lineNos="true" wrap="true" title="yaml"}
test2:
name: test2
order:
- test
- test2
notifications:
- mail.prod-email
- matrix.sysadmin
cron: "0 * * * * *"
```
| key | description | type | required
| --- | --- | --- | ---
| `order` | Defines the sequence of commands to execute | `[]string` | yes
| `sendNotificationOnSuccess` | Whether to send notification on list success with the commands' output | `bool` | no
| `notifications` | The notification service(s) and ID(s) to use on success and failure. Must be *`service.id`*. See the [notifications documentation page](/config/notifications/) for more | `[]string` | no
| `name` | Optional name of the list | `string` | no
| `cron` | Time at which to schedule the list. Only has affect when cron subcommand is run. | `string` | no
### Order
The order is an array of commands to execute in order. Each command must be defined.
```yaml
order:
- cmd-1
- cmd-2
```
### getOutput
Get command output when a notification is sent.
Is not required. Can be `true` or `false`. Default is `false`.
### Notifications
An array of notification IDs to use on success and failure. Must match any of the `notifications` object map keys.
### Name
Name is optional. If name is not defined, name will be the object's map key.
### Cron mode
Backy also has a cron mode, so one can run `backy cron` and start a process that schedules jobs to run at times defined in the configuration file.
Adding `cron: 0 0 1 * * *` to a `cmdLists` object will schedule the list at 1 in the morning. See [https://crontab.guru/](https://crontab.guru/) for reference.
{{% notice tip %}}
Note: Backy uses the second field of cron, so add anything except `*` to the beginning of a regular cron expression.
{{% /notice %}}
```yaml {lineNos="true" wrap="true" title="yaml"}
cmdLists:
  docker-container-backup: # this can be any name you want
    # all commands have to be defined
    order:
      - stop-docker-container
      - backup-docker-container-script
      - shell-cmd
      - hostname
      - start-docker-container
    notifications:
      - matrix.id
    name: backup-some-container
    cron: "0 0 1 * * *"
  hostname:
    name: hostname
    order:
      - hostname
    notifications:
    - mail.prod-email
```
+164
View File
@@ -0,0 +1,164 @@
---
title: "Commands"
description: Commands are just that, commands
weight: 1
---
### Example Config
{{% code file="/examples/example.yml" language="yaml" %}}
Values available for this section **(case-sensitive)**:
| name | notes | type | required | External directive support |
| ----------------| ------------------------------------------------------------------------------------------------------- | --------------------- | -------- |----------------------------|
| `cmd` | Defines the command to execute | `string` | yes | No |
| `Args` | Defines the arguments to the command | `[]string` | no | No |
| `environment` | Defines environment variables for the command | `[]string` | no | Partial |
| `type` | See documentation further down the page. Additional fields may be required. | `string` | no | No |
| `getOutput` | Command(s) output is in the notification(s) | `bool` | no | No |
| `host` | Depricated: use `hosts`. If not specified, the command will execute locally. | `string` | no | No |
| `hosts` | Must be specified to run commands both locallly and in parrallel. | `[]string` | no | No |
| `scriptEnvFile` | When type is `scriptFile` or `script`, this file is prepended to the input. | `string` | no | No |
| `shell` | Run the command in the shell | `string` | no | No |
| `hooks` | Hooks are used at the end of the individual command. Must have at least `error`, `success`, or `final`. | `map[string][]string` | no | No |
#### cmd
cmd must be a valid command or script to execute.
#### Args
args must be arguments to cmd as they would be passed on the command-line:
```sh
cmd [arg1 arg2 ...]
```
Define them in an array:
```yaml
Args:
- arg1
- arg2
- arg3
```
### getOutput
Get command output when a notification is sent.
Is not required. Can be `true` or `false`.
### host
{{% notice warning %}}
Depricated: use `hosts` instead.
{{% /notice %}}
{{% notice info %}}
If any `host` is not defined or left blank, the command will run on the local machine.
{{% /notice %}}
Host may or may not be defined in the `hosts` section.
{{% notice info %}}
If any `host` from the commands section does not match any object in the `hosts` section, the `Host` is assumed to be this value. This value will be used to search in the default SSH config files.
For example, say that I have a host defined in my SSH config with the `Host` defined as `web-prod`.
If I assign a value to host as `host: web-prod` and don't specify this value in the `hosts` object, web-prod will be used as the `Host` in searching the SSH config files.
{{% /notice %}}
### hosts
{{% notice info %}}
If any `command.[name].hosts` index is `localhost` or `127.0.0.1`, the command will run on the local machine.
You can also remove the field to have the command run locally.
{{% /notice %}}
Host may or may not be defined in the `hosts` section.
{{% notice info %}}
If any `host` from the commands section does not match any object in the `hosts` section, the `Host` is assumed to be this value. This value will be used to search in the default SSH config files.
For example, say that I have a host defined in my SSH config with the `Host` defined as `web-prod`.
If I assign a value to host as `host: web-prod` and don't specify this value in the `hosts` object, web-prod will be used as the `Host` in searching the SSH config files.
{{% /notice %}}
###### Example:
```yaml
command:
start-some-process:
cmd: start-server
hosts:
- prod-1
- prod-2
```
### shell
If shell is defined, the command will run in the specified shell.
Make sure to escape any shell input.
### scriptEnvFile
Path to a file.
When type is `script` or `scriptFile` , the script is appended to this file.
This is useful for specifying environment variables or other things so they don't have to be included in the script.
### type
The following options are available:
| name | description |
| --- | --- |
| script | `cmd` is used as the script |
| scriptFile | Can only be run on a host. `cmd` is read and used as the script, and `scriptEnvFile` can be used to add env variables |
| package | Run package operations. See [dedicated page](/config/packages) for configuring package commands |
| user | Run user operations. See [dedicated page](/config/user-commands) for configuring package commands |
### environment
The environment variables support expansion:
- using escaped values `$VAR` or `${VAR}`
- using any external directive, and if using the env directive, the variable will be read from a `.env` file
<!-- For now, the variables expanded have to be defined in an `.env` file in the same directory that the program is run from. -->
If using it with host specified, the SSH server has to be configured to accept those env variables.
If the command is run locally, the OS's environment is added.
### hooks
Hooks are run after the command is run.
Errors are run if the command errors, success if it returns no error. Final hooks are run regardless of error condition.
Values for hooks are as follows:
```yaml
command:
hook:
# these commands are defined elsewhere in the file
error:
- errcommand
success:
- successcommand
final:
- donecommand
```
### packages
See the [dedicated page](/config/packages) for package configuration.
+81
View File
@@ -0,0 +1,81 @@
---
title: "Packages"
weight: 2
description: This is dedicated to package commands.
---
This is dedicated to `package` commands. The command `type` field must be `package`. Package is a type that allows one to perform package operations. There are several additional options available when `type` is `package`:
| name | notes | type | required |
| --- | --- | --- | --- |
| `packageName` | The name of a package to be modified. | `[]packagemanagercommon.Package` | yes |
| `packageManager` | The name of the package manger to be used. | `string` | yes |
| `packageOperation` | The type of operation to perform. | `string` | yes |
| `packageVersion` | The version of a package. | `string` | no |
#### example
The following is an example of a package command:
```yaml
update-docker:
type: package
shell: zsh
packages:
- name: docker-ce
version: 10
packageManager: apt
packageOperation: install
host: debian-based-host
```
#### packageOperation
The following package operations are supported:
- `install`
- `remove`
- `upgrade`
- `checkVersion`
#### packageManager
The following package managers are recognized:
- `apt`
- `yum`
- `dnf`
#### package command args
You can add additional arguments using the standard `Args` key. This is useful for adding more packages, yet it does not work with `checkVersion`.
### Development
The PackageManager interface provides an easy way to enforce functions and options. There are two interfaces, `PackageManager` and `ConfigurablePackageManager` in the directory `pkg/pkgman`. Go's import-cycle "feature" caused me to implement functional options using a third interface. `PackageManagerOption`is a function that takes an interface.
#### PackageManager
```go
// PackageManager is an interface used to define common package commands. This shall be implemented by every package.
type PackageManager interface {
Install(pkg, version string, args []string) (string, []string)
Remove(pkg string, args []string) (string, []string)
Upgrade(pkg, version string) (string, []string) // Upgrade a specific package
UpgradeAll() (string, []string)
// Configure applies functional options to customize the package manager.
Configure(options ...pkgcommon.PackageManagerOption)
}
```
There are a few functional options that should be implemented using the `ConfigurablePackageManager` interface:
```go
// ConfigurablePackageManager defines methods for setting configuration options.
type ConfigurablePackageManager interface {
SetUseAuth(useAuth bool)
SetAuthCommand(authCommand string)
}
```
+66
View File
@@ -0,0 +1,66 @@
---
title: "User commands"
weight: 2
description: This is dedicated to user commands.
---
This is dedicated to `user` commands. The command `type` field must be `user`. User is a type that allows one to perform user operations. There are several additional options available when `type` is `user`:
| name | notes | type | required | External directive support
| ----------------| -------------------------------------------------------------| ---------- | ---------| --------------------------|
| `userName` | The name of a user to be configured. | `string` | yes | no |
| `userOperation` | The type of operation to perform. | `string` | yes | no |
| `userID` | The user ID to use. | `string` | no | no |
| `userGroups` | The groups the user should be added to. | `[]string` | no | no |
| `systemUser` | Create a system user. | `bool` | no | no |
| `userCreateHome`| Create the home directory. | `bool` | no | no |
| `userSshPubKeys`| The keys to add to the user's authorized keys. | `[]string` | no | yes |
| `userShell` | The shell for the user. | `string` | no | no |
| `userHome` | The user's home directory. | `string` | no | no |
| `userPassword` | The new password value when using the `password` operation. | `string` | no | yes |
#### example
The following is an example of a package command:
```yaml
addUser:
name: add user backy with custom home dir
type: user
userName: backy
userHome: /opt/backy
userOperation: add
host: some-host
```
#### userOperation
The following package operations are supported:
- `add`
- `remove`
- `modify`
- `password`
- `checkIfExists`
### Development
The UserManager interface provides an way easy to add new commands. There is one interface `Usermanager` in directory `pkg/usermanager`.
#### UserManager
```go
// UserManager defines the interface for user management operations.
// All functions but one return a string for the command and any args.
type UserManager interface {
AddUser(username, homeDir, shell string, isSystem bool, groups, args []string) (string, []string)
RemoveUser(username string) (string, []string)
ModifyUser(username, homeDir, shell string, groups []string) (string, []string)
// Modify password uses chpasswd for Linux systems to build the command to change the password
// Should return a password as the last argument
// TODO: refactor when adding more systems instead of Linux
ModifyPassword(username, password string) (string, *strings.Reader, string)
UserExists(username string) (string, []string)
}
```
+15
View File
@@ -0,0 +1,15 @@
---
title: "External Directives"
weight: 2
description: How to set up external directives.
---
External directives are for including data that should not be in the config file. The following directives are supported:
- `%{file:path/to/file}%`
- `%{env:ENV_VAR}%`
- `%{vault:vault-key}%`
See the docs of each command if the field is supported.
If the file path does not begin with the root directory marker, usually `/`, the config file's directory will be used as the starting point.
+49
View File
@@ -0,0 +1,49 @@
---
title: "Configuring Cron"
weight: 3
description: >
Use Cron to run lists at a specified time.
---
Backy provides an easy-to-use way to execute commands at a specified time.
Adding `cron: 0 0 1 * * *` to a `cmdLists` object will schedule the list at 1 in the morning. See [https://crontab.guru/](https://crontab.guru/) for reference.
GoCron allows one to configure a server to view the jobs in the scheduler. See [GoCron UI GitHub](https://github.com/go-co-op/gocron-ui).
GoCron can be configured or left alone for defaults.
GoCron configuration:
| key | description | type | required | default
| --- | --- | --- | --- | ---
| `bindAddress` | Interface's IP to bind to. Must not contain port. | `string` | no | `:port`
| `port` | Port to use. | `int` | no | `8888`
| `useSeconds` | Whether to parse the second cron field. | `bool` | no | `false`
```yaml {lineNos="true" wrap="true" title="yaml"}
goCron:
bindAddress: "0.0.0.0"
port: 8888
useSeconds: true
cmdLists:
  docker-container-backup: # this can be any name you want
    # all commands have to be defined
    order:
      - stop-docker-container
      - backup-docker-container-script
      - shell-cmd
      - hostname
      - start-docker-container
    notifications:
      - matrix.id
    name: backup-some-container
    cron: "0 0 1 * * *"
  hostname:
    name: hostname
    order:
      - hostname
    notifications:
    - mail.prod-email
```
+24
View File
@@ -0,0 +1,24 @@
---
title: "Hosts"
weight: 2
description: >
This page tells you how to use hosts.
---
| Key | Description | Type | Required | External directive support |
|----------------------|---------------------------------------------------------------|----------|----------|----------------------------|
| `OS` | Operating system of the host (used for package commands) | `string` | no | No |
| `config` | Path to the SSH config file | `string` | no | No |
| `host` | Specifies the `Host` ssh_config(5) directive | `string` | yes | No |
| `hostname` | Hostname of the host | `string` | no | No |
| `knownHostsFile` | Path to the known hosts file | `string` | no | No |
| `port` | Port number to connect to | `uint16` | no | No |
| `proxyjump` | Proxy jump hosts, comma-separated | `string` | no | No |
| `password` | Password for SSH authentication | `string` | no | No |
| `privateKeyPath` | Path to the private key file | `string` | no | No |
| `privateKeyPassword` | Password for the private key file | `string` | no | Yes |
| `user` | Username for SSH authentication | `string` | no | No |
## exec host subcommand
Backy has a subcommand `exec host`. This subcommand takes the flags of `-m host1 -m host2`. The commands can also be specified by `-c command1 -c command2`.
+75
View File
@@ -0,0 +1,75 @@
---
title: "Notifications"
weight: 3
description: >
This page tells you how to get set up Backy notifications.
---
Notifications are only configurable for command lists, as of right now.
Notifications can be sent on command list completion and failure.
The supported platforms for notifications are email (SMTP) and [Matrix](https://matrix.org/).
Notifications are defined by service, with the current form following below. Ids must come after the service.
```yaml
notifications:
mail:
prod-email:
host: yourhost.tld
port: 587
senderaddress: email@domain.tld
to:
- admin@domain.tld
username: smtp-username@domain.tld
password: your-password-here
matrix:
matrix:
home-server: your-home-server.tld
room-id: room-id
access-token: your-access-token
user-id: your-user-id
```
Sections recognized are `mail` and `matrix`
There must be a section with an id (eg. `mail.test-svr`) following one of these sections.
### mail
| key | description | type | External directive support |
| --- | --- | --- | --- |
| `host` | Specifies the SMTP host to connect to | `string` | no
| `port` | Specifies the SMTP port | `uint16` | no
| `senderaddress` | Address from which to send mail | `string` | no
| `to` | Recipients to send emails to | `[]string` | no
| `username` | SMTP username | `string` | no
| `password` | SMTP password | `string` | yes
### matrix
| key | description | type | External directive support |
| --- | --- | ---| ---- |
| `home-server` | Specifies the Matrix server connect to | `string` | no
| `room-id` | Specifies the room ID of the room to send messages to | `string` | no
| `access-token` | Matrix access token | `string` | yes
| `user-id` | Matrix user ID | `string` | no
To get your access token (assumes you are using [Element](https://element.io/)) :
1. Log in to the account you want to get the access token for. Click on the name in the top left corner, then "Settings".
2. Click the "Help & About" tab (left side of the dialog).
3. Scroll to the bottom and click on `<click to reveal>` part of Access Token.
4. Copy your access token to a safe place.
To get the room ID:
1. On Element or a similar client, navigate to the room.
2. Navigate to the settings from the top menu.
3. Click on Advanced, the room ID is there.
{{% notice info %}}
Make sure to quote the room ID, as [YAML spec defines tags using `!`](https://yaml.org/spec/1.2.2/#3212-tags).
{{% /notice %}}
+21
View File
@@ -0,0 +1,21 @@
---
title: "Remote resources"
weight: 2
description: This is dedicated to configuring remote resources.
---
Remote resources can be used for a lot of things, including config files and scripts.
## Config file
For the main config file to be fetched remotely, pass the URL using `-f [url]`.
If using S3, you should use the s3 protocol URI: `s3://bucketName/key/path`. You will also need to set the env variable `S3_ENDPOINT` to the appropriate value. The flag `--s3-endpoint` can be used to override this value or to set this value, if not already set.
## Authentication
Currently, only the AWS authentication credentials file `~/.aws/credentials` is supported. For now, the environment variable `AWS_PROFILE` is used to lookup the profile.
## Scripts
Remote script support is currently limited to http/https endpoints.
+29
View File
@@ -0,0 +1,29 @@
---
title: "Vault"
weight: 4
description: Set up and configure vault.
---
[Vault](https://www.vaultproject.io/) is a tool for storing secrets and other data securely.
A Vault key can be used by prefixing `%{vault:vault.keys.name}%` in a field that supports external directives.
This is the object in the config file:
```yaml
vault:
token: hvs.tXqcASvTP8wg92f7riyvGyuf
address: http://127.0.0.1:8200
enabled: false
keys:
- name: mongourl
mountpath: secret
key: data
path: mongo/url
type: KVv2 # KVv1 or KVv2
- name: someKeyName
mountpath: secret
key: keyData
type: KVv2
path: some/path
```
+108
View File
@@ -0,0 +1,108 @@
commands:
stop-docker-container:
cmd: docker
Args:
- compose
- -f /some/path/to/docker-compose.yaml
- down
# if host is not defined, cmd will be run locally
host: some-host
hooks:
final:
- hostname
error:
- hostname
backup-docker-container-script:
cmd: /path/to/script
# The host has to be defined in the config file
host: some-host
environment:
- FOO=BAR
- APP=$VAR
shell-cmd:
cmd: rsync
shell: bash
Args:
- -av some-host:/path/to/data ~/Docker/Backups/docker-data
hostname:
cmd: hostname
update-docker:
type: package
shell: zsh # best to run package commands in a shell
packageName: docker-ce
Args:
- docker-ce-cli
packageManager: apt
packageOperation: install
update-dockerApt:
# type: package
shell: zsh
cmd: apt
Args:
- update
- "&&"
- apt install -y docker-ce
- docker-ce-cli
packageManager: apt
packageOperation: install
cmd-lists:
cmds-to-run: # this can be any name you want
# all commands have to be defined
order:
- stop-docker-container
- backup-docker-container-script
- shell-cmd
- hostname
notifications:
- matrix.matrix
name: backup-some-server
cron: "0 0 1 * * *"
hostname:
name: hostname
order:
- hostname
notifications:
- mail.prod-email
hosts:
# any ssh_config(5) keys/values not listed here will be looked up in the config file or the default config file
some-host:
hostname: some-hostname
config: ~/.ssh/config
user: user
privateKeyPath: /path/to/private/key
port: 22
# can also be env:VAR
password: file:/path/to/file
# only one is supported for now
proxyjump: some-proxy-host
# optional
logging:
verbose: true
file: ./backy.log
console: false
cmd-std-out: false
notifications:
mail:
prod-email:
id: prod-email
type: mail
host: yourhost.tld
port: 587
senderAddress: email@domain.tld
to:
- admin@domain.tld
username: smtp-username@domain.tld
password: your-password-here
matrix:
matrix:
id: matrix
type: matrix
home-server: your-home-server.tld
room-id: room-id
access-token: your-access-token
user-id: your-user-id
+24
View File
@@ -0,0 +1,24 @@
commands:
stop-docker-container:
cmd: docker
Args:
- compose
- -f /some/path/to/docker-compose.yaml
- down
# if host is not defined, command will be run locally
# The host has to be defined in either the config file or the SSH Config files
host: some-host
hooks:
error:
- some-other-command-when-failing
success:
- success-command
final:
- final-command
backup-docker-container-script:
cmd: /path/to/local/script
# script file is input as stdin to SSH
type: scriptFile # also can be script
environment:
- FOO=BAR
- APP=$VAR
+10
View File
@@ -0,0 +1,10 @@
---
title: "Getting started"
weight: 2
description: >
This page tells you how to get started with Backy.
---
If you have not installed Backy, [see the install documentation](install).
If you need to configure it, [see the config page](config).
+161
View File
@@ -0,0 +1,161 @@
---
title: "Config File Definitions"
description: >
This page tells you how to configure Backy.
---
### Commands
The commands section is for defining commands. These can be run with or without a shell and on a host or locally.
See the [commands documentation](/config/commands) for further information.
```yaml
commands:
  stop-docker-container:
output: true # Optional and only when run in list and notifications are sent
    cmd: docker
    args:
      - compose
      - -f /some/path/to/docker-compose.yaml
      - down
    # if host is not defined, cmd will be run locally
    host: some-host 
  backup-docker-container-script:
    cmd: /path/to/script
    # The host has to be defined in the config file
    host: some-host
    environment:
      - FOO=BAR
    - APP=$VAR # defined in .env file in config directory
  shell-cmd:
    cmd: rsync
    shell: bash
    args:
      - -av
- some-host:/path/to/data
- ~/Docker/Backups/docker-data
script:
type: scriptFile # run a local script on a remote host
cmd: path/to/your/script.sh
host: some-host
  hostname:
    cmd: hostname
```
### Lists
To execute groups of commands in sequence, use a list configuration.
```yaml
cmdLists:
cmds-to-run: # this can be any name you want
# all commands have to be defined in the commands section
order:
- stop-docker-container
- backup-docker-container-script
- shell-cmd
- hostname
getOutput: true # Optional and only for when notifications are sent
notifications:
- matrix
name: backup-some-server
hostname:
name: hostname
order:
- hostname
notifications:
- prod-email
```
### Hosts
The hosts object may or may not be defined.
{{% notice info %}}
If any `host` from a commands object does not match any `host` object, the needed values will be checked in the default SSH config files.
{{% /notice %}}
```yaml
hosts:
# any needed ssh_config(5) keys/values not listed here will be looked up in the config file or the default config file
some-host:
hostname: some-hostname
config: ~/.ssh/config
user: user
privatekeypath: /path/to/private/key
port: 22
# can also be env:VAR or the password itself
password: file:/path/to/file
# can also be env:VAR or the password itself
privatekeypassword: file:/path/to/file
# only one is supported for now
proxyjump: some-proxy-host
```
### Notifications
The notifications object can have two forms.
For more, [see the notification object documentation](/config/notifications). The top-level map key is id that has to be referenced by the `cmdLists` key `notifications`.
```yaml
notifications:
mail:
prod-email:
id: prod-email
type: mail
host: yourhost.tld
port: 587
senderAddress: email@domain.tld
to:
- admin@domain.tld
username: smtp-username@domain.tld
password: your-password-here
matrix:
matrix:
id: matrix
type: matrix
home-server: your-home-server.tld
room-id: room-id
access-token: your-access-token
user-id: your-user-id
```
### Logging
`cmd-std-out` controls whether commands output is echoed to StdOut.
If `logfile` is not defined, the log file will be written to the config directory in the file `backy.log`.
`console-disabled` controls whether the logging messages are echoed to StdOut. Default is false.
`verbose` prints out debugging messages.
```yaml
logging:
verbose: false
file: path/to/log/file.log
console-disabled: false
cmd-std-out: false
```
### Vault
[Vault](https://www.vaultproject.io/) can be used to get some configuration values and ENV variables securely.
```yaml
vault:
token: hvs.tXqcASvTP8wg92f7riyvGyuf
address: http://127.0.0.1:8200
enabled: false
keys:
- name: mongourl
mountpath: secret
path: mongo/url
type: # KVv1 or KVv2
- name:
path:
type:
mountpath:
```
+21
View File
@@ -0,0 +1,21 @@
---
title: "Install Backy"
weight: 1
description: >
This page tells you how to install Backy.
---
Binaries are available from the [release page](https://git.andrewnw.xyz/CyberShell/backy/releases). Make sure to get the correct version for your system, which supports x86_64, ARM64, and i386.
### Source Install
You can install from source. You will need [Go installed](https://go.dev/doc/install).
Then run:
```bash
go install git.andrewnw.xyz/CyberShell/backy@master
```
Once set, jump over to the [config docs](/getting-started/config) and start configuring your file.
+9
View File
@@ -0,0 +1,9 @@
---
title: "Repositories"
weight: 5
---
The repo mirrors are:
* [https://git.andrewnw.xyz/CyberShell/backy](https://git.andrewnw.xyz/CyberShell/backy)
* [https://github.com/CybersShell/backy](https://github.com/CybersShell/backy)
Executable
+8
View File
@@ -0,0 +1,8 @@
module git.andrewnw.xyz/CyberShell/backy/docs
go 1.19
require (
github.com/McShelby/hugo-theme-relearn v0.0.0-20251115105808-d9ca8e8d8f59 // indirect
github.com/divinerites/plausible-hugo v1.22.0 // indirect
)
Executable
+4
View File
@@ -0,0 +1,4 @@
github.com/McShelby/hugo-theme-relearn v0.0.0-20251115105808-d9ca8e8d8f59 h1:mnEjz/Wrpv6Hea26KeFJPx94w9g9ZHIurUEWvPdaEvs=
github.com/McShelby/hugo-theme-relearn v0.0.0-20251115105808-d9ca8e8d8f59/go.mod h1:mKQQdxZNIlLvAj8X3tMq+RzntIJSr9z7XdzuMomt0IM=
github.com/divinerites/plausible-hugo v1.22.0 h1:2pZheSaIMc+EtwcEeZv0ioU2qBOEZa1Ii7IaR/9II9k=
github.com/divinerites/plausible-hugo v1.22.0/go.mod h1:cxr+YB3FUwbLon8KCs4pV4Ankbkq6lJxTQUpNb5KqPo=
+81
View File
@@ -0,0 +1,81 @@
<!DOCTYPE html>
{{- block "storeOutputFormat" . }}{{ end }}
{{- if .IsHome }}
{{- $hugoVersion := "0.141.0" }}
{{- if lt hugo.Version $hugoVersion }}
{{- errorf "The Relearn theme requires Hugo %s or later" $hugoVersion }}
{{- end }}
{{- end }}
{{- if .Site.Params.description }}
{{- warnf "UNSUPPORTED usage of 'params.description' config parameter found, move it to the front matter of your home page; see https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/6/#6-0-0" }}
{{- end }}
<html lang="{{ .Page.Language.LanguageCode }}" dir="{{ .Page.Language.LanguageDirection | default (T "Reading-direction") | default "ltr" }}" itemscope itemtype="http://schema.org/Article" data-r-output-format="{{ with .Store.Get "relearnOutputFormat" }}{{ . }}{{ else }}html{{ end }}">
<head>
{{ partial "plausible_head.html" . }}
{{- partial "meta.html" . }}
{{- $title := partial "title.gotmpl" (dict "page" . "fullyQualified" true "reverse" true) }}
<title>{{ $title }}</title>
{{- /* multilingual stuff */}}
{{- if .IsTranslated -}}
{{- range $index, $trans := .AllTranslations }}
{{- if eq $index 0 }}
<link href="{{ partial "permalink.gotmpl" (dict "to" . "abs" true) }}" rel="alternate" hreflang="x-default">
{{- end }}
<link href="{{ partial "permalink.gotmpl" (dict "to" . "abs" true) }}" rel="alternate" hreflang="{{ .Language.LanguageCode }}">
{{- end }}
{{- end }}
{{- /* output formats */}}
{{- $page := . }}
{{- $link := "<link href=\"%s\" rel=\"%s\" type=\"%s\" title=\"%s\">" }}
{{- range .AlternativeOutputFormats }}
{{- if eq .Rel "canonical" }}
{{ (printf $link (partial "permalink.gotmpl" (dict "to" . "abs" true)) .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }}
{{- else if not (partial "_relearn/pageIsSpecial.gotmpl" $page) }}
{{ (printf $link (partial "permalink.gotmpl" (dict "to" .)) .Rel .MediaType.Type ($title | htmlEscape)) | safeHTML }}
{{- end }}
{{- end }}
{{- partialCached "favicon.html" . }}
{{- partial "dependencies.html" (dict "page" . "location" "header") }}
{{- partial "custom-header.html" . }}
</head>
<body class="mobile-support {{ with .Store.Get "relearnOutputFormat" }}{{ . }}{{ else }}html{{ end }}{{- if .Site.Params.disableHoverBlockCopyToClipBoard }} disableHoverBlockCopyToClipBoard{{ end }}" data-url="{{ partial "permalink.gotmpl" (dict "to" .) }}">
<div id="R-body" class="default-animation">
<div id="R-body-overlay"></div>
<nav id="R-topbar">
<div class="topbar-wrapper">
<div class="topbar-sidebar-divider"></div>
<div class="topbar-area topbar-area-start" data-area="start">
{{- partial "topbar/area/start.html" . }}
</div>
{{- $showBreadcrumb := (and (not .Params.disableBreadcrumb) (not .Site.Params.disableBreadcrumb)) }}
{{- if $showBreadcrumb }}
<ol class="topbar-breadcrumbs breadcrumbs highlightable" itemscope itemtype="http://schema.org/BreadcrumbList">
{{- partial "breadcrumbs.html" (dict "page" . "schema" true) }}
</ol>
{{- else }}
<span class="topbar-breadcrumbs highlightable">
{{ partial "title.gotmpl" (dict "page" . "linkTitle" true) }}
</span>
{{- end }}
<div class="topbar-area topbar-area-end" data-area="end">
{{- partial "topbar/area/end.html" . }}
</div>
</div>
</nav>
<div id="R-main-overlay"></div>
<main id="R-body-inner" class="highlightable{{ with or .Type "default" }} {{ . }}{{ end }}" tabindex="-1">
<div class="flex-block-wrapper">
{{- block "body" . }}{{ end }}
</div>
</main>
{{- partial "custom-comments.html" . }}
</div>
{{- block "menu" . }}{{ end }}
{{- partial "dependencies.html" (dict "page" . "location" "footer") }}
{{- partial "custom-footer.html" . }}
<div id="toast-container" role="status" aria-live="polite" aria-atomic="false"></div>
</body>
</html>
+46
View File
File diff suppressed because one or more lines are too long
+3
View File
@@ -0,0 +1,3 @@
{{ $file := .Get "file" | readFile }}
{{ $lang := .Get "language" }}
{{ (print "```" $lang "\n" $file "\n```") }}
Vendored Submodule
+1
+20
View File
@@ -0,0 +1,20 @@
{
"domain": "go.cybershell.xyz",
"docsDomain": "pkg.go.dev",
"repositories": [
{
"prefix": "backy",
"type": "git",
"hidden": false,
"url": "https://git.andrewnw.xyz/CyberShell/backy",
"source": {
"home": "https://git.andrewnw.xyz/CyberShell/backy",
"dir": "https://git.andrewnw.xyz/CyberShell/backy/src/branch/master/{/dir}",
"file": "https://git.andrewnw.xyz/CyberShell/backy/src/branch/master/{/dir}/{file}#L{line}"
},
"website": {
"url": "https://backy.cybershell.xyz/"
}
}
]
}
+25
View File
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>go.cybershell.xyz/backy</title>
<meta name="go-import" content="go.cybershell.xyz/backy git https://git.andrewnw.xyz/CyberShell/backy">
<meta name="go-source" content="go.cybershell.xyz/backy https://git.andrewnw.xyz/CyberShell/backy https://git.andrewnw.xyz/CyberShell/backy/src/branch/master/{/dir} https://git.andrewnw.xyz/CyberShell/backy/src/branch/master/{/dir}/{file}#L{line}">
<style>
* { font-family: sans-serif; }
body { margin-top: 0; }
.content { display: inline-block; }
code { display: block; font-family: monospace; font-size: 1em; background-color: #d5d5d5; padding: 1em; margin-bottom: 16px; }
ul { margin-top: 16px; margin-bottom: 16px; }
</style>
</head>
<body>
<div class="content">
<h2>go.cybershell.xyz/backy</h2>
<code>go get go.cybershell.xyz/backy</code>
<code>import "go.cybershell.xyz/backy"</code>
Home: <a href="https://backy.cybershell.xyz/">https://backy.cybershell.xyz/</a><br/>
Source: <a href="https://git.andrewnw.xyz/CyberShell/backy">https://git.andrewnw.xyz/CyberShell/backy</a><br/>
</div>
</body>
</html>
Regular → Executable
+44 -7
View File
@@ -7,10 +7,18 @@ commands:
- down
# if host is not defined, cmd will be run locally
host: some-host
hooks:
final:
- hostname
error:
- hostname
backup-docker-container-script:
cmd: /path/to/script
# The host has to be defined in the config file
host: some-host
environment:
- FOO=BAR
- APP=$VAR
shell-cmd:
cmd: rsync
shell: bash
@@ -18,8 +26,29 @@ commands:
- -av some-host:/path/to/data ~/Docker/Backups/docker-data
hostname:
cmd: hostname
update-docker:
type: package
shell: zsh # best to run package commands in a shell
packages:
- name: docker-ce
version: latest
- name: docker-ce-cli
version: latest
packageManager: apt
packageOperation: install
update-dockerApt:
# type: package
shell: zsh
cmd: apt
packages:
- name: docker-ce
version: latest
- name: docker-ce-cli
version: latest
packageManager: apt
packageOperation: install
cmd-configs:
cmd-lists:
cmds-to-run: # this can be any name you want
# all commands have to be defined
order:
@@ -28,42 +57,50 @@ cmd-configs:
- shell-cmd
- hostname
notifications:
- matrix
- matrix.matrix
name: backup-some-server
cron: "0 0 1 * * *"
hostname:
name: hostname
order:
- hostname
notifications:
- prod-email
- mail.prod-email
hosts:
# any ssh_config(5) keys/values not listed here will be looked up in the config file or the default config file
some-host:
hostname: some-hostname
config: ~/.ssh/config
user: user
privatekeypath: /path/to/private/key
port: 22
password:
# can also be env:VAR
password: file:/path/to/file
# only one is supported for now
proxyjump: some-proxy-host
# optional
logging:
verbose: true
file: /path/to/logs/commands.log
file: ./backy.log
console: false
cmd-std-out: false
notifications:
mail:
prod-email:
id: prod-email
type: mail
host: yourhost.tld:port
host: yourhost.tld
port: 587
senderAddress: email@domain.tld
to:
- admin@domain.tld
username: smtp-username@domain.tld
password: your-password-here
matrix:
matrix:
id: matrix
type: matrix

Some files were not shown because too many files have changed in this diff Show More