Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ services:
image: ghcr.io/shell-dot/tuoni/server:${VERSION}
volumes:
- ./data/:/app/data/
- ./python-site-packages:/app/venv/external-packages/:rw
- ./logs/server/:/app/logs/
- ./payload-templates/:/app/custom-payload-templates/:ro
- ./config/tuoni.yml:/app/tuoni-production.yml:ro
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-configuration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if [[ ! $($PROJECT_ROOT/scripts/tools/yq '.client.port' $TUONI_CONFIG_FILE_PATH)
fi

# Ensure necessary directories exist
for dir in data logs/server logs/client logs/nginx payload-templates plugins transfer; do
for dir in data logs/server logs/client logs/nginx payload-templates plugins transfer python-site-packages; do
if [ ! -d "$PROJECT_ROOT/$dir" ]; then
echo "INFO | $dir directory not found, creating ..."
mkdir -p "$PROJECT_ROOT/$dir"
Expand Down
3 changes: 2 additions & 1 deletion scripts/tuoni-command-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ tuoni_commands_array=(
"import-tuoni-package" \
"client" \
"server" \
"docs"
"docs" \
"pip"
)

tuoni_client_commands_array=("start" "stop" "restart" "logs")
Expand Down
8 changes: 8 additions & 0 deletions scripts/tuoni-command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ export TUONI_CLIENT_LOGGER_LEVEL=$($PROJECT_ROOT/scripts/tools/yq '.client.logge
export TUONI_CLIENT_LOGGER_HEADERS=$($PROJECT_ROOT/scripts/tools/yq -o=json '.client.logger.headers' $TUONI_CONFIG_FILE_PATH | jq -c)

export TUONI_DOCKER_COMPOSE_COMMAND="docker compose --env-file ${PROJECT_ROOT}/config/tuoni.env -f ${PROJECT_ROOT}/docker-compose.yml"
export TUONI_DOCKER_PIP_COMMAND="docker run --env-file ${PROJECT_ROOT}/config/tuoni.env --rm -v ${PROJECT_ROOT}/python-site-packages:/app/venv/external-packages --user $UID:$UID --entrypoint /app/venv/bin/pip ghcr.io/shell-dot/tuoni/server:${VERSION} --no-cache-dir ${TUONI_SUBCOMMAND_WITH_ARGS}"

TUONI_COMPONENT=$(basename "$0")
TUONI_COMMAND="$1"
TUONI_SUBCOMMAND="$2"
TUONI_SUBCOMMAND_WITH_ARGS="${*:2}"

if [ "$TUONI_COMPONENT" == "tuoni" ]; then
TUONI_COMPONENT="app"
Expand Down Expand Up @@ -133,6 +135,7 @@ $(tput smul)AVAILABLE COMMANDS:$(tput rmul)
$(tput setaf 3)transfer-tuoni-package$(tput sgr0) Rsync transfer folder to remote defined in config/tuoni.env.
$(tput setaf 3)export-tuoni-package$(tput sgr0) Export current git repository and docker images to transfer folder.
$(tput setaf 3)import-tuoni-package$(tput sgr0) Import git repository and docker images from transfer folder.
$(tput setaf 3)pip$(tput sgr0) Manage Python packages for Tuoni Server-Side Scripting.

$(tput smul)ADDITIONAL INFORMATION:$(tput rmul)
Tuoni URL: $(tput setaf 4)https://${TUONI_HOST_FQDN}:${TUONI_CLIENT_PORT}/$(tput sgr0)
Expand Down Expand Up @@ -307,6 +310,11 @@ if [ "$TUONI_COMMAND" == "docs" ]; then
handle_docs_command "$TUONI_SUBCOMMAND"
fi

if [ "$TUONI_COMMAND" == "pip" ]; then
${TUONI_SUDO_COMMAND} ${TUONI_DOCKER_PIP_COMMAND} ${TUONI_SUBCOMMAND_WITH_ARGS}
fi


# Display Tuoni URL, username, and password during setup
if [ -n "${TUONI_USERNAME_TO_CONFIG}" ]; then
echo -e "\n\n\n\n\n"
Expand Down
2 changes: 1 addition & 1 deletion tuoni
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. $PROJECT_ROOT/config/tuoni.env

### full app
. $PROJECT_ROOT/scripts/tuoni-command.sh $1 $2
. $PROJECT_ROOT/scripts/tuoni-command.sh $*