Nicholas A. Danes, PhD


Moving site back to Fastmail

Posted on

EDIT (2021-05-26): I ended up moving back to Netlify again. It’s currently on GitHub, but I would like to transition to something else for the future. Managing app passwords for ftp was becoming a pain.

Back in January, I decided to rehost this website with Netlify. Although this has made things incredibly convenient, I sort of didn’ve love the fact I was relying on GitHub to maintain my website. Ultimately, I decided to move back to the static hosting option using my email provider, Fastmail.

My complains from before were that only FTP and WebDAV were supported for file transfering when hosting my site with Fastmail. To fix this, I decided to make a simple bash script using ncftp to allow push updates to the FTP server without having to use a GUI client. The main command looks something like:

ncftpput -u $USER -p $PASSWORD -R $HOST $DESTINATION_PATH $ORIGIN_PATH

I stored this command in a bash script called ftp_fastmail_upload. If I was successful, you are reading this blog post from me using that script!

To utilize the FTP script for a one CLI command deploy, I use the following set of aliases:

# alias to build jekyll site under _site
alias jb="bundle exec jekyll build"
# alias which calls a script to upload files to Fastmail server from _site
alias fm_ftp="bash /home/ndanes/scripts/ftp_fastmail_upload"
# alias which combines the two aliases above
alias deploy_site="jb && fm_ftp"

Now that I can deploy my site without using GitHub, I’m considering moving my website repo elsewhere. I may go back to Codeberg, but ultimately I haven’t decided.

⮨ Back to Home