diff --git a/.editorconfig b/.editorconfig index 7a477740..d89d2116 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,6 +14,6 @@ indent_style = space indent_size = 2 # Python -[{*.py,eos-image-builder,run-build,helpers/{assemble-manifest,fetch-remote-collection-id,generate-ovf-files,kill-chroot-procs,kolibri-pick-content-from-channel,mutable-path,seed-kolibri-channels},hooks/{content/50-flatpak,image/{50-flatpak.chroot,52-ek-content-cache,62-kolibri-options,70-flatpak-appstream-catalog,70-flatpak-manifest,70-ostree-manifest,70-packages-manifest}}}] +[{*.py,eos-image-builder,run-build,helpers/{assemble-manifest,fetch-remote-collection-id,generate-ovf-files,kill-chroot-procs,kolibri-pick-content-from-channel,mutable-path,seed-kolibri-channels},hooks/{content/50-flatpak,image/{50-flatpak.chroot,62-kolibri-options,70-flatpak-appstream-catalog,70-flatpak-manifest,70-ostree-manifest,70-packages-manifest}}}] indent_size = 4 max_line_length = 88 diff --git a/config/defaults.ini b/config/defaults.ini index 7df6aa35..67baf516 100644 --- a/config/defaults.ini +++ b/config/defaults.ini @@ -74,7 +74,6 @@ hooks_add = 50-reclaim-swap-stamp 50-gnome-software-cache 50-xkb-layout.chroot - 53-ek-content-preload 60-dconf-prepare 60-flatpak-autoinstall-counters.chroot 60-kolibri-content @@ -245,30 +244,6 @@ regular_users_can_manage_content = false # # Kolibri 0.12.2 User Guide for Admins [document] # 5bb37c1832c8489ab2940f31588305f6 -[endlesskey] -# Kolibri package specification to use when preloading data. This needs to be -# less than or equal to the version in the org.endlessos.Key flatpak to ensure -# it doesn't apply any database migrations that the app doesn't have yet. -# Typically this will be kolibri==, but may also be a URL for a -# pre-release not on PyPI. -kolibri_pkgspec = https://github.com/learningequality/kolibri/releases/download/v0.16.0-beta6/kolibri-0.16.0b6-py2.py3-none-any.whl - -# Kolibri xdg desktop file plugin to use when preloading channels. Out of the -# box these desktop files are not used for Endless Key, but some OS images may -# add them to the search path, so we should ensure they are pregenerated in the -# OS image. -kolibri_app_desktop_xdg_plugin_version = 1.3.0 - -# Which Endless Key collections to preload in the image. -# Must match the name of one of the collections shipped with the Endless Key -# (ex. artist, explorer, spanish etc). -collections_add = - -# By default, only the content specified in each collection will be included. -# Set this to true to include all content from all channels in the requested -# collections. -include_full_channels = false - [ostree] # Repository setup. By default the remote, remote repo and OS name are # all named eos. @@ -469,7 +444,6 @@ apps_add = io.thp.numptyphysics org.audacityteam.Audacity org.blender.Blender - org.endlessos.Key org.gimp.GIMP org.gnome.Cheese org.gnome.Gnote diff --git a/config/personality/base.ini b/config/personality/base.ini index b06f13a2..f5cc0767 100644 --- a/config/personality/base.ini +++ b/config/personality/base.ini @@ -12,5 +12,3 @@ apps_del = ${apps_add_defaults} [flatpak-remote-flathub] # Delete all default additions and explicitly build the list from scratch. apps_del = ${apps_add_defaults} -apps_add = - org.endlessos.Key diff --git a/config/personality/en.ini b/config/personality/en.ini index 2528685f..fdb938dd 100644 --- a/config/personality/en.ini +++ b/config/personality/en.ini @@ -25,13 +25,3 @@ apps_add = com.endlessnetwork.drawingtutorials com.endlessnetwork.htmltutorials com.endlessnetwork.sciencesnacks - -[endlesskey] -collections_add = - artist - athlete - curious - explorer - extras - inventor - scientist diff --git a/config/personality/es.ini b/config/personality/es.ini index ee822a3b..f824137c 100644 --- a/config/personality/es.ini +++ b/config/personality/es.ini @@ -43,8 +43,3 @@ apps_add = [flatpak-remote-flathub] apps_add = ar.com.pilas_engine.App - -[endlesskey] -collections_add = - spanish - spanish-extras diff --git a/hooks/image/53-ek-content-preload b/hooks/image/53-ek-content-preload deleted file mode 100644 index 0e28a933..00000000 --- a/hooks/image/53-ek-content-preload +++ /dev/null @@ -1,108 +0,0 @@ -# Populate the Endless Key home directory - -if [ -z "${EIB_ENDLESSKEY_COLLECTIONS}" ]; then - exit 0 -fi - -if [[ ! "${EIB_FLATPAK_REMOTE_FLATHUB_APPS}" =~ .*"org.endlessos.Key".* ]]; then - exit 0 -fi - -selected_collection_files=() - -channels_file="${EIB_TMPDIR}"/ek-channels -rm -f "${channels_file}" -touch "${channels_file}" -all_collection_files="${OSTREE_VAR}"/lib/flatpak/app/org.endlessos.Key/current/active/files/share/endless-key/collections/*.json -for collection_file in ${all_collection_files}; do - # Check if the file basename stripped off of -0001.json is part of the list - # of collections to be installed. - bn=$(basename "${collection_file%-????.json}") - if [[ " ${EIB_ENDLESSKEY_COLLECTIONS} " =~ [[:space:]]${bn}[[:space:]] ]] ; then - selected_collection_files+=("${collection_file}") - jq -r '.channels[].id' "${collection_file}" >> "${channels_file}" - fi -done - -all_channels=$(sort -u "${channels_file}") -if [ -z "${all_channels}" ]; then - echo "No Kolibri channels to preload" - exit 0 -fi - -# Seed the needed channels on the content server. -"${EIB_HELPERSDIR}"/seed-kolibri-channels ${all_channels} - -venv_dir="${EIB_TMPDIR}/kolibri-content-venv" -python3 -m venv ${venv_dir} -source ${venv_dir}/bin/activate -pip install "${EIB_ENDLESSKEY_KOLIBRI_PKGSPEC}" -pip install kolibri-app-desktop-xdg-plugin==${EIB_ENDLESSKEY_KOLIBRI_APP_DESKTOP_XDG_PLUGIN_VERSION} - -# Setup the homedir before setting any environment variables so they -# don't persist into the options file. -export KOLIBRI_HOME="${OSTREE_VAR}"/lib/endless-key/data -mkdir -p "${KOLIBRI_HOME}" -kolibri plugin enable kolibri_app_desktop_xdg_plugin -kolibri configure setup - -# Use a separate content URL if configured. -if [ -n "${EIB_KOLIBRI_CENTRAL_CONTENT_BASE_URL}" ]; then - KOLIBRI_CENTRAL_CONTENT_BASE_URL="${EIB_KOLIBRI_CENTRAL_CONTENT_BASE_URL}" - export KOLIBRI_CENTRAL_CONTENT_BASE_URL -fi - -# kolibri-app-desktop-xdg-plugin uses FLATPAK_ID to determine how to name the -# launchers it creates. This is set by Flatpak when running the app, but we are -# not running kolibri from within the Endless Key Flatpak here. -export FLATPAK_ID=org.endlessos.Key - -# Import all channel metadata and thumbnails for all channels -for channel in $all_channels; do - kolibri manage --skip-update importchannel network "${channel}" - EIB_RETRY_ATTEMPTS=2 EIB_RETRY_INTERVAL=30 eib_retry \ - kolibri manage --skip-update \ - importcontent --include-unrenderable-content --fail-on-error \ - --node_ids="" --all-thumbnails \ - network "${channel}" -done - -if [ "${EIB_ENDLESSKEY_INCLUDE_FULL_CHANNELS}" == true ]; then - for channel in $all_channels; do - EIB_RETRY_ATTEMPTS=2 EIB_RETRY_INTERVAL=30 eib_retry \ - kolibri manage --skip-update \ - importcontent --include-unrenderable-content --fail-on-error \ - network "${channel}" - done -else - for collection_file in "${selected_collection_files[@]}"; do - collection_channels=$(jq -r '.channels[].id' "${collection_file}") - for channel in $collection_channels; do - EIB_RETRY_ATTEMPTS=2 EIB_RETRY_INTERVAL=30 eib_retry \ - kolibri manage --skip-update \ - importcontent --include-unrenderable-content --fail-on-error \ - --manifest="${collection_file}" network "${channel}" - done - done -fi - -# Empty the user database, and ensure that each instance of this image has a -# unique Facility ID. -# -(echo yes; echo yes) | kolibri manage --skip-update deprovision - -# Hack the .desktop files to work around them being generated differently when -# the xdg plugin is running in the Flatpak, which it is not here. -for desktop_file in "${OSTREE_VAR}"/lib/endless-key/data/content/xdg/share/applications/*.desktop; do - sed -i -e 's/x-kolibri-dispatch:/x-endless-key-dispatch:/g' "${desktop_file}" - desktop-file-edit \ - --set-key=TryExec \ - --set-value=/var/lib/flatpak/app/org.endlessos.Key/current/active/files/bin/kolibri-gnome \ - "${desktop_file}" -done - -# Chown all the files to the kolibri user. This also happens at runtime -# via the endless-key.conf tmpfiles.d configuration. -kolibri_uid=$(ostree_uid kolibri) -kolibri_gid=$(ostree_gid kolibri) -chown -R "${kolibri_uid}:${kolibri_gid}" "${OSTREE_VAR}"/lib/endless-key diff --git a/hooks/image/54-ek-launchers b/hooks/image/54-ek-launchers deleted file mode 100644 index 53e010c5..00000000 --- a/hooks/image/54-ek-launchers +++ /dev/null @@ -1,10 +0,0 @@ -# Expose Endless Key launchers in the app grid (once a specific content pack has been downloaded) - -mkdir -p "${OSTREE_DEPLOYMENT}/etc/systemd/user-environment-generators" -cat <<- 'EOF' > "${OSTREE_DEPLOYMENT}/etc/systemd/user-environment-generators/62-endless-key.sh" - #!/bin/bash - - XDG_DATA_DIRS="/var/lib/endless-key/data/content/xdg/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" - echo "XDG_DATA_DIRS=$XDG_DATA_DIRS" -EOF -chmod 755 "${OSTREE_DEPLOYMENT}/etc/systemd/user-environment-generators/62-endless-key.sh" diff --git a/lib/eib.py b/lib/eib.py index ce486851..9a256589 100644 --- a/lib/eib.py +++ b/lib/eib.py @@ -115,7 +115,6 @@ class ImageConfigParser(configparser.ConfigParser): ('buildroot', 'mounts'), ('check', 'hooks'), ('content', 'hooks'), - ('endlesskey', 'collections'), ('error', 'hooks'), ('flatpak', 'locales'), ('flatpak-remote-*', 'apps'),