Add target to upload the website

The token will need to be added in id_oauth2_bearer.

It's not very safe to pass the content to a command as any user on the
system on which it is run will be able to get the token, though I
didn't find a command line argument in curl to pass it a file path
instead.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2022-11-22 21:17:24 +01:00
parent 0292688c77
commit b7e10712a3
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
3 changed files with 29 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/untitled/ /untitled/
/id_oauth2_bearer
/website.tar.gz /website.tar.gz

View File

@ -12,7 +12,9 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
.PHONY: all build website.tar.gz DOMAIN := gnutoo.srht.site
.PHONY: all build help upload website.tar.gz
all: website.tar.gz all: website.tar.gz
@ -32,6 +34,19 @@ build:
-- \ -- \
./build.sh ./build.sh
help:
@printf "%s\n\t%s\n\t%s\n\t%s\n" \
"Available commands:" \
"help # Print this help" \
"upload # Upload the website to https://$(DOMAIN)" \
"website.tar.gz # Create a tarball of the website"
upload: website.tar.gz
curl \
--oauth2-bearer `cat id_oauth2_bearer` \
-Fcontent=@website.tar.gz \
https://pages.sr.ht/publish/$(DOMAIN)
# See https://reproducible-builds.org/docs/archives/ for more details # See https://reproducible-builds.org/docs/archives/ for more details
website.tar.gz: build website.tar.gz: build
tar \ tar \

12
README
View File

@ -1,6 +1,18 @@
== Introduction == == Introduction ==
This project enables to easily build and deploy the Libreboot website. This project enables to easily build and deploy the Libreboot website.
== Local deployments ==
For local deployments you just need to extract the tarball in a
webroot and have a web server serve that content.
== Deployment on Sourcehut ==
Sourcehut has a way to setup a static website by uploading a tarball
of the content. Users that want to deploy a website there are expected
to follow the official documentation[1] to generate a token and add
this token to the id_oauth2_bearer file in the current directory.
[1]https://srht.site/quickstart
== License == == License ==
This project is free software: you can redistribute it and/or modify This project is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by