From a411b4ebe8285fdd03b4645249dcc6b87aa15bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 8 Jul 2024 20:22:36 +0200 Subject: [PATCH 01/30] Add --latest-commit-weekly arg to stop spam packagers --- .../autoupdate_app_sources.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/autoupdate_app_sources/autoupdate_app_sources.py b/tools/autoupdate_app_sources/autoupdate_app_sources.py index bef0844b..e141b8e3 100755 --- a/tools/autoupdate_app_sources/autoupdate_app_sources.py +++ b/tools/autoupdate_app_sources/autoupdate_app_sources.py @@ -216,6 +216,7 @@ class AppAutoUpdater: raise RuntimeError("There's no resources.sources in manifest.toml ?") self.main_upstream = self.manifest.get("upstream", {}).get("code") + self.latest_commit_weekly = False def run( self, edit: bool = False, commit: bool = False, pr: bool = False @@ -535,6 +536,9 @@ class AppAutoUpdater: return latest_version, latest_tarball, "" if revision_type == "commit": + if self.latest_commit_weekly and datetime.now().weekday() != 0: + logging.warning("Skipped autoupdater because we're not monday") + return None if asset != "tarball": raise ValueError( "For the latest commit strategies, only asset = 'tarball' is supported" @@ -631,10 +635,12 @@ class StdoutSwitch: def run_autoupdate_for_multiprocessing(data) -> tuple[str, tuple[State, str, str, str]]: - app, edit, commit, pr = data + app, edit, commit, pr, latest_commit_weekly = data stdoutswitch = StdoutSwitch() try: - result = AppAutoUpdater(app).run(edit=edit, commit=commit, pr=pr) + autoupdater = AppAutoUpdater(app) + autoupdater.latest_commit_weekly = latest_commit_weekly + result = autoupdater.run(edit=edit, commit=commit, pr=pr) return (app, result) except Exception: log_str = stdoutswitch.reset() @@ -652,6 +658,12 @@ def main() -> None: type=Path, help="If not passed, the script will run on the catalog. Github keys required.", ) + parser.add_argument( + "-w", "--latest-commit-weekly", + action=argparse.BooleanOptionalAction, + default=False, + help="For latest_commit versions, only run weekly to prevent too many PRs" + ) parser.add_argument( "--edit", action=argparse.BooleanOptionalAction, @@ -694,7 +706,7 @@ def main() -> None: with multiprocessing.Pool(processes=args.processes) as pool: tasks = pool.imap( run_autoupdate_for_multiprocessing, - ((app, args.edit, args.commit, args.pr) for app in apps), + ((app, args.edit, args.commit, args.pr, args.latest_commit_weekly) for app in apps), ) for app, result in tqdm.tqdm(tasks, total=len(apps), ascii=" ·#"): state, current_version, main_version, pr_url = result From d597690b0702eda75dff2281297fa8c5aa3894e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 8 Jul 2024 20:27:52 +0200 Subject: [PATCH 02/30] Configure autoupdate as weekly for official yunohost CI --- maintenance.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintenance.sh b/maintenance.sh index bbd966f7..1fe0d4f4 100644 --- a/maintenance.sh +++ b/maintenance.sh @@ -79,7 +79,7 @@ function autoupdate_app_sources() date >> $log git_pull_and_update_cron_and_restart_services_if_needed tools/autoupdate_app_sources/venv/bin/python3 tools/autoupdate_app_sources/autoupdate_app_sources.py \ - --edit --commit --pr --paste -j1 \ + --latest-commit-weekly --edit --commit --pr --paste -j1 \ &> $log || sendxmpppy "[appsourcesautoupdate] App sources auto-update failed miserably" } From 58d325f4c9205cf47a9f85f1560e61942d27b624 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 5 Jul 2024 17:00:20 +0000 Subject: [PATCH 03/30] Update app levels according to CI results --- apps.toml | 66 +++++++++++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/apps.toml b/apps.toml index 4e956b2b..763b7625 100644 --- a/apps.toml +++ b/apps.toml @@ -43,7 +43,7 @@ added_date = 1674232499 # 2023/01/20 antifeatures = [ "deprecated-software" ] category = "social_media" deprecated_date = 1717071136 # 2024/05/30 -level = 6 +level = 0 state = "working" subtags = [ "microblogging", "pictures" ] url = "https://github.com/YunoHost-Apps/acropolis_ynh" @@ -96,7 +96,7 @@ url = "https://github.com/YunoHost-Apps/agendav_ynh" [agora] added_date = 1674232499 # 2023/01/20 category = "wat" -level = 8 +level = 6 state = "working" url = "https://github.com/YunoHost-Apps/agora_ynh" @@ -149,7 +149,7 @@ url = "https://github.com/YunoHost-Apps/anarchism_ynh" [archivebox] added_date = 1674232499 # 2023/01/20 category = "small_utilities" -level = 6 +level = 8 state = "working" url = "https://github.com/YunoHost-Apps/archivebox_ynh" @@ -194,7 +194,7 @@ url = "https://github.com/YunoHost-Apps/automad_ynh" [backdrop] added_date = 1674232499 # 2023/01/20 category = "publishing" -level = 8 +level = 6 state = "working" subtags = [ "website" ] url = "https://github.com/YunoHost-Apps/backdrop_ynh" @@ -211,7 +211,7 @@ url = "https://github.com/YunoHost-Apps/baikal_ynh" [bazarr] added_date = 1674232499 # 2023/01/20 category = "multimedia" -level = 8 +level = 6 state = "working" url = "https://github.com/YunoHost-Apps/bazarr_ynh" @@ -227,7 +227,7 @@ url = "https://github.com/YunoHost-Apps/beehive_ynh" [biboumi] added_date = 1674232499 # 2023/01/20 category = "communication" -level = 6 +level = 8 state = "working" subtags = [ "chat" ] url = "https://github.com/YunoHost-Apps/biboumi_ynh" @@ -360,7 +360,7 @@ url = "https://github.com/YunoHost-Apps/calibreweb_ynh" [castopod] added_date = 1674232499 # 2023/01/20 category = "multimedia" -level = 8 +level = 6 potential_alternative_to = [ "Anchor", "Apple Podcasts", "Audible", "Deezer", "SoundCloud", "Spotify" ] state = "working" url = "https://github.com/YunoHost-Apps/castopod_ynh" @@ -707,7 +707,7 @@ url = "https://github.com/YunoHost-Apps/diagramsnet_ynh" [diaspora] added_date = 1674232499 # 2023/01/20 category = "social_media" -level = 8 +level = 0 potential_alternative_to = [ "Ello", "Facebook", "Hubzilla", "Myspace", "X" ] state = "working" subtags = [ "microblogging" ] @@ -737,7 +737,7 @@ url = "https://github.com/YunoHost-Apps/digitools_ynh" [digitranscode] added_date = 1674232499 # 2023/01/20 category = "small_utilities" -level = 8 +level = 0 state = "working" url = "https://github.com/YunoHost-Apps/digitranscode_ynh" @@ -835,7 +835,7 @@ url = "https://github.com/YunoHost-Apps/dokuwiki_ynh" [dolibarr] added_date = 1674232499 # 2023/01/20 category = "productivity_and_management" -level = 8 +level = 6 state = "working" subtags = [ "business_and_ngos" ] url = "https://github.com/YunoHost-Apps/dolibarr_ynh" @@ -843,7 +843,7 @@ url = "https://github.com/YunoHost-Apps/dolibarr_ynh" [domoticz] added_date = 1674232499 # 2023/01/20 category = "iot" -level = 8 +level = 6 state = "working" url = "https://github.com/YunoHost-Apps/domoticz_ynh" @@ -1048,7 +1048,7 @@ url = "https://github.com/YunoHost-Apps/etherpad_mypads_ynh" [excalidraw] added_date = 1674232499 # 2023/01/20 category = "office" -level = 8 +level = 6 potential_alternative_to = [ "Lucidchart" ] state = "working" subtags = [ "draw" ] @@ -1332,7 +1332,7 @@ url = "https://github.com/YunoHost-Apps/ghost_ynh" [gitea] added_date = 1674232499 # 2023/01/20 category = "dev" -level = 6 +level = 8 potential_alternative_to = [ "GitHub" ] state = "working" subtags = [ "forge" ] @@ -1518,7 +1518,7 @@ url = "https://github.com/YunoHost-Apps/hat_ynh" [headphones] added_date = 1674232499 # 2023/01/20 category = "multimedia" -level = 8 +level = 6 state = "working" subtags = [ "download" ] url = "https://github.com/YunoHost-Apps/headphones_ynh" @@ -1526,7 +1526,7 @@ url = "https://github.com/YunoHost-Apps/headphones_ynh" [headscale] added_date = 1686503631 # 2023/06/11 category = "system_tools" -level = 6 +level = 8 potential_alternative_to = [ "Tailscale" ] state = "working" subtags = [ "network" ] @@ -1651,7 +1651,7 @@ url = "https://github.com/YunoHost-Apps/ifconfig-io_ynh" [ifm] added_date = 1674232499 # 2023/01/20 category = "small_utilities" -level = 8 +level = 0 state = "working" url = "https://github.com/YunoHost-Apps/ifm_ynh" @@ -1758,14 +1758,14 @@ url = "https://github.com/YunoHost-Apps/jappix_ynh" [jeedom] added_date = 1674232499 # 2023/01/20 category = "iot" -level = 8 +level = 6 state = "working" url = "https://github.com/YunoHost-Apps/jeedom_ynh" [jellyfin] added_date = 1674232499 # 2023/01/20 category = "multimedia" -level = 0 +level = 6 potential_alternative_to = [ "Netflix", "Plex" ] state = "working" subtags = [ "mediacenter", "music" ] @@ -1807,7 +1807,7 @@ url = "https://github.com/YunoHost-Apps/jirafeau_ynh" [jitsi] added_date = 1674232499 # 2023/01/20 category = "communication" -level = 8 +level = 6 potential_alternative_to = [ "Google Hangouts", "Skype" ] state = "working" subtags = [ "meeting" ] @@ -1935,7 +1935,7 @@ url = "https://github.com/YunoHost-Apps/kresus_ynh" [ladder] added_date = 1702560857 # 2023/12/14 category = "reading" -level = 6 +level = 7 potential_alternative_to = [ "12ft", "13ft" ] state = "working" url = "https://github.com/YunoHost-Apps/ladder_ynh" @@ -2064,7 +2064,7 @@ url = "https://github.com/YunoHost-Apps/librex_ynh" [lidarr] added_date = 1674232499 # 2023/01/20 category = "multimedia" -level = 6 +level = 8 state = "working" url = "https://github.com/YunoHost-Apps/lidarr_ynh" @@ -2130,7 +2130,7 @@ url = "https://github.com/YunoHost-Apps/loki_ynh" [lstu] added_date = 1674232499 # 2023/01/20 category = "small_utilities" -level = 8 +level = 6 potential_alternative_to = [ "bitly" ] state = "working" subtags = [ "url_shortener" ] @@ -2323,7 +2323,7 @@ url = "https://github.com/YunoHost-Apps/meilisearch_ynh" [metabase] added_date = 1674232499 # 2023/01/20 category = "system_tools" -level = 8 +level = 6 state = "working" subtags = [ "monitoring" ] url = "https://github.com/YunoHost-Apps/metabase_ynh" @@ -2553,7 +2553,7 @@ url = "https://github.com/YunoHost-Apps/mybb_ynh" [mygpo] added_date = 1674232499 # 2023/01/20 category = "multimedia" -level = 6 +level = 8 state = "working" subtags = [ "download" ] url = "https://github.com/YunoHost-Apps/mygpo_ynh" @@ -2881,7 +2881,7 @@ url = "https://github.com/YunoHost-Apps/paperless-ngx_ynh" [peertube] added_date = 1674232499 # 2023/01/20 category = "social_media" -level = 8 +level = 6 potential_alternative_to = [ "Dailymotion", "Twitch", "Vimeo", "YouTube" ] state = "working" subtags = [ "videos" ] @@ -3103,7 +3103,7 @@ url = "https://github.com/YunoHost-Apps/pixelfed_ynh" [plainpad] added_date = 1674232499 # 2023/01/20 category = "office" -level = 8 +level = 6 state = "working" subtags = [ "text" ] url = "https://github.com/YunoHost-Apps/plainpad_ynh" @@ -3214,7 +3214,7 @@ url = "https://github.com/YunoHost-Apps/prosody_ynh" [prowlarr] added_date = 1674232499 # 2023/01/20 category = "multimedia" -level = 6 +level = 8 state = "working" url = "https://github.com/YunoHost-Apps/prowlarr_ynh" @@ -3310,7 +3310,7 @@ url = "https://github.com/YunoHost-Apps/quizzes_ynh" [radarr] added_date = 1674232499 # 2023/01/20 category = "multimedia" -level = 6 +level = 8 state = "working" url = "https://github.com/YunoHost-Apps/radarr_ynh" @@ -3471,7 +3471,7 @@ url = "https://github.com/YunoHost-Apps/samba_ynh" [satdress] added_date = 1674232499 # 2023/01/20 category = "productivity_and_management" -level = 8 +level = 6 state = "working" url = "https://github.com/YunoHost-Apps/satdress_ynh" @@ -3511,7 +3511,7 @@ url = "https://github.com/YunoHost-Apps/scrutiny_ynh" [seafile] added_date = 1674232499 # 2023/01/20 category = "synchronization" -level = 6 +level = 7 potential_alternative_to = [ "Dropbox", "Google Drive", "Mega", "Microsoft OneDrive", "Resilio Sync", "Time Machine" ] state = "working" subtags = [ "files" ] @@ -3848,7 +3848,7 @@ url = "https://github.com/YunoHost-Apps/svgedit_ynh" [synapse] added_date = 1674232499 # 2023/01/20 category = "communication" -level = 6 +level = 8 potential_alternative_to = [ "Discord", "Facebook Messenger", "Signal", "Skype", "Telegram", "Whatsapp" ] state = "working" subtags = [ "chat" ] @@ -4144,7 +4144,7 @@ url = "https://github.com/YunoHost-Apps/uptime-kuma_ynh" [vaultwarden] added_date = 1674232499 # 2023/01/20 category = "synchronization" -level = 6 +level = 8 potential_alternative_to = [ "1Password", "Dashlane", "Enpass", "LastPass" ] state = "working" subtags = [ "password" ] @@ -4490,7 +4490,7 @@ url = "https://github.com/YunoHost-Apps/zola_ynh" added_date = 1674232499 # 2023/01/20 antifeatures = [ "non-free-dependencies" ] category = "system_tools" -level = 6 +level = 8 state = "working" subtags = [ "network" ] url = "https://github.com/YunoHost-Apps/ztncui_ynh" From ad4d3349c13714abba0cf9e4945285f0a1328f32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 6 Jul 2024 21:45:38 +0200 Subject: [PATCH 04/30] Update apps.toml --- apps.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps.toml b/apps.toml index 763b7625..19115290 100644 --- a/apps.toml +++ b/apps.toml @@ -737,7 +737,7 @@ url = "https://github.com/YunoHost-Apps/digitools_ynh" [digitranscode] added_date = 1674232499 # 2023/01/20 category = "small_utilities" -level = 0 +level = 8 state = "working" url = "https://github.com/YunoHost-Apps/digitranscode_ynh" @@ -1651,7 +1651,7 @@ url = "https://github.com/YunoHost-Apps/ifconfig-io_ynh" [ifm] added_date = 1674232499 # 2023/01/20 category = "small_utilities" -level = 0 +level = 8 state = "working" url = "https://github.com/YunoHost-Apps/ifm_ynh" From 81c30d2b89cb5ee1229bb0d22187020095be2955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 9 Jul 2024 10:11:25 +0200 Subject: [PATCH 05/30] Update app levels according to CI --- apps.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps.toml b/apps.toml index 19115290..31568bbd 100644 --- a/apps.toml +++ b/apps.toml @@ -43,7 +43,7 @@ added_date = 1674232499 # 2023/01/20 antifeatures = [ "deprecated-software" ] category = "social_media" deprecated_date = 1717071136 # 2024/05/30 -level = 0 +level = 6 state = "working" subtags = [ "microblogging", "pictures" ] url = "https://github.com/YunoHost-Apps/acropolis_ynh" @@ -707,7 +707,7 @@ url = "https://github.com/YunoHost-Apps/diagramsnet_ynh" [diaspora] added_date = 1674232499 # 2023/01/20 category = "social_media" -level = 0 +level = 8 potential_alternative_to = [ "Ello", "Facebook", "Hubzilla", "Myspace", "X" ] state = "working" subtags = [ "microblogging" ] From 68536f30db85a2bc300cd4ed239733945b9b5d55 Mon Sep 17 00:00:00 2001 From: YunoHost Bot Date: Fri, 12 Jul 2024 19:06:38 +0200 Subject: [PATCH 06/30] Add Aktivisda to wishlist (#2460) --- wishlist.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wishlist.toml b/wishlist.toml index 47532350..a769cb14 100644 --- a/wishlist.toml +++ b/wishlist.toml @@ -26,6 +26,13 @@ upstream = "https://github.com/akaunting/akaunting" website = "https://akaunting.com/" added_date = 1695656621 # 2023/09/25 + +[aktivisda] +name = "Aktivisda" +description = "Web application to create visuals using an organization's graphic charter." +upstream = "https://framagit.org/aktivisda/aktivisda" +website = "https://aktivisda.earth" + [amara] name = "Amara" description = "Collaborative translation of subtitles for videosCollaborative translation of subtitles for videos" From bfcf1848bcdc7c12637517e17c2b63b5166da321 Mon Sep 17 00:00:00 2001 From: YunoHost Bot Date: Fri, 12 Jul 2024 19:06:45 +0200 Subject: [PATCH 07/30] Add Tee Worlds to wishlist (#2459) --- wishlist.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wishlist.toml b/wishlist.toml index a769cb14..3768460e 100644 --- a/wishlist.toml +++ b/wishlist.toml @@ -2024,6 +2024,13 @@ upstream = "https://github.com/sismics/docs" website = "https://teedy.io/" added_date = 1695656621 # 2023/09/25 + +[tee-worlds] +name = "Tee Worlds" +description = "An online multiplayer game. Battle with up to 16 players in a variety of game modes." +upstream = "https://github.com/teeworlds/teeworlds" +website = "https://teeworlds.com/" + [teleport] name = "Teleport" description = "Multi-protocol access proxy which understands SSH, HTTPS, RDP, Kubernetes API, MySQL, MongoDB and PostgreSQL wire protocols." From 5873c501a5dd5be9737f435b72bca39295fb2c01 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 12 Jul 2024 17:07:04 +0000 Subject: [PATCH 08/30] Automatically add dates to the catalog files --- wishlist.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wishlist.toml b/wishlist.toml index 3768460e..7f8d66b0 100644 --- a/wishlist.toml +++ b/wishlist.toml @@ -32,6 +32,7 @@ name = "Aktivisda" description = "Web application to create visuals using an organization's graphic charter." upstream = "https://framagit.org/aktivisda/aktivisda" website = "https://aktivisda.earth" +added_date = 1720803998 # 2024/07/12 [amara] name = "Amara" @@ -2030,6 +2031,7 @@ name = "Tee Worlds" description = "An online multiplayer game. Battle with up to 16 players in a variety of game modes." upstream = "https://github.com/teeworlds/teeworlds" website = "https://teeworlds.com/" +added_date = 1720804005 # 2024/07/12 [teleport] name = "Teleport" From 5f7c8271043984d9cedf284c5f01670bc7a0d72b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 19:09:32 +0200 Subject: [PATCH 09/30] :art: Format Python code with Black (#2462) Co-authored-by: yunohost-bot <14998418+yunohost-bot@users.noreply.github.com> --- tools/autoupdate_app_sources/autoupdate_app_sources.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/autoupdate_app_sources/autoupdate_app_sources.py b/tools/autoupdate_app_sources/autoupdate_app_sources.py index e141b8e3..48c56d25 100755 --- a/tools/autoupdate_app_sources/autoupdate_app_sources.py +++ b/tools/autoupdate_app_sources/autoupdate_app_sources.py @@ -659,10 +659,11 @@ def main() -> None: help="If not passed, the script will run on the catalog. Github keys required.", ) parser.add_argument( - "-w", "--latest-commit-weekly", + "-w", + "--latest-commit-weekly", action=argparse.BooleanOptionalAction, default=False, - help="For latest_commit versions, only run weekly to prevent too many PRs" + help="For latest_commit versions, only run weekly to prevent too many PRs", ) parser.add_argument( "--edit", @@ -706,7 +707,10 @@ def main() -> None: with multiprocessing.Pool(processes=args.processes) as pool: tasks = pool.imap( run_autoupdate_for_multiprocessing, - ((app, args.edit, args.commit, args.pr, args.latest_commit_weekly) for app in apps), + ( + (app, args.edit, args.commit, args.pr, args.latest_commit_weekly) + for app in apps + ), ) for app, result in tqdm.tqdm(tasks, total=len(apps), ascii=" ·#"): state, current_version, main_version, pr_url = result From a5bb31163fcffe86a52e3e0cbe678e3a6932f6ae Mon Sep 17 00:00:00 2001 From: YunoHost Bot Date: Fri, 12 Jul 2024 19:11:59 +0200 Subject: [PATCH 10/30] Add Anytype to wishlist (#2453) --- wishlist.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wishlist.toml b/wishlist.toml index 7f8d66b0..92cf6ae3 100644 --- a/wishlist.toml +++ b/wishlist.toml @@ -63,6 +63,13 @@ upstream = "https://github.com/anonaddy/anonaddy" website = "https://anonaddy.com/" added_date = 1695656621 # 2023/09/25 + +[anytype] +name = "Anytype" +description = "Local-first note taking and knowledge management software." +upstream = "https://github.com/anyproto/any-sync" +website = "https://anytype.io" + [appflowy] name = "Appflowy" description = "Alternative to Notion" From 6b61239cd6b4a8d0ad62cf89ee38cdcb38e1b3ff Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 12 Jul 2024 17:12:15 +0000 Subject: [PATCH 11/30] Automatically add dates to the catalog files --- wishlist.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/wishlist.toml b/wishlist.toml index 92cf6ae3..9b487c3e 100644 --- a/wishlist.toml +++ b/wishlist.toml @@ -69,6 +69,7 @@ name = "Anytype" description = "Local-first note taking and knowledge management software." upstream = "https://github.com/anyproto/any-sync" website = "https://anytype.io" +added_date = 1720804319 # 2024/07/12 [appflowy] name = "Appflowy" From b961202c06fac9c035812ddb02117a615d69366a Mon Sep 17 00:00:00 2001 From: YunoHost Bot Date: Fri, 12 Jul 2024 19:15:39 +0200 Subject: [PATCH 12/30] Add tootgroup to wishlist (#2446) --- wishlist.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wishlist.toml b/wishlist.toml index 9b487c3e..c2527104 100644 --- a/wishlist.toml +++ b/wishlist.toml @@ -2083,6 +2083,13 @@ upstream = "https://github.com/tmate-io/tmate" website = "https://tmate.io/" added_date = 1695656621 # 2023/09/25 + +[tootgroup] +name = "tootgroup" +description = "fediverse bot that re-toots content of a group of accounts on its own account" +upstream = "https://github.com/oe4dns/tootgroup.py" +website = "" + [trivy] name = "trivy" description = "OSS Vulnerability and Misconfiguration Scanning." From dde209f6f1b344382c2bd574d294561d8263226e Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 12 Jul 2024 17:15:57 +0000 Subject: [PATCH 13/30] Automatically add dates to the catalog files --- wishlist.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/wishlist.toml b/wishlist.toml index c2527104..4ddd2b3f 100644 --- a/wishlist.toml +++ b/wishlist.toml @@ -2089,6 +2089,7 @@ name = "tootgroup" description = "fediverse bot that re-toots content of a group of accounts on its own account" upstream = "https://github.com/oe4dns/tootgroup.py" website = "" +added_date = 1720804539 # 2024/07/12 [trivy] name = "trivy" From 7f831e7130d010d7a98e03621122b6d136e741cf Mon Sep 17 00:00:00 2001 From: YunoHost Bot Date: Sat, 13 Jul 2024 14:20:25 +0200 Subject: [PATCH 14/30] Add Tube Archivist to wishlist (#2418) --- wishlist.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wishlist.toml b/wishlist.toml index 4ddd2b3f..b4cfc285 100644 --- a/wishlist.toml +++ b/wishlist.toml @@ -2105,6 +2105,13 @@ upstream = "https://foss.heptapod.net/tryton/" website = "https://www.tryton.org/" added_date = 1698609501 # 2023/10/29 + +[tube-archivist] +name = "Tube Archivist" +description = "Tube Archivist indexes and organizes archived YouTube videos through a convenient web interface." +upstream = "https://github.com/tubearchivist/tubearchivist" +website = "https://www.tubearchivist.com/" + [tubesync] name = "tubesync" description = "Syncs YouTube channels and playlists to a locally hosted media server" From 2a9f0a95bc351a748e22d5682aa5a98abcecd924 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 13 Jul 2024 12:20:45 +0000 Subject: [PATCH 15/30] Automatically add dates to the catalog files --- wishlist.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/wishlist.toml b/wishlist.toml index b4cfc285..3da5cf43 100644 --- a/wishlist.toml +++ b/wishlist.toml @@ -2111,6 +2111,7 @@ name = "Tube Archivist" description = "Tube Archivist indexes and organizes archived YouTube videos through a convenient web interface." upstream = "https://github.com/tubearchivist/tubearchivist" website = "https://www.tubearchivist.com/" +added_date = 1720873225 # 2024/07/13 [tubesync] name = "tubesync" From 135889a7d8dd9079c70d6d13299172d2c041169b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sat, 13 Jul 2024 16:09:24 +0200 Subject: [PATCH 16/30] Rename endi in caerp --- apps.toml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps.toml b/apps.toml index 31568bbd..4b180a7d 100644 --- a/apps.toml +++ b/apps.toml @@ -339,6 +339,14 @@ state = "working" subtags = [ "monitoring" ] url = "https://github.com/YunoHost-Apps/cachet_ynh" +[caerp] +added_date = 1674232499 # 2023/01/20 +category = "productivity_and_management" +level = 0 +state = "working" +subtags = [ "accounting", "business_and_ngos" ] +url = "https://github.com/Yunohost-Apps/caerp_ynh" + [calckey] added_date = 1674232499 # 2023/01/20 antifeatures = [ "deprecated-software" ] @@ -992,14 +1000,6 @@ level = 7 state = "working" url = "https://github.com/YunoHost-Apps/encryptor-decryptor_ynh" -[endi] -added_date = 1674232499 # 2023/01/20 -category = "productivity_and_management" -level = 0 -state = "working" -subtags = [ "accounting", "business_and_ngos" ] -url = "https://github.com/Yunohost-Apps/endi_ynh" - [epicyon] added_date = 1674232499 # 2023/01/20 category = "social_media" From 497fa4f477dc4c2ca5dae108098a1f0b5034b2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 14 Jul 2024 12:51:11 +0200 Subject: [PATCH 17/30] Rename endi logo too --- logos/{endi.png => caerp.png} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename logos/{endi.png => caerp.png} (100%) diff --git a/logos/endi.png b/logos/caerp.png similarity index 100% rename from logos/endi.png rename to logos/caerp.png From 1da80a6f467407339d75c0019c0a1dfa832630b4 Mon Sep 17 00:00:00 2001 From: cjdw Date: Wed, 10 Jul 2024 20:18:25 +0000 Subject: [PATCH 18/30] Translated readme-generator using Weblate (Indonesian) Currently translated at 56.4% (22 of 39 strings) Translation: YunoHost/readme-generator Translate-URL: https://translate.yunohost.org/projects/yunohost/readme-generator/id/ --- .../translations/id/LC_MESSAGES/messages.mo | Bin 0 -> 3084 bytes .../translations/id/LC_MESSAGES/messages.po | 55 +++++++++++------- 2 files changed, 35 insertions(+), 20 deletions(-) create mode 100644 tools/readme_generator/translations/id/LC_MESSAGES/messages.mo diff --git a/tools/readme_generator/translations/id/LC_MESSAGES/messages.mo b/tools/readme_generator/translations/id/LC_MESSAGES/messages.mo new file mode 100644 index 0000000000000000000000000000000000000000..fa1a986265546f7a946164a71bc1d84c2e2d7e92 GIT binary patch literal 3084 zcmb`J&2Jk;7{&)EP|SB}3lg9XA0;vM+N}Ulxee68ZW<|WqBsFcgyQk;cz5dEneEJM zT%R~{;lKrP;aG_a^n%0<#DPDdCk~wZHy|PL%&ymQN^(K0y7_r`XXkzAdEa@qf1Wt@ z4Z-mu&R1~W!+8ehR}bM2j^hs#@)Y<4_&sOnCD)87Ngfu`4rr;g$ zZSd4FLQa5Jz*oT@cnZ7)y0~A0$H6;b4g3*wdHeys3H}AX4xT~qC&6X#Iq*8z2Y113 z@Hg-~OpD#w%rl#3w zgu+JIpzf=rA^G^ja>TA=318y38D8MK6B)fVd!ojY>!ll+RM(WTRXWJ5MNs^6(N^;L zsOG66ZJwwmX$#}WOe9PmL&h`L6--^XoZp-Z0{UyIb5T7H|!38s$up3A^j za!7|F<_5{ozPoJn=i((yLUd#6RwZ$tj3Gw?QvRa zQ=<@%L43??ve?ocr%;%QfbSPz0wE&^Sywu2OjlT?R#CjFC5_bBT}&UKv~{vt$Ux67 zqWrP&bJ6mGRZWp(nE>fBAuX3o`kX>Ln;Eh`MCO9Ulm!V^9n34=oO_DS8uNh>me1YI z4A=j9WsmDU!N+6+^0Uyj9g|L{nhU9|yD`)%DOzyaQe=~}Ag}6Xr`7IuTmjB5#!QA8 z3whO)&(Y)i0~F-bv>asWq~~kSrHPcKYIvv~b3+X2MIudkK#{OP*EPwO+e2xdHmB$; zH8y!I=LA1g#YXf$J3?IRfz`VMnL+-vi#M`CbprrUe|;o@RqaCcw4GTD;w+H zCf^fI1g{N0Xwn;<)~458_u4IbZN1rDJ@?uA^-g7t8S8CnCJkIe=_b9py|zZLw@|Ok zoo;J&?MkcN-t6>xA7E%vI&X`!q&c6?<GJ9g&ZnY39kJ&)NdMfuHal_fAPrGIB$i6^*A&FHm(n)sn1hp^EOSgfJH@0h1t(Ks1Df*L0yEMV6HT% S*#Q6X$Y{Pzj_9GIT>l@LBEG=@ literal 0 HcmV?d00001 diff --git a/tools/readme_generator/translations/id/LC_MESSAGES/messages.po b/tools/readme_generator/translations/id/LC_MESSAGES/messages.po index 3ede36c5..b0a4fb2a 100644 --- a/tools/readme_generator/translations/id/LC_MESSAGES/messages.po +++ b/tools/readme_generator/translations/id/LC_MESSAGES/messages.po @@ -8,23 +8,26 @@ msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2024-03-31 19:33+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2024-07-11 14:56+0000\n" +"Last-Translator: cjdw \n" +"Language-Team: Indonesian \n" "Language: id\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.4.3\n" "Generated-By: Babel 2.14.0\n" #: templates/ALL_README.md.j2:11 #, python-format msgid "Read the README in %(language)s" -msgstr "" +msgstr "Baca README dalam bahasa %(language)s" #: templates/README.md.j2:2 msgid "Packaging an app, starting from this example" -msgstr "" +msgstr "Memaket satu aplikasi, dimulai dari contoh ini" #: templates/README.md.j2:4 msgid "" @@ -32,22 +35,29 @@ msgid "" "github.com/new?template_name=example_ynh&template_owner=YunoHost) button on " "the Github repo" msgstr "" +"Salin aplikasi ini sebelum mengerjakannya, menggunakan tombol ['Gunakan " +"templat ini'](https://github.com/" +"new?template_name=example_ynh&template_owner=YunoHost) di repo Github" #: templates/README.md.j2:5 msgid "Edit the `manifest.toml` with app specific info" -msgstr "" +msgstr "Edit `manifest.toml` dengan info khas aplikasi" #: templates/README.md.j2:6 msgid "" "Edit the `install`, `upgrade`, `remove`, `backup` and `restore` scripts, and " "any relevant conf files in `conf/`" msgstr "" +"Edit skrip `install`, `upgrade`, `remove`, `backup` and `restore`, dan " +"setiap berkas conf yang relevan dalam `conf/`" #: templates/README.md.j2:7 msgid "" "Using the [script helpers documentation](https://yunohost.org/" "packaging_apps_helpers)" msgstr "" +"Menggunakan [dokumentasi pembantu skrip](https://yunohost.org/" +"packaging_apps_helpers)" #: templates/README.md.j2:8 msgid "" @@ -101,16 +111,16 @@ msgstr "" #: templates/README.md.j2:24 msgid "Maintenance status" -msgstr "" +msgstr "Status pemeliharaan" #: templates/README.md.j2:26 #, python-format msgid "Install %(application_name)s with YunoHost" -msgstr "" +msgstr "Pasang %(application_name)s dengan YunoHost" #: templates/README.md.j2:28 msgid "Read this README in other languages." -msgstr "" +msgstr "Baca README ini dengan bahasa yang lain." #: templates/README.md.j2:30 #, python-format @@ -118,57 +128,62 @@ msgid "" "This package allows you to install %(application_name)s quickly and simply " "on a YunoHost server." msgstr "" +"Paket ini memperbolehkan Anda untuk memasang %(application_name)s secara " +"cepat dan mudah pada server YunoHost." #: templates/README.md.j2:31 msgid "" "If you don't have YunoHost, please consult [the guide](https://yunohost.org/" "install) to learn how to install it." msgstr "" +"Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan " +"[panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk " +"memasangnya." #: templates/README.md.j2:33 msgid "Overview" -msgstr "" +msgstr "Ringkasan" #: templates/README.md.j2:37 msgid "Shipped version:" -msgstr "" +msgstr "Versi terkirim:" #: templates/README.md.j2:41 msgid "Demo:" -msgstr "" +msgstr "Demo:" #: templates/README.md.j2:45 msgid "Screenshots" -msgstr "" +msgstr "Tangkapan Layar" #: templates/README.md.j2:48 #, python-format msgid "Screenshot of %(application_name)s" -msgstr "" +msgstr "Tangkapan Layar pada %(application_name)s" #: templates/README.md.j2:53 msgid "Disclaimers / important information" -msgstr "" +msgstr "Sangkalan / informasi penting" #: templates/README.md.j2:59 msgid "Antifeatures" -msgstr "" +msgstr "Antifitur" #: templates/README.md.j2:66 msgid "Documentation and resources" -msgstr "" +msgstr "Dokumentasi dan sumber daya" #: templates/README.md.j2:68 msgid "Official app website:" -msgstr "" +msgstr "Website aplikasi resmi:" #: templates/README.md.j2:70 msgid "Official user documentation:" -msgstr "" +msgstr "Dokumentasi pengguna resmi:" #: templates/README.md.j2:72 msgid "Official admin documentation:" -msgstr "" +msgstr "Dokumentasi admin resmi:" #: templates/README.md.j2:74 msgid "Upstream app code repository:" From 46cb0c6484ba1774062796f74cde2977407edd53 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 15 Jul 2024 04:52:01 +0200 Subject: [PATCH 19/30] Add Docmost. to wishlist --- wishlist.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wishlist.toml b/wishlist.toml index 3da5cf43..178fd196 100644 --- a/wishlist.toml +++ b/wishlist.toml @@ -497,6 +497,13 @@ upstream = "https://github.com/docker/distribution/" website = "" added_date = 1695656621 # 2023/09/25 + +[docmost] +name = "Docmost." +description = "Wiki and documentation software" +upstream = "https://github.com/docmost/docmost" +website = "https://docmost.com/" + [docspell] name = "Docspell" description = "Simple document organizer" From f50b1def76246aa3404c085051ba55ae395e5983 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 15 Jul 2024 14:22:56 +0000 Subject: [PATCH 20/30] Automatically add dates to the catalog files --- wishlist.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/wishlist.toml b/wishlist.toml index 178fd196..d8bdb57d 100644 --- a/wishlist.toml +++ b/wishlist.toml @@ -503,6 +503,7 @@ name = "Docmost." description = "Wiki and documentation software" upstream = "https://github.com/docmost/docmost" website = "https://docmost.com/" +added_date = 1721053354 # 2024/07/15 [docspell] name = "Docspell" From f40cffa8245e0fd371033bd290f1417376c4637c Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 13 Jul 2024 15:25:28 +0200 Subject: [PATCH 21/30] Add Graylog to wishlist --- wishlist.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wishlist.toml b/wishlist.toml index d8bdb57d..fd353101 100644 --- a/wishlist.toml +++ b/wishlist.toml @@ -795,6 +795,13 @@ upstream = "https://github.com/graphhopper/graphhopper" website = "https://www.graphhopper.com/" added_date = 1695656621 # 2023/09/25 + +[graylog] +name = "Graylog" +description = "log management platform" +upstream = "https://github.com/Graylog2/graylog2-server" +website = "https://www.graylog.org/" + [greenlight] name = "Greenlight" description = "A really simple end-user interface for your BigBlueButton server" From 58d8e4c82804c551291807d4bd1ae01541719a8c Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 15 Jul 2024 14:29:20 +0000 Subject: [PATCH 22/30] Automatically add dates to the catalog files --- wishlist.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/wishlist.toml b/wishlist.toml index fd353101..b1975fb2 100644 --- a/wishlist.toml +++ b/wishlist.toml @@ -801,6 +801,7 @@ name = "Graylog" description = "log management platform" upstream = "https://github.com/Graylog2/graylog2-server" website = "https://www.graylog.org/" +added_date = 1721053741 # 2024/07/15 [greenlight] name = "Greenlight" From 7cbb39857e35029b84553e56e7cae4dfe25f4b63 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:30:09 +0200 Subject: [PATCH 23/30] Set caerp as notworking (#2467) Co-authored-by: OniriCorpe --- apps.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.toml b/apps.toml index 4b180a7d..355c1ddd 100644 --- a/apps.toml +++ b/apps.toml @@ -343,7 +343,7 @@ url = "https://github.com/YunoHost-Apps/cachet_ynh" added_date = 1674232499 # 2023/01/20 category = "productivity_and_management" level = 0 -state = "working" +state = "notworking" subtags = [ "accounting", "business_and_ngos" ] url = "https://github.com/Yunohost-Apps/caerp_ynh" From a0bafe760470291dbef940432c1d6b4aefff964d Mon Sep 17 00:00:00 2001 From: Mateusz <2871798+orhtej2@users.noreply.github.com> Date: Sun, 14 Jul 2024 14:36:06 +0200 Subject: [PATCH 24/30] Bump `ynh` number on non-main-asset-only updates. --- .../autoupdate_app_sources.py | 22 +++++++++++++------ tools/autoupdate_app_sources/requirements.txt | 1 - 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/tools/autoupdate_app_sources/autoupdate_app_sources.py b/tools/autoupdate_app_sources/autoupdate_app_sources.py index 48c56d25..73893f10 100755 --- a/tools/autoupdate_app_sources/autoupdate_app_sources.py +++ b/tools/autoupdate_app_sources/autoupdate_app_sources.py @@ -256,6 +256,9 @@ class AppAutoUpdater: if state == State.up_to_date: return (State.up_to_date, "", "", "") + if main_version == "": + self.repo.manifest_raw = self.bump_version(self.repo.manifest_raw, self.current_version, bump_ynh_level=True) + if edit: self.repo.edit_manifest(self.repo.manifest_raw) @@ -580,19 +583,24 @@ class AppAutoUpdater: ] if is_main: - - def repl(m: re.Match) -> str: - return m.group(1) + new_version + '~ynh1"' - - content = re.sub( - r"(\s*version\s*=\s*[\"\'])([^~\"\']+)(\~ynh\d+[\"\'])", repl, content - ) + content = self.bump_version(content, new_version) for old, new in replacements: content = content.replace(old, new) return content + def bump_version(self, content: str, new_version: str, bump_ynh_level: bool = False) -> str: + ynh_level = 1 + if bump_ynh_level: + ynh_level = int(re.search(r"\s*version\s*=\s*[\"\'][^~\"\']+~ynh(\d+)[\"\']", content).group(1)) + 1 + + def repl(m: re.Match) -> str: + return m.group(1) + new_version + f'~ynh{ynh_level}"' + + return re.sub( + r"(\s*version\s*=\s*[\"\'])([^~\"\']+)(~ynh\d+[\"\'])", repl, content + ) def paste_on_haste(data): # NB: we hardcode this here and can't use the yunopaste command diff --git a/tools/autoupdate_app_sources/requirements.txt b/tools/autoupdate_app_sources/requirements.txt index 737faa31..4acb0cc1 100644 --- a/tools/autoupdate_app_sources/requirements.txt +++ b/tools/autoupdate_app_sources/requirements.txt @@ -2,4 +2,3 @@ requests PyGithub toml tqdm -GitPython \ No newline at end of file From 249c5f723fe78a92ca8421ea8673271320d4d704 Mon Sep 17 00:00:00 2001 From: Mateusz <2871798+orhtej2@users.noreply.github.com> Date: Sun, 14 Jul 2024 23:17:28 +0200 Subject: [PATCH 25/30] Provide links to changed assets - release notes, tag page, changelog between commits. --- .../autoupdate_app_sources.py | 59 +++++++++++++++---- tools/autoupdate_app_sources/rest_api.py | 35 ++++++++++- 2 files changed, 81 insertions(+), 13 deletions(-) diff --git a/tools/autoupdate_app_sources/autoupdate_app_sources.py b/tools/autoupdate_app_sources/autoupdate_app_sources.py index 73893f10..aa0c8f86 100755 --- a/tools/autoupdate_app_sources/autoupdate_app_sources.py +++ b/tools/autoupdate_app_sources/autoupdate_app_sources.py @@ -241,9 +241,10 @@ class AppAutoUpdater: if source == "main": main_version = version branch_name = f"ci-auto-update-{version}" - pr_title = commit_msg = f"Upgrade to v{version}" - if msg: - commit_msg += f"\n{msg}" + pr_title = f"Upgrade to v{version}" + + if msg: + commit_msg += f"\n- `{source}` v{version}: {msg}" self.repo.manifest_raw = self.replace_version_and_asset_in_manifest( self.repo.manifest_raw, @@ -257,7 +258,9 @@ class AppAutoUpdater: return (State.up_to_date, "", "", "") if main_version == "": - self.repo.manifest_raw = self.bump_version(self.repo.manifest_raw, self.current_version, bump_ynh_level=True) + self.repo.manifest_raw = self.bump_version( + self.repo.manifest_raw, self.current_version, bump_ynh_level=True + ) if edit: self.repo.edit_manifest(self.repo.manifest_raw) @@ -388,7 +391,7 @@ class AppAutoUpdater: f"Unknown update strategy '{strategy}' for '{name}', expected one of {STRATEGIES}" ) - result = self.get_latest_version_and_asset(strategy, asset, autoupdate) + result = self.get_latest_version_and_asset(strategy, asset, infos) if result is None: return None new_version, assets, more_info = result @@ -455,8 +458,9 @@ class AppAutoUpdater: return next(iter(matching_assets.items())) def get_latest_version_and_asset( - self, strategy: str, asset: Union[str, dict], autoupdate + self, strategy: str, asset: Union[str, dict], infos: dict[str, Any] ) -> Optional[tuple[str, Union[str, dict[str, str]], str]]: + autoupdate = infos.get("autoupdate") upstream = autoupdate.get("upstream", self.main_upstream).strip("/") version_re = autoupdate.get("version_regex", None) allow_prereleases = autoupdate.get("allow_prereleases", False) @@ -499,6 +503,11 @@ class AppAutoUpdater: latest_assets = latest_release["tarball_url"] # get the release changelog link latest_release_html_url = latest_release["html_url"] + if latest_release_html_url is None or latest_release_html_url == "": + latest_release_html_url = api.changelog_for_ref( + latest_version_orig, "", RefType.releases + ) + if asset == "tarball": latest_tarball = api.url_for_ref(latest_version_orig, RefType.tags) return latest_version, latest_tarball, latest_release_html_url @@ -536,7 +545,11 @@ class AppAutoUpdater: tags, self.app_id, version_re ) latest_tarball = api.url_for_ref(latest_version_orig, RefType.tags) - return latest_version, latest_tarball, "" + return ( + latest_version, + latest_tarball, + api.changelog_for_ref(latest_version, "", RefType.tags), + ) if revision_type == "commit": if self.latest_commit_weekly and datetime.now().weekday() != 0: @@ -555,7 +568,23 @@ class AppAutoUpdater: ) version_format = autoupdate.get("force_version", "%Y.%m.%d") latest_version = latest_commit_date.strftime(version_format) - return latest_version, latest_tarball, "" + return ( + latest_version, + latest_tarball, + api.changelog_for_ref( + latest_commit["sha"], self.get_old_ref(infos), RefType.commits + ), + ) + return None + + @staticmethod + def get_old_ref(infos: dict[str, Any]) -> str: + regex = r".*[\/-]([a-f0-9]+)\." + if isinstance(infos["url"], str): + return re.match(regex, infos["url"]).group(1) + if isinstance(infos["url"], dict): + for _, url in infos["url"]: + return re.match(regex, url).group(1) return None def replace_version_and_asset_in_manifest( @@ -590,10 +619,19 @@ class AppAutoUpdater: return content - def bump_version(self, content: str, new_version: str, bump_ynh_level: bool = False) -> str: + def bump_version( + self, content: str, new_version: str, bump_ynh_level: bool = False + ) -> str: ynh_level = 1 if bump_ynh_level: - ynh_level = int(re.search(r"\s*version\s*=\s*[\"\'][^~\"\']+~ynh(\d+)[\"\']", content).group(1)) + 1 + ynh_level = ( + int( + re.search( + r"\s*version\s*=\s*[\"\'][^~\"\']+~ynh(\d+)[\"\']", content + ).group(1) + ) + + 1 + ) def repl(m: re.Match) -> str: return m.group(1) + new_version + f'~ynh{ynh_level}"' @@ -602,6 +640,7 @@ class AppAutoUpdater: r"(\s*version\s*=\s*[\"\'])([^~\"\']+)(~ynh\d+[\"\'])", repl, content ) + def paste_on_haste(data): # NB: we hardcode this here and can't use the yunopaste command # because this script runs on the same machine than haste is hosted on... diff --git a/tools/autoupdate_app_sources/rest_api.py b/tools/autoupdate_app_sources/rest_api.py index d097bf35..89c64d64 100644 --- a/tools/autoupdate_app_sources/rest_api.py +++ b/tools/autoupdate_app_sources/rest_api.py @@ -10,6 +10,7 @@ import requests class RefType(Enum): tags = 1 commits = 2 + releases = 3 class GithubAPI: @@ -41,13 +42,19 @@ class GithubAPI: def url_for_ref(self, ref: str, ref_type: RefType) -> str: """Get a URL for a ref.""" - if ref_type == RefType.tags: + if ref_type == RefType.tags or ref_type == RefType.releases: return f"{self.upstream}/archive/refs/tags/{ref}.tar.gz" elif ref_type == RefType.commits: return f"{self.upstream}/archive/{ref}.tar.gz" else: raise NotImplementedError + def changelog_for_ref(self, new_ref: str, old_ref: str, ref_type: RefType) -> str: + """Get a changelog for a ref.""" + if ref_type == RefType.commits: + return f"{self.upstream}/compare/{old_ref}...{new_ref}" + else: + return f"{self.upstream}/releases/tag/{new_ref}" class GitlabAPI: def __init__(self, upstream: str): @@ -135,11 +142,24 @@ class GitlabAPI: return retval - def url_for_ref(self, ref: str, ref_type: RefType) -> str: + def url_for_ref(self, ref: str, _: RefType) -> str: name = self.project_path.split("/")[-1] clean_ref = ref.replace("/", "-") return f"{self.forge_root}/{self.project_path}/-/archive/{ref}/{name}-{clean_ref}.tar.bz2" + def changelog_for_ref(self, new_ref: str, old_ref: str, ref_type: RefType) -> str: + """Get a changelog for a ref.""" + if ref_type == RefType.commits: + return ( + f"{self.forge_root}/{self.project_path}/-/compare/{old_ref}...{new_ref}" + ) + elif ref_type == RefType.tags: + return f"{self.forge_root}/{self.project_path}/-/tags/{new_ref}" + elif ref_type == RefType.releases: + return f"{self.forge_root}/{self.project_path}/-/releases/{new_ref}" + else: + raise NotImplementedError + class GiteaForgejoAPI: def __init__(self, upstream: str): @@ -173,6 +193,15 @@ class GiteaForgejoAPI: """Get a list of releases for project.""" return self.internal_api(f"repos/{self.project_path}/releases") - def url_for_ref(self, ref: str, ref_type: RefType) -> str: + def url_for_ref(self, ref: str, _: RefType) -> str: """Get a URL for a ref.""" return f"{self.forge_root}/{self.project_path}/archive/{ref}.tar.gz" + + def changelog_for_ref(self, new_ref: str, old_ref: str, ref_type: RefType) -> str: + """Get a changelog for a ref.""" + if ref_type == RefType.commits: + return ( + f"{self.forge_root}/{self.project_path}/compare/{old_ref}...{new_ref}" + ) + else: + return f"{self.forge_root}/{self.project_path}/releases/tag/{new_ref}" From 5c5ed3f7fff5fde609ad7fd3a13013b8eb726137 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:36:06 +0200 Subject: [PATCH 26/30] :art: Format Python code with Black (#2475) Co-authored-by: OniriCorpe <6963387+OniriCorpe@users.noreply.github.com> --- tools/autoupdate_app_sources/rest_api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/autoupdate_app_sources/rest_api.py b/tools/autoupdate_app_sources/rest_api.py index 89c64d64..9c47ca00 100644 --- a/tools/autoupdate_app_sources/rest_api.py +++ b/tools/autoupdate_app_sources/rest_api.py @@ -56,6 +56,7 @@ class GithubAPI: else: return f"{self.upstream}/releases/tag/{new_ref}" + class GitlabAPI: def __init__(self, upstream: str): # Find gitlab api root... From f021bc1412b088b8c7c1dddbfb1c09dc479a7167 Mon Sep 17 00:00:00 2001 From: YunoHost Bot Date: Mon, 15 Jul 2024 21:02:27 +0200 Subject: [PATCH 27/30] Update app levels according to CI results (#2465) * Update app levels according to CI results * revert miniflux level * Update apps.toml: revert netdata to level 8 --------- Co-authored-by: root Co-authored-by: OniriCorpe Co-authored-by: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> --- apps.toml | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/apps.toml b/apps.toml index 355c1ddd..0fcfaaef 100644 --- a/apps.toml +++ b/apps.toml @@ -245,7 +245,7 @@ added_date = 1674232499 # 2023/01/20 antifeatures = [ "deprecated-software" ] category = "publishing" deprecated_date = 1717071136 # 2024/05/30 -level = 7 +level = 6 potential_alternative_to = [ "Blogger", "Coldfusion", "Wix" ] state = "working" subtags = [ "blog" ] @@ -543,7 +543,7 @@ url = "https://github.com/YunoHost-Apps/concrete5_ynh" [conduit] added_date = 1691780437 # 2023/08/11 category = "communication" -level = 7 +level = 8 potential_alternative_to = [ "Discord", "Facebook Messenger", "Signal", "Skype", "Telegram", "Whatsapp" ] state = "working" subtags = [ "chat" ] @@ -614,7 +614,7 @@ url = "https://github.com/YunoHost-Apps/crabfit_ynh" [cryptpad] added_date = 1674232499 # 2023/01/20 category = "office" -level = 6 +level = 8 potential_alternative_to = [ "Google Docs" ] state = "working" subtags = [ "text" ] @@ -689,7 +689,7 @@ url = "https://github.com/YunoHost-Apps/dendrite_ynh" [dex] added_date = 1674232499 # 2023/01/20 category = "system_tools" -level = 6 +level = 8 state = "working" subtags = [ "network" ] url = "https://github.com/YunoHost-Apps/dex_ynh" @@ -851,7 +851,7 @@ url = "https://github.com/YunoHost-Apps/dolibarr_ynh" [domoticz] added_date = 1674232499 # 2023/01/20 category = "iot" -level = 6 +level = 8 state = "working" url = "https://github.com/YunoHost-Apps/domoticz_ynh" @@ -859,7 +859,7 @@ url = "https://github.com/YunoHost-Apps/domoticz_ynh" added_date = 1674232499 # 2023/01/20 branch = "main" category = "dev" -level = 8 +level = 0 state = "working" subtags = [ "programming" ] url = "https://github.com/YunoHost-Apps/dont-code_ynh" @@ -917,7 +917,7 @@ url = "https://github.com/YunoHost-Apps/easyappointments_ynh" [elabftw] added_date = 1674232499 # 2023/01/20 category = "productivity_and_management" -level = 8 +level = 6 state = "working" url = "https://github.com/YunoHost-Apps/elabftw_ynh" @@ -977,7 +977,7 @@ url = "https://github.com/YunoHost-Apps/emailpoubelle_ynh" [emoncms] added_date = 1674232499 # 2023/01/20 category = "iot" -level = 8 +level = 6 state = "working" url = "https://github.com/YunoHost-Apps/emoncms_ynh" @@ -1030,7 +1030,7 @@ url = "https://github.com/YunoHost-Apps/ethercalc_ynh" [etherpad] added_date = 1694300530 # 2023/09/09 category = "office" -level = 6 +level = 7 potential_alternative_to = [ "G Suite", "Google Docs", "Microsoft Office", "Microsoft Word", "Office 365" ] state = "working" subtags = [ "text" ] @@ -1373,7 +1373,7 @@ url = "https://github.com/YunoHost-Apps/glance_ynh" [glitchsoc] added_date = 1674232499 # 2023/01/20 category = "social_media" -level = 8 +level = 6 state = "working" subtags = [ "microblogging" ] url = "https://github.com/YunoHost-Apps/glitchsoc_ynh" @@ -1389,7 +1389,7 @@ url = "https://github.com/YunoHost-Apps/glowingbear_ynh" [glpi] added_date = 1674232499 # 2023/01/20 category = "productivity_and_management" -level = 6 +level = 8 potential_alternative_to = [ "Cherwell", "Freshdesk", "Ivanti", "Peregrine Systems (AssetCenter)", "Remedy (BMC Software)", "ServiceNow" ] state = "working" subtags = [ "task" ] @@ -1691,7 +1691,7 @@ url = "https://github.com/YunoHost-Apps/indexhibit_ynh" added_date = 1691920584 # 2023/08/13 branch = "main" category = "system_tools" -level = 7 +level = 6 state = "working" subtags = [ "db", "monitoring" ] url = "https://github.com/YunoHost-Apps/influxdb_v2_ynh" @@ -1909,7 +1909,7 @@ url = "https://github.com/YunoHost-Apps/kodi_ynh" [koel] added_date = 1694978602 # 2023/09/17 category = "multimedia" -level = 7 +level = 6 potential_alternative_to = [ "Airsonic", "Deezer", "SoundCloud", "Spotify" ] state = "working" subtags = [ "music" ] @@ -2208,7 +2208,7 @@ url = "https://github.com/YunoHost-Apps/mantis_ynh" [mastodon] added_date = 1674232499 # 2023/01/20 category = "social_media" -level = 6 +level = 8 potential_alternative_to = [ "X" ] state = "working" subtags = [ "microblogging" ] @@ -2226,7 +2226,7 @@ url = "https://github.com/YunoHost-Apps/matomo_ynh" [matrix-appservice-irc] added_date = 1675621561 # 2023/02/05 category = "communication" -level = 7 +level = 6 state = "working" subtags = [ "chat" ] url = "https://github.com/YunoHost-Apps/matrix-appservice-irc_ynh" @@ -2280,7 +2280,7 @@ url = "https://github.com/YunoHost-Apps/mautrix_facebook_ynh" [mautrix_signal] added_date = 1674232499 # 2023/01/20 category = "communication" -level = 7 +level = 6 potential_alternative_to = [ "Signal" ] state = "working" subtags = [ "chat" ] @@ -2486,7 +2486,7 @@ url = "https://github.com/YunoHost-Apps/motioneye_ynh" [movim] added_date = 1674232499 # 2023/01/20 category = "social_media" -level = 6 +level = 8 potential_alternative_to = [ "Facebook Messenger", "Facebook", "MSN" ] state = "working" subtags = [ "microblogging" ] @@ -2831,7 +2831,7 @@ url = "https://github.com/YunoHost-Apps/owncast-emojiwall_ynh" [owncloud] added_date = 1674232499 # 2023/01/20 category = "synchronization" -level = 7 +level = 8 potential_alternative_to = [ "Apple iCloud", "Dropbox", "Google Drive", "Microsoft OneDrive" ] state = "working" subtags = [ "files" ] @@ -2840,7 +2840,7 @@ url = "https://github.com/YunoHost-Apps/owncloud_ynh" [owntracks] added_date = 1674232499 # 2023/01/20 category = "small_utilities" -level = 8 +level = 6 state = "working" url = "https://github.com/YunoHost-Apps/owntracks_ynh" @@ -2915,7 +2915,7 @@ url = "https://github.com/YunoHost-Apps/pelican_ynh" [penpot] added_date = 1708540527 # 2024/02/21 category = "dev" -level = 6 +level = 7 state = "working" subtags = [ "design" ] url = "https://github.com/YunoHost-Apps/penpot_ynh" @@ -3775,7 +3775,7 @@ url = "https://github.com/YunoHost-Apps/squid3_ynh" [ssbroom] added_date = 1674232499 # 2023/01/20 category = "communication" -level = 7 +level = 8 state = "working" url = "https://github.com/YunoHost-Apps/ssbroom_ynh" @@ -3881,7 +3881,7 @@ url = "https://github.com/YunoHost-Apps/syncthing_ynh" [tandoor] added_date = 1674232499 # 2023/01/20 category = "small_utilities" -level = 6 +level = 8 state = "working" url = "https://github.com/YunoHost-Apps/tandoor_ynh" @@ -3981,7 +3981,7 @@ url = "https://github.com/YunoHost-Apps/tinyfilemanager_ynh" [tldraw] added_date = 1674232499 # 2023/01/20 category = "office" -level = 6 +level = 8 potential_alternative_to = [ "Lucidchart" ] state = "working" subtags = [ "draw" ] @@ -4506,7 +4506,7 @@ url = "https://github.com/YunoHost-Apps/zusam_ynh" [zwave-js-ui] added_date = 1674232499 # 2023/01/20 category = "iot" -level = 6 +level = 8 state = "working" url = "https://github.com/YunoHost-Apps/zwave-js-ui_ynh" From 5af06b543ecaf4e1711467477e4b590f34cbd667 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Fri, 19 Jul 2024 18:10:46 +0200 Subject: [PATCH 28/30] Add script to autopatch apps for helpers 2.1 (#2407) * Add script to autopatch apps for helpers 2.1 * helpers2.1: more patches for mysql/psql helpers * helpers2.1: misc fixes * helpers2.1: add searchandreplace for apt changes * helpers2.1: propagate additional recent changes + misc fixes * helpers2.1: replace check of PACKAGE_CHECK_EXEC with simpler ynh_in_ci_tests * helpers2.1: misc fixes * Update convert_to_helpers_2.1.py: fix sed -i syntax for MacOS where -i requires a suffix, even empty string... * Fix again for MacOS which definitely doesn't like 'append' in sed x_x * I love computers * Invalid escape sequence yada yada * Bunch of tricky issues where eg ynh_install_go becomes ynh_go_install becomes go_install due to the order of conflicting filters etc... * Misc fixes + Trash everything about fpm_usage/footprint + Autopatch upload_max_filesize/memory_limit + Encourge people to use ynh_app_setting_set_default instead of [ -z ${foo:-}] trick in upgrade * Fix invalid escape sequence * Fix invalid escape sequences again :grim: * Turns out we gotta have the absolute path to nodejs/npm/ruby in systemd confs after all because having PATH in Environment doesn't do the trick >_> * Automatically bump yunohost requirement to 11.2.16 * Make the script more idempotent * Delete scripts/config when there's no config_panel.toml * Typo when patching ynh_psql_execute_as_root --sql * Add an explicit FIXME / explanation when ynh_replace is used with positionals * Replace __USER__ by __APP__ x_x ... * Moar tweaks * Tweak REMOVEME / FIXME flag to be able to complain about it from the linter * Bump yunohost requirement to 11.2.17 * Autopatch now-unecessary chmod/chown * Recommend to always upgrade sources instead of 'if ynh_app_upstream_version_changed' * Require yunohost 11.2.18 * \--eval for mongo_exec doesnt exist anymore * Autorework the patches/ folder structure to match new expectation from ynh_setup_source * Autoremove ynh_abort_if_errors / ynh_clean_setup calls --- tools/helpers2.1/convert_to_helpers_2.1.py | 431 +++++++++++++++++++++ 1 file changed, 431 insertions(+) create mode 100644 tools/helpers2.1/convert_to_helpers_2.1.py diff --git a/tools/helpers2.1/convert_to_helpers_2.1.py b/tools/helpers2.1/convert_to_helpers_2.1.py new file mode 100644 index 00000000..73732e6e --- /dev/null +++ b/tools/helpers2.1/convert_to_helpers_2.1.py @@ -0,0 +1,431 @@ +#!/usr/bin/env python3 + +import argparse +import os +import re + + +def cleanup(): + + comment_blocks_to_cleanup = [ + r"#=+\s*\n# GENERIC START\S*\s*\n#=+\s*\n# IMPORT GENERIC HELPERS\n#=+\s*\n", + r"#=+\s*\n# EXPERIMENTAL HELPERS\s*\n#=+\s*\n", + r"#=+\s*\n# FUTURE OFFICIAL HELPERS\s*\n#=+\s*\n", + r"#=+\s*\n# PERSONAL HELPERS\s*\n#=+\s*\n", + r"#=+\s*\n# GENERIC FINALIZATION\s*\n", + r"#=+\s*\n# GENERIC FINALISATION\s*\n", + r"#=+\s*\n# STANDARD MODIFICATIONS\s*\n", + r"#=+\s*\n# STANDARD UPGRADE STEPS\s*\n", + r"#=+\s*\n# SPECIFIC UPGRADE\s*\n", + r"#=+\s*\n# CHECK VERSION\s*\n#=+\s*\n", + r"#=+\s*\n# DECLARE DATA AND CONF FILES TO BACKUP\s*\n#=+\s*\n", + ] + + removememaybes = [ + "ynh_legacy_permissions_exists", + "ynh_legacy_permissions_delete_all", + "ynh_webpath_available", + "ynh_webpath_register", + "ynh_psql_test_if_first_run", + "ynh_backup_before_upgrade", + "ynh_restore_upgradebackup", + "ynh_find_port", + "ynh_port_available", + "ynh_require_ram", + "--ignore_swap", + "--only_swap", + "ynh_print_log", + "ynh_print_OFF", + "ynh_print_ON", + "local legacy_args", + "ynh_abort_if_errors", + "ynh_clean_setup", + ] + + replaces = [ + # Unecessary exec_warn_less + (r"ynh_exec_warn_less ynh_secure_remove", "ynh_secure_remove"), + (r"ynh_exec_warn_less ynh_systemd_action", "ynh_systemctl"), + (r"ynh_exec_warn_less ynh_install_nodejs", "ynh_install_nodejs"), + (r"ynh_exec_warn_less ynh_install_go", "ynh_install_go"), + (r"ynh_exec_warn_less ynh_install_ruby", "ynh_install_ruby"), + (r"ynh_exec_warn_less ynh_composer_exec", "ynh_composer_exec"), + (r"ynh_exec_warn_less ynh_install_composer", "ynh_install_composer"), + # Setting get/set + (r" ?--app=? ?\"?\$app\"?", ""), + # Misc + (r"ynh_validate_ip4", "ynh_validate_ip --family=4"), + (r"ynh_validate_ip4", "ynh_validate_ip --family=6"), + (r"\$\(ynh_get_debian_release\)", "$YNH_DEBIAN_VERSION"), + (r"ynh_read_manifest --manifest\S*", "ynh_read_manifest"), + (r"--manifest_key", "--key"), + (r"COMMON VARIABLES\s*$", "COMMON VARIABLES AND CUSTOM HELPERS"), + (r"ynh_string_random ([0-9])", "ynh_string_random --length=\\1"), + (r"ynh_backup_if_checksum_is_different --file=?", "ynh_backup_if_checksum_is_different "), + (r"ynh_store_file_checksum --file=?", "ynh_store_file_checksum "), + (r"ynh_delete_file_checksum --file=?", "ynh_delete_file_checksum "), + (r"\[\[?.*PACKAGE_CHECK_EXEC.*eq.*1.*\]\]?", "ynh_in_ci_tests"), + (r"\[\[?.*PACKAGE_CHECK_EXEC.*=.*1.*\]\]?", "ynh_in_ci_tests"), + (r"\[\[?.*PACKAGE_CHECK_EXEC.*ne.*1.*\]\]?", "! ynh_in_ci_tests"), + (r"\[\[?.*PACKAGE_CHECK_EXEC.*eq.*0.*\]\]?", "! ynh_in_ci_tests"), + (r"\[\[?.*PACKAGE_CHECK_EXEC.*ne.*0.*\]\]?", "ynh_in_ci_tests"), + # ynh_setup_source + (r"--full_replace=1", "--full_replace"), + (r"sources/patches", "patches"), + (r"sources/extra_files/app", "sources"), + (r"sources/extra_files", "sources"), + (r'((chmod|chown).*\"?\$install_dir\"?)\s*$', "#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | \\1"), + # Logging + (r"ynh_print_err", "ynh_print_warn"), + (r"ynh_exec_quiet ?", ""), + (r"ynh_exec_fully_quiet ?", ""), + (r"ynh_exec_warn_less", "ynh_hide_warnings"), + (r"--message=?", ""), + (r"--time ", ""), + (r"--last", ""), + (r"\s*--weight=?\S*", ""), + # rm + (r"ynh_secure_remove( --file=?)? ?", "ynh_safe_rm "), + # Conf / templating + (r"__NAME__", "__APP__"), + (r"__NAMETOCHANGE__", "__APP__"), + (r"ynh_render_template", "ynh_config_add --jinja"), + (r"ynh_add_config", "ynh_config_add"), + (r'--template="../conf/', '--template="'), + (r'ynh_replace_vars --file=', 'ynh_replace_vars '), + (r'ynh_replace_vars', '_ynh_replace_vars'), + (r'((chmod|chown)\s[^-+].*\"?(\$install_dir\"?/.*(config|.env|settings|credentials)\S*|\$data_dir\"?/\S+|/etc/(sudoers.d|cron.d|\$app)\"?/\S+|\$(config|cron_path)\"?))', "#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | \\1"), + # Upgrade stuff + (r"ynh_compare_current_package_version.*lt.*version\s?=?\"?([0-9\.]+~ynh[0-9])\"?", "ynh_app_upgrading_from_version_before \\1"), + (r"ynh_compare_current_package_version.*le.*version\s?=?\"?([0-9\.]+~ynh[0-9])\"?", "ynh_app_upgrading_from_version_before_or_equal_to \\1"), + (r"upgrade_type=\S*", ""), + (r'if \[\s+"?\$upgrade_type"?\s+==\s+"?UPGRADE_APP"? \]', "# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed\nif ynh_app_upstream_version_changed"), + # Backup/store + (r"ynh_restore\s*$", "ynh_restore_everything"), + # -> Specific trick to remove the --not_mandatory here, but replace it with || true for the other occurences + (r'ynh_restore_file --origin_path="\$data_dir" \S*', 'ynh_restore "$data_dir"'), + (r"ynh_restore_file", "ynh_restore"), + (r"--src_path=?", ""), + (r"--origin_path=?", ""), + (r"--is_big\S*", ""), + (r"--not_mandatory", "|| true"), + # Fail2ban + (r"--max_retry=\S*", ""), + (r"--ports\S*", ""), + (r"ynh_add_fail2ban_config --use_template", "ynh_config_add_fail2ban"), + (r"ynh_add_fail2ban_config", "ynh_config_add_fail2ban"), + (r"ynh_remove_fail2ban_config", "ynh_config_remove_fail2ban"), + # MySQL/Postgresql + (r"ynh_mysql_dump_db \S*\$db_name\"?\s", "ynh_mysql_dump_db "), + (r"ynh_psql_dump_db \S*\$db_name\"?\s", "ynh_psql_dump_db "), + (r"ynh_mysql_connect_as [^<\\]*\s", "ynh_mysql_db_shell "), + (r"ynh_psql_connect_as [^<\\]*\s", "ynh_psql_db_shell "), + (r'ynh_mysql_execute_as_root --sql=?', 'ynh_mysql_db_shell <<< '), + (r'ynh_psql_execute_as_root --sql=?', 'ynh_psql_db_shell <<< '), + (r'ynh_mysql_execute_as_root "', 'ynh_mysql_db_shell <<< "'), + (r'ynh_psql_execute_as_root "', 'ynh_psql_db_shell <<< "'), + (r"ynh_mysql_execute_as_root '", "ynh_mysql_db_shell <<< '"), + (r"ynh_psql_execute_as_root '", "ynh_psql_db_shell <<< '"), + (r"ynh_psql_execute_as_root --database=?", "ynh_psql_db_shell "), + (r"ynh_mysql_execute_as_root --database=?", "ynh_psql_db_shell "), + (r"--sql=", "<<< "), + (r'ynh_mysql_execute_file_as_root --database=\"?(\S+)\"? --file=\"?(\S+)\"?', 'ynh_mysql_db_shell "\\1" < "\\2"'), + (r'ynh_mysql_execute_file_as_root --file=\"?(\S+)\"? --database=\"?(\S+)\"?', 'ynh_mysql_db_shell "\\2" < "\\1"'), + (r'ynh_psql_execute_file_as_root --database=\"?(\S+)\"? --file=\"?(\S+)\"?', 'ynh_psql_db_shell "\\1" < "\\2"'), + (r'ynh_psql_execute_file_as_root --file=\"?(\S+)\"? --database=\"?(\S+)\"?', 'ynh_psql_db_shell "\\2" < "\\1"'), + (r'sql_db_shell "?\$db_name"?', "sql_db_shell "), + (r'--database="?\$db_name"?', ""), + (r'--database="?\$app"?', ""), + (r"ynh_mysql_setup_db", "# FIXMEhelpers2.1 ynh_mysql_create_db"), + (r"ynh_mysql_remove_db", "# FIXMEhelpers2.1 ynh_mysql_drop_db && ynh_mysql_drop_user"), + (r"ynh_psql_setup_db", "# FIXMEhelpers2.1 ynh_psql_create_db"), + (r"ynh_psql_remove_db", "# FIXMEhelpers2.1 ynh_psql_drop_db && ynh_psql_drop_user"), + # PHP / composer + (r" ?--phpversion=\S*", ""), + (r" ?--composerversion=\S*", ""), + (r" ?--usage=\S*", ""), + (r" ?--footprint=\S*", ""), + (r"--group=www-data", "# FIXMEhelpers2.1 : --group=www-data to be replaced with php_group=www-data to be added in _common.sh"), + (r"YNH_COMPOSER_VERSION=", "composer_version="), + (r' --workdir="\$install_dir"', ""), + (r'--workdir=\$install_dir ', ""), + (r'--workdir', "# FIXMEhelpers2.1 (replace with composer_workdir=... prior to calling this helper, default is $intall_dir) --workdir"), + (r'phpversion', "php_version"), + (r'PHPVERSION', "PHP_VERSION"), + (r"ynh_add_fpm_config", "ynh_config_add_phpfpm"), + (r"ynh_remove_fpm_config", "ynh_config_remove_phpfpm"), + (r"ynh_install_composer", "ynh_composer_install\nynh_composer_exec install --no-dev "), + (r'--install_args="?([^"]+)"?(\s|$)', "\\1\\2"), + (r'--commands="([^"]+)"(\s|$)', "\\1\\2"), + (r"(^fpm_usage=)", "#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | \\1"), + (r"(^.*\$fpm_usage)", "#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | \\1"), + (r"(^fpm_footprint=)", "#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | \\1"), + (r"(^.*\$fpm_footprint)", "#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | \\1"), + (r"(^set__fpm_footprint)", "#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | \\1"), + (r"(^fpm_free_footprint=)", "#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | \\1"), + (r"(^.*\$fpm_free_footprint)", "#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | \\1"), + (r"(^set__fpm_free_footprint)", "#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | \\1"), + # Nodejs + (r'"?\$?ynh_node"?', "node"), + (r"NODEJS_VERSION=", "nodejs_version="), + (r"ynh_install_nodejs \S*", "ynh_nodejs_install"), + (r"ynh_install_nodejs", "ynh_nodejs_install"), + (r"ynh_remove_nodejs", "ynh_nodejs_remove"), + (r"ynh_use_nodejs", ""), + (r'"?\$ynh_node_load_PATH"?', ""), + (r'"?\$ynh_node_load_path"?', ""), + (r'"?\$?ynh_npm"?', "npm"), + (r'(export )?COREPACK_ENABLE_DOWNLOAD_PROMPT=0', ""), + (r'env\s+npm', "npm"), + (r'env\s+pnpm', "pnpm"), + (r'env\s+yarn', "yarn"), + (r'env\s+corepack', "corepack"), + # Ruby + (r'"?\$?ynh_ruby"?', "ruby"), + (r'"?\$?ynh_gem"?', "gem"), + (r"RUBY_VERSION=", "ruby_version="), + (r"ynh_install_ruby \S*", "ynh_ruby_install"), + (r"ynh_install_ruby", "ynh_ruby_install"), + (r"ynh_remove_ruby", "ynh_ruby_remove"), + (r"ynh_use_ruby", ""), + (r'"?\$ynh_ruby_load_PATH"?', ""), + (r'"?\$ynh_ruby_load_path"?', ""), + # Go + (r"^\s*GO_VERSION=", "go_version="), + (r'"?\$?ynh_go"?', "go"), + (r"ynh_install_go \S*", "ynh_go_install"), + (r"ynh_install_go", "ynh_go_install"), + (r"ynh_remove_go", "ynh_go_remove"), + (r"ynh_use_go", ""), + # Mongodb + (r"YNH_MONGO_VERSION", "mongo_version"), + (r"ynh_install_mongo \S*", "ynh_install_mongo"), + (r" --eval", ""), + # ynh_replace_string + (r"ynh_replace_string", "ynh_replace"), + (r"ynh_replace_special_string", "ynh_replace_regex"), + (r"--match_string", "--match"), + (r"--replace_string", "--replace"), + (r"--target_file", "--file"), + (r"(ynh_replace ('|\"))", "# FIXMEhelpers2.1: ynh_replace used with positional args. Please add the keywords: --match=, --replace=, --file=\n\\1"), + # Nginx + (r"ynh_add_nginx_config", "ynh_config_add_nginx"), + (r"ynh_remove_nginx_config", "ynh_config_remove_nginx"), + (r"ynh_change_url_nginx_config", "ynh_config_change_url_nginx"), + # Systemd + (r'--log_path="/var/log/\$app/\$app.log"', ""), + (r'--service="?\$app"?(\s|$)', "\\1"), + (r"--service_name", "--service"), + (r"--line_match", "--wait_until"), + (r' --template="systemd.service"', ""), + (r"ynh_add_systemd_config", "ynh_config_add_systemd"), + (r"ynh_remove_systemd_config --service=?", "ynh_config_remove_systemd"), + (r"ynh_remove_systemd_config", "ynh_config_remove_systemd"), + (r"ynh_systemd_action", "ynh_systemctl"), + # Logrotate + (r"ynh_use_logrotate", "ynh_config_add_logrotate"), + (r"ynh_remove_logrotate", "ynh_config_remove_logrotate"), + (r"--specific_user\S*", ""), + (r"--logfile=?", ""), + (r" ?--non-?append", ""), + (r'((chmod|chown).*\"?/var/log/\"?\$app)', "#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | \\1"), + # Apt + (r"ynh_package_is_installed (--package=)?", "_ynh_apt_package_is_installed"), + (r"ynh_package_version (--package=)?", "_ynh_apt_package_version"), + (r"ynh_package_install", "_ynh_apt_install"), + (r"ynh_install_extra_app_dependencies", "ynh_apt_install_dependencies_from_extra_repository"), + (r"ynh_install_app_dependencies", "ynh_apt_install_dependencies"), + (r"ynh_remove_app_dependencies", "ynh_apt_remove_dependencies"), + (r"ynh_package_autopurge", "_ynh_apt autoremove --purge"), + # Exec as / sudo + (r'ynh_exec_as "?\$app"?( env)?', "ynh_exec_as_app"), + (r'sudo -u "?\$app"?( env)?', "ynh_exec_as_app"), + # Cringy messages? + ("Modifying a config file...", "Updating configuration..."), + ("Updating a configuration file...", "Updating configuration..."), + ("Adding a configuration file...", "Adding $app's configuration..."), + ("Restoring the systemd configuration...", "Restoring $app's systemd service..."), + ("Configuring a systemd service...", "Configuring $app's systemd service..."), + ("Stopping a systemd service...", "Stopping $app's systemd service..."), + ("Starting a systemd service...", "Starting $app's systemd service..."), + # Recommend ynh_app_setting_set_default + (r"( *if \[.*-z.*:-}.*\].*\n?.*then\n\s+(\S+)=(.+)\n\s+ynh_app_setting_set.*\n\s*fi\n)", "# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=\\2 --value=\\3\n\\1"), + # Trailing spaces + (r"\s+$", "\n"), + ] + + replaces = [(re.compile(pattern, flags=re.M), replace) for pattern, replace in replaces] + comment_blocks_to_cleanup = [re.compile(pattern, flags=re.M) for pattern in comment_blocks_to_cleanup] + + for s in [ + "_common.sh", + "install", + "remove", + "upgrade", + "backup", + "restore", + "change_url", + "config", + ]: + + script = f"scripts/{s}" + + if not os.path.exists(script): + continue + + content = open(script).read() + + if s == "remove": + content = re.sub(r'(ynh_secure_remove .*/var/log/\$app.*)', r"#REMOVEME? (Apps should not remove their log dir during remove ... this should only happen if --purge is used, and be handled by the core...) \1", content) + + for pattern in comment_blocks_to_cleanup: + content = pattern.sub("", content) + + for pattern, replace in replaces: + content = pattern.sub(replace, content) + + for remove in removememaybes: + content = content.replace(remove, r"#REMOVEME? " + remove) + + open(script, "w").write(content) + + + # Specific PHP FPM conf patch + if os.path.exists("conf/extra_php-fpm.conf"): + + content = open("conf/extra_php-fpm.conf").read() + + pattern_upload_max_filesize = r"\nphp_\S*\[upload_max_filesize\] = (\S*)" + pattern_post_max_size = r"\nphp_\S*\[post_max_size\] = (\S*)" + pattern_memory_limit = r"\nphp_\S*\[memory_limit\] = (\S*)" + + upload_max_filesize = re.findall(pattern_upload_max_filesize, "\n" + content) + memory_limit = re.findall(pattern_memory_limit, "\n" + content) + + if memory_limit: + content = re.sub(pattern_memory_limit, "", content) + memory_limit = memory_limit[0] + install = open("scripts/install").read() + install = re.sub("(source /usr/share/yunohost/helpers)", "\\1\n\nynh_app_setting_set --key=php_memory_limit --value=" + memory_limit, install) + open("scripts/install", "w").write(install) + upgrade = open("scripts/upgrade").read() + upgrade = re.sub("(source /usr/share/yunohost/helpers)", "\\1\n\nynh_app_setting_set_default --key=php_memory_limit --value=" + memory_limit, upgrade) + open("scripts/upgrade", "w").write(upgrade) + + if upload_max_filesize: + content = re.sub(pattern_upload_max_filesize, "", content) + content = re.sub(pattern_post_max_size, "", content) + + upload_max_filesize = upload_max_filesize[0] + if upload_max_filesize != "50M": + install = open("scripts/install").read() + install = re.sub("(source /usr/share/yunohost/helpers)", "\\1\n\nynh_app_setting_set --key=php_upload_max_filesize --value=" + upload_max_filesize, install) + open("scripts/install", "w").write(install) + upgrade = open("scripts/upgrade").read() + upgrade = re.sub("(source /usr/share/yunohost/helpers)", "\\1\n\nynh_app_setting_set_default --key=php_upload_max_filesize --value=" + upload_max_filesize, upgrade) + open("scripts/upgrade", "w").write(upgrade) + + new_conf_is_empty = all(line.strip() == "" or line.strip()[0] == ";" for line in content.split("\n")) + if new_conf_is_empty: + os.system("git rm --quiet -f conf/extra_php-fpm.conf") + else: + open("conf/extra_php-fpm.conf", "w").write(content) + + + conf_replaces = [ + (r"__NAME__", "__APP__"), + (r"__NAMETOCHANGE__", "__APP__"), + (r"__USER__", "__APP__"), + ("__YNH_NODE__", "__NODEJS_DIR__/node"), + ("__YNH_NPM__", "__NODEJS_DIR__/npm"), + ("__YNH_NODE_LOAD_PATH__", "PATH=__PATH_WITH_NODEJS__"), + ("__YNH_RUBY_LOAD_PATH__", "PATH=__PATH_WITH_RUBY__"), + ("__YNH_GO_LOAD_PATH__", "PATH=__PATH_WITH_GO__"), + ("__YNH_RUBY__", "__RUBY_DIR__/ruby"), + ("__PHPVERSION__", "__PHP_VERSION__"), + ] + + for currentpath, folders, files in os.walk("conf"): + for file in files: + path = os.path.join(currentpath, file) + try: + content = open(path).read() + except UnicodeDecodeError: + # Not text? + continue + for pattern, replace in conf_replaces: + content = content.replace(pattern, replace) + + open(path, "w").write(content) + + git_cmds = [ + "git rm --quiet sources/extra_files/*/.gitignore 2>/dev/null", + "git rm --quiet sources/patches/.gitignore 2>/dev/null", + "git mv sources/extra_files/* sources/ 2>/dev/null", + "git mv sources/app/* sources/ 2>/dev/null", + "git mv sources/patches patches/ 2>/dev/null", + "test -e conf/app.sh && git rm --quiet conf/app.src", + "test -e check_process && git rm --quiet check_process", + "test -e scripts/actions && git rm -rf --quiet scripts/actions", + "test -e config_panel.json && git rm --quiet config_panel.json", + "test -e config_panel.toml.example && git rm --quiet config_panel.toml.example", + "git rm $(find ./ -name .DS_Store) 2>/dev/null", + r"grep -q '\*\~' .gitignore 2>/dev/null || echo '*~' >> .gitignore", + r"grep -q '\*.sw\[op\]' .gitignore || echo '*.sw[op]' >> .gitignore", + r"grep -q '\.DS_Store' .gitignore || echo '.DS_Store' >> .gitignore", + "git add .gitignore", + ] + + for cmd in git_cmds: + os.system(cmd) + + # If there's a config panel but the only options are the stupid php usage/footprint stuff + if os.path.exists("config_panel.toml") and os.system(r"grep -oE '^\s*\[\S+\.\S+\.\S+]' config_panel.toml | grep -qv php_fpm_config") != 0: + os.system("git rm --quiet -f config_panel.toml") + os.system("git rm --quiet -f scripts/config") + + # Remove scripts/config if no config panel ... most of the time this is only the example config script :| + if os.path.exists("scripts/config") and not os.path.exists("config_panel.toml"): + os.system("git rm --quiet -f scripts/config") + + webapp_serving_raw_assets_probably = False + if os.path.exists("conf/nginx.conf"): + nginx_conf = open("conf/nginx.conf").read() + if "alias " in nginx_conf or "root " in nginx_conf: + webapp_serving_raw_assets_probably = True + + if os.path.isdir("patches"): + for file in os.listdir("patches"): + if "-" not in file: + continue + source_name, patch_name = file.split("-", 1) + if source_name == "app": + source_name = "main" + os.system(f"mkdir -p 'patches/{source_name}'") + os.system(f"git mv patches/{file} patches/{source_name}/{patch_name}") + + # Add helpers_version = '2.1' after yunohost requirement in manifest + raw_manifest = open("manifest.toml", "r").read() + if "helpers_version" not in raw_manifest: + raw_manifest = re.sub('(yunohost = .*)', '\\1\nhelpers_version = "2.1"', raw_manifest) + raw_manifest = re.sub(r'yunohost = ">= 11\..*"', 'yunohost = ">= 11.2.18"', raw_manifest) + if webapp_serving_raw_assets_probably: + raw_manifest = re.sub(r'( *)\[resources.install_dir\]', '\\1[resources.install_dir]\n\\1group = "www-data:r-x"', raw_manifest) + + open("manifest.toml", "w").write(raw_manifest) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + description="Attempt to automatically apply changes to use YunoHost helpers v2.1 on a v2 app" + ) + parser.add_argument("app_path", help="Path to the app to convert") + + args = parser.parse_args() + + if not os.path.exists(args.app_path + "/manifest.toml"): + raise Exception("There is no manifest.toml. Is this really an app directory ?") + + os.chdir(args.app_path) + + cleanup() From e0c947972f27a659ff2bfeb25c2c1f15efd80be4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 18:14:13 +0200 Subject: [PATCH 29/30] Format Python code with Black (#2478) Co-authored-by: alexAubin <4533074+alexAubin@users.noreply.github.com> --- tools/helpers2.1/convert_to_helpers_2.1.py | 236 ++++++++++++++++----- 1 file changed, 181 insertions(+), 55 deletions(-) diff --git a/tools/helpers2.1/convert_to_helpers_2.1.py b/tools/helpers2.1/convert_to_helpers_2.1.py index 73732e6e..041ca886 100644 --- a/tools/helpers2.1/convert_to_helpers_2.1.py +++ b/tools/helpers2.1/convert_to_helpers_2.1.py @@ -61,7 +61,10 @@ def cleanup(): (r"--manifest_key", "--key"), (r"COMMON VARIABLES\s*$", "COMMON VARIABLES AND CUSTOM HELPERS"), (r"ynh_string_random ([0-9])", "ynh_string_random --length=\\1"), - (r"ynh_backup_if_checksum_is_different --file=?", "ynh_backup_if_checksum_is_different "), + ( + r"ynh_backup_if_checksum_is_different --file=?", + "ynh_backup_if_checksum_is_different ", + ), (r"ynh_store_file_checksum --file=?", "ynh_store_file_checksum "), (r"ynh_delete_file_checksum --file=?", "ynh_delete_file_checksum "), (r"\[\[?.*PACKAGE_CHECK_EXEC.*eq.*1.*\]\]?", "ynh_in_ci_tests"), @@ -74,7 +77,10 @@ def cleanup(): (r"sources/patches", "patches"), (r"sources/extra_files/app", "sources"), (r"sources/extra_files", "sources"), - (r'((chmod|chown).*\"?\$install_dir\"?)\s*$', "#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | \\1"), + ( + r"((chmod|chown).*\"?\$install_dir\"?)\s*$", + "#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | \\1", + ), # Logging (r"ynh_print_err", "ynh_print_warn"), (r"ynh_exec_quiet ?", ""), @@ -92,17 +98,29 @@ def cleanup(): (r"ynh_render_template", "ynh_config_add --jinja"), (r"ynh_add_config", "ynh_config_add"), (r'--template="../conf/', '--template="'), - (r'ynh_replace_vars --file=', 'ynh_replace_vars '), - (r'ynh_replace_vars', '_ynh_replace_vars'), - (r'((chmod|chown)\s[^-+].*\"?(\$install_dir\"?/.*(config|.env|settings|credentials)\S*|\$data_dir\"?/\S+|/etc/(sudoers.d|cron.d|\$app)\"?/\S+|\$(config|cron_path)\"?))', "#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | \\1"), + (r"ynh_replace_vars --file=", "ynh_replace_vars "), + (r"ynh_replace_vars", "_ynh_replace_vars"), + ( + r"((chmod|chown)\s[^-+].*\"?(\$install_dir\"?/.*(config|.env|settings|credentials)\S*|\$data_dir\"?/\S+|/etc/(sudoers.d|cron.d|\$app)\"?/\S+|\$(config|cron_path)\"?))", + "#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | \\1", + ), # Upgrade stuff - (r"ynh_compare_current_package_version.*lt.*version\s?=?\"?([0-9\.]+~ynh[0-9])\"?", "ynh_app_upgrading_from_version_before \\1"), - (r"ynh_compare_current_package_version.*le.*version\s?=?\"?([0-9\.]+~ynh[0-9])\"?", "ynh_app_upgrading_from_version_before_or_equal_to \\1"), + ( + r"ynh_compare_current_package_version.*lt.*version\s?=?\"?([0-9\.]+~ynh[0-9])\"?", + "ynh_app_upgrading_from_version_before \\1", + ), + ( + r"ynh_compare_current_package_version.*le.*version\s?=?\"?([0-9\.]+~ynh[0-9])\"?", + "ynh_app_upgrading_from_version_before_or_equal_to \\1", + ), (r"upgrade_type=\S*", ""), - (r'if \[\s+"?\$upgrade_type"?\s+==\s+"?UPGRADE_APP"? \]', "# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed\nif ynh_app_upstream_version_changed"), + ( + r'if \[\s+"?\$upgrade_type"?\s+==\s+"?UPGRADE_APP"? \]', + "# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed\nif ynh_app_upstream_version_changed", + ), # Backup/store (r"ynh_restore\s*$", "ynh_restore_everything"), - # -> Specific trick to remove the --not_mandatory here, but replace it with || true for the other occurences + # -> Specific trick to remove the --not_mandatory here, but replace it with || true for the other occurences (r'ynh_restore_file --origin_path="\$data_dir" \S*', 'ynh_restore "$data_dir"'), (r"ynh_restore_file", "ynh_restore"), (r"--src_path=?", ""), @@ -120,8 +138,8 @@ def cleanup(): (r"ynh_psql_dump_db \S*\$db_name\"?\s", "ynh_psql_dump_db "), (r"ynh_mysql_connect_as [^<\\]*\s", "ynh_mysql_db_shell "), (r"ynh_psql_connect_as [^<\\]*\s", "ynh_psql_db_shell "), - (r'ynh_mysql_execute_as_root --sql=?', 'ynh_mysql_db_shell <<< '), - (r'ynh_psql_execute_as_root --sql=?', 'ynh_psql_db_shell <<< '), + (r"ynh_mysql_execute_as_root --sql=?", "ynh_mysql_db_shell <<< "), + (r"ynh_psql_execute_as_root --sql=?", "ynh_psql_db_shell <<< "), (r'ynh_mysql_execute_as_root "', 'ynh_mysql_db_shell <<< "'), (r'ynh_psql_execute_as_root "', 'ynh_psql_db_shell <<< "'), (r"ynh_mysql_execute_as_root '", "ynh_mysql_db_shell <<< '"), @@ -129,42 +147,93 @@ def cleanup(): (r"ynh_psql_execute_as_root --database=?", "ynh_psql_db_shell "), (r"ynh_mysql_execute_as_root --database=?", "ynh_psql_db_shell "), (r"--sql=", "<<< "), - (r'ynh_mysql_execute_file_as_root --database=\"?(\S+)\"? --file=\"?(\S+)\"?', 'ynh_mysql_db_shell "\\1" < "\\2"'), - (r'ynh_mysql_execute_file_as_root --file=\"?(\S+)\"? --database=\"?(\S+)\"?', 'ynh_mysql_db_shell "\\2" < "\\1"'), - (r'ynh_psql_execute_file_as_root --database=\"?(\S+)\"? --file=\"?(\S+)\"?', 'ynh_psql_db_shell "\\1" < "\\2"'), - (r'ynh_psql_execute_file_as_root --file=\"?(\S+)\"? --database=\"?(\S+)\"?', 'ynh_psql_db_shell "\\2" < "\\1"'), + ( + r"ynh_mysql_execute_file_as_root --database=\"?(\S+)\"? --file=\"?(\S+)\"?", + 'ynh_mysql_db_shell "\\1" < "\\2"', + ), + ( + r"ynh_mysql_execute_file_as_root --file=\"?(\S+)\"? --database=\"?(\S+)\"?", + 'ynh_mysql_db_shell "\\2" < "\\1"', + ), + ( + r"ynh_psql_execute_file_as_root --database=\"?(\S+)\"? --file=\"?(\S+)\"?", + 'ynh_psql_db_shell "\\1" < "\\2"', + ), + ( + r"ynh_psql_execute_file_as_root --file=\"?(\S+)\"? --database=\"?(\S+)\"?", + 'ynh_psql_db_shell "\\2" < "\\1"', + ), (r'sql_db_shell "?\$db_name"?', "sql_db_shell "), (r'--database="?\$db_name"?', ""), (r'--database="?\$app"?', ""), (r"ynh_mysql_setup_db", "# FIXMEhelpers2.1 ynh_mysql_create_db"), - (r"ynh_mysql_remove_db", "# FIXMEhelpers2.1 ynh_mysql_drop_db && ynh_mysql_drop_user"), + ( + r"ynh_mysql_remove_db", + "# FIXMEhelpers2.1 ynh_mysql_drop_db && ynh_mysql_drop_user", + ), (r"ynh_psql_setup_db", "# FIXMEhelpers2.1 ynh_psql_create_db"), - (r"ynh_psql_remove_db", "# FIXMEhelpers2.1 ynh_psql_drop_db && ynh_psql_drop_user"), + ( + r"ynh_psql_remove_db", + "# FIXMEhelpers2.1 ynh_psql_drop_db && ynh_psql_drop_user", + ), # PHP / composer (r" ?--phpversion=\S*", ""), (r" ?--composerversion=\S*", ""), (r" ?--usage=\S*", ""), (r" ?--footprint=\S*", ""), - (r"--group=www-data", "# FIXMEhelpers2.1 : --group=www-data to be replaced with php_group=www-data to be added in _common.sh"), + ( + r"--group=www-data", + "# FIXMEhelpers2.1 : --group=www-data to be replaced with php_group=www-data to be added in _common.sh", + ), (r"YNH_COMPOSER_VERSION=", "composer_version="), (r' --workdir="\$install_dir"', ""), - (r'--workdir=\$install_dir ', ""), - (r'--workdir', "# FIXMEhelpers2.1 (replace with composer_workdir=... prior to calling this helper, default is $intall_dir) --workdir"), - (r'phpversion', "php_version"), - (r'PHPVERSION', "PHP_VERSION"), + (r"--workdir=\$install_dir ", ""), + ( + r"--workdir", + "# FIXMEhelpers2.1 (replace with composer_workdir=... prior to calling this helper, default is $intall_dir) --workdir", + ), + (r"phpversion", "php_version"), + (r"PHPVERSION", "PHP_VERSION"), (r"ynh_add_fpm_config", "ynh_config_add_phpfpm"), (r"ynh_remove_fpm_config", "ynh_config_remove_phpfpm"), - (r"ynh_install_composer", "ynh_composer_install\nynh_composer_exec install --no-dev "), + ( + r"ynh_install_composer", + "ynh_composer_install\nynh_composer_exec install --no-dev ", + ), (r'--install_args="?([^"]+)"?(\s|$)', "\\1\\2"), (r'--commands="([^"]+)"(\s|$)', "\\1\\2"), - (r"(^fpm_usage=)", "#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | \\1"), - (r"(^.*\$fpm_usage)", "#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | \\1"), - (r"(^fpm_footprint=)", "#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | \\1"), - (r"(^.*\$fpm_footprint)", "#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | \\1"), - (r"(^set__fpm_footprint)", "#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | \\1"), - (r"(^fpm_free_footprint=)", "#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | \\1"), - (r"(^.*\$fpm_free_footprint)", "#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | \\1"), - (r"(^set__fpm_free_footprint)", "#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | \\1"), + ( + r"(^fpm_usage=)", + "#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | \\1", + ), + ( + r"(^.*\$fpm_usage)", + "#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | \\1", + ), + ( + r"(^fpm_footprint=)", + "#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | \\1", + ), + ( + r"(^.*\$fpm_footprint)", + "#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | \\1", + ), + ( + r"(^set__fpm_footprint)", + "#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | \\1", + ), + ( + r"(^fpm_free_footprint=)", + "#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | \\1", + ), + ( + r"(^.*\$fpm_free_footprint)", + "#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | \\1", + ), + ( + r"(^set__fpm_free_footprint)", + "#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | \\1", + ), # Nodejs (r'"?\$?ynh_node"?', "node"), (r"NODEJS_VERSION=", "nodejs_version="), @@ -175,11 +244,11 @@ def cleanup(): (r'"?\$ynh_node_load_PATH"?', ""), (r'"?\$ynh_node_load_path"?', ""), (r'"?\$?ynh_npm"?', "npm"), - (r'(export )?COREPACK_ENABLE_DOWNLOAD_PROMPT=0', ""), - (r'env\s+npm', "npm"), - (r'env\s+pnpm', "pnpm"), - (r'env\s+yarn', "yarn"), - (r'env\s+corepack', "corepack"), + (r"(export )?COREPACK_ENABLE_DOWNLOAD_PROMPT=0", ""), + (r"env\s+npm", "npm"), + (r"env\s+pnpm", "pnpm"), + (r"env\s+yarn", "yarn"), + (r"env\s+corepack", "corepack"), # Ruby (r'"?\$?ynh_ruby"?', "ruby"), (r'"?\$?ynh_gem"?', "gem"), @@ -207,7 +276,10 @@ def cleanup(): (r"--match_string", "--match"), (r"--replace_string", "--replace"), (r"--target_file", "--file"), - (r"(ynh_replace ('|\"))", "# FIXMEhelpers2.1: ynh_replace used with positional args. Please add the keywords: --match=, --replace=, --file=\n\\1"), + ( + r"(ynh_replace ('|\"))", + "# FIXMEhelpers2.1: ynh_replace used with positional args. Please add the keywords: --match=, --replace=, --file=\n\\1", + ), # Nginx (r"ynh_add_nginx_config", "ynh_config_add_nginx"), (r"ynh_remove_nginx_config", "ynh_config_remove_nginx"), @@ -228,12 +300,18 @@ def cleanup(): (r"--specific_user\S*", ""), (r"--logfile=?", ""), (r" ?--non-?append", ""), - (r'((chmod|chown).*\"?/var/log/\"?\$app)', "#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | \\1"), + ( + r"((chmod|chown).*\"?/var/log/\"?\$app)", + "#REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | \\1", + ), # Apt (r"ynh_package_is_installed (--package=)?", "_ynh_apt_package_is_installed"), (r"ynh_package_version (--package=)?", "_ynh_apt_package_version"), (r"ynh_package_install", "_ynh_apt_install"), - (r"ynh_install_extra_app_dependencies", "ynh_apt_install_dependencies_from_extra_repository"), + ( + r"ynh_install_extra_app_dependencies", + "ynh_apt_install_dependencies_from_extra_repository", + ), (r"ynh_install_app_dependencies", "ynh_apt_install_dependencies"), (r"ynh_remove_app_dependencies", "ynh_apt_remove_dependencies"), (r"ynh_package_autopurge", "_ynh_apt autoremove --purge"), @@ -244,18 +322,28 @@ def cleanup(): ("Modifying a config file...", "Updating configuration..."), ("Updating a configuration file...", "Updating configuration..."), ("Adding a configuration file...", "Adding $app's configuration..."), - ("Restoring the systemd configuration...", "Restoring $app's systemd service..."), + ( + "Restoring the systemd configuration...", + "Restoring $app's systemd service...", + ), ("Configuring a systemd service...", "Configuring $app's systemd service..."), ("Stopping a systemd service...", "Stopping $app's systemd service..."), ("Starting a systemd service...", "Starting $app's systemd service..."), # Recommend ynh_app_setting_set_default - (r"( *if \[.*-z.*:-}.*\].*\n?.*then\n\s+(\S+)=(.+)\n\s+ynh_app_setting_set.*\n\s*fi\n)", "# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=\\2 --value=\\3\n\\1"), + ( + r"( *if \[.*-z.*:-}.*\].*\n?.*then\n\s+(\S+)=(.+)\n\s+ynh_app_setting_set.*\n\s*fi\n)", + "# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=\\2 --value=\\3\n\\1", + ), # Trailing spaces (r"\s+$", "\n"), ] - replaces = [(re.compile(pattern, flags=re.M), replace) for pattern, replace in replaces] - comment_blocks_to_cleanup = [re.compile(pattern, flags=re.M) for pattern in comment_blocks_to_cleanup] + replaces = [ + (re.compile(pattern, flags=re.M), replace) for pattern, replace in replaces + ] + comment_blocks_to_cleanup = [ + re.compile(pattern, flags=re.M) for pattern in comment_blocks_to_cleanup + ] for s in [ "_common.sh", @@ -276,7 +364,11 @@ def cleanup(): content = open(script).read() if s == "remove": - content = re.sub(r'(ynh_secure_remove .*/var/log/\$app.*)', r"#REMOVEME? (Apps should not remove their log dir during remove ... this should only happen if --purge is used, and be handled by the core...) \1", content) + content = re.sub( + r"(ynh_secure_remove .*/var/log/\$app.*)", + r"#REMOVEME? (Apps should not remove their log dir during remove ... this should only happen if --purge is used, and be handled by the core...) \1", + content, + ) for pattern in comment_blocks_to_cleanup: content = pattern.sub("", content) @@ -289,7 +381,6 @@ def cleanup(): open(script, "w").write(content) - # Specific PHP FPM conf patch if os.path.exists("conf/extra_php-fpm.conf"): @@ -306,10 +397,20 @@ def cleanup(): content = re.sub(pattern_memory_limit, "", content) memory_limit = memory_limit[0] install = open("scripts/install").read() - install = re.sub("(source /usr/share/yunohost/helpers)", "\\1\n\nynh_app_setting_set --key=php_memory_limit --value=" + memory_limit, install) + install = re.sub( + "(source /usr/share/yunohost/helpers)", + "\\1\n\nynh_app_setting_set --key=php_memory_limit --value=" + + memory_limit, + install, + ) open("scripts/install", "w").write(install) upgrade = open("scripts/upgrade").read() - upgrade = re.sub("(source /usr/share/yunohost/helpers)", "\\1\n\nynh_app_setting_set_default --key=php_memory_limit --value=" + memory_limit, upgrade) + upgrade = re.sub( + "(source /usr/share/yunohost/helpers)", + "\\1\n\nynh_app_setting_set_default --key=php_memory_limit --value=" + + memory_limit, + upgrade, + ) open("scripts/upgrade", "w").write(upgrade) if upload_max_filesize: @@ -319,19 +420,30 @@ def cleanup(): upload_max_filesize = upload_max_filesize[0] if upload_max_filesize != "50M": install = open("scripts/install").read() - install = re.sub("(source /usr/share/yunohost/helpers)", "\\1\n\nynh_app_setting_set --key=php_upload_max_filesize --value=" + upload_max_filesize, install) + install = re.sub( + "(source /usr/share/yunohost/helpers)", + "\\1\n\nynh_app_setting_set --key=php_upload_max_filesize --value=" + + upload_max_filesize, + install, + ) open("scripts/install", "w").write(install) upgrade = open("scripts/upgrade").read() - upgrade = re.sub("(source /usr/share/yunohost/helpers)", "\\1\n\nynh_app_setting_set_default --key=php_upload_max_filesize --value=" + upload_max_filesize, upgrade) + upgrade = re.sub( + "(source /usr/share/yunohost/helpers)", + "\\1\n\nynh_app_setting_set_default --key=php_upload_max_filesize --value=" + + upload_max_filesize, + upgrade, + ) open("scripts/upgrade", "w").write(upgrade) - new_conf_is_empty = all(line.strip() == "" or line.strip()[0] == ";" for line in content.split("\n")) + new_conf_is_empty = all( + line.strip() == "" or line.strip()[0] == ";" for line in content.split("\n") + ) if new_conf_is_empty: os.system("git rm --quiet -f conf/extra_php-fpm.conf") else: open("conf/extra_php-fpm.conf", "w").write(content) - conf_replaces = [ (r"__NAME__", "__APP__"), (r"__NAMETOCHANGE__", "__APP__"), @@ -380,7 +492,13 @@ def cleanup(): os.system(cmd) # If there's a config panel but the only options are the stupid php usage/footprint stuff - if os.path.exists("config_panel.toml") and os.system(r"grep -oE '^\s*\[\S+\.\S+\.\S+]' config_panel.toml | grep -qv php_fpm_config") != 0: + if ( + os.path.exists("config_panel.toml") + and os.system( + r"grep -oE '^\s*\[\S+\.\S+\.\S+]' config_panel.toml | grep -qv php_fpm_config" + ) + != 0 + ): os.system("git rm --quiet -f config_panel.toml") os.system("git rm --quiet -f scripts/config") @@ -407,10 +525,18 @@ def cleanup(): # Add helpers_version = '2.1' after yunohost requirement in manifest raw_manifest = open("manifest.toml", "r").read() if "helpers_version" not in raw_manifest: - raw_manifest = re.sub('(yunohost = .*)', '\\1\nhelpers_version = "2.1"', raw_manifest) - raw_manifest = re.sub(r'yunohost = ">= 11\..*"', 'yunohost = ">= 11.2.18"', raw_manifest) + raw_manifest = re.sub( + "(yunohost = .*)", '\\1\nhelpers_version = "2.1"', raw_manifest + ) + raw_manifest = re.sub( + r'yunohost = ">= 11\..*"', 'yunohost = ">= 11.2.18"', raw_manifest + ) if webapp_serving_raw_assets_probably: - raw_manifest = re.sub(r'( *)\[resources.install_dir\]', '\\1[resources.install_dir]\n\\1group = "www-data:r-x"', raw_manifest) + raw_manifest = re.sub( + r"( *)\[resources.install_dir\]", + '\\1[resources.install_dir]\n\\1group = "www-data:r-x"', + raw_manifest, + ) open("manifest.toml", "w").write(raw_manifest) From a853d2629e3bdce8f2ea3354031db50b9e571f22 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 19 Jul 2024 17:00:22 +0000 Subject: [PATCH 30/30] Update app levels according to CI results --- apps.toml | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/apps.toml b/apps.toml index 0fcfaaef..8744ce9c 100644 --- a/apps.toml +++ b/apps.toml @@ -202,7 +202,7 @@ url = "https://github.com/YunoHost-Apps/backdrop_ynh" [baikal] added_date = 1674232499 # 2023/01/20 category = "synchronization" -level = 8 +level = 6 potential_alternative_to = [ "Microsoft Outlook" ] state = "working" subtags = [ "calendar", "contacts" ] @@ -368,7 +368,7 @@ url = "https://github.com/YunoHost-Apps/calibreweb_ynh" [castopod] added_date = 1674232499 # 2023/01/20 category = "multimedia" -level = 6 +level = 8 potential_alternative_to = [ "Anchor", "Apple Podcasts", "Audible", "Deezer", "SoundCloud", "Spotify" ] state = "working" url = "https://github.com/YunoHost-Apps/castopod_ynh" @@ -724,7 +724,7 @@ url = "https://github.com/YunoHost-Apps/diaspora_ynh" [digiscreen] added_date = 1674232499 # 2023/01/20 category = "wat" -level = 6 +level = 0 state = "working" url = "https://github.com/YunoHost-Apps/digiscreen_ynh" @@ -738,7 +738,7 @@ url = "https://github.com/YunoHost-Apps/digisteps_ynh" [digitools] added_date = 1674232499 # 2023/01/20 category = "small_utilities" -level = 8 +level = 0 state = "working" url = "https://github.com/YunoHost-Apps/digitools_ynh" @@ -810,7 +810,7 @@ url = "https://github.com/YunoHost-Apps/django-for-runners_ynh" [django-fritzconnection] added_date = 1674232499 # 2023/01/20 category = "system_tools" -level = 3 +level = 8 state = "working" subtags = [ "network" ] url = "https://github.com/YunoHost-Apps/django-fritzconnection_ynh" @@ -818,7 +818,7 @@ url = "https://github.com/YunoHost-Apps/django-fritzconnection_ynh" [django_example] added_date = 1674232499 # 2023/01/20 category = "dev" -level = 8 +level = 3 state = "working" subtags = [ "programming" ] url = "https://github.com/YunoHost-Apps/django_example_ynh" @@ -1290,7 +1290,7 @@ url = "https://github.com/YunoHost-Apps/gamja_ynh" [gancio] added_date = 1696575541 # 2023/10/06 category = "social_media" -level = 7 +level = 6 state = "working" subtags = [ "events" ] url = "https://github.com/YunoHost-Apps/gancio_ynh" @@ -1350,7 +1350,7 @@ url = "https://github.com/YunoHost-Apps/gitlab_ynh" [gitlab-runner] added_date = 1674232499 # 2023/01/20 category = "dev" -level = 8 +level = 6 state = "working" subtags = [ "forge" ] url = "https://github.com/YunoHost-Apps/gitlab-runner_ynh" @@ -1373,7 +1373,7 @@ url = "https://github.com/YunoHost-Apps/glance_ynh" [glitchsoc] added_date = 1674232499 # 2023/01/20 category = "social_media" -level = 6 +level = 8 state = "working" subtags = [ "microblogging" ] url = "https://github.com/YunoHost-Apps/glitchsoc_ynh" @@ -1431,7 +1431,7 @@ url = "https://github.com/YunoHost-Apps/gotosocial_ynh" [grafana] added_date = 1674232499 # 2023/01/20 category = "system_tools" -level = 8 +level = 1 state = "working" subtags = [ "monitoring" ] url = "https://github.com/YunoHost-Apps/grafana_ynh" @@ -1675,7 +1675,7 @@ url = "https://github.com/YunoHost-Apps/immich_ynh" [incus] added_date = 1710508401 # 2024/03/15 category = "system_tools" -level = 7 +level = 6 state = "working" url = "https://github.com/YunoHost-Apps/incus_ynh" @@ -1750,7 +1750,7 @@ added_date = 1674232499 # 2023/01/20 antifeatures = [ "deprecated-software", "package-not-maintained" ] category = "communication" deprecated_date = 1714590228 # 2024/05/01 -level = 7 +level = 6 state = "working" subtags = [ "chat" ] url = "https://github.com/YunoHost-Apps/jappix_ynh" @@ -1909,7 +1909,7 @@ url = "https://github.com/YunoHost-Apps/kodi_ynh" [koel] added_date = 1694978602 # 2023/09/17 category = "multimedia" -level = 6 +level = 7 potential_alternative_to = [ "Airsonic", "Deezer", "SoundCloud", "Spotify" ] state = "working" subtags = [ "music" ] @@ -1979,7 +1979,7 @@ url = "https://github.com/YunoHost-Apps/leed_ynh" [lemmy] added_date = 1674232499 # 2023/01/20 category = "social_media" -level = 8 +level = 0 potential_alternative_to = [ "Hacker News", "Lobste.rs", "Reddit" ] state = "working" url = "https://github.com/YunoHost-Apps/lemmy_ynh" @@ -2570,7 +2570,7 @@ url = "https://github.com/YunoHost-Apps/mytinytodo_ynh" added_date = 1674232499 # 2023/01/20 antifeatures = [ "not-totally-free-upstream" ] category = "iot" -level = 6 +level = 8 state = "working" url = "https://github.com/YunoHost-Apps/n8n_ynh" @@ -2652,7 +2652,7 @@ url = "https://github.com/YunoHost-Apps/nodered_ynh" [nomad] added_date = 1674232499 # 2023/01/20 category = "dev" -level = 8 +level = 6 state = "working" url = "https://github.com/YunoHost-Apps/nomad_ynh" @@ -2733,7 +2733,7 @@ added_date = 1674232499 # 2023/01/20 antifeatures = [ "deprecated-software" ] category = "office" deprecated_date = 1708403676 # 2024/02/20 -level = 7 +level = 6 state = "working" subtags = [ "text" ] url = "https://github.com/YunoHost-Apps/opennote_ynh" @@ -2824,7 +2824,7 @@ url = "https://github.com/YunoHost-Apps/owncast_ynh" [owncast-emojiwall] added_date = 1696593645 # 2023/10/06 category = "small_utilities" -level = 7 +level = 6 state = "working" url = "https://github.com/YunoHost-Apps/owncast-emojiwall_ynh" @@ -2891,7 +2891,7 @@ url = "https://github.com/YunoHost-Apps/peertube_ynh" added_date = 1674232499 # 2023/01/20 antifeatures = [ "not-totally-free-upstream" ] category = "social_media" -level = 7 +level = 8 state = "working" subtags = [ "videos" ] url = "https://github.com/YunoHost-Apps/peertube-search-index_ynh" @@ -3245,7 +3245,7 @@ url = "https://github.com/YunoHost-Apps/pufferpanel_ynh" [pydio] added_date = 1674232499 # 2023/01/20 category = "synchronization" -level = 8 +level = 6 potential_alternative_to = [ "Google Drive", "Microsoft OneDrive" ] state = "working" subtags = [ "files" ] @@ -3697,7 +3697,7 @@ url = "https://github.com/YunoHost-Apps/snappymail_ynh" [snipeit] added_date = 1674232499 # 2023/01/20 category = "productivity_and_management" -level = 6 +level = 8 state = "working" subtags = [ "business_and_ngos" ] url = "https://github.com/YunoHost-Apps/snipeit_ynh" @@ -4186,7 +4186,7 @@ url = "https://github.com/labriqueinternet/vpnclient_ynh" [wallabag2] added_date = 1674232499 # 2023/01/20 category = "reading" -level = 8 +level = 6 state = "working" url = "https://github.com/YunoHost-Apps/wallabag2_ynh"