diff --git a/ansible/roles/documentation/templates/README_SNIPPETS/GROUP_BADGES.j2 b/ansible/roles/documentation/templates/README_SNIPPETS/GROUP_BADGES.j2 index 178052d4..7eec3f13 100644 --- a/ansible/roles/documentation/templates/README_SNIPPETS/GROUP_BADGES.j2 +++ b/ansible/roles/documentation/templates/README_SNIPPETS/GROUP_BADGES.j2 @@ -1,6 +1,5 @@ [![Blog]({{ lsio_shieldsio_static_blog }})]({{ lsio_blog_url }} "{{ lsio_blog_desc }}") [![Discord]({{ lsio_shieldsio_discord }})]({{ lsio_discord_url }} "{{ lsio_discord_desc }}") [![Discourse]({{ lsio_shieldsio_discourse_topics }})]({{ lsio_discourse_url }} "{{ lsio_discourse_desc }}") -[![Fleet]({{ lsio_shieldsio_static_fleet }})]({{ lsio_fleet_url }} "{{ lsio_fleet_desc }}") [![GitHub]({{ lsio_shieldsio_static_github }})]({{ lsio_github_url }} "{{ lsio_github_desc }}") [![Open Collective]({{ lsio_shieldsio_opencollective_all }})]({{ lsio_opencollective_url }} "{{ lsio_opencollective_desc }}") diff --git a/ansible/roles/documentation/templates/README_SNIPPETS/GROUP_INFO.j2 b/ansible/roles/documentation/templates/README_SNIPPETS/GROUP_INFO.j2 index 8205560e..d93ff375 100644 --- a/ansible/roles/documentation/templates/README_SNIPPETS/GROUP_INFO.j2 +++ b/ansible/roles/documentation/templates/README_SNIPPETS/GROUP_INFO.j2 @@ -15,6 +15,5 @@ Find us at: * [Blog]({{ lsio_blog_url }}) - {{ lsio_blog_desc }} * [Discord]({{ lsio_discord_url }}) - {{ lsio_discord_desc }} * [Discourse]({{ lsio_discourse_url }}) - {{ lsio_discourse_desc }} -* [Fleet]({{ lsio_fleet_url }}) - {{ lsio_fleet_desc }} * [GitHub]({{ lsio_github_url }}) - {{ lsio_github_desc }} * [Open Collective]({{ lsio_opencollective_url }}) - {{ lsio_opencollective_desc }} diff --git a/ansible/roles/documentation/templates/README_SNIPPETS/SELKIES.j2 b/ansible/roles/documentation/templates/README_SNIPPETS/SELKIES.j2 new file mode 100644 index 00000000..60a34d71 --- /dev/null +++ b/ansible/roles/documentation/templates/README_SNIPPETS/SELKIES.j2 @@ -0,0 +1,104 @@ +**Modern GUI desktop apps have issues with the latest Docker and syscall compatibility, you can use Docker with the `--security-opt seccomp=unconfined` setting to allow these syscalls on hosts with older Kernels or libseccomp** + +### Security + +{{ "Do not put this on the Internet if you do not know what you are doing." | admonition(flavour=markdown, severity="warning") }} + +By default this container has no authentication and the optional environment variables `CUSTOM_USER` and `PASSWORD` to enable basic http auth via the embedded NGINX server should only be used to locally secure the container from unwanted access on a local network. If exposing this to the Internet we recommend putting it behind a reverse proxy, such as [SWAG](https://github.com/linuxserver/docker-swag), and ensuring a secure authentication solution is in place. From the web interface a terminal can be launched and it is configured for passwordless sudo, so anyone with access to it can install and run whatever they want along with probing your local network. + +### Options in all Selkies based GUI containers + +This container is based on [Docker Baseimage Selkies](https://github.com/linuxserver/docker-baseimage-selkies) which means there are additional environment variables and run configurations to enable or disable specific functionality. + +#### Optional environment variables + +| Variable | Description | +| :----: | --- | +| CUSTOM_PORT | Internal port the container listens on for http if it needs to be swapped from the default {% if external_http_port is defined %}{{ external_http_port }}{% else %}3000{% endif %}. | +| CUSTOM_HTTPS_PORT | Internal port the container listens on for https if it needs to be swapped from the default {% if external_https_port is defined %}{{ external_https_port }}{% else %}3001{% endif %}. | +| CUSTOM_USER | HTTP Basic auth username, abc is default. | +| PASSWORD | HTTP Basic auth password, abc is default. If unset there will be no auth | +| SUBFOLDER | Subfolder for the application if running a subfolder reverse proxy, need both slashes IE `/subfolder/` | +| TITLE | The page title displayed on the web browser, default "Selkies". | +| START_DOCKER | If set to false a container with privilege will not automatically start the DinD Docker setup. | +| DISABLE_IPV6 | If set to true or any value this will disable IPv6 | +| LC_ALL | Set the Language for the container to run as IE `fr_FR.UTF-8` `ar_AE.UTF-8` | +| NO_DECOR | If set the application will run without window borders in openbox for use as a PWA. | +| NO_FULL | Do not automatically fullscreen applications when using openbox. | + +#### Optional run configurations + +| Variable | Description | +| :----: | --- | +| `--privileged` | Will start a Docker in Docker (DinD) setup inside the container to use docker in an isolated environment. For increased performance mount the Docker directory inside the container to the host IE `-v /home/user/docker-data:/var/lib/docker`. | +| `-v /var/run/docker.sock:/var/run/docker.sock` | Mount in the host level Docker socket to either interact with it via CLI or use Docker enabled applications. | + +### Language Support - Internationalization + +The environment variable `LC_ALL` can be used to start this container in a different language than English simply pass for example to launch the Desktop session in French `LC_ALL=fr_FR.UTF-8`. Some supported languages: + +* `-e LC_ALL=zh_CN.UTF-8` - Chinese +* `-e LC_ALL=ja_JP.UTF-8` - Japanese +* `-e LC_ALL=ko_KR.UTF-8` - Korean +* `-e LC_ALL=ar_AE.UTF-8` - Arabic +* `-e LC_ALL=ru_RU.UTF-8` - Russian +* `-e LC_ALL=es_MX.UTF-8` - Spanish (Latin America) +* `-e LC_ALL=de_DE.UTF-8` - German +* `-e LC_ALL=fr_FR.UTF-8` - French +* `-e LC_ALL=nl_NL.UTF-8` - Netherlands +* `-e LC_ALL=it_IT.UTF-8` - Italian + +{% if show_nvidia is defined %}### Nvidia GPU Support + +**Nvidia support is not compatible with Alpine based images as Alpine lacks Nvidia drivers** + +Nvidia support is available by leveraging Zink for OpenGL support. This can be enabled with the following run flags: + +| Variable | Description | +| :----: | --- | +| --gpus all | This can be filtered down but for most setups this will pass the one Nvidia GPU on the system | +| --runtime nvidia | Specify the Nvidia runtime which mounts drivers and tools in from the host | + +The compose syntax is slightly different for this as you will need to set nvidia as the default runtime: + +``` +sudo nvidia-ctk runtime configure --runtime=docker --set-as-default +sudo service docker restart +``` + +And to assign the GPU in compose: + +``` +services: + {{ project_name }}: + image: lscr.io/{{ lsio_project_name_short }}/{{ project_name }}:{{ release_tag }} + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: 1 + capabilities: [compute,video,graphics,utility] +``` + +{% endif %}### Application management + +#### PRoot Apps + +If you run system native installations of software IE `sudo apt-get install filezilla` and then upgrade or destroy/re-create the container that software will be removed and the container will be at a clean state. For some users that will be acceptable and they can update their system packages as well using system native commands like `apt-get upgrade`. If you want Docker to handle upgrading the container and retain your applications and settings we have created [proot-apps](https://github.com/linuxserver/proot-apps) which allow portable applications to be installed to persistent storage in the user's `$HOME` directory and they will work in a confined Docker environment out of the box. These applications and their settings will persist upgrades of the base container and can be mounted into different flavors ofSelkiess based containers on the fly. This can be achieved from the command line with: + +``` +proot-apps install filezilla +``` + +PRoot Apps is included in all Selkies based containers, a list of linuxserver.io supported applications is located [HERE](https://github.com/linuxserver/proot-apps?tab=readme-ov-file#supported-apps). + +#### Native Apps + +It is possible to install extra packages during container start using [universal-package-install](https://github.com/linuxserver/docker-mods/tree/universal-package-install). It might increase starting time significantly. PRoot is preferred. + +```yaml + environment: + - DOCKER_MODS=linuxserver/mods:universal-package-install + - INSTALL_PACKAGES=libfuse2|git|gdb +``` diff --git a/ansible/roles/documentation/templates/README_SNIPPETS/SUPPORTED_ARCHITECTURES.j2 b/ansible/roles/documentation/templates/README_SNIPPETS/SUPPORTED_ARCHITECTURES.j2 index 6adae53a..16e84d8d 100644 --- a/ansible/roles/documentation/templates/README_SNIPPETS/SUPPORTED_ARCHITECTURES.j2 +++ b/ansible/roles/documentation/templates/README_SNIPPETS/SUPPORTED_ARCHITECTURES.j2 @@ -13,4 +13,3 @@ The architectures supported by this image are: | riscv64 | {{ '✅ | riscv64-\' }} | {% endif %} | arm64 | {{ '✅ | arm64v8-\' if 'arm64' in (available_architectures | map(attribute="arch") ) else '❌ |' }} | -| armhf | {{ '✅ | arm32v7-\' if 'armhf' in (available_architectures | map(attribute="arch") ) else '❌ |' }} | diff --git a/ansible/roles/documentation/templates/documentation.md.j2 b/ansible/roles/documentation/templates/documentation.md.j2 index b0d68661..0bb4a179 100644 --- a/ansible/roles/documentation/templates/documentation.md.j2 +++ b/ansible/roles/documentation/templates/documentation.md.j2 @@ -64,6 +64,10 @@ description: "{{ noter(project_blurb) | trim }}" {% if kasm_blurb is defined %} {% include "README_SNIPPETS/KASM.j2" | trim %} +{% endif %} +{% if selkies_blurb is defined %} +{% include "README_SNIPPETS/SELKIES.j2" | trim %} + {% endif %} {% if readonly_supported is defined and readonly_supported %} {% include "README_SNIPPETS/READONLY.j2" | trim %} diff --git a/ansible/roles/documentation/templates/readme.md.j2 b/ansible/roles/documentation/templates/readme.md.j2 index fe54b74f..35ef54d8 100644 --- a/ansible/roles/documentation/templates/readme.md.j2 +++ b/ansible/roles/documentation/templates/readme.md.j2 @@ -55,6 +55,10 @@ {% if kasm_blurb is defined %} {% include "README_SNIPPETS/KASM.j2" | trim %} +{% endif %} +{% if selkies_blurb is defined %} +{% include "README_SNIPPETS/SELKIES.j2" | trim %} + {% endif %} {% if readonly_supported is defined and readonly_supported %} {% include "README_SNIPPETS/READONLY.j2" | trim %} diff --git a/ansible/roles/github/templates/call_issue_pr_tracker.yml.j2 b/ansible/roles/github/templates/call_issue_pr_tracker.yml.j2 index 2c307843..d07cf121 100644 --- a/ansible/roles/github/templates/call_issue_pr_tracker.yml.j2 +++ b/ansible/roles/github/templates/call_issue_pr_tracker.yml.j2 @@ -8,6 +8,9 @@ on: pull_request_review: types: [submitted,edited,dismissed] +permissions: + contents: read + jobs: manage-project: permissions: diff --git a/ansible/roles/github/templates/call_issues_cron.yml.j2 b/ansible/roles/github/templates/call_issues_cron.yml.j2 index ce11487e..b31c33cb 100644 --- a/ansible/roles/github/templates/call_issues_cron.yml.j2 +++ b/ansible/roles/github/templates/call_issues_cron.yml.j2 @@ -4,6 +4,9 @@ on: - cron: '{{ 60 | random(seed=('docker-' + project_name + '-minute')) }} {{ 24 | random(seed=('docker-' + project_name + '-hour')) }} * * *' workflow_dispatch: +permissions: + contents: read + jobs: stale: permissions: diff --git a/ansible/roles/github/templates/external_trigger.yml.j2 b/ansible/roles/github/templates/external_trigger.yml.j2 index f57e87af..c5d0b95b 100644 --- a/ansible/roles/github/templates/external_trigger.yml.j2 +++ b/ansible/roles/github/templates/external_trigger.yml.j2 @@ -10,6 +10,9 @@ name: External Trigger Main on: workflow_dispatch: +permissions: + contents: read + jobs: external-trigger-{{ ls_branch|regex_replace('[^a-zA-Z0-9-]','-') }}: runs-on: ubuntu-latest @@ -107,8 +110,8 @@ jobs: "username": "Github Actions"}' ${{ '{{' }} secrets.DISCORD_WEBHOOK {{ '}}' }} exit 1 fi - EXT_RELEASE=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g') - echo "External version: \`${EXT_RELEASE}\`" >> $GITHUB_STEP_SUMMARY + EXT_RELEASE_SANITIZED=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g') + echo "Sanitized external version: \`${EXT_RELEASE_SANITIZED}\`" >> $GITHUB_STEP_SUMMARY echo "Retrieving last pushed version" >> $GITHUB_STEP_SUMMARY image="{{ better_vars.LS_USER }}/{{ project_name }}" tag="{{ release_tag }}" @@ -164,8 +167,8 @@ jobs: exit 1 fi echo "Last pushed version: \`${IMAGE_VERSION}\`" >> $GITHUB_STEP_SUMMARY - if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then - echo "Version \`${EXT_RELEASE}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY + if [ "${EXT_RELEASE_SANITIZED}" == "${IMAGE_VERSION}" ]; then + echo "Sanitized version \`${EXT_RELEASE_SANITIZED}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY exit 0 {% if external_type == "alpine_repo" and better_vars.MULTIARCH == 'true' %} elif [[ $(curl -sL "{{ better_vars.DIST_REPO }}aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"{{ better_vars.DIST_REPO_PACKAGES }}"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]{% if build_armhf %} || [[ $(curl -sL "{{ better_vars.DIST_REPO }}armv7/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"{{ better_vars.DIST_REPO_PACKAGES }}"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]{% endif %}; then @@ -197,7 +200,7 @@ jobs: "username": "Github Actions"}' ${{ '{{' }} secrets.DISCORD_WEBHOOK {{ '}}' }} else printf "\n## Trigger new build\n\n" >> $GITHUB_STEP_SUMMARY - echo "New version \`${EXT_RELEASE}\` found; old version was \`${IMAGE_VERSION}\`. Triggering new build" >> $GITHUB_STEP_SUMMARY + echo "New sanitized version \`${EXT_RELEASE_SANITIZED}\` found; old version was \`${IMAGE_VERSION}\`. Triggering new build" >> $GITHUB_STEP_SUMMARY if [[ "${artifacts_found}" == "true" ]]; then echo "All artifacts seem to be uploaded." >> $GITHUB_STEP_SUMMARY fi @@ -217,7 +220,7 @@ jobs: --data-urlencode "description=GHA external trigger https://github.com/${{ '{{' }} github.repository {{ '}}' }}/actions/runs/${{ '{{' }} github.run_id {{ '}}' }}" \ --data-urlencode "Submit=Submit" echo "**** Notifying Discord ****" - TRIGGER_REASON="A version change was detected for {{ project_name }} tag {{ release_tag }}. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}" + TRIGGER_REASON="A version change was detected for {{ project_name }} tag {{ release_tag }}. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE_SANITIZED}" curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903, "description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}], "username": "Github Actions"}' ${{ '{{' }} secrets.DISCORD_WEBHOOK {{ '}}' }} diff --git a/ansible/roles/github/templates/external_trigger_scheduler.yml.j2 b/ansible/roles/github/templates/external_trigger_scheduler.yml.j2 index 5f327898..661ab5a3 100644 --- a/ansible/roles/github/templates/external_trigger_scheduler.yml.j2 +++ b/ansible/roles/github/templates/external_trigger_scheduler.yml.j2 @@ -5,6 +5,9 @@ on: - cron: '{{ 60 | random(seed=(project_name + '-external-minute')) }} * * * *' workflow_dispatch: +permissions: + contents: read + jobs: external-trigger-scheduler: runs-on: ubuntu-latest diff --git a/ansible/roles/github/templates/greetings.yml.j2 b/ansible/roles/github/templates/greetings.yml.j2 index 548282a6..ee1c1103 100644 --- a/ansible/roles/github/templates/greetings.yml.j2 +++ b/ansible/roles/github/templates/greetings.yml.j2 @@ -2,8 +2,14 @@ name: Greetings on: [pull_request_target, issues] +permissions: + contents: read + jobs: greeting: + permissions: + issues: write + pull-requests: write runs-on: ubuntu-latest steps: - uses: actions/first-interaction@v1 diff --git a/ansible/roles/github/templates/package_trigger_scheduler.yml.j2 b/ansible/roles/github/templates/package_trigger_scheduler.yml.j2 index ceb71c9f..4f70f9ad 100644 --- a/ansible/roles/github/templates/package_trigger_scheduler.yml.j2 +++ b/ansible/roles/github/templates/package_trigger_scheduler.yml.j2 @@ -5,6 +5,9 @@ on: - cron: '{{ 60 | random(seed=(project_name + '-minute')) }} {{ 24 | random(seed=(project_name + '-hour')) }} * * {{ 7 | random(seed=(project_name + '-day')) }}' workflow_dispatch: +permissions: + contents: read + jobs: package-trigger-scheduler: runs-on: ubuntu-latest diff --git a/ansible/vars/common.yml b/ansible/vars/common.yml index 5b70b45f..de75e470 100644 --- a/ansible/vars/common.yml +++ b/ansible/vars/common.yml @@ -14,7 +14,6 @@ lsio_discord_url: "https://linuxserver.io/discord" lsio_discourse_url: "https://discourse.{{ lsio_short_url }}" lsio_docker_hub_url: "https://hub.docker.com/r/{{ lsio_project_name_short }}" lsio_docs_url: "https://docs.{{ lsio_short_url }}" -lsio_fleet_url: "https://fleet.{{ lsio_short_url }}" lsio_github_url: "https://github.com/{{ lsio_project_name_short }}" lsio_gitlab_url: "https://gitlab.com/{{ lsio_project_name }}" lsio_mods_url: "https://mods.{{ lsio_short_url }}/?mod={{ project_name }}" @@ -38,7 +37,6 @@ arch_armhf: "armhf" lsio_blog_desc: "all the things you can do with our containers including How-To guides, opinions and much more!" lsio_discord_desc: "realtime support / chat with the community and the team." lsio_discourse_desc: "post on our community forum." -lsio_fleet_desc: "an online web interface which displays all of our maintained images." lsio_github_desc: "view the source for all of our repositories." lsio_mods_desc: "view available mods for this container." lsio_universal_mods_desc: "view available universal mods." @@ -72,7 +70,6 @@ lsio_shieldsio_jenkins_build: "https://img.shields.io/jenkins/build?{{ lsio_badg lsio_shieldsio_microbadger_layers: "https://img.shields.io/microbadger/layers/{{ lsio_project_name_short }}/{{ project_name }}.svg?{{ lsio_badge_url_parameters }}" lsio_shieldsio_opencollective_all: "https://img.shields.io/opencollective/all/{{ lsio_project_name_short }}.svg?{{ lsio_badge_url_parameters }}&label=Supporters&logo=open%20collective" lsio_shieldsio_static_blog: "https://img.shields.io/static/v1.svg?{{ lsio_badge_url_parameters }}&label={{ lsio_project_name }}&message=Blog" -lsio_shieldsio_static_fleet: "https://img.shields.io/static/v1.svg?{{ lsio_badge_url_parameters }}&label={{ lsio_project_name }}&message=Fleet" lsio_shieldsio_static_github_package: "https://img.shields.io/static/v1.svg?{{ lsio_badge_url_parameters }}&label={{ lsio_project_name }}&message=GitHub%20Package&logo=github" lsio_shieldsio_static_github: "https://img.shields.io/static/v1.svg?{{ lsio_badge_url_parameters }}&label={{ lsio_project_name }}&message=GitHub&logo=github" lsio_shieldsio_static_gitlab_registry: "https://img.shields.io/static/v1.svg?{{ lsio_badge_url_parameters }}&label={{ lsio_project_name }}&message=GitLab%20Registry&logo=gitlab"