~sircmpwn/sr.ht-discuss

2 2

Is sourcehut a good fit for hosting my static website?

Details
Message ID
<166587056633.7.17070885054298636814.69218748@ploum.eu>
DKIM signature
missing
Download raw message
Hello,

I’m currently in the process of merging my 18yo wordpress blog and my 
gemlog into one big static site and looking for a hosting provider for 
it. Being a happy paying user of srht, the service seems a good fit but 
I’m a bit confused by how setting it up and how I will be impacted by 
the limitations.


## Current setup

Currently, my prototype is hosted on rawtext.club. All my blog is in a 
git repository which contains .gmi files (content), a "files" folder 
(for pictures and assets) and a publish.py script. When I git push this 
repository to rawtext.club through ssh, I call the newly pushed 
publish.py through a post-receive.hook in the git repo. Two folders are 
generated : public_html and public_gemini.

It works fine

## How would it work on sr.ht?

I’m new to build.yml files and a bit confused on how to do it. If I 
understand correctly, this means that everytime I push, the whole blog, 
including 20years of assets, is gzipped and sent to the host. Isn’t that 
a bit overkill? Should I care? I not too far from the 1Go limitation but 
I’m confident that I could optimize some old pictures to reduce the size 
of the whole blog (which is not far from the 1million words mark).

## Both gemini and web?

The same git repository (which I also host on sr.ht) should serve for 
both the gemini site and the website. Both should be served by the same 
domain name (ploum.net). If I read correctly sr.ht documentation, this 
usecase is not (yet?) considered. Do you think it should be possible?

## symbolic links limitation

Another limitation I face is the symbolic links one. I use symbolic 
links for two purposes:

1. Avoid duplicating the "files" folder for gemini and web. Both have a 
symbolic link pointing to the git repository.

2. Keeping old wordpress urls for my 800 old posts. Good URLs never 
change. Some of those posts are fairly well cited and linked accross the 
web. With wordpress, each post has its own slug. On my new static site, 
each post would be a real html file. Symbolic links are a good way to 
keep old links working without fidling with the webserver (or, god 
forbid, a .htaccess file).

If I read documentation correctly, this is impossible to be done on srht 
(it should be noted that, in my case, symbolic links could be generated 
only once. Currently, they are not part of publish.py because of that. 
But I could include them there.)

## srht or not?

Based on all those information, do you believe I could adapt my system 
to be hosted on sourcehut? If not, do you have any idea of an 
alternative, preferably based in Europe?

Thanks a lot

-- 
Ploum - Lionel Dricot
Blog: https://www.ploum.net — Livres: https://ploum.net/livres
Gemini : gemini://rawtext.club/~ploum/
Details
Message ID
<093558f3-6b4c-0d7c-8fc1-0694f6343bbf@ianmjones.com>
In-Reply-To
<166587056633.7.17070885054298636814.69218748@ploum.eu> (view parent)
DKIM signature
missing
Download raw message
> I’m new to build.yml files and a bit confused on how to do it. If I 
> understand correctly, this means that everytime I push, the whole blog, 
> including 20years of assets, is gzipped and sent to the host. Isn’t that 
> a bit overkill? Should I care? I not too far from the 1Go limitation but 
> I’m confident that I could optimize some old pictures to reduce the size 
> of the whole blog (which is not far from the 1million words mark).

You might struggle, maybe due to the tar.gz file size, but also because 
of the time taken to uncompress so many files. It's hard to tell unless 
you give it a go.

> ## Both gemini and web?
> 
> The same git repository (which I also host on sr.ht) should serve for 
> both the gemini site and the website. Both should be served by the same 
> domain name (ploum.net). If I read correctly sr.ht documentation, this 
> usecase is not (yet?) considered. Do you think it should be possible?

Yes, this is possible, I do it on my personal site, using the 
"-Fprotocol=GEMINI" and "-Fprotocol=HTTPS" arguments to curl as appropriate.

https://git.sr.ht/~ianmjones/ianmjones.com/tree/master/item/.build.yml

> ## symbolic links limitation

Hmm, not sure about this one.

> ## srht or not?

¯\_(ツ)_/¯

--

Ian
Olivier C <olivier@pfad.fr>
Details
Message ID
<848688cc-bb2f-4045-88f7-875f3438759f@app.fastmail.com>
In-Reply-To
<093558f3-6b4c-0d7c-8fc1-0694f6343bbf@ianmjones.com> (view parent)
DKIM signature
missing
Download raw message
(sorry for the previous message, the "Reply to thread" button did not work as expected)

> everytime I push, the whole blog, 
> including 20years of assets, is gzipped and sent to the host

Yes, this is how it is supposed to work.
You could also just update a given subfolder according to 
https://man.sr.ht/pages.sr.ht/api.md (but probably not relevant
in your case).

> ## Both gemini and web?

Yes, as Ian wrote. The tar.gz archives are independent for gemini
and https. For a given domain the right one will be chosen depending
on the requesting protocol.

> ## symbolic links limitation

For case 1 (gemini/https), you will have include the file in both tar.gz.
For case 2, I think you currently have to (physically) duplicate the content.
If it is only for html file, it should be much of an issue.

---

You can try on your current "public_html" and "public_gemini" folders like this:
1. Generate the tar, while "dereferencing" (-h) the symlink
 (so that they are included as normal files)

tar -C public_html -cvzh . > html.tar.gz
tar -C public_gemini -cvzh . > gemini.tar.gz

2. Upload both archives to srht using a personnal token
https://meta.sr.ht/oauth2/personal-token

curl --oauth2-bearer "access token" \
    -Fcontent=@html.tar.gz \
    https://pages.sr.ht/publish/{your-username}.srht.site

curl --oauth2-bearer "access token" \
    -Fcontent=@gemini.tar.gz \
    -Fprotocol=GEMINI \
    https://pages.sr.ht/publish/{your-username}.srht.site

You should be able to visit both under {https,gemini}://{your-username}.srht.site
Reply to thread Export thread (mbox)