Home

Awesome

HeavyScript

Archived Repository Notice

HeavyScript is Archived

Due to the upcoming update for TrueNAS SCALE (link to update), where they will be completely removing k3s and replacing it with Docker Compose, I have decided to archive this repository. Since I do not want to use Docker Compose, I will not be supporting it. The tools that HeavyScript offers will all be deprecated by this release due to that change, as the tools are designed for TrueNAS SCALE's k3s implementation, not Docker.

Instead, I will be switching over to TalosOS, and users should watch the TrueCharts Discord channel for migration notices.

It is also worth noting that TrueCharts has archived and completely removed their charts from TrueNAS SCALE as well, as seen here: TrueCharts Catalog.

TrueCharts' comments on the situation can be seen here: TrueCharts Deprecation News.

Personal Note

Developing HeavyScript was my first project and the most fun I've had with coding. Amassing 380+ stars throughout the years is nothing I ever dreamed of when I started the project, and I am sad to see it go.

Thank you to everyone who has supported and used HeavyScript!

Best regards,
Heavybullets8

Contact

If you have questions or would like to contribute, I have a sub discord category hosted on the Truecharts Discord.

https://discord.gg/tVsPTHWTtr

Table of contents:

<details> <summary>Click to expand</summary> </details> <br>

The Menu

image

Access this with heavyscript

<br>

Arguments

App

heavyscript app [Flag]

FlagExampleParameterDescription
-s<br>--start-s<br>--start[Optional: app name]Start an application.
-x<br>--stop-x<br>--stop[Optional: app name]Stop an application.
-r<br>--restart-r<br>--restart[Optional: app name]Restart an application.
-d<br>--delete-d<br>--delete[Optional: app name]Delete an application.
<br>

Backup

heavyscript backup [Flag]

FlagExampleParameterDescription
-c [number]<br>--create [number]-c 15<br>--create 15IntegerCreate a backup with the specified retention number.
-r<br>--restore-r<br>--restoreRestore a backup.
-d<br>--delete-d<br>--deleteDelete a backup.
<br>

DNS

heavyscript dns [Optional App Name(s)]

Pass an optional app name to display DNS information for that specific app.

If no app name is provided, it will show internal DNS addresses for all services.

Example:

heavscript dns sonarr radarr nextcloud
<br >

Enable

heavyscript enable [Flag]

FlagExampleDescription
--api--apiEnables external access to the Kubernetes API server.
--apt--aptEnable apt, apt-get, and apt-key.
--helm--helmEnable helm commands.
<br >

Git

heavyscript git [Flag]

FlagExampleDescription
-b<br>--branch-b<br>--branchChoose a branch or tag for HeavyScript to use
-g<br>--global-g<br>--globalAdd the script to the global path.
<br>

Pod

heavyscript pod [Flag]

FlagExampleDescription
-l<br>--logs-l<br>--logsDisplay container logs.
-s<br>--shell-s<br>--shellOpen a shell for the container.
<br>

PVC

heavyscript pvc [Optional Flag]

FlagExampleDescription
-m<br>--mount-m<br>--mountOpen a menu to mount PVCs.
-u<br>--unmount-u<br>--unmountUnmount all mounted PVCs.
<br>

Self-Update

heavyscript self-update

FlagExampleDescription
--major--majorIncludes major updates when self-updating
<br>

Sync

heavyscript sync

Syncs the catalog.

<br>

Update

heavyscript update [Flags]

FlagExampleParameterDescription
-a<br>--include-major-a<br>--include-majorUpdate the application even if it is a major version update
-b<br>--backup-b 14<br>--backup 14IntegerTake a backup, and set the number of backups to keep
-c<br>--concurrent-c 5<br>--concurrent 5IntegerHow many applications to concurrently update (default: 1)
-i<br>--ignore-i nextcloud,sonarr -i sonarr<br>--ignore nextcloud --ignore sonarrStringIgnore updating the specified application
-I<br>--ignore-img-I<br>--ignore-imgIgnore container image updates
-p<br>--prune-p<br>--prunePrune unused images after the update
-r<br>--rollback-r<br>--rollbackRoll back to the previous version if update failure
-s<br>--sync-s<br>--syncSync the catalog prior to updating applications
-u<br>--update-only-u nextcloud,sonarr<br>--update-only nextcloudStringOnly update the specified application(s)
-x<br>--stop-x<br>--stopStop the application prior to updating (Not recommended)
-t<br>--timeout-t 500<br>--timeout 500IntegerSet the timeout for the update process in seconds (default: 500)
-U<br>--self-update-U<br>--self-updateUpdate HeavyScript itself prior to updating
-v<br>--verbose-v<br>--verboseDisplay verbose output
<br>

How to Install

HeavyScript can be installed in two different ways depending on your needs and privileges on the system:

Option 1: Non-Privileged Install (Regular User)

This installation method is suitable if you don't have root access or prefer not to install HeavyScript with elevated privileges.

Installation Command:

curl -s https://raw.githubusercontent.com/Heavybullets8/heavy_script/main/functions/deploy.sh | bash && source "$HOME/.bashrc" 2>/dev/null && source "$HOME/.zshrc" 2>/dev/null

What This Does:

Note:

Option 2: Privileged Install (Root or Sudo)

If you have root access or can use sudo, this method will set up HeavyScript for all users on the system.

Installation Command:

curl -s https://raw.githubusercontent.com/Heavybullets8/heavy_script/main/functions/deploy.sh | sudo bash && source "$HOME/.bashrc" 2>/dev/null && source "$HOME/.zshrc" 2>/dev/null

What This Does:

Note:


Choosing the Right Option:

<br>

How to Update

While Updating

heavyscript update --self-update [OPTIONS]

Direct

heavyscript self-update

self-update will update HeavyScript to the latest release, regardless of the branch or tag you're on, and allows you to use any other arguments.

<br>

Configuration File

Purpose

The configuration file is generated the first time the script is run. You can edit it using nano:

nano ~/heavy_script/config.ini

Modifications in the config file will become the script's defaults.

For example, if you set sync to true under the [UPDATE] section, running heavyscript update will sync the catalog without specifying --sync or -s in the CLI.

<br>

Disabling the Configuration

To disable the configuration for a specific run of the script, use:

heavyscript --no-config

This will ignore the configuration file for that run.

<br>

Cron Jobs

How to Create a Cron Job

To automate tasks using HeavyScript, you can create a cron job. Here's how to set it up in TrueNAS SCALE:

  1. Navigate to the TrueNAS SCALE GUI.
  2. Go to System Settings > Advanced.
  3. Click on Cron Jobs.
  4. Click Add to create a new cron job.

image

Important Note on the Command Path

The command for the cron job should use the full path to the heavy_script.sh file. This path depends on the user who installed HeavyScript. For instance, if you installed HeavyScript as a non-root user, replace /root with your home directory path.

You can find your home directory path by running echo $HOME in the terminal.

Cron Job Settings

My Personal Cron Job

Here's an example of how I set up my personal cron job:

bash /root/heavy_script/heavy_script.sh update --backup 14 --concurrent 10 --prune --rollback --sync --self-update

Remember to adjust the path in the command based on where HeavyScript is installed and the user account used for installation.