diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 72d2f5b..19163e7 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -22,8 +22,8 @@ jobs:
exit 1
fi
env:
- CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }}
- CF_DEPLOY_DOMAIN: ${{ secrets.CF_DEPLOY_DOMAIN }}
+ CF_ZONE_ID: ${{ vars.CF_ZONE_ID }}
+ CF_DEPLOY_DOMAIN: ${{ vars.CF_DEPLOY_DOMAIN }}
# this is needed to get the lowercase version of the repository_owner name
# TODO: switch to some lowercase function in the future when Actions supports it
@@ -116,11 +116,14 @@ jobs:
env:
TF_VAR_cloudflare_account_id: ${{ secrets.CF_ACCOUNT_ID }}
TF_VAR_cloudflare_api_token: ${{ secrets.CF_API_TOKEN }}
- TF_VAR_cloudflare_zone_id: ${{ secrets.CF_ZONE_ID }}
- TF_VAR_cloudflare_deploy_domain: ${{ secrets.CF_DEPLOY_DOMAIN }}
+ TF_VAR_cloudflare_zone_id: ${{ vars.CF_ZONE_ID }}
+ TF_VAR_cloudflare_deploy_domain: ${{ vars.CF_DEPLOY_DOMAIN }}
TF_VAR_gh_username: ${{ env.OWNER_LOWER }}
TF_VAR_d1_id: ${{ env.d1_id }}
TF_VAR_access_auth_domain: ${{ env.auth_domain }}
+ TF_VAR_wd_instance_title: ${{ vars.INSTANCE_TITLE }}
+ TF_VAR_wd_admin_email: ${{ vars.ADMIN_EMAIL }}
+ TF_VAR_wd_instance_description: ${{ vars.INSTANCE_DESCR }}
- name: retrieve Terraform state KV namespace
uses: cloudflare/wrangler-action@2.0.0
diff --git a/README.md b/README.md
index ce90bb7..ef046fa 100644
--- a/README.md
+++ b/README.md
@@ -70,7 +70,7 @@ Wildebeest uses [Deploy to Workers](https://deploy.workers.cloudflare.com/) to a
**Click here to start the installation.**
-[](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/wildebeest&authed=true)
+[](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/wildebeest&authed=true&fields={%22name%22:%22Zone%20tag%22,%22secret%22:%22CF_ZONE_ID%22,%22descr%22:%22Zone%20tag%22}&fields={%22name%22:%22Domain%22,%22secret%22:%22CF_DEPLOY_DOMAIN%22,%22descr%22:%22Domain%20on%20which%20your%20instance%20will%20be%20running%22}&fields={%22name%22:%22Instance%20title%22,%22secret%22:%22INSTANCE_TITLE%22,%22descr%22:%22Title%20of%20your%20instance%22}&fields={%22name%22:%22Administrator%20email%22,%22secret%22:%22ADMIN_EMAIL%22,%22descr%22:%22An%20email%20address%20that%20can%20be%20messaged%20regarding%20inquiries%20or%20issues%22}&fields={%22name%22:%22Instance%20description%22,%22secret%22:%22INSTANCE_DESCR%22,%22descr%22:%22A%20short,%20plain-text%20description%20of%20your%20instance%22})
Please pay attention to all the steps involved in the installation process.
diff --git a/scripts/generate-one-click-deploy-button.mjs b/scripts/generate-one-click-deploy-button.mjs
new file mode 100644
index 0000000..df0dd6f
--- /dev/null
+++ b/scripts/generate-one-click-deploy-button.mjs
@@ -0,0 +1,35 @@
+const PROJECT_URL = 'https://github.com/cloudflare/wildebeest'
+const ONE_CLICK_BASE_URL = 'https://deploy.workers.cloudflare.com'
+const FIELDS = [
+ {
+ name: 'Zone tag',
+ secret: 'CF_ZONE_ID',
+ descr: 'Zone tag',
+ },
+ {
+ name: 'Domain',
+ secret: 'CF_DEPLOY_DOMAIN',
+ descr: 'Domain on which your instance will be running',
+ },
+ {
+ name: 'Instance title',
+ secret: 'INSTANCE_TITLE',
+ descr: 'Title of your instance',
+ },
+ {
+ name: 'Administrator email',
+ secret: 'ADMIN_EMAIL',
+ descr: 'An email address that can be messaged regarding inquiries or issues',
+ },
+ {
+ name: 'Instance description',
+ secret: 'INSTANCE_DESCR',
+ descr: 'A short, plain-text description of your instance',
+ },
+]
+
+const fields = FIELDS.map((x) => JSON.stringify(x))
+ .map((v) => `fields=${v}`)
+ .join('&')
+const url = new URL(`/?url=${PROJECT_URL}&authed=true&${fields}`, ONE_CLICK_BASE_URL)
+console.log(url.href)
diff --git a/tf/main.tf b/tf/main.tf
index 5564bf7..608b1b8 100644
--- a/tf/main.tf
+++ b/tf/main.tf
@@ -32,6 +32,19 @@ variable "access_auth_domain" {
sensitive = true
}
+variable "wd_instance_title" {
+ type = string
+ sensitive = true
+}
+variable "wd_admin_email" {
+ type = string
+ sensitive = true
+}
+variable "wd_instance_description" {
+ type = string
+ sensitive = true
+}
+
terraform {
required_providers {
cloudflare = {
@@ -81,6 +94,10 @@ resource "cloudflare_pages_project" "wildebeest_pages_project" {
DOMAIN = sensitive(trimspace(var.cloudflare_deploy_domain))
ACCESS_AUD = sensitive(cloudflare_access_application.wildebeest_access.aud)
ACCESS_AUTH_DOMAIN = sensitive(var.access_auth_domain)
+
+ INSTANCE_TITLE = var.wd_instance_title
+ ADMIN_EMAIL = var.wd_admin_email
+ INSTANCE_DESCR = var.wd_instance_description
}
kv_namespaces = {
KV_CACHE = sensitive(cloudflare_workers_kv_namespace.wildebeest_cache.id)