Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
donavanbecker committed Dec 22, 2023
1 parent 9bf9b12 commit f7bcd2d
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ contact_links:
- name: Homebridge Discord Channel for Cloudflared Tunnel
url: https://discord.gg/8fpZA4S
about: Please ask and answer questions here.
- name: Homebridge-cloudflared-tunnel - Pull Requests
- name: homebridge-cloudflared-tunnel - Pull Requests
url: https://github.com/donavanbecker/homebridge-cloudflared-tunnel/pulls
about: Please report security vulnerabilities here.
3 changes: 2 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Add 'branding' to any file changes within 'branding' folder
branding: branding/*
branding:
- branding/*

# Add 'enhancement' label to any change to index.js file
enhancement:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/beta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
publish:
needs: lint

if: ${{ github.repository == 'donavanbecker/homebridge-clouldflared-tunnel' }}
if: ${{ github.repository == 'donavanbecker/homebridge-cloudflared-tunnel' }}

uses: donavanbecker/.github/.github/workflows/npm-publish.yml@latest
with:
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Auto-merge dependabot updates
runs-on: ubuntu-latest
steps:
- uses: mitto98/dependabot-automerge-action@master
- uses: mitto98/dependabot-automerge-action@v1.0.2
with:
token: ${{ github.token }}
merge: true
8 changes: 4 additions & 4 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"url": {
"type": "string",
"title": "Name",
"default": "URL",
"title": "URL",
"placeholder": "http://localhost:8581",
"pattern": "^https?://",
"required": false
},
Expand All @@ -29,8 +29,8 @@
},
"hostname": {
"type": "string",
"title": "Name",
"default": "hostname",
"title": "hostname",
"placeholder": "homebridge.local",
"required": true
},
"protocol": {
Expand Down
44 changes: 5 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"displayName": "Cloudflared Tunnel",
"name": "homebridge-cloudflared-tunnel",
"version": "0.1.0",
"version": "0.2.0",
"description": "The Cloudflared Tunnel plugin allows you to run a Cloudflare-Tunnel for exposing your homebridge instance for remote access.",
"author": "donavanbecker",
"author": {
"name": "donavanbecker",
"url": "https://github.com/donavanbecker"
},
"type": "commonjs",
"license": "Apache-2.0",
"icon": "https://raw.githubusercontent.com/donavanbecker/homebridge-cloudflared-tunnel/latest/branding/icon.png",
"repository": {
Expand All @@ -23,6 +27,7 @@
"update": "ncu -u && npm update && npm install",
"update dependencies": "npm run check && npm run update",
"lint": "eslint src/**.ts",
"jlint": "eslint homebridge-ui/public/**.mjs",
"watch": "npm run build && npm link && nodemon",
"build": "rimraf ./dist && tsc",
"prepublishOnly": "npm run lint && npm run build",
Expand All @@ -48,10 +53,7 @@
],
"dependencies": {
"@homebridge/plugin-ui-utils": "^1.0.0",
"ctun": "^0.0.10",
"undici": "^6.2.0",
"rxjs": "^7.8.1",
"super-stringify": "^1.0.0"
"ctun": "^0.0.10"
},
"devDependencies": {
"@types/node": "^20.10.5",
Expand Down
11 changes: 3 additions & 8 deletions src/platform.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { startTunnel } from "ctun";
import { startTunnel } from 'ctun';
import { CloudflaredTunnelPlatformConfig } from './settings';
import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, Service, Characteristic } from 'homebridge';

Expand Down Expand Up @@ -77,7 +77,7 @@ export class CloudflaredTunnelPlatform implements DynamicPlatformPlugin {
if (this.config.url && this.config.hostname) {
this.debugLog(`URL: ${this.config.url}`);
this.debugLog(`Hostname: ${this.config.hostname}`);
throw new Error(`Cannot have both url and hostname in config. Please remove one.`);
throw new Error('Cannot have both url and hostname in config. Please remove one.');
}
if (!this.config.logging) {
this.config.logging = 'standard';
Expand Down Expand Up @@ -106,12 +106,7 @@ export class CloudflaredTunnelPlatform implements DynamicPlatformPlugin {
//Default: {protocol}://{hostname}:{port}
//The local server URL to tunnel.

const tunnel = await startTunnel(
{
url: url,
verifyTLS: this.config.verifyTLS,
}
); // pass in the port of the server you want to tunnel
const tunnel = await startTunnel({ url: url, verifyTLS: this.config.verifyTLS});
this.infoLog(`Tunnel URL: ${tunnel}`);
} catch {
this.errorLog('Failed to Start Tunnel');
Expand Down
10 changes: 5 additions & 5 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export const PLUGIN_NAME = 'homebridge-cloudflared-tunnel';

//Config
export interface CloudflaredTunnelPlatformConfig extends PlatformConfig {
url: string;
port: number;
hostname: string;
protocol: string;
verifyTLS: boolean;
url?: string;
port?: number;
hostname?: string;
protocol?: string;
verifyTLS?: boolean;
logging?: string;
}

0 comments on commit f7bcd2d

Please sign in to comment.