mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-07-19 18:27:55 +02:00
update build actions and fix frontend warnings
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
@@ -13,20 +13,20 @@ jobs:
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v4
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
@@ -135,7 +135,7 @@ jobs:
|
||||
phishingclub.sig
|
||||
|
||||
- name: Build and push multi-arch Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile.release
|
||||
|
||||
@@ -12,20 +12,20 @@ jobs:
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v4
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
@@ -212,7 +212,7 @@ jobs:
|
||||
tar -tzf packages/phishingclub_${{ steps.get_version.outputs.VERSION }}_linux_arm64.tar.gz
|
||||
|
||||
- name: Upload build artifacts (for review)
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: phishingclub-test-build-${{ steps.get_version.outputs.HASH }}
|
||||
path: |
|
||||
|
||||
@@ -9,15 +9,13 @@
|
||||
startOfMonth,
|
||||
endOfMonth,
|
||||
startOfWeek,
|
||||
endOfWeek,
|
||||
startOfDay,
|
||||
endOfDay,
|
||||
addDays,
|
||||
subDays,
|
||||
isSameDay,
|
||||
isSameMonth,
|
||||
getDay,
|
||||
getDaysInMonth
|
||||
getDay
|
||||
} from 'date-fns';
|
||||
import { scrollBarClassesHorizontal, scrollBarClassesVertical } from '$lib/utils/scrollbar';
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
export let isProfileMenuVisible = false;
|
||||
export let isMobileMenuVisible = false;
|
||||
export let toggleChangeCompanyModal;
|
||||
|
||||
let isUpdateAvailable = false;
|
||||
let isInstalled = false;
|
||||
|
||||
@@ -1077,9 +1077,9 @@ declare var Infinity: number;
|
||||
{#if activeTab === 'config'}
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">
|
||||
<p class="block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1">
|
||||
Browser Mode
|
||||
</label>
|
||||
</p>
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -285,7 +285,7 @@
|
||||
{:else if loginStatus === AppStateService.LOGIN.LOGGED_OUT && $page.route.id === '/login'}
|
||||
<slot />
|
||||
{:else if loginStatus === AppStateService.LOGIN.LOGGED_IN && $page.route.id !== '/login'}
|
||||
<Header bind:isProfileMenuVisible bind:isMobileMenuVisible {toggleChangeCompanyModal} />
|
||||
<Header bind:isProfileMenuVisible bind:isMobileMenuVisible />
|
||||
{#if installState === AppStateService.INSTALL.INSTALLED}
|
||||
<DesktopMenu
|
||||
bind:this={desktopMenuRef}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
import AutoRefresh from '$lib/components/AutoRefresh.svelte';
|
||||
import TableCellScope from '$lib/components/table/TableCellScope.svelte';
|
||||
import ProxyConfigBuilder from '$lib/components/proxy/ProxyConfigBuilder.svelte';
|
||||
import jsyaml, { dumpWithLiteralStrings } from '$lib/components/yaml/index.js';
|
||||
import FileField from '$lib/components/FileField.svelte';
|
||||
|
||||
// services
|
||||
@@ -100,34 +101,30 @@
|
||||
}
|
||||
|
||||
try {
|
||||
// dynamically import js-yaml
|
||||
import('$lib/components/yaml/index.js').then((jsyaml) => {
|
||||
const parsed = jsyaml.default.load(yamlStr);
|
||||
if (!parsed || typeof parsed !== 'object') {
|
||||
console.warn('Invalid YAML: not an object');
|
||||
return;
|
||||
}
|
||||
const parsed = jsyaml.load(yamlStr);
|
||||
if (!parsed || typeof parsed !== 'object') {
|
||||
console.warn('Invalid YAML: not an object');
|
||||
return;
|
||||
}
|
||||
|
||||
// extract and apply general section
|
||||
if (parsed._general) {
|
||||
if (parsed._general.name) {
|
||||
formValues.name = parsed._general.name;
|
||||
}
|
||||
if (parsed._general.description) {
|
||||
formValues.description = parsed._general.description;
|
||||
}
|
||||
if (parsed._general.start_url) {
|
||||
formValues.startURL = parsed._general.start_url;
|
||||
}
|
||||
// remove _general from parsed object before serializing back
|
||||
delete parsed._general;
|
||||
// extract and apply general section
|
||||
if (parsed._general) {
|
||||
if (parsed._general.name) {
|
||||
formValues.name = parsed._general.name;
|
||||
}
|
||||
if (parsed._general.description) {
|
||||
formValues.description = parsed._general.description;
|
||||
}
|
||||
if (parsed._general.start_url) {
|
||||
formValues.startURL = parsed._general.start_url;
|
||||
}
|
||||
// remove _general from parsed object before serializing back
|
||||
delete parsed._general;
|
||||
}
|
||||
|
||||
// serialize back to YAML without _meta for the config
|
||||
// use dumpWithLiteralStrings to preserve literal block style for replace/body fields
|
||||
const cleanYaml = jsyaml.dumpWithLiteralStrings(parsed);
|
||||
formValues.proxyConfig = cleanYaml;
|
||||
});
|
||||
// serialize back to YAML without _meta for the config
|
||||
// use dumpWithLiteralStrings to preserve literal block style for replace/body fields
|
||||
formValues.proxyConfig = dumpWithLiteralStrings(parsed);
|
||||
} catch (e) {
|
||||
console.warn('Failed to parse imported YAML config:', e);
|
||||
}
|
||||
@@ -135,12 +132,11 @@
|
||||
|
||||
// export configuration to YAML file with metadata (for YAML mode)
|
||||
function exportYamlConfig() {
|
||||
import('$lib/components/yaml/index.js').then((yamlModule) => {
|
||||
try {
|
||||
// parse current config
|
||||
const parsed = formValues.proxyConfig
|
||||
? yamlModule.default.load(formValues.proxyConfig) || {}
|
||||
: {};
|
||||
try {
|
||||
// parse current config
|
||||
const parsed = formValues.proxyConfig
|
||||
? jsyaml.load(formValues.proxyConfig) || {}
|
||||
: {};
|
||||
|
||||
// build output with _general first
|
||||
const output = {};
|
||||
@@ -160,24 +156,23 @@
|
||||
// merge rest of config
|
||||
Object.assign(output, parsed);
|
||||
|
||||
// serialize to YAML with literal block style for replace/body fields
|
||||
const yamlContent = yamlModule.dumpWithLiteralStrings(output);
|
||||
// serialize to YAML with literal block style for replace/body fields
|
||||
const yamlContent = dumpWithLiteralStrings(output);
|
||||
|
||||
// create blob and download
|
||||
const blob = new Blob([yamlContent], { type: 'application/x-yaml' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
const safeName = (formValues.name || 'proxy-config').replace(/[^a-zA-Z0-9-_]/g, '_');
|
||||
a.download = `${safeName}.yaml`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
} catch (e) {
|
||||
console.warn('Failed to export YAML config:', e);
|
||||
}
|
||||
});
|
||||
// create blob and download
|
||||
const blob = new Blob([yamlContent], { type: 'application/x-yaml' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
const safeName = (formValues.name || 'proxy-config').replace(/[^a-zA-Z0-9-_]/g, '_');
|
||||
a.download = `${safeName}.yaml`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
} catch (e) {
|
||||
console.warn('Failed to export YAML config:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// trigger file input for YAML mode import
|
||||
|
||||
Reference in New Issue
Block a user