Hello from my tablet
- 4 minutes read - 749 wordsHello there! I’m writing this in Markor on my tablet. I set it up so I can ssh into the VPS from my tablet.
I might take this down in a bit. But I wanted to upload it and see how it goes. So if you see this, it may only be temporary!
Update:
- I have the whole directory synced to NextCloud from my laptop.
- As a result, I’d like to be able to pull it down to the tablet, run hugo, then rsync it.
- However, I can’t seem to access NextCloud files from Termux. Which is probably for the best, but still…
So I guess I can write an entry on here, let NextCloud sync with the laptop, then regenerate in Hugo on there, and upload from there?
I’ll have to think more on a workflow. I don’t know how many entries I’ll be writing on the tablet but it’s nice to have the option.
I’d regenerate the site on the VPS itself, but its Hugo package is significantly older than even Termux’s, so that is not ideal.
Anyway, will keep working on this.
Cheers.
Update 25 May 2022
I am going to try the following workflow:
- SSH in
- copy the hugo directory from NextCloud to my root /home
- SFTP the whole directory to the tablet
- clear the public/ folder
- run hugo to rebuild
- rsync it to the hugo www directory!
I think this will work super fucking well and I can script it. I will probably work on this weekend or Friday or something.
I love how goddamn geeky this is and I am fully embracing it.
Update 27 May 2022
I just opened this in NextCloud and am editing it. After that I’m going to do the steps outlined above and we’ll see what happens.
Further update: Copying the contents of the hugo directory from NextCloud to my root user’s homedir on the VPS, then rsyncing to the tablet. I run hugo and generate the site. Fine. Then I rsync it to the /www directory of my server where it needs to go. The permissions get all fucked up in transit and I don’t know why. It appears that hugo on the tablet is chmod’ing the entire public/ directory to 0700 and I have no idea why.
On my laptop, it generates the site and chmods almost everything 755, which makes sense.
Why would this be a default? My hugo version is 0.92 on the laptop and 0.99.1 on the tablet. I don’t understand it.
Will have to do more with this, but for now, the site will likely need to be generated on the laptop.
further update
OK, I am going to have to think about how to script this. The bottleneck is getting the files from NextCloud onto the tablet, just downloading them.
update 28 May 2022
Testing tablet upload…
Ultimately, it worked! I am going to jot down a few notes right now as I’m too tired to do a full writeup on how I got it to work.
- SSH is picky about permissions:
- homedir of a user needs to be chmod 700
- .ssh directory needs to be chmod 700
- authorized_keys needs to be chmod 600
- Homedir should not be writable by group:
chmod go-w /home/user
(vel sim.) - Homedir, .ssh, and authorized_keys must belong to user:group hugo_user:hugo_user – e.g.,
chown -R hugo_user:hugo_user <file>
- Somehow the publickey in authorized_keys got fucked up for the hugo user, so I had to rebuild keypairs for that user.
- ssh is not particularly wordy or explanatory in why this didn’t work; I had to search for errors and also check auth.log to figure out what the fuck happened.
ssh -vvv
was also my friend.
Here’s a general idea of the workflow:
- make edits to the blog (add entry, edit entry, whatever)
- sync to NextCloud, make sure it matches
- rsync the hugo directory from NextCloud to the hugo user’s homedir (I used hugo/ as a tempdir)
- ssh in to the hugo user
- generate the site
- copy public/ to the website root (in my case www/ off of the hugo user’s homedir)
- delete the hugo/ tempdir
- done!!
I’d like to find a way to script this, especially some of the middle steps, but I honestly don’t mind doing it manually for now.
It works!!!
Also I need to teach myself more Markdown because I’m sure this page looks terrible, but oh well. I’m learning.
cheers and thanks to those of you who helped me through this, especially LJ!
<3 grey