Shipnix news

Shipnix is sunsetting January 2025

Hello everyone. I have eventually decided to set an end-date for the Shipnix project.

Unfortunately, Shipnix did not hit the mark on what the target audience wanted, and the cost of further developing/maintaining it for an unsustainibly small customer base makes it impossible to justify.

I have decided to shut down Shipnix on the 28th of January 2025 to honor remaining subscriptions until they expire.

After this, Shipnix will be no more.

All further billing on existing subscription stops from today, but you may continue using the subscription tier you are currently on until the sunset date.

Your servers will keep running #

Although I understand this announcement is an inconvenience for those who have chosen to manage servers via Shipnix, your applications will still be working after Shipnix is gone.

You can still deploy changes to them, you'll just have to do it directly via SSH.

For a more graceful transition, I have written a script you can use for deploying and another one for modifying environment variables.

Sunset deployment script #

You can store this bash script as ./deploy-prod.sh at the root of your project.

It emulates how Shipnix deploys, and we have added some git safe-guards to ensure you know that this script only deploys what exists on your remote repository (Github etc).

Make sure to modify the three variables on top with the correct values:

#!/usr/bin/env bash 

# The IP address on your server. Find it in your dashboard on Shipnix, or DigitalOcean
SERVER_IP_ADDRESS=your.server.ip.address
# Identical to your server name om Shipnix
NIXOS_CONFIGURATION_NAME=your-shipnix-server-name
# Use origin/master or origin/main, or a commit hash if you want to deploy a specific commit
GIT_TARGET=origin/main


# Check for any uncommitted or untracked changes
if ! git diff-index --quiet HEAD -- || git ls-files --others --exclude-standard | grep -q .; then
    echo "Uncommitted or untracked changes detected."
    echo "These changes will not be deployed if you proceed."
    read -p "Are you sure you want to deploy? (y/n) " -n 1 -r
    echo
    if [[ ! $REPLY =~ ^[Yy]$ ]]
    then
        echo "Deployment aborted."
        exit 1
    fi
fi

# Fetch latest changes from the remote
git fetch

# Check if there are local commits not pushed to GIT_TARGET
LOCAL_COMMIT=$(git rev-parse HEAD)
REMOTE_COMMIT=$(git rev-parse "${GIT_TARGET}")

if [ "$LOCAL_COMMIT" != "$REMOTE_COMMIT" ]; then
    echo "Local commits not pushed to ${GIT_TARGET}."
    echo "These changes will not be deployed if you proceed."
    read -p "Are you sure you want to deploy? (y/n) " -n 1 -r
    echo 
    if [[ ! $REPLY =~ ^[Yy]$ ]]
    then
        echo "Deployment aborted."
        exit 1
    fi
else
    echo "Local branch is aligned with ${GIT_TARGET}. Proceeding with deployment."
fi

echo "Deploying to ${SERVER_IP_ADDRESS} with configuration ${NIXOS_CONFIGURATION_NAME} and git target ${GIT_TARGET}"

# The deployment script
ssh ship@${SERVER_IP_ADDRESS} bash << EOF
#!/usr/bin/env bash 
set -euo pipefail

log_error() {
  echo -e "\033[0;31mError: \$1\033[0m" 1>&2
}

trap 'log_error "Deployment failed with status \$?"' ERR


cd /home/ship/server
git fetch --all
git reset --hard ${GIT_TARGET}
git checkout -f ${GIT_TARGET} --detach
/home/ship/server/nixos/scripts/before-rebuild
set -o allexport
source /etc/shipnix/.env
set +o allexport
sudo nixos-rebuild switch --flake /home/ship/server --impure
/home/ship/server/nixos/scripts/after-rebuild

EOF

Sunset script for managing environment variables #

For managing your server secrets, you can use this little script and for example name it ./prod-env in your project root:

#!/usr/bin/env bash 
set -euxo pipefail

SERVER_SERVER_IP_ADDRESS=your.server.ip.address

ssh -t ship@${SERVER_IP_ADDRESS} 'nano /etc/shipnix/.env'

If you have vim installed on your server, you can replace nano with vim.

Remember that you will need to redeploy your server after changing your environment variables.

Migration options #

IHP users might consider using migrating to deploy-to-nixos, which is a built-in solution in IHP for deploying your applications. It works similarly to Shipnix but using nixos-rebuild directly from your local machine. It's all done from your command line, and maintained by IHP.

If you want to migrate, you might want to follow the instructions in the docs by from scratch, for example by creating an EC2 instance on AWS, and migrating your database when it's up and running, then switching over your domain records.

All the best, Lillo