This commit is contained in:
Casper V. Kristensen 2024-08-05 20:25:39 +02:00
parent 66eb184cc5
commit 9543e4a8eb
3 changed files with 12 additions and 4 deletions

View file

@ -8,11 +8,16 @@ internet surveillance](https://ulovliglogning.dk/). Privacy through obscurity?
podman run --rm -it quay.io/caspervk/autosurfer:latest
```
To show the Firefox GUI:
```shell
podman run --rm -it --network host --env DISPLAY --security-opt label=type:container_runtime_t quay.io/caspervk/autosurfer:latest
```
# Building
```shell
nix build .#oci
./result | podman load
podman run --rm -it autosurfer:0.0.1
# podman push autosurfer:0.0.1 quay.io/caspervk/autosurfer:0.0.1
podman run --rm -it autosurfer:dev
# podman push autosurfer:dev quay.io/caspervk/autosurfer:latest
```

View file

@ -1,5 +1,6 @@
import asyncio
import json
import os
import websockets
from selenium import webdriver
@ -15,7 +16,9 @@ service = webdriver.FirefoxService(
options = webdriver.FirefoxOptions()
# Selenium only checks /usr/bin/firefox by default
options.binary_location = "/bin/firefox"
options.add_argument("--headless")
if not os.getenv("DISPLAY"):
options.add_argument("--headless")
driver = webdriver.Firefox(service=service, options=options)
driver.set_page_load_timeout(3)

View file

@ -62,7 +62,7 @@
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/docker/examples.nix
oci = pkgs.dockerTools.streamLayeredImage {
name = "autosurfer";
tag = "0.0.1";
tag = "dev";
created = builtins.substring 0 8 self.lastModifiedDate;
contents = [
env