Skip to content

Commit

Permalink
v3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ojullien committed Aug 1, 2019
1 parent d9cf5b4 commit cee2809
Show file tree
Hide file tree
Showing 19 changed files with 121 additions and 93 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.vscode/
desktop.ini
/src/installShell.sh
priv-*.cfg.sh
local.*
*.fr.conf
/src/bin/ca/
*.com.conf
42 changes: 42 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[submodule "src/autosave"]
path = src/autosave
url = https://github.com/ojullien/bash-autosave.git
[submodule "src/autosavedb"]
path = src/autosavedb
url = https://github.com/ojullien/bash-autosavedb.git
[submodule "src/clean"]
path = src/clean
url = https://github.com/ojullien/bash-clean.git
[submodule "src/createdomain"]
path = src/createdomain
url = https://github.com/ojullien/bash-createdomain.git
[submodule "src/fillwithzeros"]
path = src/fillwithzeros
url = https://github.com/ojullien/bash-fillwithzeros.git
[submodule "src/install"]
path = src/install
url = https://github.com/ojullien/bash-install.git
[submodule "src/manageservices"]
path = src/manageservices
url = https://github.com/ojullien/bash-manageservices.git
[submodule "src/pki"]
path = src/pki
url = https://github.com/ojullien/bash-pki.git
[submodule "src/savedb"]
path = src/savedb
url = https://github.com/ojullien/bash-savedb.git
[submodule "src/savesite"]
path = src/savesite
url = https://github.com/ojullien/bash-savesite.git
[submodule "src/savesystemconf"]
path = src/savesystemconf
url = https://github.com/ojullien/bash-savesystemconf.git
[submodule "src/sys"]
path = src/sys
url = https://github.com/ojullien/bash-sys.git
[submodule "src/tartime"]
path = src/tartime
url = https://github.com/ojullien/bash-tartime.git
[submodule "src/updatesystem"]
path = src/updatesystem
url = https://github.com/ojullien/bash-updatesystem.git
53 changes: 36 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,47 @@
# Contributing
Thanks you for taking the time to contribute! Please fork the repository and make changes as you'd like.

As we use these scripts for our own projects, it contains only the features we need. But, we want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer
**Thanks you for taking the time to contribute!**

This package is a meta-package, aggregating the following bash components (as submodules):

- Core framework
- [sys](https://github.com/ojullien/bash-sys) contains scripts that offer useful functions.
- Applications
- [autosave](https://github.com/ojullien/bash-autosave): Builds a timestamped compressed archive with system logs, web logs and send it to a ftp server.
- [autosavedb](https://github.com/ojullien/bash-autosavedb): Builds a timestamped compressed archive with databases data, and send it to a ftp server.
- [clean](https://github.com/ojullien/bash-clean): Cleans the /var/log folder.
- [createdomain](https://github.com/ojullien/bash-createdomain): Creates an apache user/group and a home directory in /var/www.
- [fillwithzeros](https://github.com/ojullien/bash-fillwithzeros): Fills disks with zero for compression (virtualization) and shutdown the server.
- [install](https://github.com/ojullien/bash-install): Configures a fresh debian/ubuntu installation.
- [manageservices](https://github.com/ojullien/bash-manageservices): Disable, start or stop a list of services defined in the config.sh file.
- [pki](https://github.com/ojullien/bash-pki): Simple Public Key Infrastructure (PKI) management toolkit.
- [savedb](https://github.com/ojullien/bash-savedb): Saves a database.
- [savesite](https://github.com/ojullien/bash-savesite): Saves a www site (located in /var/www).
- [savesystemconf](https://github.com/ojullien/bash-savesystemconf): Saves a system configuration (located in /etc).
- [tartime](https://github.com/ojullien/bash-tartime): Tar and compress files to a timestamped bz2 archive. Standalone script located in bin folder.
- [updatesystem](https://github.com/ojullien/bash-updatesystem): Updates the system.

The issues and pull requests rightfully belong against the individual components and **should be made** accordingly.

As we use these scripts for our own projects, they contain only the features we need. But, we want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a bug.
- Discussing the current state of the code.
- Submitting a fix.
- Proposing new features.
- Becoming a maintainer.

## We develop with GitHub

We use github to host code, to track issues and feature requests, as well as accept pull requests.

## If you have any ideas
Pull requests are the best way to propose changes to the codebase. There are warmly welcome.

1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. Issue that pull request!
Pull requests are the best way to propose changes to the codebase. There are warmly welcome.

## Bug and fix
If you encounter any **bugs**, please open an [issue](https://github.com/ojullien/Shell/issues/new).

If you encounter any **bugs**, please open an issue rightfully belong against the individual components.

**Great Bug Reports** tend to have:

Expand All @@ -36,4 +54,5 @@ If you encounter any **bugs**, please open an [issue](https://github.com/ojullie
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

## License
By contributing, you agree that your contributions will be licensed under its MIT License.

By contributing, you agree that your contributions will be licensed under its [MIT License](LICENSE).
102 changes: 28 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,48 @@
# Shell

Personal Shell scripting projects.
Personal Shell scripting projects in bash. This package is a metapackage aggregating the following bash components (as submodules):

- Core framework
- [sys](https://github.com/ojullien/bash-sys) contains scripts that offer useful functions.
- Applications
- [autosave](https://github.com/ojullien/bash-autosave): Builds a timestamped compressed archive with system logs, web logs and send it to a ftp server.
- [autosavedb](https://github.com/ojullien/bash-autosavedb): Builds a timestamped compressed archive with databases data, and send it to a ftp server.
- [clean](https://github.com/ojullien/bash-clean): Cleans the /var/log folder.
- [createdomain](https://github.com/ojullien/bash-createdomain): Creates an apache user/group and a home directory in /var/www.
- [fillwithzeros](https://github.com/ojullien/bash-fillwithzeros): Fills disks with zero for compression (virtualization) and shutdown the server.
- [install](https://github.com/ojullien/bash-install): Configures a fresh debian/ubuntu installation.
- [manageservices](https://github.com/ojullien/bash-manageservices): Disable, start or stop a list of services defined in the config.sh file.
- [pki](https://github.com/ojullien/bash-pki): Simple Public Key Infrastructure (PKI) management toolkit.
- [savedb](https://github.com/ojullien/bash-savedb): Saves a database.
- [savesite](https://github.com/ojullien/bash-savesite): Saves a www site (located in /var/www).
- [savesystemconf](https://github.com/ojullien/bash-savesystemconf): Saves a system configuration (located in /etc).
- [tartime](https://github.com/ojullien/bash-tartime): Tar and compress files to a timestamped bz2 archive. Standalone script located in bin folder.
- [updatesystem](https://github.com/ojullien/bash-updatesystem): Updates the system.

*As I use these scripts for my own projects, they contain only the features I need.*

## Table of Contents

[Installation](#installation) | [Features](#features) | [Documentation](#documentation) | [Test](#test) | [Contributing](#contributing) | [License](#license)
[Installation](#installation) | [Documentation](#documentation) | [Contributing](#contributing) | [License](#license)

## Installation

Require a Debian/Ubuntu version of linux and a Bash version ~4.4.

1. [Download a release](https://github.com/ojullien/Shell/releases) or clone this repository.
2. Use [scripts/installShell.sh](https://github.com/ojullien/Shell/tree/master/scripts) to automatically install the project in the /opt/ folder.
3. If needed, add `PATH="$PATH:/opt/oju/Shell/bin"` to the .profile files.
4. For each apps in [app folder](https://github.com/ojullien/Shell/tree/master/src/app) check out and edit the configuration file named `config.sh`.
5. Run the app you want. In [Shell/bin](https://github.com/ojullien/Shell/tree/master/src/bin) folder run `./<app_name>.sh` or `bash <app_name>.sh`.

All the main app scripts can take, at least, the following options:

- `-n | --no-display` Display mode. Contents are not displayed.
- `-l | --active-log` Log mode. Contents are logged.
- `-w | --wait` Wait user. Wait for user input between actions.
- `-h | --help` Show the help..
- `-v | --version` Show the version.

## Features

- Core framework
- [sys](https://github.com/ojullien/Shell/tree/master/src/sys) contains scripts that offer useful functions:
- db/mariadb.sh: MariaDB functions.
- db/mysql.sh: MySQL functions.
- bashversion.sh: Tests the current bash version.
- config.sh: Load local app configuration file.
- constant.sh: Core constants.
- filesystem.sh: file system functions.
- ftp.sh: FTP functions.
- openssl.sh: openssl-req and openssl-x509 wrapper functions.
- option.sh: common command line options functions.
- package.sh: package manager (dpkg, apt, aptitude)
- runasroot.sh: Tests the user credentials.
- service.sh: service manager (use system/d.sh or system/v.sh)
- ssh.sh: SSH functions.
- string.sh: string functions.
- system/d.sh: System V service manager.
- system/v.sh: systemd service manager.

- Applications
- [app/](https://github.com/ojullien/Shell/tree/master/src/app) contains the main core files (functions, configurations, ...) for each apps.
- autosave: Builds a timestamped compressed archive with system logs, web logs and send it to a ftp server. Clean the system log after that.
- autosavedb: Builds a timestamped compressed archive with databases data, and send it to a ftp server.
- clean: Cleans the /var/log folder.
- createdomain: Creates an apache user/group and a home directory in /var/www.
- fillwithzeros: Fills disks with zero for compression (virtualization) and shutdown the server.
- install: Configures a fresh debian/ubuntu installation. (ssh is already installed and configured)
- Initial update and upgrade
- update source.list
- update system
- upgrade system
- Install or modify .bashrc, .bash_alias, .bash_profile, .profile files
- Configure swap
- Uninstall packages (vim-tiny, ...)
- Install system packages (dkms, build-essential, util-linux, deborphan, localepurge, hdparm, smartmontools, ...)
- Install and configure app packages (vim, fail2ban, ftp, mlocate, chkrootkit, logwatch, ...)
- Optimize SSD
- manageservices: Disable, start or stop a list of services defined in the config.sh file.
- pki: Simple Public Key Infrastructure (PKI) management toolkit.
- savedb: Saves a database.
- savesite: Saves a www site (located in /var/www).
- savesystemconf: Saves a system configuration (located in /etc).
- tartime: Tar and compress files to a timestamped bz2 archive. Standalone script located in bin folder.
- update-system: Updates the system.
1. [Download a release](https://github.com/ojullien/Shell/releases) or clone this repository using thsi command: `git clone --recurse-submodules https://github.com/ojullien/Shell`.
2. Use [scripts/install.sh](https://github.com/ojullien/Shell/tree/master/scripts) to automatically install the project in the /opt/oju/bash folder.
3. If needed, add `PATH="$PATH:/opt/oju/bash/bin"` to the .profile files.
4. For each apps in `/opt/oju/bash/app` check out and edit the configuration file named `config.sh`.
5. Run the app you want. In `/opt/oju/bash/bin` folder run `./<app_name>.sh` or `bash <app_name>.sh`.

## Documentation

I wrote and I use these scripts for my own projects. And, unfortunately, I do not provide exhaustive documentation. Please read the code and the comments ;)

## Test

I wrote few lines of 'unit test' code for the core framework (sys). No more, sorry.

## Contributing

Thanks you for taking the time to contribute. Please fork the repository and make changes as you'd like.

As I use these scripts for my own projects, it contains only the features I need. But If you have any ideas, just open an [issue](https://github.com/ojullien/Shell/issues/new) and tell me what you think. Pull requests are also warmly welcome.

If you encounter any **bugs**, please open an [issue](https://github.com/ojullien/Shell/issues/new).

Be sure to include a title and clear description,as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.
**Thanks you for taking the time to contribute**. If you wish to contribute, please read the [CONTRIBUTING.md](CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) files.

## License

This project is open-source and is licensed under the [MIT License](https://github.com/ojullien/Shell/blob/master/LICENSE).
This project is open-source and is licensed under the [MIT License](LICENSE).
File renamed without changes.
1 change: 1 addition & 0 deletions src/autosave
Submodule autosave added at f31402
1 change: 1 addition & 0 deletions src/autosavedb
Submodule autosavedb added at 0524fe
1 change: 1 addition & 0 deletions src/clean
Submodule clean added at 9728c2
1 change: 1 addition & 0 deletions src/createdomain
Submodule createdomain added at 2d94d8
1 change: 1 addition & 0 deletions src/fillwithzeros
Submodule fillwithzeros added at 5e06e9
1 change: 1 addition & 0 deletions src/install
Submodule install added at 874b73
1 change: 1 addition & 0 deletions src/manageservices
Submodule manageservices added at 969bea
1 change: 1 addition & 0 deletions src/pki
Submodule pki added at 588657
1 change: 1 addition & 0 deletions src/savedb
Submodule savedb added at 32a9eb
1 change: 1 addition & 0 deletions src/savesite
Submodule savesite added at d64d65
1 change: 1 addition & 0 deletions src/savesystemconf
Submodule savesystemconf added at 15fc14
1 change: 1 addition & 0 deletions src/sys
Submodule sys added at cee545
1 change: 1 addition & 0 deletions src/tartime
Submodule tartime added at 97fa0f
1 change: 1 addition & 0 deletions src/updatesystem
Submodule updatesystem added at b74dfc

0 comments on commit cee2809

Please sign in to comment.