<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.bathcs.com/index.php?action=history&amp;feed=atom&amp;title=Cloudflare</id>
	<title>Cloudflare - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bathcs.com/index.php?action=history&amp;feed=atom&amp;title=Cloudflare"/>
	<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Cloudflare&amp;action=history"/>
	<updated>2026-08-26T11:21:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Cloudflare&amp;diff=229&amp;oldid=prev</id>
		<title>Pm2022: Pm2022 moved page BOSS/Hosting/Cloudflare to Cloudflare</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Cloudflare&amp;diff=229&amp;oldid=prev"/>
		<updated>2026-08-26T08:06:41Z</updated>

		<summary type="html">&lt;p&gt;Pm2022 moved page &lt;a href=&quot;/wiki/BOSS/Hosting/Cloudflare&quot; class=&quot;mw-redirect&quot; title=&quot;BOSS/Hosting/Cloudflare&quot;&gt;BOSS/Hosting/Cloudflare&lt;/a&gt; to &lt;a href=&quot;/wiki/Cloudflare&quot; title=&quot;Cloudflare&quot;&gt;Cloudflare&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:06, 26 August 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Pm2022</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Cloudflare&amp;diff=219&amp;oldid=prev</id>
		<title>Pm2022: cat</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Cloudflare&amp;diff=219&amp;oldid=prev"/>
		<updated>2026-08-26T07:52:30Z</updated>

		<summary type="html">&lt;p&gt;cat&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:52, 26 August 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l72&quot;&gt;Line 72:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 72:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* See [https://developers.cloudflare.com/workers/ Cloudflare documentation]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* See [https://developers.cloudflare.com/workers/ Cloudflare documentation]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:BOSS hosting methods]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Bath Open Source Society]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Pm2022</name></author>
	</entry>
	<entry>
		<id>https://wiki.bathcs.com/index.php?title=Cloudflare&amp;diff=122&amp;oldid=prev</id>
		<title>Hw2210: Translate from boss.bathcs.com</title>
		<link rel="alternate" type="text/html" href="https://wiki.bathcs.com/index.php?title=Cloudflare&amp;diff=122&amp;oldid=prev"/>
		<updated>2026-06-04T08:40:41Z</updated>

		<summary type="html">&lt;p&gt;Translate from boss.bathcs.com&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Cloudflare offers free hosting (with unlimited access) using their “Pages” (for static pages) and “Workers” (for non-static pages).&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
If you are wanting to do this for &amp;lt;code&amp;gt;bathcs.com&amp;lt;/code&amp;gt; you need super-admin access to the BathCS account.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Pages ==&lt;br /&gt;
&lt;br /&gt;
We will be using Cloudflare Pages for all static pages (due to the university not allowing static page hosting on their GitLab instance due to security concerns).&lt;br /&gt;
&lt;br /&gt;
We integrate these into the CI (using secrets to make sure people cannot just access our account).&lt;br /&gt;
&lt;br /&gt;
We will explain the setup required for this to work, the Pages docs can be found on [https://developers.cloudflare.com/pages/ Cloudflare documentation on pages].&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
A student with super-admin access to the Cloudflare account will have to perform these steps. This means a BathCS admin is needed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
We will be directly uploading the output directory to Cloudflare, explained on [https://developers.cloudflare.com/pages/get-started/direct-upload/ Cloudflare’s direct upload documentation] and [https://developers.cloudflare.com/pages/how-to/use-direct-upload-with-continuous-integration/ continuous deployment documentation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;You could add &amp;lt;code&amp;gt;wrangler&amp;lt;/code&amp;gt; as a development package, but there is usually no point and just using &amp;lt;code&amp;gt;deno&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;deno add npm:wrangler --dev --frozen=false&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;You will then have to add a project to Cloudflare. This can be done via the CLI or the dashboard (which will ask you to login to Cloudflare):&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;deno run --no-lock npm:wrangler pages project create&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Please make sure you set the production branch to &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; – it will default to the current branch, which might be an issue later. See [https://www.geeksforgeeks.org/how-to-change-git-default-branch-from-master/ geeksforgeeks] for how to change this.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;You will then have to create a new API token for the BCSS account which is explained by [https://developers.cloudflare.com/pages/how-to/use-direct-upload-with-continuous-integration/#generate-an-api-token Cloudflare API token documentation]. Please make sure that “BCSS” is the only account included (and created with the shared Cloudflare account and not simply by a member of BCSS).&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|text=&lt;br /&gt;
&amp;lt;p&amp;gt;Each website/project should have its own API key for security reasons&amp;lt;/p&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Please save this API token in the Admin organisation on VaultTub with its respective name (it will not be shown again).&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Add the API token to the GitLab CI/CD variables (go to Settings &amp;amp;gt; CI/CD &amp;amp;gt; Variables).&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;There should be two variables added:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;CLOUDFLARE_ACCOUNT_ID&amp;lt;/code&amp;gt;: Set to the BCSS account id&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;CLOUDFLARE_API_TOKEN&amp;lt;/code&amp;gt;: Set this to the API token generated&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;These should be marked as “Protected” and “Masked”&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This is sadly less secure than a secrets manager, however we have yet to find a free one, so please limit Maintainer access to the project.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Update the pipeline to a build script&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;If you want some good example structures, we use [https://gitlab.bath.ac.uk/cs/components GitLab CI components] for standardised checks and deployment, please see the pipeline in [https://gitlab.bath.ac.uk/cs/services/froom/-/blob/dev/.gitlab-ci.yml?ref_type=heads froom] or [https://gitlab.bath.ac.uk/cs/services/wiki/-/blob/main/.gitlab-ci.yml?ref_type=heads our policies wiki] for examples of how to use them. Below is a raw example of how it works behind the hood (note building should be separated into its own pipeline)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;yaml&amp;quot;&amp;gt;deploy:&lt;br /&gt;
  stage: deploy&lt;br /&gt;
  tags:&lt;br /&gt;
    - shared_runner&lt;br /&gt;
  before_script:&lt;br /&gt;
    - deno install&lt;br /&gt;
  script:&lt;br /&gt;
    - deno run build&lt;br /&gt;
    - deno run -A npm:wrangler pages deploy &amp;lt;out-dir&amp;gt; --project-name=&amp;lt;project-name&amp;gt;&lt;br /&gt;
  rules:&lt;br /&gt;
    - if: &amp;#039;$CI_COMMIT_BRANCH == &amp;quot;$CI_DEFAULT_BRANCH&amp;quot;&lt;br /&gt;
      when: always&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The production branch name should be the branch name you chose in part &amp;lt;code&amp;gt;2.&amp;lt;/code&amp;gt;, which hopefully should be &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Add custom domain for Cloudflare pages. Go to the Cloudflare dashboard and find the project in the “Workers &amp;amp;amp; Pages” section. And then select “Custom domains” and click “Set up a custom domain”. If you type a hostname on the domain “bathcs.com”, it should do everything for you 🎉.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Workers ==&lt;br /&gt;
&lt;br /&gt;
We have yet to implement Workers properly and so there is a summary of [https://developers.cloudflare.com/workers/ Cloudflare workers documentation]&lt;br /&gt;
&lt;br /&gt;
This has the downside that projects normally need to be written mostly from the ground up to work with workers (so it’s great if you are just about to start a new project).&lt;br /&gt;
&lt;br /&gt;
If you are going to write a project for Workers, we recommend checking out their [https://developers.cloudflare.com/workers/languages/rust/ Rust support] (and using that if you can) as JavaScript is still really bad for security.&lt;br /&gt;
&lt;br /&gt;
You may also want to design your project in a way that you can easily host it as a docker container (e.g. using &amp;lt;code&amp;gt;axum&amp;lt;/code&amp;gt; and refactoring significantly). This mostly just makes it easy for debugging and is a backup if Cloudflare decides to make Workers cost money.&lt;br /&gt;
&lt;br /&gt;
=== Resources ===&lt;br /&gt;
&lt;br /&gt;
* See [https://developers.cloudflare.com/workers/ Cloudflare documentation]&lt;/div&gt;</summary>
		<author><name>Hw2210</name></author>
	</entry>
</feed>