10 Commits

Author SHA1 Message Date
3a4d499cf4 better handling of exceptions, again 2024-03-09 15:47:01 +01:00
c947fed756 find_deprecated: better handling of exceptions 2024-03-09 14:54:51 +01:00
1cf5e4f88b rest_api: deprecated sometimes isn't present? 2024-03-09 14:54:51 +01:00
c27a91206e Add find_deprecated github action 2024-03-09 14:54:51 +01:00
179b5f319a find_deprecated: Read the archived status of the upstream repository 2024-03-09 14:54:51 +01:00
1a685249cf Add a crappy script that finds deprecated apps
tl;dr, only working for github and gitlab upstreams, checks if the latest commit is more than 1 year old.
It also removes deprecated-software if required.
2024-03-09 14:54:51 +01:00
9a62a901db Flag a lot of apps as deprecated. Add an alternative in the wishlist. 2024-03-09 14:52:15 +01:00
48ca810d12 Merge pull request #2109 from YunoHost/OniriCorpe-patch-1
Readme: add alt text and edit 'antifeatures' and 'category' comments
2024-03-09 12:53:26 +01:00
31f92a1bd1 Readme: add alt text and edit 'antifeatures' and 'category' comments 2024-03-09 06:11:43 +01:00
68741582d0 Merge pull request #2105 from YunoHost/readme_generator_generic_lang_list
feat(readme_generator): don't hardcode the list of languages, extract it from the README templates
2024-03-08 21:08:48 +01:00
9 changed files with 245 additions and 152 deletions

30
.github/workflows/deprecated.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Find deprecated softwares
on:
schedule:
- cron: '0 20 * * 1'
jobs:
black:
name: Find deprecated softwares
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install toml python lib
run: |
pip3 install toml tomlkit gitpython
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Flag deprecated apps in the catalog"
commit-message: ":coffin: Flag deprecated apps in the catalog"
body: |
This was done with tools/find_deprecated.py
base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch
branch: actions/deprecated

View File

@ -1,6 +1,6 @@
# YunoHost application catalog # YunoHost application catalog
<img src="https://avatars.githubusercontent.com/u/1519495?s=200&v=4" width=80><img src="https://yunohost.org/user/images/yunohost_package.png" width=80> <img alt="YunoHost logo" src="https://avatars.githubusercontent.com/u/1519495?s=200&v=4" width=80><img alt="Package logo" src="https://yunohost.org/user/images/yunohost_package.png" width=80>
This repository contains the default YunoHost app catalog, as well as related This repository contains the default YunoHost app catalog, as well as related
tools that can be run manually or automatically. tools that can be run manually or automatically.
@ -16,7 +16,7 @@ them such as their category or maintenance state. This file is regularly read by
- You can browse [the contributor documentation](https://yunohost.org/contributordoc) - You can browse [the contributor documentation](https://yunohost.org/contributordoc)
- If you are not familiar with Git/GitHub, you can have a look at our [homemade guide](https://yunohost.org/packaging_apps_git) - If you are not familiar with Git/GitHub, you can have a look at our [homemade guide](https://yunohost.org/packaging_apps_git)
- Don't hesitate to reach for help on the dedicated [application packaging chatroom](https://yunohost.org/chat_rooms) ... we can even schedule an audio meeting to help you get started! - Don't hesitate to reach for help on the dedicated [application packaging chatroom](https://yunohost.org/chat_rooms)... we can even schedule an audio meeting to help you get started!
## How to add your app to the application catalog ## How to add your app to the application catalog
@ -46,9 +46,9 @@ App example addition:
```toml ```toml
[your_app] [your_app]
antifeatures = [ "deprecated-software" ] # Remove if no relevant antifeature applies antifeatures = [ "deprecated-software" ] # Replace with the appropriate category id found in antifeatures.toml, remove if no relevant antifeature applies
potential_alternative_to = [ "YouTube" ] # Indicate if your app can be thought of as an alternative to popular proprietary services (or remove if none applies) potential_alternative_to = [ "YouTube" ] # Indicate if your app can be thought of as an alternative to popular proprietary services (or remove if none applies)
category = "foobar" # Replace with the appropriate category id found in categories.toml category = "foobar" # Replace with the appropriate category id found in categories.toml, don't invent a category
state = "working" state = "working"
url = "https://github.com/YunoHost-Apps/your_app_ynh" url = "https://github.com/YunoHost-Apps/your_app_ynh"
``` ```

View File

@ -37,6 +37,7 @@ level = 6
state = "working" state = "working"
subtags = [ "microblogging", "pictures" ] subtags = [ "microblogging", "pictures" ]
url = "https://github.com/YunoHost-Apps/acropolis_ynh" url = "https://github.com/YunoHost-Apps/acropolis_ynh"
antifeatures = ["deprecated-software"]
[actual] [actual]
category = "productivity_and_management" category = "productivity_and_management"
@ -59,6 +60,7 @@ level = 8
state = "working" state = "working"
subtags = [ "db" ] subtags = [ "db" ]
url = "https://github.com/YunoHost-Apps/adminer_ynh" url = "https://github.com/YunoHost-Apps/adminer_ynh"
antifeatures = ["deprecated-software"]
[aeneria] [aeneria]
category = "iot" category = "iot"
@ -73,6 +75,7 @@ potential_alternative_to = [ "Google Agenda", "Microsoft Outlook" ]
state = "working" state = "working"
subtags = [ "calendar" ] subtags = [ "calendar" ]
url = "https://github.com/YunoHost-Apps/agendav_ynh" url = "https://github.com/YunoHost-Apps/agendav_ynh"
antifeatures = ["deprecated-software"]
[agora] [agora]
category = "wat" category = "wat"
@ -185,6 +188,7 @@ category = "iot"
level = 8 level = 8
state = "working" state = "working"
url = "https://github.com/YunoHost-Apps/beehive_ynh" url = "https://github.com/YunoHost-Apps/beehive_ynh"
antifeatures = ["deprecated-software"]
[biboumi] [biboumi]
category = "communication" category = "communication"
@ -199,6 +203,7 @@ level = 7
state = "working" state = "working"
subtags = [ "books" ] subtags = [ "books" ]
url = "https://github.com/YunoHost-Apps/bicbucstriim_ynh" url = "https://github.com/YunoHost-Apps/bicbucstriim_ynh"
antifeatures = ["deprecated-software"]
[blogotext] [blogotext]
category = "publishing" category = "publishing"
@ -207,6 +212,7 @@ potential_alternative_to = [ "Blogger", "Coldfusion", "Wix" ]
state = "working" state = "working"
subtags = [ "blog" ] subtags = [ "blog" ]
url = "https://github.com/YunoHost-Apps/blogotext_ynh" url = "https://github.com/YunoHost-Apps/blogotext_ynh"
antifeatures = ["deprecated-software"]
[bludit] [bludit]
category = "publishing" category = "publishing"
@ -331,6 +337,7 @@ category = "small_utilities"
level = 8 level = 8
state = "working" state = "working"
url = "https://github.com/YunoHost-Apps/cheky_ynh" url = "https://github.com/YunoHost-Apps/cheky_ynh"
antifeatures = ["deprecated-software"]
[chitchatter] [chitchatter]
category = "communication" category = "communication"
@ -434,6 +441,7 @@ potential_alternative_to = [ "Disqus" ]
state = "working" state = "working"
subtags = [ "website" ] subtags = [ "website" ]
url = "https://github.com/YunoHost-Apps/commento_ynh" url = "https://github.com/YunoHost-Apps/commento_ynh"
antifeatures = ["deprecated-software"]
[compteur_du_gase] [compteur_du_gase]
category = "office" category = "office"
@ -487,7 +495,7 @@ subtags = [ "db" ]
url = "https://github.com/YunoHost-Apps/couchdb_ynh" url = "https://github.com/YunoHost-Apps/couchdb_ynh"
[couchpotato] [couchpotato]
antifeatures = [ "package-not-maintained" ] antifeatures = [ "package-not-maintained", "deprecated-software" ]
category = "multimedia" category = "multimedia"
level = 0 level = 0
potential_alternative_to = [ "Netflix" ] potential_alternative_to = [ "Netflix" ]
@ -657,6 +665,7 @@ level = 6
state = "working" state = "working"
subtags = [ "pastebin" ] subtags = [ "pastebin" ]
url = "https://github.com/YunoHost-Apps/distbin_ynh" url = "https://github.com/YunoHost-Apps/distbin_ynh"
antifeatures = ["deprecated-software"]
[django-fmd] [django-fmd]
category = "iot" category = "iot"
@ -836,6 +845,7 @@ category = "small_utilities"
level = 8 level = 8
state = "working" state = "working"
url = "https://github.com/YunoHost-Apps/encryptor-decryptor_ynh" url = "https://github.com/YunoHost-Apps/encryptor-decryptor_ynh"
antifeatures = ["deprecated-software"]
[endi] [endi]
category = "productivity_and_management" category = "productivity_and_management"
@ -865,6 +875,7 @@ potential_alternative_to = [ "Google Sheets", "G Suite", "Microsoft Excel", "Off
state = "working" state = "working"
subtags = [ "spreadsheet" ] subtags = [ "spreadsheet" ]
url = "https://github.com/YunoHost-Apps/ethercalc_ynh" url = "https://github.com/YunoHost-Apps/ethercalc_ynh"
antifeatures = ["deprecated-software"]
[etherpad] [etherpad]
category = "office" category = "office"
@ -902,6 +913,7 @@ level = 8
state = "working" state = "working"
subtags = [ "monitoring" ] subtags = [ "monitoring" ]
url = "https://github.com/YunoHost-Apps/facette_ynh" url = "https://github.com/YunoHost-Apps/facette_ynh"
antifeatures = ["deprecated-software"]
[facilmap] [facilmap]
category = "productivity_and_management" category = "productivity_and_management"
@ -943,6 +955,7 @@ potential_alternative_to = [ "WeTransfer" ]
state = "working" state = "working"
subtags = [ "files" ] subtags = [ "files" ]
url = "https://github.com/YunoHost-Apps/filepizza_ynh" url = "https://github.com/YunoHost-Apps/filepizza_ynh"
antifeatures = ["deprecated-software"]
[firefish] [firefish]
category = "social_media" category = "social_media"
@ -1002,6 +1015,7 @@ potential_alternative_to = [ "Invision Community", "Vanilla", "vBulletin", "XenF
state = "working" state = "working"
subtags = [ "forum" ] subtags = [ "forum" ]
url = "https://github.com/YunoHost-Apps/fluxbb_ynh" url = "https://github.com/YunoHost-Apps/fluxbb_ynh"
antifeatures = ["deprecated-software"]
[focalboard] [focalboard]
category = "productivity_and_management" category = "productivity_and_management"
@ -1123,6 +1137,7 @@ level = 8
state = "working" state = "working"
subtags = [ "website", "blog" ] subtags = [ "website", "blog" ]
url = "https://github.com/YunoHost-Apps/getsimple_ynh" url = "https://github.com/YunoHost-Apps/getsimple_ynh"
antifeatures = ["deprecated-software"]
[ghost] [ghost]
antifeatures = [ "arbitrary-limitations" ] antifeatures = [ "arbitrary-limitations" ]
@ -1354,6 +1369,7 @@ category = "system_tools"
level = 7 level = 7
state = "working" state = "working"
url = "https://github.com/Yunohost-Apps/httpsh_ynh" url = "https://github.com/Yunohost-Apps/httpsh_ynh"
antifeatures = ["deprecated-software"]
[hubzilla] [hubzilla]
category = "social_media" category = "social_media"
@ -1442,7 +1458,6 @@ subtags = [ "videos" ]
url = "https://github.com/YunoHost-Apps/invidious_ynh" url = "https://github.com/YunoHost-Apps/invidious_ynh"
[invoiceninja] [invoiceninja]
antifeatures = [ "deprecated-software" ]
category = "productivity_and_management" category = "productivity_and_management"
level = 7 level = 7
state = "working" state = "working"
@ -1475,7 +1490,7 @@ state = "working"
url = "https://github.com/YunoHost-Apps/jackett_ynh" url = "https://github.com/YunoHost-Apps/jackett_ynh"
[jappix] [jappix]
antifeatures = [ "package-not-maintained" ] antifeatures = [ "package-not-maintained", "deprecated-software" ]
category = "communication" category = "communication"
level = 7 level = 7
state = "working" state = "working"
@ -1646,7 +1661,7 @@ subtags = [ "text" ]
url = "https://github.com/YunoHost-Apps/languagetool_ynh" url = "https://github.com/YunoHost-Apps/languagetool_ynh"
[laverna] [laverna]
antifeatures = [ "package-not-maintained" ] antifeatures = [ "package-not-maintained", "deprecated-software" ]
category = "office" category = "office"
level = 7 level = 7
state = "working" state = "working"
@ -1727,6 +1742,7 @@ level = 7
state = "working" state = "working"
subtags = [ "wiki" ] subtags = [ "wiki" ]
url = "https://github.com/YunoHost-Apps/libreto_ynh" url = "https://github.com/YunoHost-Apps/libreto_ynh"
antifeatures = ["deprecated-software"]
[libretranslate] [libretranslate]
category = "small_utilities" category = "small_utilities"
@ -1774,6 +1790,7 @@ level = 6
state = "working" state = "working"
subtags = [ "monitoring" ] subtags = [ "monitoring" ]
url = "https://github.com/YunoHost-Apps/linuxdash_ynh" url = "https://github.com/YunoHost-Apps/linuxdash_ynh"
antifeatures = ["deprecated-software"]
[lionwiki-t2t] [lionwiki-t2t]
category = "publishing" category = "publishing"
@ -1812,6 +1829,7 @@ potential_alternative_to = [ "Google Docs", "Microsoft Excel" ]
state = "working" state = "working"
subtags = [ "spreadsheet" ] subtags = [ "spreadsheet" ]
url = "https://github.com/YunoHost-Apps/luckysheet_ynh" url = "https://github.com/YunoHost-Apps/luckysheet_ynh"
antifeatures = ["deprecated-software"]
[lufi] [lufi]
category = "synchronization" category = "synchronization"
@ -1986,6 +2004,7 @@ level = 8
state = "working" state = "working"
subtags = [ "chat" ] subtags = [ "chat" ]
url = "https://github.com/YunoHost-Apps/minchat_ynh" url = "https://github.com/YunoHost-Apps/minchat_ynh"
antifeatures = ["deprecated-software"]
[mindmaps] [mindmaps]
category = "office" category = "office"
@ -1993,6 +2012,7 @@ level = 8
state = "working" state = "working"
subtags = [ "mindmap" ] subtags = [ "mindmap" ]
url = "https://github.com/YunoHost-Apps/mindmaps_ynh" url = "https://github.com/YunoHost-Apps/mindmaps_ynh"
antifeatures = ["deprecated-software"]
[minetest] [minetest]
category = "games" category = "games"
@ -2006,6 +2026,7 @@ category = "publishing"
level = 8 level = 8
state = "working" state = "working"
url = "https://github.com/YunoHost-Apps/mineweb_ynh" url = "https://github.com/YunoHost-Apps/mineweb_ynh"
antifeatures = ["deprecated-software"]
[minidlna] [minidlna]
category = "multimedia" category = "multimedia"
@ -2118,6 +2139,7 @@ level = 8
state = "working" state = "working"
subtags = [ "meeting" ] subtags = [ "meeting" ]
url = "https://github.com/YunoHost-Apps/mumble-web_ynh" url = "https://github.com/YunoHost-Apps/mumble-web_ynh"
antifeatures = ["deprecated-software"]
[mumbleserver] [mumbleserver]
category = "communication" category = "communication"
@ -2353,6 +2375,7 @@ category = "wat"
level = 8 level = 8
state = "working" state = "working"
url = "https://github.com/YunoHost-Apps/osjs_ynh" url = "https://github.com/YunoHost-Apps/osjs_ynh"
antifeatures = ["deprecated-software"]
[osticket] [osticket]
category = "productivity_and_management" category = "productivity_and_management"
@ -2590,6 +2613,7 @@ level = 8
state = "working" state = "working"
subtags = [ "website", "blog" ] subtags = [ "website", "blog" ]
url = "https://github.com/YunoHost-Apps/pico_ynh" url = "https://github.com/YunoHost-Apps/pico_ynh"
antifeatures = ["deprecated-software"]
[pihole] [pihole]
category = "system_tools" category = "system_tools"
@ -3035,6 +3059,7 @@ category = "system_tools"
level = 6 level = 6
state = "working" state = "working"
url = "https://github.com/YunoHost-Apps/shellinabox_ynh" url = "https://github.com/YunoHost-Apps/shellinabox_ynh"
antifeatures = ["deprecated-software"]
[shiori] [shiori]
category = "small_utilities" category = "small_utilities"
@ -3057,6 +3082,7 @@ potential_alternative_to = [ "bitly" ]
state = "working" state = "working"
subtags = [ "url_shortener" ] subtags = [ "url_shortener" ]
url = "https://github.com/YunoHost-Apps/shuri_ynh" url = "https://github.com/YunoHost-Apps/shuri_ynh"
antifeatures = ["deprecated-software"]
[signaturepdf] [signaturepdf]
category = "small_utilities" category = "small_utilities"
@ -3069,12 +3095,14 @@ category = "small_utilities"
level = 6 level = 6
state = "working" state = "working"
url = "https://github.com/YunoHost-Apps/simple-file-manager_ynh" url = "https://github.com/YunoHost-Apps/simple-file-manager_ynh"
antifeatures = ["deprecated-software"]
[simple-hash-generator] [simple-hash-generator]
category = "small_utilities" category = "small_utilities"
level = 8 level = 8
state = "working" state = "working"
url = "https://github.com/YunoHost-Apps/simple-hash-generator_ynh" url = "https://github.com/YunoHost-Apps/simple-hash-generator_ynh"
antifeatures = ["deprecated-software"]
[simple-torrent] [simple-torrent]
antifeatures = [ "deprecated-software" ] antifeatures = [ "deprecated-software" ]
@ -3092,7 +3120,7 @@ subtags = [ "chat" ]
url = "https://github.com/YunoHost-Apps/simplex_ynh" url = "https://github.com/YunoHost-Apps/simplex_ynh"
[simplytranslate] [simplytranslate]
antifeatures = [ "non-free-network" ] antifeatures = [ "non-free-network", "deprecated-software" ]
category = "small_utilities" category = "small_utilities"
level = 7 level = 7
state = "working" state = "working"
@ -3104,6 +3132,7 @@ level = 8
state = "working" state = "working"
subtags = [ "website" ] subtags = [ "website" ]
url = "https://github.com/YunoHost-Apps/sitemagiccms_ynh" url = "https://github.com/YunoHost-Apps/sitemagiccms_ynh"
antifeatures = ["deprecated-software"]
[slingcode] [slingcode]
category = "dev" category = "dev"
@ -3111,6 +3140,7 @@ level = 8
state = "working" state = "working"
subtags = [ "programming" ] subtags = [ "programming" ]
url = "https://github.com/YunoHost-Apps/slingcode_ynh" url = "https://github.com/YunoHost-Apps/slingcode_ynh"
antifeatures = ["deprecated-software"]
[snappymail] [snappymail]
category = "communication" category = "communication"
@ -3199,6 +3229,7 @@ category = "system_tools"
level = 8 level = 8
state = "working" state = "working"
url = "https://github.com/YunoHost-Apps/ssh_chroot_dir_ynh" url = "https://github.com/YunoHost-Apps/ssh_chroot_dir_ynh"
antifeatures = ["deprecated-software"]
[statpingng] [statpingng]
category = "system_tools" category = "system_tools"
@ -3228,6 +3259,7 @@ potential_alternative_to = [ "Google Slides", "Office 365", "Prezi", "SoZi" ]
state = "working" state = "working"
subtags = [ "impress" ] subtags = [ "impress" ]
url = "https://github.com/YunoHost-Apps/strut_ynh" url = "https://github.com/YunoHost-Apps/strut_ynh"
antifeatures = ["deprecated-software"]
[superset] [superset]
category = "wat" category = "wat"
@ -3284,7 +3316,7 @@ state = "working"
url = "https://github.com/YunoHost-Apps/tandoor_ynh" url = "https://github.com/YunoHost-Apps/tandoor_ynh"
[taskboard] [taskboard]
antifeatures = [ "package-not-maintained" ] antifeatures = [ "package-not-maintained", "deprecated-software" ]
category = "productivity_and_management" category = "productivity_and_management"
level = 7 level = 7
potential_alternative_to = [ "Trello" ] potential_alternative_to = [ "Trello" ]
@ -3470,6 +3502,7 @@ level = 8
state = "working" state = "working"
subtags = [ "task" ] subtags = [ "task" ]
url = "https://github.com/YunoHost-Apps/tyto_ynh" url = "https://github.com/YunoHost-Apps/tyto_ynh"
antifeatures = ["deprecated-software"]
[ulogger] [ulogger]
category = "small_utilities" category = "small_utilities"
@ -3755,6 +3788,7 @@ level = 6
potential_alternative_to = [ "Mullvad" ] potential_alternative_to = [ "Mullvad" ]
state = "working" state = "working"
url = "https://github.com/YunoHost-Apps/zeronet_ynh" url = "https://github.com/YunoHost-Apps/zeronet_ynh"
antifeatures = ["deprecated-software"]
[zerotier] [zerotier]
antifeatures = [ "not-totally-free-upstream", "non-free-network" ] antifeatures = [ "not-totally-free-upstream", "non-free-network" ]

View File

@ -40,6 +40,10 @@ class GithubAPI:
"""Get a list of releases for project.""" """Get a list of releases for project."""
return self.internal_api(f"repos/{self.upstream_repo}/releases") return self.internal_api(f"repos/{self.upstream_repo}/releases")
def archived(self) -> bool:
"""Return the archival status for the repository"""
return self.internal_api(f"repos/{self.upstream_repo}")["archived"]
def url_for_ref(self, ref: str, ref_type: RefType) -> str: def url_for_ref(self, ref: str, ref_type: RefType) -> str:
"""Get a URL for a ref.""" """Get a URL for a ref."""
if ref_type == RefType.tags: if ref_type == RefType.tags:
@ -53,6 +57,7 @@ class GithubAPI:
class GitlabAPI: class GitlabAPI:
def __init__(self, upstream: str): def __init__(self, upstream: str):
# Find gitlab api root... # Find gitlab api root...
upstream = upstream.rstrip("/")
self.forge_root = self.get_forge_root(upstream).rstrip("/") self.forge_root = self.get_forge_root(upstream).rstrip("/")
self.project_path = upstream.replace(self.forge_root, "").lstrip("/") self.project_path = upstream.replace(self.forge_root, "").lstrip("/")
self.project_id = self.find_project_id(self.project_path) self.project_id = self.find_project_id(self.project_path)
@ -128,6 +133,10 @@ class GitlabAPI:
return retval return retval
def archived(self) -> bool:
"""Return the archival status for the repository"""
return self.internal_api(f"projects/{self.project_id}").get("archived", False)
def url_for_ref(self, ref: str, ref_type: RefType) -> str: def url_for_ref(self, ref: str, ref_type: RefType) -> str:
name = self.project_path.split("/")[-1] name = self.project_path.split("/")[-1]
clean_ref = ref.replace("/", "-") clean_ref = ref.replace("/", "-")
@ -166,6 +175,10 @@ class GiteaForgejoAPI:
"""Get a list of releases for project.""" """Get a list of releases for project."""
return self.internal_api(f"repos/{self.project_path}/releases") return self.internal_api(f"repos/{self.project_path}/releases")
def archived(self) -> bool:
"""Return the archival status for the repository"""
return self.internal_api(f"repos/{self.project_path}")["archived"]
def url_for_ref(self, ref: str, ref_type: RefType) -> str: def url_for_ref(self, ref: str, ref_type: RefType) -> str:
"""Get a URL for a ref.""" """Get a URL for a ref."""
return f"{self.forge_root}/{self.project_path}/archive/{ref}.tar.gz" return f"{self.forge_root}/{self.project_path}/archive/{ref}.tar.gz"

152
tools/find_deprecated.py Executable file
View File

@ -0,0 +1,152 @@
#!/usr/bin/env python3
import traceback
import argparse
import tomlkit
import multiprocessing
import datetime
import json
import sys
from functools import cache
import logging
from pathlib import Path
from typing import Optional
import toml
import tqdm
import github
# add apps/tools to sys.path
sys.path.insert(0, str(Path(__file__).parent.parent))
from appslib.utils import REPO_APPS_ROOT, get_catalog # noqa: E402 pylint: disable=import-error,wrong-import-position
from app_caches import app_cache_folder # noqa: E402 pylint: disable=import-error,wrong-import-position
from autoupdate_app_sources.rest_api import GithubAPI, GitlabAPI, GiteaForgejoAPI, RefType # noqa: E402,E501 pylint: disable=import-error,wrong-import-position
@cache
def get_github() -> tuple[Optional[tuple[str, str]], Optional[github.Github], Optional[github.InputGitAuthor]]:
try:
github_login = (REPO_APPS_ROOT / ".github_login").open("r", encoding="utf-8").read().strip()
github_token = (REPO_APPS_ROOT / ".github_token").open("r", encoding="utf-8").read().strip()
github_email = (REPO_APPS_ROOT / ".github_email").open("r", encoding="utf-8").read().strip()
auth = (github_login, github_token)
github_api = github.Github(github_token)
author = github.InputGitAuthor(github_login, github_email)
return auth, github_api, author
except Exception as e:
logging.warning(f"Could not get github: {e}")
return None, None, None
def upstream_last_update_ago(app: str) -> tuple[str, int | None]:
manifest_toml = app_cache_folder(app) / "manifest.toml"
manifest_json = app_cache_folder(app) / "manifest.json"
if manifest_toml.exists():
manifest = toml.load(manifest_toml.open("r", encoding="utf-8"))
upstream = manifest.get("upstream", {}).get("code")
elif manifest_json.exists():
manifest = json.load(manifest_json.open("r", encoding="utf-8"))
upstream = manifest.get("upstream", {}).get("code")
else:
raise RuntimeError(f"App {app} doesn't have a manifest!")
if upstream is None:
raise RuntimeError(f"App {app} doesn't have an upstream code link!")
api = None
try:
if upstream.startswith("https://github.com/"):
try:
api = GithubAPI(upstream, auth=get_github()[0])
except AssertionError as e:
logging.error(f"Exception while handling {app}: {e}")
return app, None
if upstream.startswith("https://gitlab.") or upstream.startswith("https://framagit.org"):
api = GitlabAPI(upstream)
if upstream.startswith("https://codeberg.org"):
api = GiteaForgejoAPI(upstream)
if not api:
autoupdate = manifest.get("resources", {}).get("sources", {}).get("main", {}).get("autoupdate")
if autoupdate:
strat = autoupdate["strategy"]
if "gitea" in strat or "forgejo" in strat:
api = GiteaForgejoAPI(upstream)
if api:
if api.archived():
# A stupid value that we know to be higher than the trigger value
return app, 1000
last_commit = api.commits()[0]
date = last_commit["commit"]["author"]["date"]
date = datetime.datetime.fromisoformat(date)
ago: datetime.timedelta = datetime.datetime.now() - date.replace(tzinfo=None)
return app, ago.days
except Exception:
logging.error(f"Exception while handling {app}", traceback.format_exc())
raise
raise RuntimeError(f"App {app} not handled (not github, gitlab or gitea with autoupdate). Upstream is {upstream}")
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("apps", nargs="*", type=str,
help="If not passed, the script will run on the catalog. Github keys required.")
parser.add_argument("-j", "--processes", type=int, default=multiprocessing.cpu_count())
args = parser.parse_args()
apps_dict = get_catalog()
if args.apps:
apps_dict = {app: info for app, info in apps_dict.items() if app in args.apps}
deprecated: list[str] = []
not_deprecated: list[str] = []
# for app, info in apps_dict.items():
with multiprocessing.Pool(processes=args.processes) as pool:
tasks = pool.imap_unordered(upstream_last_update_ago, apps_dict.keys())
for _ in tqdm.tqdm(range(len(apps_dict)), ascii=" ·#"):
try:
app, result = next(tasks)
except Exception as e:
print(f"Exception found: {e}")
continue
if result is None:
continue
if result > 365:
deprecated.append(app)
else:
not_deprecated.append(app)
catalog = tomlkit.load(open("apps.toml"))
for app, info in catalog.items():
antifeatures = info.get("antifeatures", [])
if app in deprecated:
if "deprecated-software" not in antifeatures:
antifeatures.append("deprecated-software")
elif app in not_deprecated:
if "deprecated-software" in antifeatures:
antifeatures.remove("deprecated-software")
else:
continue
# unique the keys
if antifeatures:
info["antifeatures"] = antifeatures
else:
if "antifeatures" in info.keys():
info.pop("antifeatures")
tomlkit.dump(catalog, open("apps.toml", "w"))
if __name__ == "__main__":
main()

View File

@ -1,60 +0,0 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/readme_generator
It shall NOT be edited by hand.
-->
# GoToSocial for YunoHost
[![Integration level](https://dash.yunohost.org/integration/gotosocial.svg)](https://dash.yunohost.org/appci/app/gotosocial) ![Working status](https://ci-apps.yunohost.org/ci/badges/gotosocial.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/gotosocial.maintain.svg)
[![Install GoToSocial with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gotosocial)
*[Lire ce readme en français.](./README_fr.md)*
> *This package allows you to install GoToSocial quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview
GoToSocial is a fast [ActivityPub](https://activitypub.rocks/) social network server, written in Golang.
With GoToSocial, you can keep in touch with your friends, post, read, and share images and articles. All without being tracked or advertised to!
The official documentation is at [docs.gotosocial.org](https://docs.gotosocial.org).
The documentation for this YunoHost package [can be read here](./doc/DOCS.md) and the admin is **strongly encouraged to read it**!
Please note that this package uses the ["i'm so tired" software license 1.0](https://github.com/YunoHost-Apps/gotosocial_ynh/blob/master/LICENSE), please read it and accept it before proceeding with installation.
**Shipped version:** 0.13.3~ynh1
## Screenshots
![Screenshot of GoToSocial](./doc/screenshots/screenshot.png)
## :red_circle: Antifeatures
- **Alpha software**: Early development stage. May contain changing or unstable features, bugs, and security vulnerability.
- **Not totally free package**: The YunoHost package of this app is under an overall free licence, but with clauses that restrict its use.
## Documentation and resources
- Official app website: <https://gotosocial.org/>
- Official user documentation: <https://docs.gotosocial.org/en/latest/>
- Official admin documentation: <https://docs.gotosocial.org/en/latest/>
- Upstream app code repository: <https://github.com/superseriousbusiness/gotosocial>
- YunoHost Store: <https://apps.yunohost.org/app/gotosocial>
- Report a bug: <https://github.com/YunoHost-Apps/gotosocial_ynh/issues>
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/gotosocial_ynh/tree/testing).
To try the testing branch, please proceed like that.
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/gotosocial_ynh/tree/testing --debug
or
sudo yunohost app upgrade gotosocial -u https://github.com/YunoHost-Apps/gotosocial_ynh/tree/testing --debug
```
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View File

@ -1,60 +0,0 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/readme_generator
It shall NOT be edited by hand.
-->
# GoToSocial pour YunoHost
[![Niveau dintégration](https://dash.yunohost.org/integration/gotosocial.svg)](https://dash.yunohost.org/appci/app/gotosocial) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/gotosocial.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/gotosocial.maintain.svg)
[![Installer GoToSocial avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gotosocial)
*[Read this readme in english.](./README.md)*
> *Ce package vous permet dinstaller GoToSocial rapidement et simplement sur un serveur YunoHost.
Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment linstaller et en profiter.*
## Vue densemble
Un serveur de réseau social véloce basé sur [ActivityPub](https://activitypub.rocks/) écrit en Golang.
Avec GoToSocial, vous pouvez rester en contact avec vos amis, publier, lire et partager des images et des articles. Tout cela sans être pisté ni subir de publicité !
Vous pouvez consulter la documentation officielle à l'adresse : [docs.gotosocial.org](https://docs.gotosocial.org).
La documentation de ce paquet YunoHost [est lisible ici](./doc/DOCS_fr.md) et l'admin est **vivement encouragé-e à la lire** !
Veuillez noter que ce paquet utilise la ["i'm so tired" software license 1.0](https://github.com/YunoHost-Apps/gotosocial_ynh/blob/master/LICENSE), veuillez la lire et l'accepter avant de procéder à l'installation.
**Version incluse :** 0.13.3~ynh1
## Captures décran
![Capture décran de GoToSocial](./doc/screenshots/screenshot.png)
## :red_circle: Anti-fonctionnalités
- **Logiciel en version alpha** : Le logiciel est au tout début de son développement. Il pourrait contenir des fonctionnalités changeantes ou instables, des bugs, et des failles de sécurité.
- **Package sous licence libre restreinte** : Le package YunoHost de cette application est sous une licence globalement libre, mais avec des clauses qui pourraient restreindre son utilisation.
## Documentations et ressources
- Site officiel de lapp : <https://gotosocial.org/>
- Documentation officielle utilisateur : <https://docs.gotosocial.org/en/latest/>
- Documentation officielle de ladmin : <https://docs.gotosocial.org/en/latest/>
- Dépôt de code officiel de lapp : <https://github.com/superseriousbusiness/gotosocial>
- YunoHost Store : <https://apps.yunohost.org/app/gotosocial>
- Signaler un bug : <https://github.com/YunoHost-Apps/gotosocial_ynh/issues>
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/gotosocial_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/gotosocial_ynh/tree/testing --debug
ou
sudo yunohost app upgrade gotosocial -u https://github.com/YunoHost-Apps/gotosocial_ynh/tree/testing --debug
```
**Plus dinfos sur le packaging dapplications :** <https://yunohost.org/packaging_apps>

View File

@ -1,22 +0,0 @@
import os
import subprocess
CWD = os.path.split(os.path.realpath(__file__))[0]
COMMIT_ID = "8f788213b363a46a5b6faa8f844d86d4adac9446"
DIRECTORY = CWD + "/gotosocial_ynh"
def test_running_make_readme():
subprocess.check_call(["rm", "-rf", DIRECTORY])
subprocess.check_call(["git", "clone", "https://github.com/yunohost-apps/gotosocial_ynh", DIRECTORY, "-q"])
subprocess.check_call(["git", "checkout", COMMIT_ID, "-q"], cwd=DIRECTORY)
print(CWD)
subprocess.check_call([CWD + "/../make_readme.py", DIRECTORY])
assert open(CWD + "/README.md").read() == open(DIRECTORY + "/README.md").read()
assert open(CWD + "/README_fr.md").read() == open(DIRECTORY + "/README_fr.md").read()
if __name__ == '__main__':
test_running_make_readme()

View File

@ -1711,6 +1711,12 @@ upstream = ""
website = "https://umap.openstreetmap.fr/" website = "https://umap.openstreetmap.fr/"
draft = "https://github.com/YunoHost-Apps/umap_ynh" draft = "https://github.com/YunoHost-Apps/umap_ynh"
[univer]
name = "Univer"
description = "Replacement of Luckysheet (deprecated, in yunohost packages)"
upstream = "https://github.com/dream-num/univer"
website = "https://univer.ai/"
[upmpdcli] [upmpdcli]
name = "upmpdcli" name = "upmpdcli"
description = "" description = ""