diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5b8b6f3..a1736a1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,8 +6,8 @@ variables: PACKER_VERSION: 1.4.3 ANNOUNCE: http://labsync.lab.fablab-nea.de:6969/announce WEBSEED: http://labsync.lab.fablab-nea.de/labsync/$CI_COMMIT_REF_NAME/$CI_PIPELINE_ID/images - DOCKER_IMAGE_BUILDER: ${CI_REGISTRY_IMAGE}/labsync-builder:main - DOCKER_IMAGE_SECURITY_SCANNER: ${CI_REGISTRY_IMAGE}/security-scanner:main + DOCKER_IMAGE_BUILDER: ${CI_REGISTRY_IMAGE}/labsync-builder:$CI_COMMIT_REF_SLUG + DOCKER_IMAGE_SECURITY_SCANNER: ${CI_REGISTRY_IMAGE}/security-scanner:$CI_COMMIT_REF_SLUG DOCKER_TLS_CERTDIR: "" stages: @@ -21,26 +21,17 @@ dockerimage_builder: - apk add --no-cache make services: - docker:dind - variables: - DOCKER_IMAGE_BUILDER: ${CI_REGISTRY_IMAGE}/labsync-builder:$CI_COMMIT_REF_SLUG script: - docker pull $DOCKER_IMAGE_BUILDER || true - - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY - make builderimg - docker push $DOCKER_IMAGE_BUILDER - - echo "DOCKER_IMAGE_BUILDER=$DOCKER_IMAGE_BUILDER" >> build.env - artifacts: - reports: - dotenv: build.env - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - when: on_success - - if: - changes: - paths: - - builder/**/* - compare_to: main - when: on_success + tags: + - fablab + - ssd + except: + refs: + - schedules dockerimage_security_scanner: stage: prepare @@ -50,22 +41,15 @@ dockerimage_security_scanner: - docker:dind script: - docker pull $DOCKER_IMAGE_SECURITY_SCANNER || true - - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY - make secscanimg - docker push $DOCKER_IMAGE_SECURITY_SCANNER - - echo "DOCKER_IMAGE_SECURITY_SCANNER=${CI_REGISTRY_IMAGE}/security-scanner:$CI_COMMIT_REF_SLUG" >> build.env - artifacts: - reports: - dotenv: build.env - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - when: on_success - - if: - changes: - paths: - - security-scanner/**/* - compare_to: main - when: on_success + tags: + - fablab + - ssd + except: + refs: + - schedules security_scanner: stage: check @@ -73,7 +57,7 @@ security_scanner: script: - set -x - export GITLAB_URL="$(echo "$CI_PROJECT_URL" | grep -Eo '^https?://[^/]*')" - - /code/venv/bin/python -m security_scanner $target + - python3 -m security_scanner $target only: refs: - schedules @@ -81,17 +65,8 @@ security_scanner: variables: - $task == "security-scanner" - $target - -lightburn-download: - stage: prepare - image: alpine - script: - - mkdir -p packer/ansible/roles/lightburn/files - - 'wget -O packer/ansible/roles/lightburn/files/lightburn.zip --header "JOB-TOKEN: $CI_JOB_TOKEN" "${CI_SERVER_URL}/api/v4/projects/fablab%2Flightburn-patched/jobs/artifacts/main/download?job=patch-Linux64"' - artifacts: - paths: - - packer/ansible/roles/lightburn/files/lightburn.zip - expire_in: 4 hours + tags: + - dedicated .squashfs_template: &squashfs_template image: $DOCKER_IMAGE_BUILDER @@ -99,9 +74,7 @@ lightburn-download: services: - docker:dind script: - - echo DOCKER_IMAGE_BUILDER=$DOCKER_IMAGE_BUILDER - - echo DOCKER_IMAGE_SECURITY_SCANNER=$DOCKER_IMAGE_SECURITY_SCANNER - - scripts/packer.sh debian-bookworm + - scripts/packer.sh debian-bullseye - aws --endpoint-url "$AWS_ENDPOINT_URL" s3 cp images/ "s3://$AWS_BUCKET/$CI_COMMIT_REF_SLUG/$CI_JOB_ID/" --recursive --no-progress artifacts: paths: @@ -111,6 +84,9 @@ lightburn-download: - images/*.linux #- images/*.squashfs - images/*.torrent + tags: + - fablab + - ssd squashfs_featurebranch: <<: *squashfs_template diff --git a/Makefile b/Makefile index 413424f..b201b6e 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ qemu_network = 10.2.2.0 qemu_netmask = 24 qemu_vm_ip = 10.2.2.10 qemu_disk = tmp/qemu-disk.img -qemu_target ?= debian-bookworm +qemu_target ?= debian-bullseye qemu_kernel = $(qemu_target).linux qemu_torrent = $(qemu_target).torrent qemu_initramfs = $(shell \ @@ -35,7 +35,7 @@ fi \ ci_environment=$(shell env | sed -n 's/^\(CI_.*\)=.*/-e \1/p') .PHONY: default -default: builderimg images/debian-bookworm.squashfs +default: builderimg images/debian-bullseye.squashfs .PHONY: clean clean: @@ -60,7 +60,7 @@ images: [ ! -d "$@" ] && mkdir "$@" touch "$@" -images/debian-bookworm.squashfs: images +images/debian-bullseye.squashfs: images docker run \ --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ @@ -72,9 +72,9 @@ images/debian-bookworm.squashfs: images $(ci_environment) \ "$(DOCKER_IMAGE_BUILDER)" \ scripts/packer.sh \ - debian-bookworm + debian-bullseye -images/debian-bookworm.torrent: images +images/debian-bullseye.torrent: images docker run \ --rm \ -v "${PWD}:${PWD}" \ @@ -82,7 +82,7 @@ images/debian-bookworm.torrent: images -e "WEBSEED=$(WEBSEED)" \ "$(DOCKER_IMAGE_BUILDER)" \ scripts/torrent.sh \ - debian-bookworm + debian-bullseye .PHONY: ansible ansible: @@ -104,24 +104,24 @@ ansible: # updates the initramfs # only used for development -images/debian-bookworm.initramfs.dev: tmp/initramfs-extracted/debian-bookworm packer/initramfs/labsync - cp packer/initramfs/labsync tmp/initramfs-extracted/debian-bookworm/scripts/labsync - (cd tmp/initramfs-extracted/debian-bookworm && find . | cpio -H newc -o | gzip > $(CWD)/images/debian-bookworm.initramfs.dev) +images/debian-bullseye.initramfs.dev: tmp/initramfs-extracted/debian-bullseye packer/initramfs/labsync + cp packer/initramfs/labsync tmp/initramfs-extracted/debian-bullseye/scripts/labsync + (cd tmp/initramfs-extracted/debian-bullseye && find . | cpio -H newc -o | gzip > $(CWD)/images/debian-bullseye.initramfs.dev) tmp: [ ! -d "$@" ] && mkdir "$@" || true -tmp/initramfs-extracted/debian-bookworm: images/debian-bookworm.initramfs - rm -rf tmp/initramfs-extracted/debian-bookworm - mkdir -p tmp/initramfs-extracted/debian-bookworm - (cd tmp/initramfs-extracted/debian-bookworm && zcat "$(CWD)/images/debian-bookworm.initramfs" | cpio -i) - touch tmp/initramfs-extracted/debian-bookworm +tmp/initramfs-extracted/debian-bullseye: images/debian-bullseye.initramfs + rm -rf tmp/initramfs-extracted/debian-bullseye + mkdir -p tmp/initramfs-extracted/debian-bullseye + (cd tmp/initramfs-extracted/debian-bullseye && zcat "$(CWD)/images/debian-bullseye.initramfs" | cpio -i) + touch tmp/initramfs-extracted/debian-bullseye $(qemu_disk): tmp qemu-img create "$@" 20G tmp/netboot.tar.gz: tmp - wget -c -O "$@" https://cdn-aws.deb.debian.org/debian/dists/bookworm/main/installer-amd64/current/images/netboot/netboot.tar.gz + wget -c -O "$@" https://cdn-aws.deb.debian.org/debian/dists/bullseye/main/installer-amd64/current/images/netboot/netboot.tar.gz touch "$@" tmp/tftproot: tmp/netboot.tar.gz diff --git a/packer/ansible/playbook.yml b/packer/ansible/playbook.yml index 773a7bc..73983eb 100644 --- a/packer/ansible/playbook.yml +++ b/packer/ansible/playbook.yml @@ -11,8 +11,6 @@ - role: firefox - role: windowmanager - role: inkscape - - role: lightburn - - role: prusa-slicer - role: fablab - role: hardware - role: docker @@ -46,18 +44,65 @@ version: 3.3.1 lightburn: dockerimage: r.jalr.de/fablab/lightburn + prusa_slicer: + settings: | + no_controller = 1 + no_defaults = 1 + preset_update = 0 + show_splash_screen = 0 + use_inches = 0 + version_check = 0 + view_mode = expert + + [filaments] + AmazonBasics TPU @MINI = 1 + Das Filament PLA = 1 + Generic PETG = 1 + Generic PETG @MINI = 1 + Generic PETG @MMU2 = 1 + Generic PLA = 1 + Generic PLA @MMU2 = 1 + Prusament ASA = 1 + Prusament ASA @MINI = 1 + Prusament ASA @MMU2 = 1 + Prusament PC Blend = 1 + Prusament PC Blend @MINI = 1 + Prusament PC Blend @MMU2 = 1 + Prusament PETG = 1 + Prusament PETG @MINI = 1 + Prusament PETG @MMU2 = 1 + Prusament PLA = 1 + Prusament PLA @MMU2 = 1 + Prusament PVB = 1 + Prusament PVB @MMU2 = 1 + Verbatim BVOH = 1 + Verbatim BVOH @MMU2 = 1 + + [presets] + filament = Prusament PLA + physical_printer = + print = 0.15mm QUALITY @MK3 + printer = Original Prusa i3 MK3 + sla_material = + sla_print = + + [vendor:PrusaResearch] + model:MK3 = 0.4 + model:MK3SMMU2S = 0.4 firefox: language_packs: - de extensions: - uBlock0@raymondhill.net + - https-everywhere@eff.org debian_sections: - main - contrib - non-free debian_mirror: http://ftp.de.debian.org/debian hardware: - firmware: [] + firmware: + - firmware-amd-graphics greeting: title: Willkommen im FabLab Bad Windsheim content: > @@ -66,56 +111,3 @@ Du hast Dich mit einem Gast-Account angemeldet. Alle Daten werden nach der Anmeldung gelöscht. Wenn Du Deine Daten dauerhaft speichern möchtest, lege Dir bitte einen Account an! - lightburn: - devices: - - https://raw.githubusercontent.com/fablab-nea/LaserKutter/main/lightburn/LaserKutter.lbdev - prusa_slicer: - settings: | - no_controller = 1 - no_defaults = 1 - preset_update = 0 - show_splash_screen = 0 - use_inches = 0 - version_check = 0 - view_mode = expert - tls_accepted_cert_store_location = /etc/ssl/certs/ca-certificates.crt - tls_cert_store_accepted = yes - - [filaments] - AmazonBasics TPU @MINI = 1 - Das Filament PLA = 1 - Generic PETG = 1 - Generic PETG @MINI = 1 - Generic PETG @MMU2 = 1 - Generic PLA = 1 - Generic PLA @MMU2 = 1 - Prusament ASA = 1 - Prusament ASA @MINI = 1 - Prusament ASA @MMU2 = 1 - Prusament PC Blend = 1 - Prusament PC Blend @MINI = 1 - Prusament PC Blend @MMU2 = 1 - Prusament PETG = 1 - Prusament PETG @MINI = 1 - Prusament PETG @MMU2 = 1 - Prusament PLA = 1 - Prusament PLA @MMU2 = 1 - Prusament PVB = 1 - Prusament PVB @MMU2 = 1 - Verbatim BVOH = 1 - Verbatim BVOH @MMU2 = 1 - - [presets] - filament = Prusament PLA - physical_printer = - print = 0.15mm QUALITY @MK3 - printer = Original Prusa i3 MK3 - sla_material = - sla_print = - - [vendor:PrusaResearch] - model:MK3 = 0.4 - model:MK3SMMU2S = 0.4 - - [vendor:Ultimaker] - model:ULTIMAKER2 = 0.4 diff --git a/packer/ansible/roles/fablab/files/lightburn/lightburn.desktop b/packer/ansible/roles/fablab/files/lightburn/lightburn.desktop new file mode 100644 index 0000000..90496bc --- /dev/null +++ b/packer/ansible/roles/fablab/files/lightburn/lightburn.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=LightBurn +GenericName=LightBurn +Comment=Laser Cutter Job Control Application +Exec=x-terminal-emulator -e 'sudo /usr/local/bin/lightburn' +Icon=/usr/local/share/lightburn/lightburn.png +Terminal=false +Type=Application +Categories=Graphics diff --git a/packer/ansible/roles/fablab/files/lightburn/lightburn.sh b/packer/ansible/roles/fablab/files/lightburn/lightburn.sh new file mode 100755 index 0000000..5e84a58 --- /dev/null +++ b/packer/ansible/roles/fablab/files/lightburn/lightburn.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +. /etc/default/lightburn + +if [ ! -z "$SUDO_COMMAND" ] && [ "$SUDO_COMMAND" = "$0" ]; then + home="$(getent passwd "$SUDO_UID" | cut -d: -f6)" + export PUID="$SUDO_UID" + export PGID="$SUDO_GID" +else + home="$HOME" + export PUID=$(id -u) + export PGID=$(id -g) +fi + +config_dir="$home/.config/lightburn" + +mkdir -p "$config_dir" + +media="/media/$(id -un $PUID)" +if [ -e "$media" ]; then + media_volume="-v $media:/media" +fi + +docker run \ + --rm \ + -e PUID \ + -e PGID \ + -e DISPLAY \ + -v /tmp/.X11-unix/:/tmp/.X11-unix/ \ + -v $config_dir:/config/ \ + -v $home:/workdir/ \ + $media_volume \ + --network=none \ + "$LIGHTBURN_DOCKER_IMAGE" diff --git a/packer/ansible/roles/fablab/tasks/lightburn.yml b/packer/ansible/roles/fablab/tasks/lightburn.yml new file mode 100644 index 0000000..19f9386 --- /dev/null +++ b/packer/ansible/roles/fablab/tasks/lightburn.yml @@ -0,0 +1,66 @@ +--- +- file: + path: /usr/local/share/lightburn + state: directory + mode: "0755" + owner: root + group: root + +- name: copy icon + copy: + src: lightburn/lightburn.png + dest: /usr/local/share/lightburn/lightburn.png + owner: root + group: root + mode: "0644" + +- name: copy script + copy: + src: lightburn/lightburn.sh + dest: /usr/local/bin/lightburn + owner: root + group: root + mode: "0755" + +- name: add lightburn configuration + template: + src: lightburn/lightburn.j2 + dest: /etc/default/lightburn + owner: root + group: root + mode: "0644" + +- name: add lightburn to applications menu + copy: + src: lightburn/lightburn.desktop + dest: /usr/share/applications/lightburn.desktop + owner: root + group: root + mode: "0644" + +- name: add group + group: + name: lightburn + system: yes + +- name: add sudoers config + copy: + content: "%lightburn ALL=/usr/local/bin/lightburn, NOPASSWD:/usr/local/bin/lightburn\n" + dest: /etc/sudoers.d/lightburn + owner: root + group: root + mode: "0644" + +- name: ensure guest-account settings directory exists + file: + path: /etc/guest-account + state: directory + mode: "0755" + owner: root + group: root + +- name: add lightburn group to guest account + lineinfile: + path: /etc/guest-account/groups + line: lightburn + create: yes diff --git a/packer/ansible/roles/fablab/tasks/main.yml b/packer/ansible/roles/fablab/tasks/main.yml index 1bb8ab5..4702f08 100644 --- a/packer/ansible/roles/fablab/tasks/main.yml +++ b/packer/ansible/roles/fablab/tasks/main.yml @@ -18,8 +18,14 @@ - import_tasks: visicut.yml tags: - fablab:visicut -# - import_tasks: platformio.yml -# tags: -# - fablab:platformio + - import_tasks: lightburn.yml + tags: + - fablab:lightburn + - import_tasks: prusa.yml + tags: + - fablab:prusa + - import_tasks: platformio.yml + tags: + - fablab:platformio tags: - fablab diff --git a/packer/ansible/roles/fablab/tasks/prusa.yml b/packer/ansible/roles/fablab/tasks/prusa.yml new file mode 100644 index 0000000..8211e1c --- /dev/null +++ b/packer/ansible/roles/fablab/tasks/prusa.yml @@ -0,0 +1,25 @@ +--- +- name: install slic3r-prusa + apt: + name: slic3r-prusa + state: present + +- name: create skel directories + file: + path: "/etc/skel/{{ item }}" + state: directory + loop: + - .config + - .config/PrusaSlicer + - .config/PrusaSlicer/vendor + +- name: create symlink to vendor profiles + file: + src: /usr/share/PrusaSlicer/profiles/PrusaResearch.ini + dest: /etc/skel/.config/PrusaSlicer/vendor/PrusaResearch.ini + state: link + +- name: Copy Prusa slicer settings + copy: + content: "{{ fablab.prusa_slicer.settings }}" + dest: /etc/skel/.config/PrusaSlicer/PrusaSlicer.ini diff --git a/packer/ansible/roles/fablab/templates/lightburn/lightburn.j2 b/packer/ansible/roles/fablab/templates/lightburn/lightburn.j2 new file mode 100755 index 0000000..bf7cfad --- /dev/null +++ b/packer/ansible/roles/fablab/templates/lightburn/lightburn.j2 @@ -0,0 +1 @@ +LIGHTBURN_DOCKER_IMAGE='{{ fablab.lightburn.dockerimage }}' diff --git a/packer/ansible/roles/firefox/files/policies.json b/packer/ansible/roles/firefox/files/policies.json index 46d5317..65685f9 100644 --- a/packer/ansible/roles/firefox/files/policies.json +++ b/packer/ansible/roles/firefox/files/policies.json @@ -19,7 +19,7 @@ "NoDefaultBookmarks": true, "OfferToSaveLogins": true, "Homepage": { - "URL": "https://wiki.fablab-nea.de/" + "URL": "about:blank" }, "OverrideFirstRunPage": "", "SearchEngines": { diff --git a/packer/ansible/roles/fonts/tasks/main.yml b/packer/ansible/roles/fonts/tasks/main.yml index 6408a58..2f8f750 100644 --- a/packer/ansible/roles/fonts/tasks/main.yml +++ b/packer/ansible/roles/fonts/tasks/main.yml @@ -3,11 +3,5 @@ - import_tasks: google.yml tags: - fonts:google - - name: Install font viewer - apt: - name: - - fontmatrix - tags: - - fonts:fontmatrix tags: - fonts diff --git a/packer/ansible/roles/inkscape/files/inkscape-silhouette b/packer/ansible/roles/inkscape/files/inkscape-silhouette index 2f40eef..05d9c57 160000 --- a/packer/ansible/roles/inkscape/files/inkscape-silhouette +++ b/packer/ansible/roles/inkscape/files/inkscape-silhouette @@ -1 +1 @@ -Subproject commit 2f40eef85264eb6646ea7e89cbd4659560b88235 +Subproject commit 05d9c57336b13028c01c5bfd850431708c934016 diff --git a/packer/ansible/roles/lightburn/.gitignore b/packer/ansible/roles/lightburn/.gitignore deleted file mode 100644 index c4c4ffc..0000000 --- a/packer/ansible/roles/lightburn/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.zip diff --git a/packer/ansible/roles/lightburn/files/lightburn.desktop b/packer/ansible/roles/lightburn/files/lightburn.desktop deleted file mode 100644 index 62d3c05..0000000 --- a/packer/ansible/roles/lightburn/files/lightburn.desktop +++ /dev/null @@ -1,6 +0,0 @@ -[Desktop Entry] -Name=LightBurn -Exec=/opt/LightBurn/LightBurn -Icon=/opt/LightBurn/LightBurn.png -Type=Application -Categories=Graphics;VectorGraphics;Engineering; diff --git a/packer/ansible/roles/lightburn/tasks/devices.yml b/packer/ansible/roles/lightburn/tasks/devices.yml deleted file mode 100644 index 2981a65..0000000 --- a/packer/ansible/roles/lightburn/tasks/devices.yml +++ /dev/null @@ -1,34 +0,0 @@ -- name: Download devices files - uri: - url: "{{ device_url }}" - return_content: true - loop: "{{ lightburn.devices }}" - loop_control: - loop_var: device_url - register: lightburn_downloaded_devices - -- name: Create lightburn settings - set_fact: - lightburn_devices: "{{ lightburn_devices | default([]) + [device_settings] }}" - vars: - device_settings: "{{ (device.content | from_json)['DeviceList'][0] }}" - loop: "{{ lightburn_downloaded_devices.results }}" - loop_control: - loop_var: device - label: "{{ device_settings.DisplayName }}" - -- name: Create settings directory - file: - path: "{{ item }}" - state: directory - loop: - - /etc/skel/.config - - /etc/skel/.config/LightBurn - -- name: Create settings file - copy: - dest: /etc/skel/.config/LightBurn/prefs.ini - content: "{{ lightburn_settings | to_nice_json() }}" - vars: - lightburn_settings: - DeviceList: "{{ lightburn_devices }}" diff --git a/packer/ansible/roles/lightburn/tasks/install.yml b/packer/ansible/roles/lightburn/tasks/install.yml deleted file mode 100644 index cd9895d..0000000 --- a/packer/ansible/roles/lightburn/tasks/install.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Extract zip file - unarchive: - src: lightburn.zip - dest: /opt -- name: Create applications directory - file: - path: /usr/local/share/applications/ - state: directory -- name: Copy desktop file - copy: - src: lightburn.desktop - dest: /usr/local/share/applications/lightburn.desktop diff --git a/packer/ansible/roles/lightburn/tasks/main.yml b/packer/ansible/roles/lightburn/tasks/main.yml deleted file mode 100644 index 82ab78c..0000000 --- a/packer/ansible/roles/lightburn/tasks/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- block: - - import_tasks: install.yml - tags: - - lightburn:install - - import_tasks: devices.yml - tags: - - lightburn:devices - tags: - - lightburn diff --git a/packer/ansible/roles/prusa-slicer/defaults/main.yml b/packer/ansible/roles/prusa-slicer/defaults/main.yml deleted file mode 100644 index cd9af8b..0000000 --- a/packer/ansible/roles/prusa-slicer/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -prusa_slicer_use_package: false diff --git a/packer/ansible/roles/prusa-slicer/files/PrusaGcodeviewer.desktop b/packer/ansible/roles/prusa-slicer/files/PrusaGcodeviewer.desktop deleted file mode 100644 index 51d1b4d..0000000 --- a/packer/ansible/roles/prusa-slicer/files/PrusaGcodeviewer.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Name=Prusa GCode viewer -Exec=/opt/PrusaSlicer/bin/prusa-slicer --gcodeviewer %F -Icon=/opt/PrusaSlicer/resources/icons/PrusaSlicer-gcodeviewer.svg -Terminal=false -Type=Application -MimeType=text/x.gcode; -Categories=Graphics;3DGraphics; -Keywords=3D;Printing;Slicer; diff --git a/packer/ansible/roles/prusa-slicer/files/PrusaSlicer.desktop b/packer/ansible/roles/prusa-slicer/files/PrusaSlicer.desktop deleted file mode 100644 index 42680f4..0000000 --- a/packer/ansible/roles/prusa-slicer/files/PrusaSlicer.desktop +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Name=PrusaSlicer -GenericName=3D Printing Software -Terminal=false -Exec=/opt/PrusaSlicer/bin/prusa-slicer %F -Icon=/opt/PrusaSlicer/resources/icons/PrusaSlicer.png -Type=Application -MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf; -Categories=Graphics;3DGraphics;Engineering; -Keywords=3D;Printing;Slicer;slice;3D;printer;convert;gcode;stl;obj;amf;SLA -StartupNotify=false -StartupWMClass=prusa-slicer diff --git a/packer/ansible/roles/prusa-slicer/tasks/configure.yml b/packer/ansible/roles/prusa-slicer/tasks/configure.yml deleted file mode 100644 index 649fb4d..0000000 --- a/packer/ansible/roles/prusa-slicer/tasks/configure.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -- set_fact: - prusa_slicer_profiles_directory: /usr/share/PrusaSlicer/profiles - when: prusa_slicer_use_package | bool - -- set_fact: - prusa_slicer_profiles_directory: /opt/PrusaSlicer/resources/profiles - when: not prusa_slicer_use_package | bool - -- name: create skel directories - file: - path: "/etc/skel/{{ item }}" - state: directory - loop: - - .config - - .config/PrusaSlicer - - .config/PrusaSlicer/vendor - -- name: create symlink to vendor profiles - file: - src: "{{ prusa_slicer_profiles_directory }}/{{ item }}.ini" - dest: /etc/skel/.config/PrusaSlicer/vendor/{{ item }}.ini - state: link - loop: - - PrusaResearch - - Ultimaker - -- name: Stat /opt/PrusaSlicer - stat: - path: /opt/PrusaSlicer - register: prusa_slicer_stat - -- name: Set version - set_fact: - prusa_slicer_version: "{{ prusa_slicer_stat.stat.lnk_target | regex_replace('^/opt/PrusaSlicer-(.*)-[0-9]{12}$', '\\1') }}" - when: prusa_slicer_stat.stat.exists and prusa_slicer_stat.stat.islnk - -- debug: - var: prusa_slicer_version - -- name: Copy Prusa slicer settings - copy: - content: | - version_system_info_sent = {{ prusa_slicer_version | default('') }} - {{ prusa_slicer.settings }} - dest: /etc/skel/.config/PrusaSlicer/PrusaSlicer.ini diff --git a/packer/ansible/roles/prusa-slicer/tasks/install_from_github.yml b/packer/ansible/roles/prusa-slicer/tasks/install_from_github.yml deleted file mode 100644 index c191e33..0000000 --- a/packer/ansible/roles/prusa-slicer/tasks/install_from_github.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -- name: Get latest release - uri: - url: https://api.github.com/repos/prusa3d/PrusaSlicer/releases/latest - return_content: true - register: prusa_slicer_release - -- name: Create tarball tempfile - tempfile: - state: file - suffix: .tar.gz - register: prusa_slicer_tarball - -- name: Select asset - set_fact: - prusa_slicer_asset: "{{ asset }}" - when: "asset.name | regex_search('PrusaSlicer-.*linux-x64-GTK3.*\\.tar\\.bz2$')" - loop: "{{ prusa_slicer_release.json.assets }}" - loop_control: - loop_var: asset - label: "{{ asset.name }}" - -- name: Download release file - get_url: - url: "{{ prusa_slicer_asset.browser_download_url }}" - dest: "{{ prusa_slicer_tarball.path }}" - force: true - -- name: Extract tarball - unarchive: - src: "{{ prusa_slicer_tarball.path }}" - dest: /opt - remote_src: true - -- name: Remove tarball - ansible.builtin.file: - path: "{{ prusa_slicer_tarball.path }}" - state: absent - when: prusa_slicer_tarball.path is defined - -- name: Create symlink - file: - src: "/opt/{{ prusa_slicer_directory }}" - dest: "/opt/PrusaSlicer" - state: link - vars: - prusa_slicer_directory: "{{ prusa_slicer_asset.name | regex_replace('\\.tar\\.bz2$', '') }}" - -- name: Create applications directory - file: - path: /usr/local/share/applications/ - state: directory - -- name: Copy desktop files - copy: - src: "{{ item }}.desktop" - dest: /usr/local/share/applications/{{ item }}.desktop - loop: - - PrusaSlicer - - PrusaGcodeviewer diff --git a/packer/ansible/roles/prusa-slicer/tasks/main.yml b/packer/ansible/roles/prusa-slicer/tasks/main.yml deleted file mode 100644 index 2487822..0000000 --- a/packer/ansible/roles/prusa-slicer/tasks/main.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- block: - - import_tasks: package.yml - when: prusa_slicer_use_package | bool - tags: - - prusa-slicer:install - - - import_tasks: install_from_github.yml - when: not prusa_slicer_use_package | bool - tags: - - prusa-slicer:install - - - import_tasks: configure.yml - tags: - - prusa-slicer:configure - - tags: - - prusa-slicer diff --git a/packer/ansible/roles/prusa-slicer/tasks/package.yml b/packer/ansible/roles/prusa-slicer/tasks/package.yml deleted file mode 100644 index 31a992c..0000000 --- a/packer/ansible/roles/prusa-slicer/tasks/package.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: install slic3r-prusa - apt: - name: slic3r-prusa - state: present diff --git a/packer/debian-bookworm.yaml b/packer/debian-bullseye.yaml similarity index 95% rename from packer/debian-bookworm.yaml rename to packer/debian-bullseye.yaml index 8d9d0a5..f4dcc0e 100644 --- a/packer/debian-bookworm.yaml +++ b/packer/debian-bullseye.yaml @@ -20,7 +20,7 @@ variables: builders: - discard: true - image: debian:bookworm + image: debian:bullseye type: docker volumes: '{{user `images`}}': /tmp/images @@ -62,17 +62,16 @@ provisioners: - cp $(find /boot/ -name 'vmlinuz-*' | sort -V | tail -n 1) '/tmp/images/{{user `linux_file`}}' type: shell - inline: - - apt-get -y install openssh-server python3 lsb-release + - apt-get -y install openssh-server python lsb-release + - mkdir -p /root/.ansible/tmp type: shell - playbook_file: ansible/playbook.yml type: ansible - user: root + user: "{{user `ssh_user`}}" ansible_env_vars: - "ANSIBLE_SSH_ARGS='-o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa'" - "ANSIBLE_PYTHON_INTERPRETER=/usr/bin/python3" - extra_arguments: - - "--scp-extra-args" - - "'-O'" + - "ANSIBLE_VERBOSITY=4" - inline: - rm /boot && mkdir /boot type: shell diff --git a/security-scanner/Dockerfile b/security-scanner/Dockerfile index 622e443..677e003 100644 --- a/security-scanner/Dockerfile +++ b/security-scanner/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bookworm-slim +FROM debian:bullseye-slim RUN apt-get update \ && apt-get -y install \ @@ -7,17 +7,14 @@ RUN apt-get update \ python3 \ python3-apt \ python3-pip \ - python3-venv \ && rm -rf /var/lib/apt/lists/* COPY setup.py /code/setup.py WORKDIR /code -RUN python3 -m venv --system-site-packages venv - -RUN venv/bin/pip install -e . +RUN pip3 install -e . ADD . /code -RUN venv/bin/python setup.py install +RUN python3 setup.py install diff --git a/txt.cfg b/txt.cfg index c61741b..1cfc6a4 100644 --- a/txt.cfg +++ b/txt.cfg @@ -1,7 +1,7 @@ label labsync menu label ^labsync - kernel images/debian-bookworm.linux - append initrd=images/debian-bookworm.initramfs.dev boot=labsync labsync_disk=sda labsync_partsize_boot=512 labsync_torrent=http://10.2.2.1/debian-bookworm.torrent quiet vga=792 ip=10.2.2.10:::255.255.255.0:qemu-host:ens3:off labsync_wait=pause + kernel images/debian-bullseye.linux + append initrd=images/debian-bullseye.initramfs.dev boot=labsync labsync_disk=sda labsync_partsize_boot=512 labsync_torrent=http://10.2.2.1/debian-bullseye.torrent quiet vga=792 ip=10.2.2.10:::255.255.255.0:qemu-host:ens3:off labsync_wait=pause label install menu label ^Install