From b7e10712a3403fe2519ac91c3ba9ad741efeaff8 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Tue, 22 Nov 2022 21:17:24 +0100 Subject: [PATCH] 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 --- .gitignore | 1 + Makefile | 17 ++++++++++++++++- README | 12 ++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9e4266f..1c5010b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /untitled/ +/id_oauth2_bearer /website.tar.gz diff --git a/Makefile b/Makefile index 18b26b6..2d40fd2 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,9 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -.PHONY: all build website.tar.gz +DOMAIN := gnutoo.srht.site + +.PHONY: all build help upload website.tar.gz all: website.tar.gz @@ -32,6 +34,19 @@ build: -- \ ./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 website.tar.gz: build tar \ diff --git a/README b/README index 1ed55d2..2d374e6 100644 --- a/README +++ b/README @@ -1,6 +1,18 @@ == Introduction == 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 == 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