From 4b6c1b3ce2945b9847fe5699a88d13e280a52fa0 Mon Sep 17 00:00:00 2001 From: flobee Date: Wed, 8 Nov 2023 22:32:24 +0100 Subject: [PATCH] VERSION 2.1.0 - Improves uninstall.sh - Updates README.md --- LICENSE.txt | 30 +++++ README.md | 198 ++++++++++++++++++++++++++----- config.sh.example-for-your-setup | 3 +- selfupdate.sh | 5 +- uninstall.sh | 0 5 files changed, 206 insertions(+), 30 deletions(-) create mode 100644 LICENSE.txt mode change 100755 => 100644 uninstall.sh diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..b25369d --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,30 @@ +License + +Copyright 2021 Florian Blasel + +commit d1b5aef7274415d1e94fc63e908efd189b3d2bb8 (tag: 1.0.0) + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 549f1d8..e0c64f7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,23 @@ +# Intro + +Install helper scripts for the [https://gitea.io/](https://gitea.io/) project +using the binary versions. + +**Gitea** is a lightweight DevOps platform like bitbucket, github, gitlab...: +For a own hosting in public or local domain. And it is open source. +It brings teams and developers high-efficiency but easy operations from planning +to production. Read more: https://about.gitea.com/ + +In my oppinion: The primary benefit in a local domain for low to medium teams +and repositories: It is very fast! +Even with a sqliteDB when i started using it. And it can scale. + +**I ❤ Gitea** + + + +## WARNING: + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -9,40 +29,46 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +More: Check the [License](#license). +# TOC + -**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* +**Table of contents** -- [About](#about) - - [Getting started](#getting-started) - - [Updates](#updates) - - [Usage over the time](#usage-over-the-time) ++ [About](#about) ++ [Getting started](#getting-started) ++ [Updates](#updates) ++ [Usage over the time](#usage-over-the-time) ++ [Single script details](#single-script-details) ++ [License](#license) -# About +## About -Install helper scripts for `gitea`. - -Under debian and many other *nix OS's. +Install helper scripts for installing `gitea`. Made under/for debian and +many other *nix OS's. I had some issues at the very first day installing `gitea` and was not able to -get it run. +get it run quickly. The documentation was not good enough in that time so this may help you today. -Install `gitea` under user "`git`"?. Read ahead. Optional you can change the user. +Install `gitea` under user "`git`"?. Read ahead... + +Optional you can change the user and other important options for scaling gitea +and this installation. You will find some scripts you may execute by hand or running the main `runner.sh` script. The `runner.sh` script will guide you by default. Asks questions for backups or -the kind of update (update or install from scratch) depending on -`config.sh[-dist]` settings. +the kind of update (update or install from scratch) depending on config settings. Read all infomations of the output befor you go on to avoid problems. @@ -50,10 +76,12 @@ The scripts must run under `root` and will setup needed path and rights and switch the user when needed for setup/configure the frontend (gitea frontend) with furhter details. +**Hints:** -Hints: +Please read this document first. There some hints you may need to get it run +better than me at very the first time. On code updates: Check this doc also! -Forget your /home/git/.ssh/authorized_keys +Forget your /home/[USER_for_GITEA]/.ssh/authorized_keys Gitea will do! Bring it to zero bytes if already exists and you will have less issues. @@ -85,14 +113,17 @@ To reduce output and handling create and setup your `config.sh` to overwrite the defaults. By default you will be asked for each action. Depending on the settings in `config.sh[-dist]` the `runner.sh` does -all steps and can guide you or just does it without request any futher user +all steps and can guide you or just does it without requesting any futher user input. -Maybe some time some updates are required. Update the repository or use the +Maybe some time some updates are required. Update this repository or use the `selfupdate.sh` script to replace/update existing scripts. Note: `config.sh-dist` would be replaced with the default values! Don't edit it. -Don't copy it to be used as `config.sh`. +Don't copy it to be used as `config.sh`! + + `config.sh-dist` = maintainer side + `config.sh` = your values For automisations you can set the config to not ask questions anymore e.g. using your custom `config.sh`. Suggested values then: @@ -100,13 +131,13 @@ your custom `config.sh`. Suggested values then: ACTION_ASKQUESTIONS='N'; ACTION_TYPE='U'; -Then call `runner.sh '[new url]'`, `update.sh '[new url]'` or `download.sh -'[new url]'`. Download only downloads the binarys and checks the sha256 -checksum. +Then call `runner.sh '[optional new url]'` or e.g. `update.sh '[new url]'`. + +For all jobs the `runner.sh` is the best entry point for the latest version +(depending on the config: `CONFIG_GITEA_BIN_URL='latest'`). -For all jobs the `runner.sh` is the best entry point for the latest version or -update your config with an actual version you want to use or simply force using -the version you want to install: `runner.sh [URL]`. +Or: Update your config with an url/version you want to use or simply force using +the version you want to install/ update: `runner.sh [URL]`. To avoid overwriting your settings (e.g. when using `selfupdate.sh`) add your own `config.sh` including your settings which you can find in `config.sh-dist`. @@ -117,8 +148,9 @@ your values will take account (lifo). ## Usage over the time -Once gitea is installed there are not may things to take care of. Except on OS -changes or changes of gitea where the installer needs some updates. +Once gitea service is installed there are not may things to take care for. +Except on scaling (DB of FS) or OS changes or changes of gitea where the +installer needs some updates. Update the repository or use `selfupdate.sh` and compare/review the `config.sh-dist` for changes and update your custom `config.sh` if exists. @@ -133,8 +165,120 @@ Then you can run the `runner.sh` which just do all automatically. Suggestion: symlink `config.sh.example-for-your-setup` to `config.sh` if you want to have updates from the maintainer. It is only the 'update' case and -creates backups. +creates backups and dont asks questions anymore. Happy git + tea :) + + +## Single script details + +What the single scripts do (A-Z) and some hints you may like or need to know. + + ++ `backup.sh` + + Does only backups from the gitea installation (by given path in config) and + also from the path of the repositories (by given path in config). the path of + the git user (config: USER) account will (currently) not be backuped! This is + something for general backups (repositories and gitea installation may be at + very different places where user account things more OS related things) + + ++ `download.sh [optional new url]` + + Downloads only the binary (by given new url or url from config) and checks the + sha256 checksum. All the rest must be done by hand. + ++ `install.sh [optional new url]` + + Install gitea from scratch/ new installation. Optional use your 'new url' if + you dont want to install the latest version (depends on config settings). 'new + url' will overwrite this config setting. + + ++ `pre-install.sh` is for internal things, not executable... + + and is used within the `install.sh` script. It can use your OS package manager + to check for required packages this program needs to work propperly. + For debian OS's (eg. ubuntu) this works out of the box. + + ++ `runner.sh [optional new url]` + + Basis for all actions to install or upgrade gitea. All other + scripts are seperations. The very first time it was an 'all in one' script + for all actions. Enable `ACTION_ASKQUESTIONS='Y'` for manual usage. + + ++ `selfupdate.sh` + + Updates all the scripts for this app. You dont need to clone the repository. + Updates are only from the 'stable' branch. Which means: The maintainer has + tested the functions in any or all ways and marked it to be 'stable'. + + ++ `uninstall.sh` + + Currently a self deletion of this scripts and for the gitea installation + including ALL OF YOUR DATA (within the default setup/config). + If the paths for this app, repositoies or gitea installation are out of the + git user account it will be left untouched. It will remove the user account + and ALL under its account on FS and will remove system services. DB, if sqlite + also! The `uninstall.sh` is set to force ask questions so that you must give + an input before the deletion starts. + The script come in mode 644 to not call by accident. + + ++ `update.sh [optional new url]` + + Like the `install.sh` task but just the update case. Creation of basis things + are left untouched. It downloads and installs a new binary and re-init the + services based on the settings. + + The optional new url is good when updating not to the latest version! You may + want to update stepwise the minor or major versions if you dont update + regulary. I do if i miss some updates because of unknown situations of gitea + it self. Does a new major version really handle all bugs of a minor version? + Hopefully yes but one is not really sure and the develpoment goes fast there. + Minor vervion 1 includes some bugs which are fixed in minor version 2... + and so on. And the next major version? Does ist solv the sub parts? READ the + changelog and make you own oppinion. Based on this i deside using minor or + major updates stepwise. Global: If i have a minor version i update each until + the next major version and then each major version until the latest version + exist or i want to have/ use. + + + +## License + +Copyright 2021 Florian Blasel + +commit d1b5aef7274415d1e94fc63e908efd189b3d2bb8 (tag: 1.0.0) + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/config.sh.example-for-your-setup b/config.sh.example-for-your-setup index 4fbb5f2..4a9bca4 100644 --- a/config.sh.example-for-your-setup +++ b/config.sh.example-for-your-setup @@ -2,7 +2,8 @@ # shellcheck disable=SC2034 # Unused variables left for readability # # --------------------------------------------------------------------- -# Paths and settings you may want to change +# Paths and settings you may want to change. +# The rest comes from the main config by the maintainer in config.sh-dist. # --------------------------------------------------------------------- ACTION_ASKQUESTIONS='N'; # Ask or just use the config defaults (Y|N)? N for automisations diff --git a/selfupdate.sh b/selfupdate.sh index 7148a13..44de407 100755 --- a/selfupdate.sh +++ b/selfupdate.sh @@ -1,4 +1,5 @@ #!/bin/dash +#echo "File: $(readlink -f "$0")"; # --------------------------------------------------------------------- # self update script @@ -16,9 +17,9 @@ sourceConfigs "${DIR_OF_FILE}" "config.sh-dist" "config.sh"; # all old files (may still exists) to be removed FILE_LIST_OLD=''; # all new files to download -FILE_LIST_NEW='backup.sh config.sh-dist config.sh.example-for-your-setup download.sh pre-install.sh install.sh README.md runner.sh shellFunctions.sh update.sh z_after_install_update.sh selfupdate.sh'; +FILE_LIST_NEW='LICENSE.txt README.md backup.sh config.sh-dist config.sh.example-for-your-setup download.sh install.sh pre-install.sh runner.sh selfupdate.sh shellFunctions.sh uninstall.sh update.sh z_after_install_update.sh '; -EXECUTABLES='selfupdate.sh runner.sh'; +EXECUTABLES='selfupdate.sh runner.sh update.sh backup.sh download.sh'; for FILE in ${FILE_LIST_OLD}; do diff --git a/uninstall.sh b/uninstall.sh old mode 100755 new mode 100644