diff --git a/.github/workflows/ewpratten-com.yml b/.github/workflows/ewpratten-com.yml new file mode 100644 index 0000000..016e531 --- /dev/null +++ b/.github/workflows/ewpratten-com.yml @@ -0,0 +1,20 @@ +name: ewpratten.com + +on: + push: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + - name: Download Zola + run: | + wget https://github.com/getzola/zola/releases/download/v0.17.2/zola-v0.17.2-x86_64-unknown-linux-gnu.tar.gz -O /tmp/zola.tar.gz + tar -xvf /tmp/zola.tar.gz -C /tmp + - name: Build + run: | + cd sites/ewpratten.com + zola build diff --git a/sites/sdf.ewpratten.com/_worker.js b/sites/sdf.ewpratten.com/_worker.js new file mode 100644 index 0000000..e8e724d --- /dev/null +++ b/sites/sdf.ewpratten.com/_worker.js @@ -0,0 +1,31 @@ +export default { + async fetch(request, env, ctx) { + if (request.url) { + // Construct the destination URL + let sdf_url = new URL("http://ewpratten.sdf.org"); + sdf_url.pathname = (new URL(request.url)).pathname; + + // Forward CF info if it exists + let headers = {}; + if (request.cf) { + headers["X-CF-ASN"] = request.cf.asn; + headers["X-CF-As-Organization"] = request.cf.asOrganization; + headers["X-CF-Colo"] = request.cf.colo; + headers["X-CF-Country"] = request.cf.country; + headers["X-CF-Timezone"] = request.cf.timezone; + } + + // Build a request + let sdf_request = new Request( + sdf_url, + { + headers: headers + } + ); + + // Fetch the content from SDF + let response = await fetch(sdf_request); + return response; + } + }, + }; \ No newline at end of file