('TipUPJSONToken');
4 |
5 | export interface SfngTipUpPlacement {
6 | origin?: 'left' | 'right';
7 | offset?: number;
8 | }
9 |
--------------------------------------------------------------------------------
/desktop/angular/projects/safing/ui/src/lib/toggle-switch/index.ts:
--------------------------------------------------------------------------------
1 | export * from './toggle-switch';
2 | export * from './toggle.module';
3 |
4 |
--------------------------------------------------------------------------------
/desktop/angular/projects/safing/ui/src/lib/tooltip/_tooltip-component.scss:
--------------------------------------------------------------------------------
1 | sfng-tooltip-container {
2 | @apply relative block;
3 |
4 | max-width: 16rem;
5 | }
6 |
--------------------------------------------------------------------------------
/desktop/angular/projects/safing/ui/src/lib/tooltip/index.ts:
--------------------------------------------------------------------------------
1 | export * from './tooltip';
2 | export * from './tooltip.module';
3 |
4 |
--------------------------------------------------------------------------------
/desktop/angular/projects/safing/ui/src/lib/tooltip/tooltip-component.html:
--------------------------------------------------------------------------------
1 |
4 | {{ message }}
5 |
6 |
7 |
--------------------------------------------------------------------------------
/desktop/angular/projects/safing/ui/src/lib/ui.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { SfngAccordionModule } from './accordion';
3 |
4 |
5 | @NgModule({
6 | exports: [
7 | SfngAccordionModule
8 | ]
9 | })
10 | export class UiModule { }
11 |
--------------------------------------------------------------------------------
/desktop/angular/projects/safing/ui/src/public-api.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Public API Surface of ui
3 | */
4 |
5 | export * from './lib/accordion';
6 | export * from './lib/dialog';
7 | export * from './lib/dropdown';
8 | export * from './lib/overlay-stepper';
9 | export * from './lib/pagination';
10 | export * from './lib/select';
11 | export * from './lib/tabs';
12 | export * from './lib/tipup';
13 | export * from './lib/toggle-switch';
14 | export * from './lib/tooltip';
15 | export * from './lib/ui.module';
16 |
17 |
--------------------------------------------------------------------------------
/desktop/angular/projects/safing/ui/theming.scss:
--------------------------------------------------------------------------------
1 | @import "./src/lib/select/select";
2 | @import "./src/lib/dialog/dialog";
3 | @import "./src/lib/pagination/pagination";
4 | @import "./src/lib/tabs/tab-group";
5 | @import "./src/lib/tipup/tipup";
6 | @import "./src/lib/tooltip/tooltip-component";
7 | @import "./src/lib/toggle-switch/toggle-switch";
8 | @import "./src/lib/dialog/confirm.dialog";
9 |
--------------------------------------------------------------------------------
/desktop/angular/projects/safing/ui/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../out-tsc/lib",
5 | "declaration": true,
6 | "declarationMap": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": [
10 | "dom",
11 | "es2018"
12 | ]
13 | },
14 | "exclude": [
15 | "src/test.ts",
16 | "**/*.spec.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/desktop/angular/projects/safing/ui/tsconfig.lib.prod.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.lib.json",
4 | "compilerOptions": {
5 | "declarationMap": false
6 | },
7 | }
8 |
--------------------------------------------------------------------------------
/desktop/angular/projects/safing/ui/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "../../../tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "../../../out-tsc/spec",
6 | "types": [
7 | "jasmine"
8 | ]
9 | },
10 | "files": [
11 | "src/test.ts"
12 | ],
13 | "include": [
14 | "**/*.spec.ts",
15 | "**/*.d.ts"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/desktop/angular/projects/tauri-builtin/src/app/app.config.ts:
--------------------------------------------------------------------------------
1 | import { ApplicationConfig } from '@angular/core';
2 | import { TauriIntegrationService } from 'src/app/integration/taur-app';
3 |
4 | export const appConfig: ApplicationConfig = {
5 | providers: [
6 | {
7 | provide: TauriIntegrationService,
8 | useClass: TauriIntegrationService,
9 | deps: []
10 | },
11 | ],
12 | };
13 |
--------------------------------------------------------------------------------
/desktop/angular/projects/tauri-builtin/src/assets:
--------------------------------------------------------------------------------
1 | ../../../assets
--------------------------------------------------------------------------------
/desktop/angular/projects/tauri-builtin/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/desktop/angular/projects/tauri-builtin/src/favicon.ico
--------------------------------------------------------------------------------
/desktop/angular/projects/tauri-builtin/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | TauriBuiltin
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/desktop/angular/projects/tauri-builtin/src/main.ts:
--------------------------------------------------------------------------------
1 | import { bootstrapApplication } from '@angular/platform-browser';
2 | import { appConfig } from './app/app.config';
3 | import { AppComponent } from './app/app.component';
4 |
5 | bootstrapApplication(AppComponent, appConfig)
6 | .catch((err) => console.error(err));
7 |
--------------------------------------------------------------------------------
/desktop/angular/projects/tauri-builtin/src/styles.scss:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | @import "safing/ui/theming";
6 |
7 | /** foboar **/
8 |
--------------------------------------------------------------------------------
/desktop/angular/projects/tauri-builtin/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "../../tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "../../out-tsc/app",
6 | "types": []
7 | },
8 | "files": ["src/main.ts"],
9 | "include": ["src/**/*.d.ts", "../../src/electron-app.d.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/desktop/angular/proxy.json:
--------------------------------------------------------------------------------
1 | {
2 | "/api": {
3 | "target": "http://localhost:817/",
4 | "secure": false
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/integration/index.ts:
--------------------------------------------------------------------------------
1 | export * from './integration';
2 | export * from './factory';
3 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/intro/index.ts:
--------------------------------------------------------------------------------
1 | export * from './intro.module';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/intro/step-1-welcome/index.ts:
--------------------------------------------------------------------------------
1 | export * from './step-1-welcome';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/intro/step-2-trackers/index.ts:
--------------------------------------------------------------------------------
1 | export * from './step-2-trackers'
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/intro/step-3-dns/index.ts:
--------------------------------------------------------------------------------
1 | export * from './step-3-dns'
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/intro/step-4-tipups/index.ts:
--------------------------------------------------------------------------------
1 | export * from './step-4-tipups'
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/intro/step-4-tipups/step-4-tipups.ts:
--------------------------------------------------------------------------------
1 | import { ChangeDetectionStrategy, Component } from "@angular/core";
2 | import { Step } from "@safing/ui";
3 | import { of } from "rxjs";
4 |
5 | @Component({
6 | templateUrl: './step-4-tipups.html',
7 | styleUrls: ['../step.scss'],
8 | changeDetection: ChangeDetectionStrategy.OnPush,
9 | })
10 | export class Step4TipupsComponent implements Step {
11 | validChange = of(true)
12 | }
13 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/intro/step.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | @apply flex flex-col items-center justify-center;
3 | }
4 |
5 | h1 {
6 | @apply text-primary text-2xl font-medium capitalize text-center py-5;
7 | }
8 |
9 | p {
10 | @apply text-tertiary text-sm font-medium text-center;
11 | }
12 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/layout/side-dash/side-dash.html:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/layout/side-dash/side-dash.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | display: flex;
3 | flex-direction: column;
4 | align-items: center;
5 | justify-content: flex-start;
6 | overflow: hidden;
7 | overflow-y: hidden;
8 | width: 419px;
9 |
10 | @apply pt-4;
11 | }
12 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/layout/side-dash/side-dash.ts:
--------------------------------------------------------------------------------
1 | import { ChangeDetectionStrategy, Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-side-dash',
5 | templateUrl: './side-dash.html',
6 | styleUrls: ['./side-dash.scss'],
7 | changeDetection: ChangeDetectionStrategy.OnPush,
8 | })
9 | export class SideDashComponent {
10 | /** Whether or not a SPN account login is required */
11 | spnLoginRequired = false;
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/app-view/app-view.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | @apply flex flex-col h-screen max-h-screen;
3 | }
4 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/app-view/index.ts:
--------------------------------------------------------------------------------
1 | export { AppViewComponent } from './app-view';
2 | export { AppOverviewComponent } from './overview';
3 | export { QuickSettingInternetButtonComponent } from './qs-internet';
4 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/app-view/qs-history/qs-history.component.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/desktop/angular/src/app/pages/app-view/qs-history/qs-history.component.scss
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/app-view/qs-internet/index.ts:
--------------------------------------------------------------------------------
1 | export * from './qs-internet';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/app-view/qs-select-exit/index.ts:
--------------------------------------------------------------------------------
1 | export * from './qs-select-exit';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/app-view/qs-select-exit/qs-select-exit.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/desktop/angular/src/app/pages/app-view/qs-select-exit/qs-select-exit.scss
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/app-view/qs-use-spn/index.ts:
--------------------------------------------------------------------------------
1 | export * from './qs-use-spn';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/monitor/index.ts:
--------------------------------------------------------------------------------
1 | export { MonitorPageComponent } from './monitor';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/page.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | display : flex;
3 | flex-direction: column;
4 | width : 100%;
5 | height : 100%;
6 | }
7 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/spn/country-details/index.ts:
--------------------------------------------------------------------------------
1 | export * from './country-details';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/spn/country-overlay/index.ts:
--------------------------------------------------------------------------------
1 | export * from './country-overlay';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/spn/index.ts:
--------------------------------------------------------------------------------
1 | export * from './spn-page';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/spn/map-legend/index.ts:
--------------------------------------------------------------------------------
1 | export * from './map-legend';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/spn/map-renderer/index.ts:
--------------------------------------------------------------------------------
1 | export * from './map-renderer';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/spn/node-icon/index.ts:
--------------------------------------------------------------------------------
1 | export * from './node-icon';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/spn/pin-details/index.ts:
--------------------------------------------------------------------------------
1 | export * from './pin-details';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/spn/pin-list/index.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/desktop/angular/src/app/pages/spn/pin-list/index.ts
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/spn/pin-overlay/index.ts:
--------------------------------------------------------------------------------
1 | export * from './pin-overlay';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/spn/pin-overlay/pin-overlay.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | min-width: 220px;
3 | display: block;
4 | }
5 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/spn/pin-route/index.ts:
--------------------------------------------------------------------------------
1 | export * from './pin-route';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/spn/spn-feature-carousel/index.ts:
--------------------------------------------------------------------------------
1 | export * from './spn-feature-carousel';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/spn/utils.ts:
--------------------------------------------------------------------------------
1 | import { OverlayRef } from '@angular/cdk/overlay';
2 | import { InjectionToken } from '@angular/core';
3 |
4 | export const OVERLAY_REF = new InjectionToken('OVERLAY_REF');
5 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/support/form/index.ts:
--------------------------------------------------------------------------------
1 | export * from './support-form';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/support/index.ts:
--------------------------------------------------------------------------------
1 | export * from './support';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/pages/support/progress-dialog/index.ts:
--------------------------------------------------------------------------------
1 | export * from './progress-dialog';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/services/index.ts:
--------------------------------------------------------------------------------
1 | export { NotificationsService } from './notifications.service';
2 | export * from './notifications.types';
3 | export * from './session-data.service';
4 | export { StatusService } from './status.service';
5 | export * from './status.types';
6 | export * from './supporthub.service';
7 | export * from './ui-state.service';
8 |
9 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/services/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "sideEffects": false
3 | }
4 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/services/status.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { StatusService } from './status.service';
4 |
5 | describe('StatusService', () => {
6 | let service: StatusService;
7 |
8 | beforeEach(() => {
9 | TestBed.configureTestingModule({});
10 | service = TestBed.inject(StatusService);
11 | });
12 |
13 | it('should be created', () => {
14 | expect(service).toBeTruthy();
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/action-indicator/action-indicator.module.ts:
--------------------------------------------------------------------------------
1 | import { CommonModule } from "@angular/common";
2 | import { NgModule } from "@angular/core";
3 | import { IndicatorComponent } from "./indicator";
4 |
5 | @NgModule({
6 | imports: [
7 | CommonModule,
8 | ],
9 | declarations: [
10 | IndicatorComponent,
11 | ]
12 | })
13 | export class ActionIndicatorModule { }
14 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/action-indicator/index.ts:
--------------------------------------------------------------------------------
1 | export * from './action-indicator.service';
2 | export * from './action-indicator.module';
3 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/app-icon/index.ts:
--------------------------------------------------------------------------------
1 | export { AppIconComponent } from './app-icon';
2 | export { SfngAppIconModule } from './app-icon.module';
3 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/config/basic-setting/index.ts:
--------------------------------------------------------------------------------
1 | export * from './basic-setting';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/config/filter-lists/index.ts:
--------------------------------------------------------------------------------
1 | export { FilterListComponent } from './filter-list';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/config/generic-setting/index.ts:
--------------------------------------------------------------------------------
1 | export * from './generic-setting';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/config/index.ts:
--------------------------------------------------------------------------------
1 | export * from './basic-setting';
2 | export * from './config-settings';
3 | export * from './config.module';
4 | export * from './filter-lists';
5 | export * from './generic-setting';
6 | export * from './ordererd-list';
7 | export * from './rule-list';
8 | export * from './safe.pipe';
9 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/config/ordererd-list/index.ts:
--------------------------------------------------------------------------------
1 | export { OrderedListComponent } from './ordered-list';
2 | export { OrderedListItemComponent } from './item';
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/config/ordererd-list/item.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{value}}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/config/rule-list/index.ts:
--------------------------------------------------------------------------------
1 | export * from './list-item';
2 | export * from './rule-list';
3 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/count-indicator/count-indicator.html:
--------------------------------------------------------------------------------
1 | {{ count | prettyCount }}
2 |
5 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/count-indicator/count-indicator.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from "@angular/core";
2 | import { CountIndicatorComponent } from "./count-indicator";
3 | import { PrettyCountPipe } from "./count.pipe";
4 |
5 | @NgModule({
6 | declarations: [
7 | CountIndicatorComponent,
8 | PrettyCountPipe,
9 | ],
10 | exports: [
11 | CountIndicatorComponent,
12 | PrettyCountPipe,
13 | ]
14 | })
15 | export class CountIndicatorModule { }
16 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/count-indicator/count-indicator.scss:
--------------------------------------------------------------------------------
1 | @import '../../../theme/mixins/_pill.scss';
2 |
3 | :host {
4 | @include pill-container;
5 | @apply pl-2;
6 | @apply bg-buttons-dark;
7 | @apply w-20;
8 | }
9 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/count-indicator/count.pipe.ts:
--------------------------------------------------------------------------------
1 | import { Pipe, PipeTransform } from "@angular/core";
2 |
3 | @Pipe({
4 | name: 'prettyCount',
5 | pure: true
6 | })
7 | export class PrettyCountPipe implements PipeTransform {
8 | transform(value: number) {
9 | if (value > 999) {
10 | const v = Math.floor(value / 1000);
11 | if (value === v * 1000) {
12 | return `${v}k`;
13 | }
14 | return `${v}k+`
15 | }
16 | return `${value}`
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/count-indicator/index.ts:
--------------------------------------------------------------------------------
1 | export * from './count-indicator';
2 | export * from './count-indicator.module';
3 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/country-flag/country.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { CountryFlagDirective } from './country-flag';
3 |
4 | @NgModule({
5 | declarations: [
6 | CountryFlagDirective
7 | ],
8 | exports: [
9 | CountryFlagDirective,
10 | ]
11 | })
12 | export class CountryFlagModule { }
13 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/country-flag/index.ts:
--------------------------------------------------------------------------------
1 | export * from './country-flag';
2 | export * from './country.module';
3 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/edit-profile-dialog/index.ts:
--------------------------------------------------------------------------------
1 | export * from './edit-profile-dialog';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/exit-screen/index.ts:
--------------------------------------------------------------------------------
1 | export * from './exit.service';
2 | export * from './exit-screen';
3 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/expertise/expertise-switch.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | display: flex;
3 | @apply pl-2;
4 | user-select: none;
5 | flex-direction: row;
6 | align-items: center;
7 | justify-content: center;
8 | }
9 |
10 | sfng-tipup {
11 | margin-right: 0.5rem;
12 | }
13 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/expertise/index.ts:
--------------------------------------------------------------------------------
1 | export * from './expertise-directive';
2 | export * from './expertise-switch';
3 | export * from './expertise.service';
4 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/feature-scout/feature-scout.scss:
--------------------------------------------------------------------------------
1 | .feature-icon {
2 | @apply text-primary text-opacity-80;
3 |
4 | &.feature-icon-off {
5 | opacity: 0.25;
6 | }
7 | }
8 |
9 | .status-info {
10 | @apply text-primary text-opacity-80 text-xxs text-center;
11 |
12 | &:hover {
13 | cursor: default;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/feature-scout/index.ts:
--------------------------------------------------------------------------------
1 | export * from './feature-scout';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/focus/focus.module.ts:
--------------------------------------------------------------------------------
1 | import { CommonModule } from "@angular/common";
2 | import { NgModule } from "@angular/core";
3 | import { AutoFocusDirective } from "./focus.directive";
4 |
5 | @NgModule({
6 | imports: [
7 | CommonModule,
8 | ],
9 | declarations: [
10 | AutoFocusDirective,
11 | ],
12 | exports: [
13 | AutoFocusDirective,
14 | ]
15 | })
16 | export class SfngFocusModule { }
17 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/focus/index.ts:
--------------------------------------------------------------------------------
1 | export { AutoFocusDirective } from './focus.directive';
2 | export * from './focus.module';
3 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/fuzzySearch/index.ts:
--------------------------------------------------------------------------------
1 | import Fuse from 'fuse.js';
2 |
3 | export { FuseSearchOpts, FuzzySearchService } from './fuse.service';
4 | export { FuzzySearchPipe } from './search-pipe';
5 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/loading/index.ts:
--------------------------------------------------------------------------------
1 | export { LoadingComponent } from './loading';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/loading/loading.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/loading/loading.ts:
--------------------------------------------------------------------------------
1 | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, HostBinding } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-loading',
5 | templateUrl: './loading.html',
6 | styleUrls: ['./loading.scss'],
7 | changeDetection: ChangeDetectionStrategy.OnPush,
8 | })
9 | export class LoadingComponent {
10 | @HostBinding('class.animate')
11 | _animate = true;
12 |
13 | constructor(private changeDetectorRef: ChangeDetectorRef) { }
14 | }
15 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/menu/index.ts:
--------------------------------------------------------------------------------
1 | export { MenuComponent, MenuTriggerComponent, MenuItemComponent, MenuGroupComponent } from './menu';
2 | export * from './menu.module';
3 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/menu/menu-group.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 | width: 100%;
4 |
5 | @apply p-1;
6 | @apply px-4;
7 | @apply text-secondary;
8 |
9 | display: block;
10 | text-transform: uppercase;
11 | font-size: 0.7rem;
12 | opacity: .7;
13 | }
14 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/menu/menu-item.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | @apply block w-full;
3 |
4 | cursor: pointer;
5 | @apply p-2;
6 | @apply px-4 text-primary text-xxs;
7 | font-weight: 500;
8 |
9 | &:hover {
10 | @apply bg-gray-300;
11 | }
12 |
13 | &.disabled {
14 | cursor: not-allowed;
15 | opacity: 0.5;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/menu/menu.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/multi-switch/index.ts:
--------------------------------------------------------------------------------
1 | export { MultiSwitchComponent } from './multi-switch';
2 | export { SwitchItemComponent } from './switch-item';
3 | export * from './multi-switch.module';
4 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/multi-switch/multi-switch.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/add-to-filter/index.ts:
--------------------------------------------------------------------------------
1 | export * from './add-to-filter';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/connection-details/index.ts:
--------------------------------------------------------------------------------
1 | export * from './conn-details';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/connection-row/index.ts:
--------------------------------------------------------------------------------
1 | export * from './conn-row';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/index.ts:
--------------------------------------------------------------------------------
1 | export * from './netquery.component';
2 | export * from './netquery.module';
3 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/line-chart/index.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/desktop/angular/src/app/shared/netquery/line-chart/index.ts
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/pipes/index.ts:
--------------------------------------------------------------------------------
1 | export * from './location.pipe';
2 | export * from './can-show.pipe';
3 | export * from './can-use-rules.pipe';
4 | export * from './is-blocked.pipe';
5 | export * from './country-name.pipe';
6 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/pipes/is-blocked.pipe.ts:
--------------------------------------------------------------------------------
1 | import { Pipe, PipeTransform } from '@angular/core';
2 | import { IsDenied, NetqueryConnection } from '@safing/portmaster-api';
3 |
4 | @Pipe({
5 | name: "isBlocked",
6 | pure: true
7 | })
8 | export class IsBlockedConnectionPipe implements PipeTransform {
9 | transform(conn: NetqueryConnection): boolean {
10 | return IsDenied(conn?.verdict);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/scope-label/index.ts:
--------------------------------------------------------------------------------
1 | export * from './scope-label';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/scope-label/scope-label.html:
--------------------------------------------------------------------------------
1 |
2 | {{subdomain}}.
4 | {{domain}}
5 |
6 |
7 | {{ scopeTranslation[scope || ''] || 'N/A' }}
8 |
9 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/search-overlay/index.ts:
--------------------------------------------------------------------------------
1 | export * from './search-overlay';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/search-overlay/search-overlay.html:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/searchbar/index.ts:
--------------------------------------------------------------------------------
1 | export * from './searchbar';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/tag-bar/index.ts:
--------------------------------------------------------------------------------
1 | export * from './tag-bar';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/netquery/textql/index.ts:
--------------------------------------------------------------------------------
1 | export * from './parser';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/network-scout/index.ts:
--------------------------------------------------------------------------------
1 | export * from './network-scout';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/network-scout/network-scout.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | @apply w-full p-2 flex flex-col gap-2;
3 | }
4 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/notification-list/index.ts:
--------------------------------------------------------------------------------
1 | export { NotificationListComponent as NotificationWidgetComponent, NotificationWidgetConfig } from './notification-list.component';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/pipes/index.ts:
--------------------------------------------------------------------------------
1 | export * from './common-pipes.module';
2 | export * from './time-ago.pipe';
3 | export * from './to-profile.pipe';
4 | export * from './duration.pipe';
5 | export * from './to-seconds.pipe';
6 | export * from './round.pipe';
7 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/pipes/round.pipe.ts:
--------------------------------------------------------------------------------
1 | import { Pipe, PipeTransform } from '@angular/core';
2 |
3 | @Pipe({
4 | name: 'round',
5 | pure: true,
6 | })
7 | export class RoundPipe implements PipeTransform {
8 | transform(value: number, roundBy: number) {
9 | if (isNaN(value)) {
10 | return NaN
11 | }
12 |
13 | return Math.floor(value / roundBy) * roundBy
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/process-details-dialog/index.ts:
--------------------------------------------------------------------------------
1 | export * from './process-details-dialog';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/prompt-list/index.ts:
--------------------------------------------------------------------------------
1 | export { PromptListComponent as PromptWidgetComponent } from './prompt-list.component';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/security-lock/index.ts:
--------------------------------------------------------------------------------
1 | export * from './security-lock';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/spn-account-details/index.ts:
--------------------------------------------------------------------------------
1 | export * from './spn-account-details';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/spn-account-details/spn-account-details.scss:
--------------------------------------------------------------------------------
1 | table tr {
2 | background-color: transparent !important;
3 | }
4 |
5 | table .table-section-start {
6 | border-top: 1.5rem solid transparent;
7 | }
8 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/spn-login/index.ts:
--------------------------------------------------------------------------------
1 | export * from './spn-login';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/spn-network-status/index.ts:
--------------------------------------------------------------------------------
1 | export * from './spn-network-status';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/spn-status/index.ts:
--------------------------------------------------------------------------------
1 | export * from './spn-status';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/app/shared/text-placeholder/index.ts:
--------------------------------------------------------------------------------
1 | export { PlaceholderComponent } from './placeholder';
2 |
--------------------------------------------------------------------------------
/desktop/angular/src/assets:
--------------------------------------------------------------------------------
1 | ../assets
--------------------------------------------------------------------------------
/desktop/angular/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = new class {
2 | readonly supportHub = "https://support.safing.io"
3 | readonly production = true;
4 |
5 | get httpAPI() {
6 | return `http://${window.location.host}/api`
7 | }
8 |
9 | get portAPI() {
10 | const result = `ws://${window.location.host}/api/database/v1`;
11 | return result;
12 | }
13 | }
--------------------------------------------------------------------------------
/desktop/angular/src/theme.less:
--------------------------------------------------------------------------------
1 |
2 | // Custom Theming for NG-ZORRO
3 | // For more information: https://ng.ant.design/docs/customize-theme/en
4 | @import "../node_modules/ng-zorro-antd/ng-zorro-antd.dark.less";
5 |
--------------------------------------------------------------------------------
/desktop/angular/src/theme/_breadcrumbs.scss:
--------------------------------------------------------------------------------
1 | h4.breadcrumbs {
2 | * {
3 | margin-left : 0.125rem;
4 | margin-right: 0.125rem;
5 | }
6 |
7 | span {
8 | outline: none;
9 | @apply text-secondary;
10 |
11 | &:hover {
12 | @apply text-primary;
13 | text-decoration: underline;
14 | }
15 |
16 | &:last-of-type {
17 | @apply text-primary;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/desktop/angular/src/theme/_dialog.scss:
--------------------------------------------------------------------------------
1 | .dialog-screen-backdrop {
2 | backdrop-filter : blur(10px);
3 | background-color: rgba(#000000, 0.7);
4 | }
5 |
6 | .dialog-screen-backdrop-light {
7 | backdrop-filter : blur(3px);
8 | background-color: rgba(#000000, 0.4);
9 | }
10 |
--------------------------------------------------------------------------------
/desktop/angular/src/theme/_pill.scss:
--------------------------------------------------------------------------------
1 | @import 'mixins/_pill.scss';
2 |
3 | .pill-container {
4 | @include pill-container;
5 | @apply pl-2;
6 | @apply bg-buttons-dark;
7 | }
8 |
--------------------------------------------------------------------------------
/desktop/angular/src/theme/_search.scss:
--------------------------------------------------------------------------------
1 | em.search-result {
2 | @apply text-background;
3 | @apply bg-yellow;
4 | @apply border;
5 | @apply border-yellow;
6 | @apply rounded-sm;
7 |
8 | text-decoration: none;
9 | font-style: inherit;
10 | }
11 |
--------------------------------------------------------------------------------
/desktop/angular/src/theme/_tailwind.scss:
--------------------------------------------------------------------------------
1 | /** The tailwind post-processor will inject all tailwind styles here **/
2 | @import 'tailwindcss/base';
3 | @import 'tailwindcss/components';
4 | @import 'tailwindcss/utilities';
5 |
--------------------------------------------------------------------------------
/desktop/angular/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/app",
6 | "types": [
7 | ]
8 | },
9 | "files": [
10 | "src/main.ts",
11 | "src/polyfills.ts"
12 | ],
13 | "include": [
14 | "src/**/*.d.ts"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/desktop/angular/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/spec",
6 | "types": [
7 | "jasmine"
8 | ]
9 | },
10 | "files": [
11 | "src/test.ts",
12 | "src/polyfills.ts"
13 | ],
14 | "include": [
15 | "src/**/*.spec.ts",
16 | "src/**/*.d.ts",
17 | "src/app/widgets/status-widget-factory/settings.ts"
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/desktop/tauri/.cargo/config.toml:
--------------------------------------------------------------------------------
1 | [target.aarch64-unknown-linux-gnu]
2 | linker = "aarch64-linux-gnu-gcc"
3 | rustflags = ["-C", "link-args=-L/usr/lib/aarch64-linux-gnu/"]
4 |
5 | [target.armv7-unknown-linux-gnueabihf]
6 | linker = "arm-linux-gnueabihf-gcc"
7 | rustflags = ["-C", "link-args=-L/usr/lib/arm-linux-gnueabihf/"]
8 |
--------------------------------------------------------------------------------
/desktop/tauri/src-tauri/.gitignore:
--------------------------------------------------------------------------------
1 | # Generated by Cargo
2 | # will have compiled files and executables
3 | /target/
4 |
--------------------------------------------------------------------------------
/desktop/tauri/src-tauri/Cross.toml:
--------------------------------------------------------------------------------
1 | [target.aarch64-unknown-linux-gnu]
2 | image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main"
3 |
4 | pre-build = [
5 | "dpkg --add-architecture $CROSS_DEB_ARCH",
6 | "apt-get update && apt-get --assume-yes install libssl-dev:$CROSS_DEB_ARCH libjavascriptcoregtk-4.0-dev:$CROSS_DEB_ARCH librsvg2-dev libayatana-appindicator3-dev libwebkit2gtk-4.0-dev libsoup2.4-dev libgtk-3-dev"
7 | ]
8 |
--------------------------------------------------------------------------------
/desktop/tauri/src-tauri/build.rs:
--------------------------------------------------------------------------------
1 | fn main() {
2 | tauri_build::build()
3 | }
4 |
--------------------------------------------------------------------------------
/desktop/tauri/src-tauri/src/portapi/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod client;
2 | pub mod message;
3 | pub mod types;
4 | pub mod models;
--------------------------------------------------------------------------------
/desktop/tauri/src-tauri/src/portapi/models/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod config;
2 | pub mod spn;
3 | pub mod notification;
4 | pub mod subsystem;
--------------------------------------------------------------------------------
/desktop/tauri/src-tauri/src/portapi/models/spn.rs:
--------------------------------------------------------------------------------
1 | use serde::*;
2 |
3 |
4 | #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
5 | pub struct SPNStatus {
6 | #[serde(rename = "Status")]
7 | pub status: String,
8 | }
--------------------------------------------------------------------------------
/desktop/tauri/src-tauri/src/service/manager.rs:
--------------------------------------------------------------------------------
1 | use std::process::{Command, ExitStatus, Stdio};
2 | use std::{fs, io};
3 |
4 | use thiserror::Error;
5 |
6 | #[cfg(target_os = "linux")]
7 | use std::os::unix::fs::PermissionsExt;
8 |
9 | use super::status::StatusResult;
10 |
11 | static SYSTEMCTL: &str = "systemctl";
12 | // TODO(ppacher): add support for kdesudo and gksudo
13 |
14 | enum SudoCommand {
15 | Pkexec,
16 | Gksu,
17 | }
18 |
--------------------------------------------------------------------------------
/desktop/tauri/src-tauri/templates/nsis_install_hooks.nsh:
--------------------------------------------------------------------------------
1 | !define NSIS_HOOK_POSTINSTALL "NSIS_HOOK_POSTINSTALL_"
2 |
3 | !macro NSIS_HOOK_POSTINSTALL_
4 | ExecWait '"$INSTDIR\portmaster-start.exe" install core-service --data="$INSTDIR\data"'
5 | !macroend
6 |
7 |
8 | !define NSIS_HOOK_PREUNINSTALL "NSIS_HOOK_PREUNINSTALL_"
9 |
10 | !macro NSIS_HOOK_PREUNINSTALL_
11 | ExecWait 'sc.exe stop PortmasterCore'
12 | ExecWait 'sc.exe delete PortmasterCore'
13 | !macroend
14 |
15 |
--------------------------------------------------------------------------------
/packaging/linux/portmaster-autostart.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Name=Portmaster
3 | GenericName=Application Firewall Notifier
4 | Exec=/usr/bin/portmaster --with-prompts --with-notifications --background
5 | Icon=portmaster
6 | Terminal=false
7 | Type=Application
8 | Categories=System
9 | NoDisplay=true
--------------------------------------------------------------------------------
/packaging/linux/portmaster.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Name=Portmaster
3 | GenericName=Application Firewall
4 | Exec={{exec}} --data=/opt/safing/portmaster --with-prompts --with-notifications
5 | Icon={{icon}}
6 | Terminal=false
7 | Type=Application
8 | Categories=System
9 |
--------------------------------------------------------------------------------
/packaging/linux/postinst:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | systemctl daemon-reload
4 | systemctl enable portmaster.service
5 |
6 | echo "Please reboot your system"
--------------------------------------------------------------------------------
/packaging/linux/postrm:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
--------------------------------------------------------------------------------
/packaging/windows/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/packaging/windows/.gitkeep
--------------------------------------------------------------------------------
/runtime/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/runtime/.gitkeep
--------------------------------------------------------------------------------
/service/broadcasts/testdata/README.md:
--------------------------------------------------------------------------------
1 | # Testing Broadcast Notifications
2 |
3 | ```
4 | # View matching data
5 | curl http://127.0.0.1:817/api/v1/broadcasts/matching-data
6 |
7 | # Reset state
8 | curl -X POST http://127.0.0.1:817/api/v1/broadcasts/reset-state
9 |
10 | # Simulate notifications
11 | curl --upload-file notifications.yaml http://127.0.0.1:817/api/v1/broadcasts/simulate
12 | ```
13 |
--------------------------------------------------------------------------------
/service/compat/debug_default.go:
--------------------------------------------------------------------------------
1 | //go:build !windows && !linux
2 |
3 | package compat
4 |
5 | import "github.com/safing/portmaster/base/utils/debug"
6 |
7 | // AddToDebugInfo adds compatibility data to the given debug.Info.
8 | func AddToDebugInfo(di *debug.Info) {
9 | // Not yet implemented on this platform.
10 | }
11 |
--------------------------------------------------------------------------------
/service/compat/iptables_test.go:
--------------------------------------------------------------------------------
1 | //go:build linux
2 |
3 | package compat
4 |
5 | import (
6 | "testing"
7 | )
8 |
9 | func TestIPTablesChains(t *testing.T) {
10 | // Skip in CI.
11 | if testing.Short() {
12 | t.Skip()
13 | }
14 | t.Parallel()
15 |
16 | chain, err := GetIPTablesChains()
17 | if err != nil {
18 | t.Fatal(err)
19 | }
20 |
21 | if len(chain) < 35 {
22 | t.Errorf("Expected at least 35 output lines, not %d", len(chain))
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/service/config.go:
--------------------------------------------------------------------------------
1 | package service
2 |
3 | type ServiceConfig struct{}
4 |
--------------------------------------------------------------------------------
/service/core/os_default.go:
--------------------------------------------------------------------------------
1 | //go:build !windows
2 |
3 | package core
4 |
5 | // only return on Fatal error!
6 | func startPlatformSpecific() error {
7 | return nil
8 | }
9 |
--------------------------------------------------------------------------------
/service/firewall/interception/dnsmonitor/eventlistener.go:
--------------------------------------------------------------------------------
1 | //go:build !linux && !windows
2 | // +build !linux,!windows
3 |
4 | package dnsmonitor
5 |
6 | type Listener struct{}
7 |
8 | func newListener(_ *DNSMonitor) (*Listener, error) {
9 | return &Listener{}, nil
10 | }
11 |
12 | func (l *Listener) flush() error {
13 | // Nothing to flush
14 | return nil
15 | }
16 |
17 | func (l *Listener) stop() error {
18 | return nil
19 | }
20 |
--------------------------------------------------------------------------------
/service/firewall/interception/ebpf/bandwidth/bpf_bpfeb.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/service/firewall/interception/ebpf/bandwidth/bpf_bpfeb.o
--------------------------------------------------------------------------------
/service/firewall/interception/ebpf/bandwidth/bpf_bpfel.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/service/firewall/interception/ebpf/bandwidth/bpf_bpfel.o
--------------------------------------------------------------------------------
/service/firewall/interception/ebpf/connection_listener/bpf_bpfeb.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/service/firewall/interception/ebpf/connection_listener/bpf_bpfeb.o
--------------------------------------------------------------------------------
/service/firewall/interception/ebpf/connection_listener/bpf_bpfel.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/service/firewall/interception/ebpf/connection_listener/bpf_bpfel.o
--------------------------------------------------------------------------------
/service/firewall/interception/ebpf/exec/bpf_bpfeb.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/service/firewall/interception/ebpf/exec/bpf_bpfeb.o
--------------------------------------------------------------------------------
/service/firewall/interception/ebpf/exec/bpf_bpfel.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/service/firewall/interception/ebpf/exec/bpf_bpfel.o
--------------------------------------------------------------------------------
/service/firewall/interception/windowskext/doc.go:
--------------------------------------------------------------------------------
1 | // +build windows
2 |
3 | // Package windowskext provides network interception capabilities on windows via the Portmaster Kernel Extension.
4 | package windowskext
5 |
--------------------------------------------------------------------------------
/service/firewall/interception/windowskext2/doc.go:
--------------------------------------------------------------------------------
1 | // +build windows
2 |
3 | // Package windowskext provides network interception capabilities on windows via the Portmaster Kernel Extension.
4 | package windowskext
5 |
--------------------------------------------------------------------------------
/service/firewall/interception/windowskext2/service.go:
--------------------------------------------------------------------------------
1 | //go:build windows
2 | // +build windows
3 |
4 | package windowskext
5 |
6 | import "github.com/safing/portmaster/windows_kext/kextinterface"
7 |
8 | func createKextService(driverName string, driverPath string) (*kextinterface.KextService, error) {
9 | return kextinterface.CreateKextService(driverName, driverPath)
10 | }
11 |
--------------------------------------------------------------------------------
/service/integration/integration.go:
--------------------------------------------------------------------------------
1 | //go:build !windows
2 | // +build !windows
3 |
4 | package integration
5 |
6 | type OSSpecific struct{}
7 |
8 | // Initialize is empty on any OS different then Windows.
9 | func (i *OSIntegration) Initialize() error {
10 | return nil
11 | }
12 |
13 | // CleanUp releases any resourses allocated during initializaion.
14 | func (i *OSIntegration) CleanUp() error {
15 | return nil
16 | }
17 |
--------------------------------------------------------------------------------
/service/intel/resolver.go:
--------------------------------------------------------------------------------
1 | package intel
2 |
3 | import (
4 | "context"
5 | )
6 |
7 | var reverseResolver func(ctx context.Context, ip string) (domain string, err error)
8 |
9 | // SetReverseResolver allows the resolver module to register a function to allow reverse resolving IPs to domains.
10 | func SetReverseResolver(fn func(ctx context.Context, ip string) (domain string, err error)) {
11 | if reverseResolver == nil {
12 | reverseResolver = fn
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/service/mgr/doc.go:
--------------------------------------------------------------------------------
1 | // Package mgr provides simple managing of flow control and logging.
2 | package mgr
3 |
--------------------------------------------------------------------------------
/service/netenv/environment_linux_test.go:
--------------------------------------------------------------------------------
1 | package netenv
2 |
3 | import "testing"
4 |
5 | func TestLinuxEnvironment(t *testing.T) {
6 | t.Parallel()
7 |
8 | nameserversTest, err := getNameserversFromResolvconf()
9 | if err != nil {
10 | t.Errorf("failed to get namerservers from resolvconf: %s", err)
11 | }
12 | t.Logf("nameservers from resolvconf: %+v", nameserversTest)
13 | }
14 |
--------------------------------------------------------------------------------
/service/netenv/environment_test.go:
--------------------------------------------------------------------------------
1 | package netenv
2 |
3 | import "testing"
4 |
5 | func TestEnvironment(t *testing.T) {
6 | t.Parallel()
7 |
8 | nameserversTest := Nameservers()
9 | t.Logf("nameservers: %+v", nameserversTest)
10 |
11 | gatewaysTest := Gateways()
12 | t.Logf("gateways: %+v", gatewaysTest)
13 | }
14 |
--------------------------------------------------------------------------------
/service/netenv/environment_windows_test.go:
--------------------------------------------------------------------------------
1 | package netenv
2 |
3 | import "testing"
4 |
5 | func TestWindowsEnvironment(t *testing.T) {
6 | defaultIf := getDefaultInterface()
7 | if defaultIf == nil {
8 | t.Error("failed to get default interface")
9 | }
10 | t.Logf("default interface: %+v", defaultIf)
11 | }
12 |
--------------------------------------------------------------------------------
/service/netenv/location_default.go:
--------------------------------------------------------------------------------
1 | //go:build !windows
2 |
3 | package netenv
4 |
5 | import "net"
6 |
7 | func newICMPListener(_ string) (net.PacketConn, error) { //nolint:unused,deadcode // TODO: clean with Windows code later.
8 | return net.ListenPacket("ip4:icmp", "0.0.0.0")
9 | }
10 |
--------------------------------------------------------------------------------
/service/netenv/main_test.go:
--------------------------------------------------------------------------------
1 | package netenv
2 |
3 | // func TestMain(m *testing.M) {
4 | // pmtesting.TestMain(m, module)
5 | // }
6 |
--------------------------------------------------------------------------------
/service/netenv/online-status_test.go:
--------------------------------------------------------------------------------
1 | package netenv
2 |
3 | import (
4 | "context"
5 | "testing"
6 | )
7 |
8 | func TestCheckOnlineStatus(t *testing.T) {
9 | t.Parallel()
10 |
11 | checkOnlineStatus(context.Background())
12 | t.Logf("online status: %s", GetOnlineStatus())
13 | t.Logf("captive portal: %+v", GetCaptivePortal())
14 | }
15 |
--------------------------------------------------------------------------------
/service/netenv/os_default.go:
--------------------------------------------------------------------------------
1 | //go:build !android
2 |
3 | package netenv
4 |
5 | import (
6 | "net"
7 | "time"
8 | )
9 |
10 | var (
11 | monitorNetworkChangeOnlineTicker = time.NewTicker(15 * time.Second)
12 | monitorNetworkChangeOfflineTicker = time.NewTicker(time.Second)
13 | )
14 |
15 | func osGetInterfaceAddrs() ([]net.Addr, error) {
16 | return net.InterfaceAddrs()
17 | }
18 |
19 | func osGetNetworkInterfaces() ([]net.Interface, error) {
20 | return net.Interfaces()
21 | }
22 |
--------------------------------------------------------------------------------
/service/process/doc.go:
--------------------------------------------------------------------------------
1 | // Package process fetches process and socket information from the operating system.
2 | // It can find the process owning a network connection.
3 | package process
4 |
--------------------------------------------------------------------------------
/service/profile/binmeta/find_default.go:
--------------------------------------------------------------------------------
1 | //go:build !linux && !windows
2 |
3 | package binmeta
4 |
5 | import "context"
6 |
7 | // GetIconAndName returns zero values for unsupported platforms.
8 | func GetIconAndName(ctx context.Context, binPath string, homeDir string) (icon *Icon, name string, err error) {
9 | return nil, "", nil
10 | }
11 |
--------------------------------------------------------------------------------
/service/resolver/compat.go:
--------------------------------------------------------------------------------
1 | package resolver
2 |
3 | import "net"
4 |
5 | // This is a workaround for enabling the resolver to work with the compat
6 | // module without importing it. Long-term, the network module should not import
7 | // the resolver package, as this breaks the SPN hub.
8 | var (
9 | CompatDNSCheckInternalDomainScope string
10 | CompatSelfCheckIsFailing func() bool
11 | CompatSubmitDNSCheckDomain func(subdomain string) (respondWith net.IP)
12 | )
13 |
--------------------------------------------------------------------------------
/service/updates/os_integration_default.go:
--------------------------------------------------------------------------------
1 | //go:build !linux
2 | // +build !linux
3 |
4 | package updates
5 |
6 | func upgradeSystemIntegration() error {
7 | return nil
8 | }
9 |
--------------------------------------------------------------------------------
/spn/access/account/client.go:
--------------------------------------------------------------------------------
1 | package account
2 |
3 | // Customer Agent URLs.
4 | const (
5 | CAAuthenticateURL = "/authenticate"
6 | CAProfileURL = "/user/profile"
7 | CAGetTokensURL = "/tokens"
8 | )
9 |
10 | // Customer Hub URLs.
11 | const (
12 | CHAuthenticateURL = "/v1/authenticate"
13 | CHUserProfileURL = "/v1/user_profile"
14 | )
15 |
--------------------------------------------------------------------------------
/spn/conf/map.go:
--------------------------------------------------------------------------------
1 | package conf
2 |
3 | import (
4 | "flag"
5 |
6 | "github.com/safing/portmaster/spn/hub"
7 | )
8 |
9 | // Primary Map Configuration.
10 | var (
11 | MainMapName = "main"
12 | MainMapScope = hub.ScopePublic
13 | )
14 |
15 | func init() {
16 | flag.StringVar(&MainMapName, "spn-map", "main", "set main SPN map - use only for testing")
17 | }
18 |
--------------------------------------------------------------------------------
/spn/conf/version.go:
--------------------------------------------------------------------------------
1 | package conf
2 |
3 | const (
4 | // VersionOne is the first protocol version.
5 | VersionOne = 1
6 |
7 | // CurrentVersion always holds the newest version in production.
8 | CurrentVersion = 1
9 | )
10 |
--------------------------------------------------------------------------------
/spn/spn.go:
--------------------------------------------------------------------------------
1 | package spn
2 |
--------------------------------------------------------------------------------
/spn/testing/simple/config-template.json:
--------------------------------------------------------------------------------
1 | {
2 | "core": {
3 | "log": {
4 | "level": "trace"
5 | },
6 | "metrics": {
7 | "instance": "test_$HUBNAME",
8 | "push": ""
9 | }
10 | },
11 | "spn": {
12 | "publicHub": {
13 | "name": "test-$HUBNAME",
14 | "transports": ["http:80", "http:8080", "tcp:17"],
15 | "allowUnencrypted": true,
16 | "bindToAdvertised": true
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/spn/testing/simple/reset-databases.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | cd "$( dirname "${BASH_SOURCE[0]}" )"
4 |
5 | rm -rf testdata/me/*
6 | rm -rf testdata/shared/*
7 | rm -rf testdata/hub*/databases
8 |
--------------------------------------------------------------------------------
/spn/testing/simple/stop.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | cd "$( dirname "${BASH_SOURCE[0]}" )"
4 |
5 | docker compose -p spn-test-simple stop
6 | docker compose -p spn-test-simple rm
7 |
8 | oldnet=$(docker network ls | grep spn-test-simple | cut -d" " -f1)
9 | if [[ $oldnet != "" ]]; then
10 | docker network rm $oldnet
11 | fi
12 |
13 | if [[ -d "data/shared" ]]; then
14 | rm -r "data/shared"
15 | fi
16 |
--------------------------------------------------------------------------------
/spn/tools/start-checksum.txt:
--------------------------------------------------------------------------------
1 | 3f45f0814c6db28c3899b39ae0ab01f8f20a8cc98697dbe8039162ccd9590bf8 ./portmaster-start
2 |
--------------------------------------------------------------------------------
/windows_core_dll/build.ps1:
--------------------------------------------------------------------------------
1 | msbuild .\windows_core_dll.sln /p:Configuration=Release
2 | ls .\x64\Release\portmaster-core.dll
--------------------------------------------------------------------------------
/windows_core_dll/framework.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
4 | // Windows Header Files
5 | #include
6 |
--------------------------------------------------------------------------------
/windows_core_dll/pch.cpp:
--------------------------------------------------------------------------------
1 | // pch.cpp: source file corresponding to the pre-compiled header
2 |
3 | #include "pch.h"
4 |
5 | // When you are using pre-compiled headers, this source file is necessary for compilation to succeed.
6 |
--------------------------------------------------------------------------------
/windows_core_dll/windows_core_dll.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/windows_kext/c_helper/ARM64/c_helper.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/windows_kext/c_helper/ARM64/c_helper.lib
--------------------------------------------------------------------------------
/windows_kext/c_helper/x64/c_helper.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/safing/portmaster/45565fa34f4299469d3fa8c55f1325c64fe4061a/windows_kext/c_helper/x64/c_helper.lib
--------------------------------------------------------------------------------
/windows_kext/driver/.cargo/config.toml:
--------------------------------------------------------------------------------
1 | [build]
2 | target = "x86_64-pc-windows-msvc"
3 | rustflags = ["-C", "panic=abort"]
4 |
--------------------------------------------------------------------------------
/windows_kext/driver/Makefile.toml:
--------------------------------------------------------------------------------
1 | [env.development]
2 | TARGET_PATH = "target/x86_64-pc-windows-msvc/debug"
3 |
4 | [env.production]
5 | TARGET_PATH = "target/x86_64-pc-windows-msvc/release"
6 | BUILD_FLAGS = "--release"
7 |
8 | [tasks.build-driver]
9 | script = [
10 | "cargo build $BUILD_FLAGS",
11 | ]
12 |
13 | [tasks.upload]
14 | dependencies = ["build-driver"]
15 | script = [
16 | "scp $TARGET_PATH/driver.lib windows:'C:/Dev/'",
17 | ]
18 |
19 |
--------------------------------------------------------------------------------
/windows_kext/driver/rust-toolchain:
--------------------------------------------------------------------------------
1 | stable
2 |
--------------------------------------------------------------------------------
/windows_kext/kextinterface/kext_file_test.go:
--------------------------------------------------------------------------------
1 | //go:build linux
2 | // +build linux
3 |
4 | package kextinterface
5 |
6 | type KextFile struct{}
7 |
8 | func (f *KextFile) Read(buffer []byte) (int, error) {
9 | return 0, nil
10 | }
11 |
12 | // func (f *KextFile) flushBuffer() {}
13 |
--------------------------------------------------------------------------------
/windows_kext/kextinterface/version.txt:
--------------------------------------------------------------------------------
1 | [2, 0, 6, 0]
2 |
--------------------------------------------------------------------------------
/windows_kext/protocol/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "protocol"
3 | version = "0.0.0"
4 | edition = "2021"
5 |
6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7 |
8 | [dependencies]
9 | num = { version = "0.4", default-features = false }
10 | num-derive = { version = "0.4", default-features = false }
11 | num-traits = { version = "0.2", default-features = false }
12 |
13 | [dev-dependencies]
14 | rand = "0.8.5"
15 |
--------------------------------------------------------------------------------
/windows_kext/protocol/src/lib.rs:
--------------------------------------------------------------------------------
1 | #![cfg_attr(not(test), no_std)]
2 | extern crate alloc;
3 |
4 | pub mod command;
5 | pub mod info;
6 |
--------------------------------------------------------------------------------
/windows_kext/release/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "release"
3 | version = "0.0.0"
4 | edition = "2021"
5 |
6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7 |
8 | [dependencies]
9 | handlebars = "5.1.0"
10 | serde = "1.0.197"
11 | serde_derive = "1.0.197"
12 | serde_json = "1.0.114"
13 | chrono = "0.4.35"
14 | zip = { version = "0.6.6", default-features = false }
15 |
--------------------------------------------------------------------------------
/windows_kext/test_protocol.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | echo Running tests
3 | echo ========================
4 | cd protocol
5 | cargo test
6 |
7 | cd ../kextinterface
8 | go test -v .
9 |
--------------------------------------------------------------------------------
/windows_kext/wdk/.cargo/config.toml:
--------------------------------------------------------------------------------
1 | [build]
2 | target = "x86_64-pc-windows-msvc"
3 |
--------------------------------------------------------------------------------
/windows_kext/wdk/build.rs:
--------------------------------------------------------------------------------
1 | #[cfg(target_arch = "x86_64")]
2 | fn main() {
3 | // C Helper
4 | println!("cargo:rerun-if-changed=../c_helper/x64/c_helper.lib");
5 | println!("cargo:rustc-link-search=native=../c_helper/x64");
6 | }
7 |
8 | #[cfg(target_arch = "aarch64")]
9 | fn main() {
10 | // C Helper
11 | println!("cargo:rerun-if-changed=../c_helper/ARM64/c_helper.lib");
12 | println!("cargo:rustc-link-search=native=../c_helper/ARM64");
13 | }
14 |
--------------------------------------------------------------------------------
/windows_kext/wdk/rust-analyzer.cargo.target:
--------------------------------------------------------------------------------
1 | x86_64-pc-windows-msvc
--------------------------------------------------------------------------------
/windows_kext/wdk/rust-toolchain:
--------------------------------------------------------------------------------
1 | stable
2 |
--------------------------------------------------------------------------------
/windows_kext/wdk/src/error.rs:
--------------------------------------------------------------------------------
1 | // use anyhow::anyhow;
2 |
3 | // pub fn anyhow_ntstatus(status: i32) -> anyhow::Error {
4 | // if let Some(value) = ntstatus::ntstatus::NtStatus::from_u32(status as u32) {
5 | // return anyhow!(value);
6 | // }
7 |
8 | // return anyhow!("UNKNOWN_NTSTATUS_CODE");
9 | // }
10 |
--------------------------------------------------------------------------------