* Move portbase into monorepo * Add new simple module mgr * [WIP] Switch to new simple module mgr * Add StateMgr and more worker variants * [WIP] Switch more modules * [WIP] Switch more modules * [WIP] swtich more modules * [WIP] switch all SPN modules * [WIP] switch all service modules * [WIP] Convert all workers to the new module system * [WIP] add new task system to module manager * [WIP] Add second take for scheduling workers * [WIP] Add FIXME for bugs in new scheduler * [WIP] Add minor improvements to scheduler * [WIP] Add new worker scheduler * [WIP] Fix more bug related to new module system * [WIP] Fix start handing of the new module system * [WIP] Improve startup process * [WIP] Fix minor issues * [WIP] Fix missing subsystem in settings * [WIP] Initialize managers in constructor * [WIP] Move module event initialization to constrictors * [WIP] Fix setting for enabling and disabling the SPN module * [WIP] Move API registeration into module construction * [WIP] Update states mgr for all modules * [WIP] Add CmdLine operation support * Add state helper methods to module group and instance * Add notification and module status handling to status package * Fix starting issues * Remove pilot widget and update security lock to new status data * Remove debug logs * Improve http server shutdown * Add workaround for cleanly shutting down firewall+netquery * Improve logging * Add syncing states with notifications for new module system * Improve starting, stopping, shutdown; resolve FIXMEs/TODOs * [WIP] Fix most unit tests * Review new module system and fix minor issues * Push shutdown and restart events again via API * Set sleep mode via interface * Update example/template module * [WIP] Fix spn/cabin unit test * Remove deprecated UI elements * Make log output more similar for the logging transition phase * Switch spn hub and observer cmds to new module system * Fix log sources * Make worker mgr less error prone * Fix tests and minor issues * Fix observation hub * Improve shutdown and restart handling * Split up big connection.go source file * Move varint and dsd packages to structures repo * Improve expansion test * Fix linter warnings * Fix interception module on windows * Fix linter errors --------- Co-authored-by: Vladimir Stoilov <vladimir@safing.io> |
||
---|---|---|
.. | ||
e2e | ||
projects | ||
src | ||
.eslintrc.json | ||
.gitignore | ||
angular.json | ||
assets | ||
browser-extension-dev.config.ts | ||
browser-extension.config.ts | ||
docker.sh | ||
karma.conf.js | ||
package-lock.json | ||
package.json | ||
proxy.json | ||
README.md | ||
tailwind.config.js | ||
tsconfig.app.json | ||
tsconfig.json | ||
tsconfig.spec.json |
Portmaster
Welcome to the new Portmaster User-Interface. It's based on Angular and is built, unit and e2e tested using @angular/cli
.
Running locally
This section explains how to prepare your Ubuntu machine to build and test the new Portmaster User-Interface. It's recommended to use a virtual machine but running it on bare metal will work as well. You can use the new Portmaster UI as well as the old one in parallel so you can simply switch back when something is still missing or buggy.
- Prepare your tooling
There's a simple dockerized way to build and test the new UI. Just make sure to have docker installed:
sudo apt update
sudo apt install -y docker.io git
sudo systemctl enable --now docker
sudo gpasswd -a $USER docker
- Portmaster installation
Next, make sure to install the Portmaster using the official .deb installer from here. See the Wiki for more information.
Once the Portmaster is installed we need to add two new configuration flags. Execute the following:
echo 'PORTMASTER_ARGS="--experimental-nfqueue --devmode"' | sudo tee /etc/default/portmaster
sudo systemctl daemon-reload
sudo systemctl restart portmaster
- Build and run the new UI
Now, clone this repository and execute the docker.sh
script:
# Clone the repository
git clone https://github.com/safing/portmaster-ui
# Enter the repo and checkout the correct branch
cd portmaster-ui
git checkout feature/new-ui
# Enter the directory and run docker.sh
cd modules/portmaster
sudo bash ./docker.sh
Finally open your browser and point it to http://localhost:8080.
Hacking Quick Start
Although everything should work in the docker container as well, for the best development experience it's recommended to install @angular/cli
locally.
It's highly recommended to:
- Use VSCode (or it's oss or server-side variant) with
- the official Angular Language Service extension
- the Tailwind CSS Extension Pack extension
- the formate: CSS/LESS/SCSS formatter extension
Folder Structure
From the project root (the folder containing this README.md) there are only two folders with the following content and structure:
src/
contains the actual application sources:app/
contains the actual application sources (components, services, uni tests ...)layout/
contains components that form the overall application layout. For example the navigation bar and the side dash are located there.pages/
contains the different pages of the application. A page is something that is associated with a dedicated application route and is rendered at the applications main content.services/
contains shared services (like PortAPI and friends)shared/
contains shared components that are likely used accross other components or pages.widgets/
contains widgets and their settings components for the application side dash.debug/
contains a debug sidebar component
assets/
contains static assets that must be shipped seperately.environments/
contains build and production related environment settings (those are handled by@angular/cli
automatically, see angular.json)
e2e/
contains end-to-end testing sources.
Development server
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
In development mode (that is, you don't pass --prod
) the UI expects portmaster running at ws://127.0.0.1:817/api/database/v1
. See environment.
Code scaffolding
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Build
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Running unit tests
Run ng test
to execute the unit tests via Karma.
Running end-to-end tests
Run ng e2e
to execute the end-to-end tests via Protractor.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.