Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
0dafdf00e1
|
|||
5c93b31286
|
|||
091c81000b
|
80
README.md
80
README.md
@ -1,4 +1,4 @@
|
||||
# Easy Docker Deployment (UBUNTU ONLY)
|
||||
# Octojoom - Easy Docker Deployment
|
||||
With this script we can easily deploy docker containers of Joomla and Openssh. This combination of these tools give rise to a powerful and very secure shared development environment.
|
||||
|
||||
This program has **command input** options as seen in the menus below, but these command are _not the only way_ to set these values.
|
||||
@ -11,37 +11,29 @@ That same time the output message to the terminal will show you where the specif
|
||||
---
|
||||
# Install
|
||||
```shell
|
||||
$ sudo curl -L "https://git.vdm.dev/api/v1/repos/octoleo/docker-deploy/raw/src/docker-deploy?access_token=xxxx" -o /usr/local/bin/docker-deploy
|
||||
$ sudo chmod +x /usr/local/bin/docker-deploy
|
||||
$ sudo curl -L "https://git.vdm.dev/api/v1/repos/octoleo/octojoom/raw/src/octojoom" -o /usr/local/bin/octojoom
|
||||
$ sudo chmod +x /usr/local/bin/octojoom
|
||||
```
|
||||
|
||||
### How to get the Access Token
|
||||
Sign in to [https://git.vdm.dev/](https://git.vdm.dev/user/login) with your **GitHub** or **Gitlab** account.
|
||||
Then open your [applications settings](https://git.vdm.dev/user/settings/applications) and create a new access token.
|
||||
|
||||

|
||||
|
||||
The first time you use the program, it will ask for the access token again, so it can do updates in the future.
|
||||
|
||||
---
|
||||
# Usage
|
||||
|
||||
> To see the usage help menu
|
||||
```shell
|
||||
$ docker-deploy -h
|
||||
$ octojoom -h
|
||||
```
|
||||
### Help Menu (docker-deploy)
|
||||
### Help Menu (octojoom)
|
||||
```txt
|
||||
Usage: docker-deploy [OPTION...]
|
||||
Usage: octojoom [OPTION...]
|
||||
Options
|
||||
======================================================
|
||||
--type <type>
|
||||
set type you would like to work with
|
||||
example: docker-deploy --type joomla
|
||||
example: octojoom --type joomla
|
||||
======================================================
|
||||
--task <task>
|
||||
set type of task you would like to perform
|
||||
example: docker-deploy --task setup
|
||||
example: octojoom --task setup
|
||||
======================================================
|
||||
--container <container.domain.name>
|
||||
Directly enabling or disabling a container with
|
||||
@ -49,74 +41,74 @@ Usage: docker-deploy [OPTION...]
|
||||
The container must exist, which means it was
|
||||
setup previously
|
||||
Used without type and task Joomla-Enable is (default)
|
||||
example: docker-deploy --container "io.vdm.dev"
|
||||
example: octojoom --container "io.vdm.dev"
|
||||
======================================================
|
||||
--update
|
||||
to update your install
|
||||
example: docker-deploy --update
|
||||
example: octojoom --update
|
||||
======================================================
|
||||
--access-token <token>
|
||||
to update the program you will need an access token
|
||||
from https://git.vdm.dev/user/settings/applications
|
||||
example: docker-deploy --access-token xxxxxxxxxxx
|
||||
example: octojoom --access-token xxxxxxxxxxx
|
||||
======================================================
|
||||
--uninstall
|
||||
to uninstall this script
|
||||
example: docker-deploy --uninstall
|
||||
example: octojoom --uninstall
|
||||
======================================================
|
||||
AVAILABLE FOR TO ANY CONTAINER
|
||||
======================================================
|
||||
-k|--key <key>
|
||||
set key for the docker compose container naming
|
||||
!! no spaces allowed in the key !!
|
||||
example: docker-deploy -k="vdm"
|
||||
example: docker-deploy --key="vdm"
|
||||
example: octojoom -k="vdm"
|
||||
example: octojoom --key="vdm"
|
||||
======================================================
|
||||
-e|--env-key <key>
|
||||
set key for the environment variable naming
|
||||
!! no spaces allowed in the key & must be UPPERCASE !!
|
||||
example: docker-deploy -e="VDM"
|
||||
example: docker-deploy --env-key="VDM"
|
||||
example: octojoom -e="VDM"
|
||||
example: octojoom --env-key="VDM"
|
||||
======================================================
|
||||
-d|--domain <domain.com>
|
||||
set key website domain
|
||||
!! must be domain.tld !!
|
||||
example: docker-deploy -d="joomla.org"
|
||||
example: docker-deploy --domain="joomla.org"
|
||||
example: octojoom -d="joomla.org"
|
||||
example: octojoom --domain="joomla.org"
|
||||
======================================================
|
||||
-s|--sub-domain <domain.com>
|
||||
set key website sub domain
|
||||
!! no spaces allowed in the sub domain !!
|
||||
example: docker-deploy -s="jcb"
|
||||
example: docker-deploy --sub-domain="jcb"
|
||||
example: octojoom -s="jcb"
|
||||
example: octojoom --sub-domain="jcb"
|
||||
======================================================
|
||||
AVAILABLE FOR JOOMLA CONTAINER
|
||||
======================================================
|
||||
-j|--joomla-version <version-tag>
|
||||
see available tags here https://hub.docker.com/_/joomla
|
||||
example: docker-deploy -j=3.10
|
||||
example: docker-deploy --joomla-version=3.10
|
||||
example: octojoom -j=3.10
|
||||
example: octojoom --joomla-version=3.10
|
||||
======================================================
|
||||
AVAILABLE FOR OPENSSH CONTAINER
|
||||
======================================================
|
||||
-u|--username <username>
|
||||
set username of the container
|
||||
example: docker-deploy -u="ubuntu"
|
||||
example: docker-deploy --username="ubuntu"
|
||||
example: octojoom -u="ubuntu"
|
||||
example: octojoom --username="ubuntu"
|
||||
======================================================
|
||||
--uid <id>
|
||||
set container user id
|
||||
example: docker-deploy --uid=1000
|
||||
example: octojoom --uid=1000
|
||||
======================================================
|
||||
--gid <id>
|
||||
set container user group id
|
||||
example: docker-deploy --gid=1000
|
||||
example: octojoom --gid=1000
|
||||
======================================================
|
||||
-p|--port <port>
|
||||
set ssh port to use
|
||||
!! do not use 22 !!
|
||||
example: docker-deploy -p=2239
|
||||
example: docker-deploy --port=2239
|
||||
example: octojoom -p=2239
|
||||
example: octojoom --port=2239
|
||||
======================================================
|
||||
--ssh-dir <dir>
|
||||
set ssh directory name found in the .ssh dir
|
||||
@ -124,34 +116,34 @@ Usage: docker-deploy [OPTION...]
|
||||
This directory has separate files for
|
||||
each public key allowed to access
|
||||
the container
|
||||
example: docker-deploy --ssh-dir="teamname"
|
||||
example: octojoom --ssh-dir="teamname"
|
||||
======================================================
|
||||
--sudo
|
||||
switch to add the container user to the
|
||||
sudo group of the container
|
||||
example: docker-deploy --sudo
|
||||
example: octojoom --sudo
|
||||
======================================================
|
||||
-t|--time-zone <time/zone>
|
||||
set time zone of the container
|
||||
!! must valid time zone !!
|
||||
example: docker-deploy -t="Africa/Windhoek"
|
||||
example: docker-deploy --time-zone="Africa/Windhoek"
|
||||
example: octojoom -t="Africa/Windhoek"
|
||||
example: octojoom --time-zone="Africa/Windhoek"
|
||||
======================================================
|
||||
HELP ʕ•ᴥ•ʔ
|
||||
======================================================
|
||||
-h|--help
|
||||
display this help menu
|
||||
example: docker-deploy -h
|
||||
example: docker-deploy --help
|
||||
example: octojoom -h
|
||||
example: octojoom --help
|
||||
======================================================
|
||||
Docker Deployment v2.1.0
|
||||
Octojoom
|
||||
======================================================
|
||||
```
|
||||
---
|
||||
# Uninstall
|
||||
|
||||
```shell
|
||||
$ docker-deploy --uninstall
|
||||
$ octojoom --uninstall
|
||||
```
|
||||
---
|
||||
# Free Software License
|
||||
|
@ -1,11 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# The most recent program version.
|
||||
_VERSION="2.1.0"
|
||||
_V="2.1"
|
||||
_VERSION="3.0.0"
|
||||
_V="3.0"
|
||||
|
||||
# The program full name
|
||||
PROGRAM_NAME="Docker Deployment"
|
||||
PROGRAM_NAME="Octojoom"
|
||||
|
||||
# make sure whiptail is installed
|
||||
command -v whiptail >/dev/null 2>&1 || {
|
||||
@ -176,8 +176,6 @@ function portainer__TRuST__setup() {
|
||||
# container
|
||||
export VDM_REMOVE_SECURE
|
||||
export VDM_ENTRY_POINT
|
||||
# set the update of the host file once
|
||||
setUpdateHostFile
|
||||
# set host file if needed
|
||||
updateHostFile
|
||||
## create the directory if it does not yet already exist
|
||||
@ -376,8 +374,6 @@ function joomla__TRuST__setup() {
|
||||
export vdm_database_user
|
||||
export vdm_database_pass
|
||||
export vdm_database_rootpass
|
||||
# set the update of the host file once
|
||||
setUpdateHostFile
|
||||
# set host file if needed
|
||||
updateHostFile
|
||||
# also set the database domain
|
||||
@ -716,7 +712,7 @@ function joomla__TRuST__edit() {
|
||||
local vdm_edit_me
|
||||
local container
|
||||
# list containers... and allow selection to edit
|
||||
container=$(getSelectedDirectory "Select a container to manually edit if you like." \
|
||||
container=$(getSelectedDirectory "Select a container to manually edit the docker-composer.yml file.\n[Only continue if you know what your doing!]" \
|
||||
"${VDM_REPO_PATH}/${VDM_CONTAINER_TYPE}/available/" '' "Edit ${VDM_CONTAINER_TYPE^} Container")
|
||||
# check that we have something, else return to main menu
|
||||
if [ ${#container} -ge 1 ]; then
|
||||
@ -724,6 +720,8 @@ function joomla__TRuST__edit() {
|
||||
vdm_edit_me="${VDM_REPO_PATH}/${VDM_CONTAINER_TYPE}/available/${container}/docker-compose.yml"
|
||||
# check if this docker-composer.yml exist
|
||||
if [ -f "${vdm_edit_me}" ]; then
|
||||
# give little heads-up
|
||||
showNotice "${USER^}, to save the changes you've made or to just close the file again press:\n\n[ctrl+x] with nano on ubuntu." 13
|
||||
# lets open the file with nano for now
|
||||
"${EDITOR:-nano}" "${vdm_edit_me}"
|
||||
# if this container is enabled ask if it should be redeployed
|
||||
@ -750,7 +748,7 @@ function openssh__TRuST__edit() {
|
||||
local vdm_edit_me
|
||||
local container
|
||||
# list containers... and allow selection to edit
|
||||
container=$(getSelectedDirectory "Select a container to manually edit if you like." \
|
||||
container=$(getSelectedDirectory "Select a container to manually edit the docker-composer.yml file.\n[Only continue if you know what your doing!]" \
|
||||
"${VDM_REPO_PATH}/${VDM_CONTAINER_TYPE}/available/" '' "Edit ${VDM_CONTAINER_TYPE^} Container")
|
||||
# check that we have something, else return to main menu
|
||||
if [ ${#container} -ge 1 ]; then
|
||||
@ -758,6 +756,8 @@ function openssh__TRuST__edit() {
|
||||
vdm_edit_me="${VDM_REPO_PATH}/${VDM_CONTAINER_TYPE}/available/${container}/docker-compose.yml"
|
||||
# check if this docker-composer.yml exist
|
||||
if [ -f "${vdm_edit_me}" ]; then
|
||||
# give little heads-up
|
||||
showNotice "${USER^}, to save the changes you've made or to just close the file again press:\n\n[ctrl+x] with nano on ubuntu." 13
|
||||
# lets open the file with nano for now
|
||||
"${EDITOR:-nano}" "${vdm_edit_me}"
|
||||
# if this container is enabled ask if it should be redeployed
|
||||
@ -780,6 +780,10 @@ function traefik__TRuST__edit() {
|
||||
if [ ! -f "${VDM_REPO_PATH}/${VDM_CONTAINER_TYPE}/docker-compose.yml" ]; then
|
||||
showError "There is no ${VDM_CONTAINER_TYPE^} container to edit."
|
||||
else
|
||||
# give little warning for less command ready people
|
||||
if (whiptail --yesno "Only continue if you know what your doing!\n\n\
|
||||
${USER^}, to save the changes you've made or to just close the file again press:\n\n\
|
||||
[ctrl+x] with nano on ubuntu." --title "Continue to edit ${VDM_CONTAINER_TYPE^} config." 15 112); then
|
||||
# lets open the file with nano for now
|
||||
"${EDITOR:-nano}" "${VDM_REPO_PATH}/${VDM_CONTAINER_TYPE}/docker-compose.yml"
|
||||
# if this container is enabled ask if it should be redeployed
|
||||
@ -788,6 +792,7 @@ function traefik__TRuST__edit() {
|
||||
enableContainer "${VDM_CONTAINER_TYPE}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#####################################################################################################################VDM
|
||||
@ -797,6 +802,10 @@ function portainer__TRuST__edit() {
|
||||
if [ ! -f "${VDM_REPO_PATH}/${VDM_CONTAINER_TYPE}/docker-compose.yml" ]; then
|
||||
showError "There is no ${VDM_CONTAINER_TYPE^} container to edit."
|
||||
else
|
||||
# give little warning for less command ready people
|
||||
if (whiptail --yesno "Only continue if you know what your doing!\n\n\
|
||||
${USER^}, to save the changes you've made or to just close the file again press:\n\n\
|
||||
[ctrl+x] with nano on ubuntu." --title "Continue to edit ${VDM_CONTAINER_TYPE^} config." 15 112); then
|
||||
# lets open the file with nano for now
|
||||
"${EDITOR:-nano}" "${VDM_REPO_PATH}/${VDM_CONTAINER_TYPE}/docker-compose.yml"
|
||||
# if this container is enabled ask if it should be redeployed
|
||||
@ -805,6 +814,7 @@ function portainer__TRuST__edit() {
|
||||
enableContainer "${VDM_CONTAINER_TYPE}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#####################################################################################################################VDM
|
||||
@ -818,7 +828,7 @@ function joomla__TRuST__enable() {
|
||||
elif [ ! -d "${VDM_PROJECT_PATH}" ]; then
|
||||
# this should never happen, but in case
|
||||
showError "The path ${VDM_PROJECT_PATH} does not exist, so we can't mount the persistent volumes. This error should never show, \
|
||||
please open an issue and report docker-deploy-error-1234 with the steps of how you got here?"
|
||||
please open an issue and report octojoom-error-1234 with the steps of how you got here?"
|
||||
elif [ ${#VDM_CONTAINER} -ge 1 ]; then
|
||||
# this means we have a single already selected container to enable if it exists
|
||||
if [ -d "${VDM_REPO_PATH}/${VDM_CONTAINER_TYPE}/available/${VDM_CONTAINER}" ]; then
|
||||
@ -1506,39 +1516,37 @@ function deletePersistentVolumes() {
|
||||
function runUpdate() {
|
||||
# we need sudo permissions
|
||||
if (whiptail --yesno "${USER^}, to update ${PROGRAM_NAME} we need sudo privileges." --title "Give sudo Privileges" 8 112); then
|
||||
# check that we have an access token
|
||||
getAccessToken || return 1
|
||||
# remove the current version
|
||||
if [ -f /usr/local/bin/docker-deploy ]; then
|
||||
if [ -f /usr/local/bin/octojoom ]; then
|
||||
# just backup in case of failure
|
||||
sudo mv /usr/local/bin/docker-deploy /usr/local/bin/docker-deploy.bak
|
||||
sudo mv /usr/local/bin/octojoom /usr/local/bin/octojoom.bak
|
||||
fi
|
||||
# some local values
|
||||
local branch
|
||||
# get the target branch to use in our update
|
||||
branch=$(getTargetBranch)
|
||||
# pull the latest version. Master is always the latest
|
||||
if sudo curl --fail -L "https://git.vdm.dev/api/v1/repos/octoleo/docker-deploy/raw/src/docker-deploy?ref=${branch:-master}&access_token=${VDM_ACCESS_TOKEN}" -o /usr/local/bin/docker-deploy 2>/dev/null; then
|
||||
if sudo curl --fail -L "https://git.vdm.dev/api/v1/repos/octoleo/octojoom/raw/src/octojoom?ref=${branch:-master}" -o /usr/local/bin/octojoom 2>/dev/null; then
|
||||
# give success message
|
||||
echo "SUCCESS: Update was successful."
|
||||
# do we have a backup
|
||||
if [ -f /usr/local/bin/docker-deploy.bak ]; then
|
||||
if [ -f /usr/local/bin/octojoom.bak ]; then
|
||||
# lets remove it now
|
||||
sudo rm -f /usr/local/bin/docker-deploy.bak
|
||||
sudo rm -f /usr/local/bin/octojoom.bak
|
||||
fi
|
||||
else
|
||||
# show the error
|
||||
echo >&2 "ERROR: Update failed! Please try again later."
|
||||
# do we have a backup
|
||||
if [ -f /usr/local/bin/docker-deploy.bak ]; then
|
||||
if [ -f /usr/local/bin/octojoom.bak ]; then
|
||||
# move backup back
|
||||
sudo mv /usr/local/bin/docker-deploy.bak /usr/local/bin/docker-deploy
|
||||
sudo mv /usr/local/bin/octojoom.bak /usr/local/bin/octojoom
|
||||
fi
|
||||
fi
|
||||
# always set the permission again if we have a file
|
||||
if [ -f /usr/local/bin/docker-deploy ]; then
|
||||
if [ -f /usr/local/bin/octojoom ]; then
|
||||
# the we make sure its executable
|
||||
sudo chmod +x /usr/local/bin/docker-deploy
|
||||
sudo chmod +x /usr/local/bin/octojoom
|
||||
fi
|
||||
# always exit so the new script can load
|
||||
exit 0
|
||||
@ -1591,9 +1599,9 @@ function runUninstall() {
|
||||
sudo rm -fr "${VDM_REPO_PATH}"
|
||||
fi
|
||||
elif (whiptail --yesno "Would you like to only remove the actual ${PROGRAM_NAME} v${_V} script but keep all the Docker stuff?" --title "Keep Docker Stuff" 8 112); then
|
||||
# now remove the docker-deploy script
|
||||
if [ -f /usr/local/bin/docker-deploy ]; then
|
||||
sudo rm -f /usr/local/bin/docker-deploy
|
||||
# now remove the octojoom script
|
||||
if [ -f /usr/local/bin/octojoom ]; then
|
||||
sudo rm -f /usr/local/bin/octojoom
|
||||
fi
|
||||
# give the final message
|
||||
whiptail --title "${PROGRAM_NAME} v${_VERSION} is UNINSTALLED" --msgbox "\n\
|
||||
@ -1677,9 +1685,9 @@ function runUninstall() {
|
||||
sudo rm -fr "${VDM_SRC_PATH}"
|
||||
fi
|
||||
fi
|
||||
# now remove the docker-deploy script
|
||||
if [ -f /usr/local/bin/docker-deploy ]; then
|
||||
sudo rm -f /usr/local/bin/docker-deploy
|
||||
# now remove the octojoom script
|
||||
if [ -f /usr/local/bin/octojoom ]; then
|
||||
sudo rm -f /usr/local/bin/octojoom
|
||||
fi
|
||||
# last and final question as this is most dangerous and serious issue.
|
||||
if [ -d "${VDM_PROJECT_PATH}" ] &&
|
||||
@ -1695,10 +1703,10 @@ function runUninstall() {
|
||||
}
|
||||
|
||||
# we show the octoleo info quietly
|
||||
octoleoQuietly() {
|
||||
octojoomQuietly() {
|
||||
local message
|
||||
# now set the message
|
||||
message=" https://git.vdm.dev/octoleo/docker-deploy
|
||||
message=" https://git.vdm.dev/octoleo/octojoom
|
||||
|
||||
Welcome to an Octoleo Program (${PROGRAM_NAME} v$_VERSION)
|
||||
|
||||
@ -1887,7 +1895,7 @@ function showTraefik() {
|
||||
menu_options+=("delete" "Delete Traefik") && i=$((i + 1))
|
||||
# get the selection
|
||||
CHOICE=$(
|
||||
whiptail --menu "Make your selection" 16 112 $i \
|
||||
whiptail --menu "Make your selection" 20 112 $i \
|
||||
--title "Traefik | ${PROGRAM_NAME} v${_V}" --fb \
|
||||
--backtitle " Octoleo" --nocancel --notags \
|
||||
"${menu_options[@]}" 3>&2 2>&1 1>&3
|
||||
@ -1936,7 +1944,7 @@ function showPortainer() {
|
||||
menu_options+=("delete" "Delete Portainer") && i=$((i + 1))
|
||||
# get the selection
|
||||
CHOICE=$(
|
||||
whiptail --menu "Make your selection" 16 112 $i \
|
||||
whiptail --menu "Make your selection" 20 112 $i \
|
||||
--title "Portainer | ${PROGRAM_NAME} v${_V}" --fb \
|
||||
--backtitle " Octoleo" --nocancel --notags \
|
||||
"${menu_options[@]}" 3>&2 2>&1 1>&3
|
||||
@ -1973,6 +1981,9 @@ function showHelpMenu() {
|
||||
menu_options+=("command-help" "Help with commands")
|
||||
# Show folder paths
|
||||
menu_options+=("important-paths" "Important paths")
|
||||
# Edit the global config
|
||||
[ -f "${VDM_SRC_PATH}/.env" ] &&
|
||||
menu_options+=("edit-config" "Edit Config") && i=$((i + 1))
|
||||
# Report an Issue
|
||||
menu_options+=("report-issue" "Report an issue")
|
||||
# Update the whole script
|
||||
@ -1980,10 +1991,10 @@ function showHelpMenu() {
|
||||
# Uninstall the whole script
|
||||
menu_options+=("uninstall" "Uninstall ${PROGRAM_NAME,,}")
|
||||
# Octoleo details
|
||||
menu_options+=("octoleo" "Octoleo")
|
||||
menu_options+=("octojoom" "Octojoom")
|
||||
# get the selection
|
||||
CHOICE=$(
|
||||
whiptail --menu "Make your selection" 16 112 $i \
|
||||
whiptail --menu "Make your selection" 20 112 $i \
|
||||
--title "Help Menu | ${PROGRAM_NAME} v${_V}" --fb \
|
||||
--backtitle " Octoleo" --nocancel --notags \
|
||||
"${menu_options[@]}" 3>&2 2>&1 1>&3
|
||||
@ -1996,8 +2007,11 @@ function showHelpMenu() {
|
||||
"important-paths")
|
||||
showImportantPaths
|
||||
;;
|
||||
"edit-config")
|
||||
editConfigFile
|
||||
;;
|
||||
"report-issue")
|
||||
showLink "https://git.vdm.dev/octoleo/docker-deploy/issues" "To report an issue go to:" "Report an Issue"
|
||||
showLink "https://git.vdm.dev/octoleo/octojoom/issues" "To report an issue go to:" "Report an Issue"
|
||||
;;
|
||||
"update")
|
||||
runUpdate
|
||||
@ -2005,8 +2019,8 @@ function showHelpMenu() {
|
||||
"uninstall")
|
||||
runUninstall
|
||||
;;
|
||||
"octoleo")
|
||||
octoleoQuietly
|
||||
"octojoom")
|
||||
octojoomQuietly
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@ -2020,14 +2034,18 @@ function domainsMenu() {
|
||||
# load the back menu
|
||||
menu_options+=("back" "<-- Return to the main menu.")
|
||||
# add more domains
|
||||
menu_options+=("add" "Add Domain")
|
||||
allowMultiDomains &&
|
||||
menu_options+=("add" "Add Domain") && i=$((i + 1))
|
||||
# remove existing domains
|
||||
[ -f "${VDM_SRC_PATH}/.domains" ] &&
|
||||
menu_options+=("delete" "Delete Domain") && i=$((i + 1))
|
||||
# edit available container
|
||||
allowEditHostFile &&
|
||||
menu_options+=("edit" "Edit Host File") && i=$((i + 1))
|
||||
# get the selection
|
||||
CHOICE=$(
|
||||
whiptail --menu "Make your selection" 16 112 $i \
|
||||
--title "Help Menu | ${PROGRAM_NAME} v${_V}" --fb \
|
||||
whiptail --menu "Make your selection" 20 112 $i \
|
||||
--title "Domains Menu | ${PROGRAM_NAME} v${_V}" --fb \
|
||||
--backtitle " Octoleo" --nocancel --notags \
|
||||
"${menu_options[@]}" 3>&2 2>&1 1>&3
|
||||
)
|
||||
@ -2039,6 +2057,9 @@ function domainsMenu() {
|
||||
"delete")
|
||||
deleteMultiDomains
|
||||
;;
|
||||
"edit")
|
||||
editHostFile
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@ -2047,7 +2068,7 @@ function mainMenu() {
|
||||
# menu for dynamic addition
|
||||
local menu_options=()
|
||||
# our counter
|
||||
local i=9
|
||||
local i=6
|
||||
# Joomla containers
|
||||
menu_options+=("joomla" "Joomla Containers")
|
||||
# Openssh containers
|
||||
@ -2057,8 +2078,10 @@ function mainMenu() {
|
||||
# Portainer container
|
||||
menu_options+=("portainer" "Portainer Container")
|
||||
# Manage Domains
|
||||
allowMultiDomains &&
|
||||
menu_options+=("domains" "Manage Domains") && i=$((i + 1))
|
||||
if allowEditHostFile || allowMultiDomains; then
|
||||
menu_options+=("domains" "Manage Domains")
|
||||
i=$((i + 1))
|
||||
fi
|
||||
# Delete Persistent Volumes
|
||||
hasDirectories '' "${VDM_PROJECT_PATH}" &&
|
||||
menu_options+=("delete" "Delete Persistent Volumes") && i=$((i + 1))
|
||||
@ -2107,17 +2130,17 @@ function mainMenu() {
|
||||
|
||||
# show error
|
||||
function showError() {
|
||||
whiptail --title "ERROR | ${PROGRAM_NAME} v${_V}" --msgbox "${1}" 12 112
|
||||
whiptail --title "ERROR | ${PROGRAM_NAME} v${_V}" --msgbox "${1}" "${2:-12}" 112
|
||||
}
|
||||
|
||||
# show info
|
||||
function showInfo() {
|
||||
whiptail --title "INFO | ${PROGRAM_NAME} v${_V}" --infobox "${1}" 12 112
|
||||
whiptail --title "INFO | ${PROGRAM_NAME} v${_V}" --infobox "${1}" "${2:-12}" 112
|
||||
}
|
||||
|
||||
# show notice
|
||||
function showNotice() {
|
||||
whiptail --title "NOTICE | ${PROGRAM_NAME} v${_V}" --msgbox "${1}" 12 112
|
||||
whiptail --title "NOTICE | ${PROGRAM_NAME} v${_V}" --msgbox "${1}" "${2:-12}" 112
|
||||
}
|
||||
|
||||
# show link
|
||||
@ -2139,7 +2162,7 @@ function showImportantPaths() {
|
||||
CONFIG: ${VDM_SRC_PATH}
|
||||
|
||||
Then we have some key environment variable files that hold very useful and important information.
|
||||
Since we do not store any passwords or other important details in the docker-deploy.yml files
|
||||
Since we do not store any passwords or other important details in the octojoom.yml files
|
||||
they are stored in these environment variable files and its permissions are (600) for security.
|
||||
|
||||
JOOMLA: ${VDM_REPO_PATH}/joomla/.env
|
||||
@ -2198,6 +2221,7 @@ function hasDirectories() {
|
||||
function getRandomPass() {
|
||||
# simple basic random
|
||||
# shellcheck disable=SC2046
|
||||
# shellcheck disable=SC2005
|
||||
echo $(tr -dc 'A-HJ-NP-Za-km-z2-9' </dev/urandom | dd bs="${1:-128}" count=1 status=none)
|
||||
}
|
||||
|
||||
@ -2296,38 +2320,6 @@ function getPassword() {
|
||||
echo "${PASSWORD}"
|
||||
}
|
||||
|
||||
# get and set the access token
|
||||
function getAccessToken() {
|
||||
# we try getting the token twice
|
||||
local t=0
|
||||
local new_token=false
|
||||
# check that we have an access token, els ask for it
|
||||
while [ ${#VDM_ACCESS_TOKEN} -le 30 ]; do
|
||||
# this is a new token
|
||||
new_token=true
|
||||
# get the value
|
||||
VDM_ACCESS_TOKEN=$(getInput "Enter access token for updates.\n[You can get an access token from https://git.vdm.dev/user/settings/applications]" \
|
||||
'' 'Access Token')
|
||||
# keep asking if empty
|
||||
if [ ${#VDM_ACCESS_TOKEN} -le 30 ]; then
|
||||
showError "Updates can only be done if you have an access token."
|
||||
# increment our try
|
||||
t=$((t + 1))
|
||||
# when the user for the second time does not supply the correct value we return
|
||||
if [ $t -eq 2 ]; then
|
||||
return 12
|
||||
fi
|
||||
fi
|
||||
done
|
||||
# make the token available
|
||||
export VDM_ACCESS_TOKEN
|
||||
# store the token for next time
|
||||
$new_token && setEnvVariable "VDM_ACCESS_TOKEN=\"${VDM_ACCESS_TOKEN}\"" &&
|
||||
showNotice "The token has been stored in the environment variable file (${VDM_SRC_PATH}/.env)."
|
||||
# we have success
|
||||
return 0
|
||||
}
|
||||
|
||||
# get the target branch to use in update
|
||||
function getTargetBranch() {
|
||||
# now make the selection
|
||||
@ -2354,9 +2346,10 @@ function getListDomains() {
|
||||
# build the menu
|
||||
for domain in "${domains[@]}"; do
|
||||
# load the back menu
|
||||
menu_options+=("${domain}")
|
||||
[ "${#domain}" -ge 1 ] && menu_options+=("${domain}")
|
||||
done
|
||||
# we show a list of options including the option to add another
|
||||
# shellcheck disable=SC2005
|
||||
echo "$(printf "${separator}%s" "${menu_options[@]}")"
|
||||
fi
|
||||
fi
|
||||
@ -2373,52 +2366,66 @@ function getMultiDomain() {
|
||||
local i=0
|
||||
# always add the main domain or (default) first
|
||||
# so we should always have a selection
|
||||
setMultiDomain "${VDM_DOMAIN:-${USER:-joomla}.vdm}"
|
||||
saveMultiDomain "${VDM_DOMAIN}"
|
||||
# now clear the main domain (in case we use getDomain)
|
||||
unset VDM_DOMAIN
|
||||
# get existing domains
|
||||
if [ -f "${VDM_SRC_PATH}/.domains" ] && readarray -t domains <"${VDM_SRC_PATH}/.domains"; then
|
||||
# build the menu
|
||||
if [ "${#domains[@]}" -gt 0 ]; then
|
||||
# loop domains
|
||||
for domain in "${domains[@]}"; do
|
||||
# load the back menu
|
||||
menu_options+=("${domain}" "${domain}" "OFF")
|
||||
# load the domain if it has a length
|
||||
[ "${#domain}" -ge 1 ] && menu_options+=("${domain}" "${domain}" "OFF")
|
||||
# increment our counter
|
||||
i=$((i + 1))
|
||||
[ "${#domain}" -ge 1 ] && i=$((i + 1))
|
||||
done
|
||||
# make sure we have domains
|
||||
if [ "${#menu_options[@]}" -gt 0 ]; then
|
||||
# we show a list of options including the option to add another
|
||||
domain_name=$(whiptail --title "Select a Domain" --radiolist --nocancel --notags \
|
||||
"Select a domain, or none to add another." 30 80 $i \
|
||||
"${menu_options[@]}" 3>&1 1>&2 2>&3)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
# check if we have a selection
|
||||
if [ "${domain_name:-none}" = 'none' ]; then
|
||||
# we must let them enter the new domain name
|
||||
domain_name=$(getDomain "Enter a domain name" "Enter a Domain Name")
|
||||
getDomain 'Enter a domain name' 'Enter a Domain Name'
|
||||
else
|
||||
# set the new main domain
|
||||
VDM_DOMAIN="${domain_name}"
|
||||
# update the main domain
|
||||
export VDM_DOMAIN
|
||||
fi
|
||||
# add for next time
|
||||
setMultiDomain "${domain_name:-${USER:-joomla}.vdm}"
|
||||
# update the main domain
|
||||
echo "${domain_name:-${USER:-joomla}.vdm}"
|
||||
saveMultiDomain "${VDM_DOMAIN}"
|
||||
}
|
||||
|
||||
# set the VDM domain value
|
||||
function getDomain() {
|
||||
# set some locals
|
||||
local message="Enter main domain name"
|
||||
local title="Enter Main Domain"
|
||||
local tld="${VDM_CONTAINER_TYPE:-vdm}"
|
||||
# get the arg passed if any
|
||||
message="${1:-$message}"
|
||||
title="${2:-$title}"
|
||||
# get the VDM Domain value if not already set
|
||||
while [ ${#VDM_DOMAIN} -le 1 ] || [[ "${VDM_DOMAIN}" != *.* ]]; do
|
||||
# get the value
|
||||
VDM_DOMAIN=$(getInput "${1:-Enter main domain name.}\n[must have at least one dot]" \
|
||||
"${3:-${USER:-joomla}.vdm}" "${2:-Enter Main Domain}")
|
||||
VDM_DOMAIN=$(getInput "${message}\n[must have at least one dot]" \
|
||||
"${USER:-octoleo}.${tld,,}" "${title}")
|
||||
# keep asking if empty or does exist
|
||||
if [ ${#VDM_DOMAIN} -le 1 ]; then
|
||||
showError "${4:-You must enter a domain name!}"
|
||||
showError "You must enter a domain name!"
|
||||
elif [[ "${VDM_DOMAIN}" != *.* ]]; then
|
||||
showError "${5:-You must enter a domain name with at least one dot!}"
|
||||
showError "You must enter a domain name with at least one dot"
|
||||
fi
|
||||
done
|
||||
# return what we found
|
||||
echo "${VDM_DOMAIN}"
|
||||
# update the main domain
|
||||
export VDM_DOMAIN
|
||||
}
|
||||
|
||||
# set the main domain
|
||||
@ -2426,13 +2433,11 @@ function getMainDomain() {
|
||||
# we first check if we have a main domain passed as command argument
|
||||
if $VDM_ARG_DOMAIN; then
|
||||
# if domain passed by arg we just return it
|
||||
VDM_DOMAIN=$(getDomain "Enter a domain name" "Enter a Domain Name")
|
||||
getDomain 'Enter a domain name' 'Enter a Domain Name'
|
||||
else
|
||||
# update the main domain with a selection
|
||||
VDM_DOMAIN=$(getMultiDomain)
|
||||
getMultiDomain
|
||||
fi
|
||||
# make sure it is available
|
||||
export VDM_DOMAIN
|
||||
}
|
||||
|
||||
# set the domain
|
||||
@ -2450,11 +2455,9 @@ function setDomain() {
|
||||
# set the main domain
|
||||
function setMainDomain() {
|
||||
# set the main domain if not set
|
||||
VDM_DOMAIN=$(getDomain)
|
||||
getDomain
|
||||
# add this value if not set variable
|
||||
setEnvVariable "VDM_DOMAIN=\"${VDM_DOMAIN}\""
|
||||
# make sure it is available
|
||||
export VDM_DOMAIN
|
||||
}
|
||||
|
||||
# set the sub domain
|
||||
@ -2464,10 +2467,10 @@ function setSubDomain() {
|
||||
while [ ${#VDM_SUBDOMAIN} -le 1 ] || [[ "${VDM_SUBDOMAIN}" =~ [^a-zA-Z] ]] ||
|
||||
[ -d "${VDM_REPO_PATH}/${3:-$VDM_CONTAINER_TYPE}/available/${VDM_SUBDOMAIN}.${VDM_DOMAIN}" ] ||
|
||||
[ -d "${VDM_REPO_PATH}/${3:-$VDM_CONTAINER_TYPE}/available/${VDM_SUBDOMAIN%db}.${VDM_DOMAIN}" ] ||
|
||||
[ "${VDM_SUBDOMAIN}" = "${2:-}" ]; do
|
||||
[ "${VDM_SUBDOMAIN}" = "${2}" ]; do
|
||||
# get the value
|
||||
VDM_SUBDOMAIN=$(getInput "Enter sub-domain used for this ${VDM_CONTAINER_TYPE^} container.\n[Text with no spaces that is only alphabetical]" \
|
||||
"${1:-}" 'Enter Sub-Domain')
|
||||
"${1}" 'Enter Sub-Domain')
|
||||
# keep asking if empty or does exist
|
||||
if [ ${#VDM_SUBDOMAIN} -ge 1 ] && [ -d "${VDM_REPO_PATH}/${3:-$VDM_CONTAINER_TYPE}/available/${VDM_SUBDOMAIN}.${VDM_DOMAIN}" ] ||
|
||||
[ -d "${VDM_REPO_PATH}/${3:-$VDM_CONTAINER_TYPE}/available/${VDM_SUBDOMAIN%db}.${VDM_DOMAIN}" ]; then
|
||||
@ -2500,12 +2503,9 @@ function setMultiDomains() {
|
||||
# now clear the main domain each time
|
||||
unset VDM_DOMAIN
|
||||
# we must let them enter the new domain name
|
||||
domain_name=$(getDomain "Enter a domain name" "Enter a Domain Name")
|
||||
getDomain 'Enter a domain name' 'Enter a Domain Name'
|
||||
# add for next time
|
||||
setMultiDomain "${domain_name:-${USER:-joomla}.vdm}" || {
|
||||
# return an error
|
||||
return $?
|
||||
}
|
||||
saveMultiDomain "${VDM_DOMAIN}"
|
||||
# get the list of domains
|
||||
list_domains=$(getListDomains "\n")
|
||||
# update the question
|
||||
@ -2514,35 +2514,17 @@ function setMultiDomains() {
|
||||
fi
|
||||
}
|
||||
|
||||
# to set a global multiple domain file and values
|
||||
function setMultiDomain() {
|
||||
# check if the env file exist
|
||||
if [ -f "${VDM_SRC_PATH}/.domains" ]; then
|
||||
grep -q "${1}" "${VDM_SRC_PATH}/.domains" || echo "${1}" >>"${VDM_SRC_PATH}/.domains"
|
||||
elif (whiptail --yesno "Can we create the ${VDM_SRC_PATH}/.domains file" --title "Multi Domain File" 8 112); then
|
||||
# make sure the folder exist
|
||||
mkdir -p "${VDM_SRC_PATH}"
|
||||
# so we creat the file
|
||||
echo "${1}" >"${VDM_SRC_PATH}/.domains"
|
||||
# make sure the permissions are secured
|
||||
chmod 600 "${VDM_SRC_PATH}/.domains"
|
||||
else
|
||||
showError "The ${VDM_SRC_PATH}/.domains file does not exist. So ${1} could not be added!"
|
||||
# we return false
|
||||
return 12
|
||||
fi
|
||||
# we return true
|
||||
return 0
|
||||
}
|
||||
|
||||
# set the multi domain switch
|
||||
function setMultiDomainSwitch() {
|
||||
# Allow multiple domains
|
||||
if [ "${VDM_MULTI_DOMAIN:-not}" = 'not' ]; then
|
||||
# explain the pros and cons...
|
||||
showNotice "The down side to allowing multiple domains is that you will need to select a main domain each time you setup a new container. The advantage is that you can have multiple domains ;)"
|
||||
showNotice "Next you should make the selection of using a single or multiple domain setup.\n\n\
|
||||
With multiple domain setups you will need to select a main domain each time you setup a new container.\n\
|
||||
With a single domain setup you setup the main domain once, and then only need setup the subdomains\n\
|
||||
with each new container."
|
||||
# check the security switch
|
||||
if (whiptail --yesno "Would you like to allow for multiple domains?" --defaultno --title "Allow Multi Domains" 8 112); then
|
||||
if (whiptail --yesno "Would you like to use a multiple domains setup?" --defaultno --title "Allow Multi Domains" 8 112); then
|
||||
# we set the secure switch
|
||||
VDM_MULTI_DOMAIN=true
|
||||
else
|
||||
@ -2615,7 +2597,7 @@ function setUpdateHostFile() {
|
||||
function setSecureState() {
|
||||
if [ "${VDM_SECURE:-not}" = 'not' ]; then
|
||||
# check the security switch
|
||||
if (whiptail --yesno "Would you like to use Letsencrypt auto setup for your containers [only for server with public static IP]" --defaultno --title "Letsencrypt" 8 112); then
|
||||
if (whiptail --yesno "Would you like to use Letsencrypt auto setup for your containers [ONLY for server with public static IP]" --defaultno --title "Letsencrypt" 8 112); then
|
||||
# we set the secure switch
|
||||
VDM_SECURE=true
|
||||
else
|
||||
@ -2703,6 +2685,48 @@ function allowMultiDomains() {
|
||||
return 12
|
||||
}
|
||||
|
||||
# do we allow multiple domains
|
||||
function allowEditHostFile() {
|
||||
# check if we allow host file updates
|
||||
setUpdateHostFile
|
||||
# allow multi domain setup
|
||||
if $VDM_UPDATE_HOST; then
|
||||
# yes we do
|
||||
return 0
|
||||
fi
|
||||
# now we don't
|
||||
return 12
|
||||
}
|
||||
|
||||
# to set a global multiple domain file and values
|
||||
function saveMultiDomain() {
|
||||
# set some locals
|
||||
local domain_name
|
||||
local src_path_domain
|
||||
# set the domain and remove any whitespace
|
||||
domain_name="$(echo -e "${1}" | tr -d '[:space:]')";
|
||||
src_path_domain="${VDM_SRC_PATH}/.domains";
|
||||
# check that we have a domain string
|
||||
if [ ${#domain_name} -ge 1 ]; then
|
||||
# check if the file exist
|
||||
if [ -f "${src_path_domain}" ]; then
|
||||
# check if its already set
|
||||
if grep -L "${domain_name}" "${src_path_domain}"; then
|
||||
echo "${domain_name}" >>"${src_path_domain}"
|
||||
fi
|
||||
else
|
||||
# make sure the folder exist
|
||||
mkdir -p "${VDM_SRC_PATH}"
|
||||
# so we creat the file
|
||||
echo "${domain_name}" >"${src_path_domain}"
|
||||
# make sure the permissions are secured
|
||||
chmod 600 "${src_path_domain}"
|
||||
fi
|
||||
fi
|
||||
# we return true
|
||||
return 0
|
||||
}
|
||||
|
||||
# delete multiple domains
|
||||
function deleteMultiDomains() {
|
||||
# menu for dynamic addition
|
||||
@ -2751,7 +2775,7 @@ function isFunc() {
|
||||
# update the host file
|
||||
function updateHostFile() {
|
||||
# check if we should add to host file
|
||||
if $VDM_UPDATE_HOST; then
|
||||
if allowEditHostFile; then
|
||||
# check if already in host file
|
||||
if grep -q "${1:-$VDM_SUBDOMAIN}.${2:-$VDM_DOMAIN}" /etc/hosts; then
|
||||
showNotice "${USER^}, ${1:-$VDM_SUBDOMAIN}.${2:-$VDM_DOMAIN} is already in the /etc/hosts file."
|
||||
@ -2764,22 +2788,50 @@ function updateHostFile() {
|
||||
fi
|
||||
}
|
||||
|
||||
# the manually edit the host file
|
||||
function editHostFile() {
|
||||
# check if we should add to host file
|
||||
if allowEditHostFile; then
|
||||
# if this container is enabled ask if it should be redeployed
|
||||
if (whiptail --yesno "To edit the host file we need sudo privileges.\n[Only continue if you know what your doing!]" --title "Give sudo Privileges" 15 112); then
|
||||
# give little heads-up
|
||||
showNotice "${USER^}, to save the changes you've made or to just close the file again press:\n\n[ctrl+x] with nano on ubuntu." 13
|
||||
# lets open the file with nano for now
|
||||
sudo "${EDITOR:-nano}" /etc/hosts
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# the manually edit the config file
|
||||
function editConfigFile() {
|
||||
# check if the file exist
|
||||
if [ -f "${VDM_SRC_PATH}/.env" ]; then
|
||||
# give little warning for less command ready people
|
||||
if (whiptail --yesno "Only continue if you know what your doing!\n\n\
|
||||
${USER^}, to save the changes you've made or to just close the file again press:\n\n\
|
||||
[ctrl+x] with nano on ubuntu." --title "Continue to edit ${PROGRAM_NAME} global config." 15 112); then
|
||||
# all direct edit of the global config file
|
||||
"${EDITOR:-nano}" "${VDM_SRC_PATH}/.env"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
#####################################################################################################################VDM
|
||||
######################################## CLI MENU ʕ•ᴥ•ʔ
|
||||
|
||||
# help message
|
||||
function showHelp() {
|
||||
cat <<EOF
|
||||
Usage: ${0##*/:-} [OPTION...]
|
||||
Usage: octojoom [OPTION...]
|
||||
Options
|
||||
======================================================
|
||||
--type <type>
|
||||
set type you would like to work with
|
||||
example: ${0##*/:-} --type joomla
|
||||
example: octojoom --type joomla
|
||||
======================================================
|
||||
--task <task>
|
||||
set type of task you would like to perform
|
||||
example: ${0##*/:-} --task setup
|
||||
example: octojoom --task setup
|
||||
======================================================
|
||||
--container <container.domain.name>
|
||||
Directly enabling or disabling a container with
|
||||
@ -2787,74 +2839,74 @@ Usage: ${0##*/:-} [OPTION...]
|
||||
The container must exist, which means it was
|
||||
setup previously
|
||||
Used without type and task Joomla-Enable is (default)
|
||||
example: ${0##*/:-} --container "io.vdm.dev"
|
||||
example: octojoom --container "io.vdm.dev"
|
||||
======================================================
|
||||
--update
|
||||
to update your install
|
||||
example: ${0##*/:-} --update
|
||||
example: octojoom --update
|
||||
======================================================
|
||||
--access-token <token>
|
||||
to update the program you will need an access token
|
||||
from https://git.vdm.dev/user/settings/applications
|
||||
example: docker-deploy --access-token xxxxxxxxxxx
|
||||
example: octojoom --access-token xxxxxxxxxxx
|
||||
======================================================
|
||||
--uninstall
|
||||
to uninstall this script
|
||||
example: ${0##*/:-} --uninstall
|
||||
example: octojoom --uninstall
|
||||
======================================================
|
||||
AVAILABLE FOR TO ANY CONTAINER
|
||||
======================================================
|
||||
-k|--key <key>
|
||||
set key for the docker compose container naming
|
||||
!! no spaces allowed in the key !!
|
||||
example: ${0##*/:-} -k="vdm"
|
||||
example: ${0##*/:-} --key="vdm"
|
||||
example: octojoom -k="vdm"
|
||||
example: octojoom --key="vdm"
|
||||
======================================================
|
||||
-e|--env-key <key>
|
||||
set key for the environment variable naming
|
||||
!! no spaces allowed in the key & must be UPPERCASE !!
|
||||
example: ${0##*/:-} -e="VDM"
|
||||
example: ${0##*/:-} --env-key="VDM"
|
||||
example: octojoom -e="VDM"
|
||||
example: octojoom --env-key="VDM"
|
||||
======================================================
|
||||
-d|--domain <domain.com>
|
||||
set key website domain
|
||||
!! must be domain.tld !!
|
||||
example: ${0##*/:-} -d="joomla.org"
|
||||
example: ${0##*/:-} --domain="joomla.org"
|
||||
example: octojoom -d="joomla.org"
|
||||
example: octojoom --domain="joomla.org"
|
||||
======================================================
|
||||
-s|--sub-domain <domain.com>
|
||||
set key website sub domain
|
||||
!! no spaces allowed in the sub domain !!
|
||||
example: ${0##*/:-} -s="jcb"
|
||||
example: ${0##*/:-} --sub-domain="jcb"
|
||||
example: octojoom -s="jcb"
|
||||
example: octojoom --sub-domain="jcb"
|
||||
======================================================
|
||||
AVAILABLE FOR JOOMLA CONTAINER
|
||||
======================================================
|
||||
-j|--joomla-version <version-tag>
|
||||
see available tags here https://hub.docker.com/_/joomla
|
||||
example: ${0##*/:-} -j=3.10
|
||||
example: ${0##*/:-} --joomla-version=3.10
|
||||
example: octojoom -j=3.10
|
||||
example: octojoom --joomla-version=3.10
|
||||
======================================================
|
||||
AVAILABLE FOR OPENSSH CONTAINER
|
||||
======================================================
|
||||
-u|--username <username>
|
||||
set username of the container
|
||||
example: ${0##*/:-} -u="ubuntu"
|
||||
example: ${0##*/:-} --username="ubuntu"
|
||||
example: octojoom -u="ubuntu"
|
||||
example: octojoom --username="ubuntu"
|
||||
======================================================
|
||||
--uid <id>
|
||||
set container user id
|
||||
example: ${0##*/:-} --uid=1000
|
||||
example: octojoom --uid=1000
|
||||
======================================================
|
||||
--gid <id>
|
||||
set container user group id
|
||||
example: ${0##*/:-} --gid=1000
|
||||
example: octojoom --gid=1000
|
||||
======================================================
|
||||
-p|--port <port>
|
||||
set ssh port to use
|
||||
!! do not use 22 !!
|
||||
example: ${0##*/:-} -p=2239
|
||||
example: ${0##*/:-} --port=2239
|
||||
example: octojoom -p=2239
|
||||
example: octojoom --port=2239
|
||||
======================================================
|
||||
--ssh-dir <dir>
|
||||
set ssh directory name found in the .ssh dir
|
||||
@ -2862,25 +2914,25 @@ Usage: ${0##*/:-} [OPTION...]
|
||||
This directory has separate files for
|
||||
each public key allowed to access
|
||||
the container
|
||||
example: ${0##*/:-} --ssh-dir="teamname"
|
||||
example: octojoom --ssh-dir="teamname"
|
||||
======================================================
|
||||
--sudo
|
||||
switch to add the container user to the
|
||||
sudo group of the container
|
||||
example: ${0##*/:-} --sudo
|
||||
example: octojoom --sudo
|
||||
======================================================
|
||||
-t|--time-zone <time/zone>
|
||||
set time zone of the container
|
||||
!! must valid time zone !!
|
||||
example: ${0##*/:-} -t="Africa/Windhoek"
|
||||
example: ${0##*/:-} --time-zone="Africa/Windhoek"
|
||||
example: octojoom -t="Africa/Windhoek"
|
||||
example: octojoom --time-zone="Africa/Windhoek"
|
||||
======================================================
|
||||
HELP ʕ•ᴥ•ʔ
|
||||
======================================================
|
||||
-h|--help
|
||||
display this help menu
|
||||
example: ${0##*/:-} -h
|
||||
example: ${0##*/:-} --help
|
||||
example: octojoom -h
|
||||
example: octojoom --help
|
||||
======================================================
|
||||
${PROGRAM_NAME} v${_VERSION}
|
||||
======================================================
|
||||
@ -3201,7 +3253,7 @@ fi
|
||||
#####################################################################################################################VDM
|
||||
######################################## SETUP KEY PATHS
|
||||
# the src folder path is where we store the script global env
|
||||
VDM_SRC_PATH="/home/${USER}/.config/docker-deploy"
|
||||
VDM_SRC_PATH="/home/${USER}/.config/octojoom"
|
||||
# create the folder if not set
|
||||
# shellcheck disable=SC2174
|
||||
mkdir -p -m '700' "${VDM_SRC_PATH}"
|
||||
@ -3210,8 +3262,6 @@ mkdir -p -m '700' "${VDM_SRC_PATH}"
|
||||
[ -f "${VDM_SRC_PATH}/.env" ] && source "${VDM_SRC_PATH}/.env"
|
||||
# get repo path where store the container deploy scripts
|
||||
while [ ${#VDM_REPO_PATH} -le 1 ] || [ ! -d "${VDM_REPO_PATH}" ]; do
|
||||
# we catch the token now.. so we don't need asking for it later
|
||||
getAccessToken
|
||||
# creat the path if it exist
|
||||
if [ ${#VDM_REPO_PATH} -ge 1 ] && (whiptail --yesno "Can we create the ${VDM_REPO_PATH} repository folder" --title "Create the Path" 8 112); then
|
||||
mkdir -p "${VDM_REPO_PATH}"
|
Reference in New Issue
Block a user