-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 78a57e6
Showing
12 changed files
with
1,053 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
github: [mattstein] | ||
ko_fi: mattstein | ||
buy_me_a_coffee: mattts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Create Alfred Workflow | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Composer dependencies | ||
uses: php-actions/composer@v6 | ||
# Store version number without `v` | ||
- name: Write release version | ||
run: | | ||
TAG=${{ github.ref_name }} | ||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV | ||
- name: Build Alfred workflow | ||
id: alfred_builder | ||
uses: com30n/build-alfred-workflow@v1 | ||
with: | ||
workflow_dir: . | ||
exclude_patterns: '.git/* .gitignore .github docker_tag Dockerfile-php-build DOCKER_ENV output.log resources/*' | ||
custom_version: "${{ env.VERSION }}" | ||
- name: Create release | ||
id: create_release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
token: ${{ secrets.RELEASE_TOKEN }} | ||
files: ${{ steps.alfred_builder.outputs.workflow_file }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
.DS_Store | ||
vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright 2024 Matt Stein | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Cloudflare Alfred Workflow | ||
|
||
Launch Cloudflare zone details in a browser. | ||
|
||
![Workflow screenshot](resources/screenshot.png) | ||
|
||
Custom theme using [Berkeley Mono](https://berkeleygraphics.com/typefaces/berkeley-mono/). | ||
|
||
## Installation | ||
|
||
Download the `.alfredworkflow` file from the [latest release](https://github.com/mattstein/alfred-cloudflare-workflow/releases) and double-click to install. | ||
|
||
## Configuration | ||
|
||
You must provide either a Cloudflare API token (recommended) or a global email address and API key. | ||
|
||
| Variable | Default | Required? | Note | | ||
| --- | --- | --- | --- | | ||
| `CLOUDFLARE_API_TOKEN` | | ✅ | Required and recommended. | | ||
| `CLOUDFLARE_EMAIL` | | ✅ | Required if you don’t create an API token. | | ||
| `CLOUDFLARE_API_KEY` | | ✅ | Required with the email address if you don’t create an API token. | | ||
| `CACHE_SECONDS` | 30 | ❌ | Duration for which cached responses will be re-used. | | ||
|
||
### Creating an API Token | ||
|
||
The token takes slightly more setup, but it’s safer because you can limit its permissions so you don’t have to stress out if it’s ever compromised. (This workflow uses Cloudflare’s first-party PHP SDK and doesn’t do anything shady, but it’s a Good Idea™ to be very careful about storing secrets.) | ||
|
||
1. In the Cloudflare web control panel, click the user avatar in the top right and then click **My Profile**. | ||
2. In the sidebar navigation menu, click **API Tokens**. | ||
3. On this “User API Tokens” page, click **Create Token**. | ||
4. Next to “Create Custom Token” at the bottom of the page, click **Get started**. | ||
5. Fill out the fields. | ||
- **Token name** is up to you. I picked “Alfred” because this is no time to be clever. | ||
- **Permissions** should select **Zone**, then **Zone Settings**, and **Read**. | ||
- **Zone Resources** should select **Include** and **All zones** unless you’d prefer to limit it further. | ||
- You can skip **Client IP Address Filtering** and **TTL** unless you’d like to set them. | ||
6. Click **Continue to summary**. | ||
7. Confirm by clicking **Create Token**. | ||
8. Copy the resulting token and add it to the workflow’s `CLOUDFLARE_API_TOKEN` environment variable. | ||
|
||
That’s it! This way you don’t need your account email address and global key. | ||
|
||
## Usage | ||
|
||
Use the Alfred trigger `cf` to automatically list your Cloudflare Zones, which can optionally be filtered if you keep typing. | ||
|
||
Press <kbd>return</kbd> to open a browser window with that zone in Cloudflare’s control panel. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"require": { | ||
"joetannenbaum/alfred-workflow": "^1.1", | ||
"cloudflare/sdk": "^1.3" | ||
} | ||
} |
Oops, something went wrong.