1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

Merge pull request #1 from YunoHost/master

fetch
This commit is contained in:
Simon MELLERIN 2018-12-19 11:56:18 +01:00 committed by GitHub
commit a3e121cc13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 74 additions and 40 deletions

View file

@ -93,7 +93,7 @@
},
"borg": {
"branch": "master",
"level": 2,
"level": 7,
"revision": "HEAD",
"state": "working",
"url": "https://github.com/YunoHost-Apps/borg_ynh"
@ -127,6 +127,12 @@
"state": "working",
"url": "https://github.com/YunoHost-Apps/cachet_ynh"
},
"calibreweb": {
"branch": "master",
"revision": "HEAD",
"state": "inprogress",
"url": "https://github.com/YunoHost-Apps/calibre_ynh"
},
"cesium": {
"branch": "master",
"level": 3,
@ -200,8 +206,7 @@
},
"cowyo": {
"branch": "master",
"level": 2,
"revision": "0ce8a8c89a42f08f82667d7764851762db55557a",
"revision": "HEAD",
"state": "working",
"url": "https://github.com/YunoHost-Apps/cowyo_ynh"
},
@ -578,7 +583,7 @@
},
"halcyon": {
"branch": "master",
"level": 6,
"level": 0,
"revision": "HEAD",
"state": "working",
"url": "https://github.com/YunoHost-Apps/halcyon_ynh"
@ -771,6 +776,13 @@
"state": "notworking",
"url": "https://github.com/Yunohost-Apps/lektor_ynh"
},
"libreerp": {
"branch": "master",
"level": 0,
"revision": "HEAD",
"state": "working",
"url": "https://github.com/Yunohost-Apps/libreerp_ynh"
},
"libresonic": {
"branch": "master",
"level": 1,
@ -1053,13 +1065,6 @@
"state": "inprogress",
"url": "https://github.com/YunoHost-Apps/nodebb_ynh"
},
"odoo": {
"branch": "master",
"level": 0,
"revision": "HEAD",
"state": "inprogress",
"url": "https://github.com/Yunohost-Apps/odoo_ynh"
},
"ofbiz": {
"branch": "master",
"level": 0,
@ -1070,7 +1075,6 @@
},
"onlyoffice": {
"branch": "master",
"level": 3,
"revision": "9eee4dcb9f7602247981b4ba2a7ca7ab12634c26",
"state": "working",
"url": "https://github.com/YunoHost-Apps/onlyoffice_ynh"
@ -1203,6 +1207,7 @@
},
"pilea": {
"branch": "master",
"level": 2,
"revision": "3d09ad6f50ee55dde58c36adb5c369bf314d9edf",
"state": "working",
"url": "https://github.com/SimonMellerin/pilea_ynh/"
@ -1245,7 +1250,7 @@
},
"plume": {
"branch": "master",
"level": 3,
"level": 0,
"revision": "HEAD",
"state": "working",
"url": "https://github.com/YunoHost-Apps/plume_ynh"
@ -1399,7 +1404,7 @@
"branch": "master",
"level": 0,
"revision": "HEAD",
"state": "inprogress",
"state": "working",
"url": "https://github.com/YunoHost-apps/shsd_ynh"
},
"shuri": {
@ -1669,9 +1674,9 @@
},
"wekan": {
"branch": "master",
"level": 0,
"level": 3,
"revision": "HEAD",
"state": "inprogress",
"state": "working",
"url": "https://github.com/YunoHost-Apps/wekan_ynh"
},
"wemawema": {
@ -1737,12 +1742,6 @@
"revision": "795449cb43ccdba949c814746d6ea90eee0a7259",
"state": "working",
"url": "https://github.com/aymhce/yunohost_ynh"
},
"zabbix": {
"branch": "master",
"revision": "9386c5b2",
"state": "inprogress",
"url": "https://framagit.org/Mickael-Martin/zabbix_ynh"
},
"z-push": {
"branch": "master",
@ -1752,9 +1751,15 @@
"state": "working",
"url": "https://github.com/YunoHost-Apps/z-push_ynh"
},
"zabbix": {
"branch": "master",
"revision": "9386c5b2",
"state": "inprogress",
"url": "https://framagit.org/Mickael-Martin/zabbix_ynh"
},
"zeronet": {
"branch": "master",
"level": 2,
"level": 7,
"revision": "1a77591a8dffdc4bcfd297a9340e98e0e6775865",
"state": "working",
"url": "https://github.com/YunoHost-Apps/zeronet_ynh"

View file

@ -13,11 +13,6 @@ from dateutil.parser import parse
# Regular expression patterns
"""GitHub repository URL."""
re_github_repo = re.compile(
r'^(http[s]?|git)://github.com/(?P<owner>[\w\-_]+)/(?P<repo>[\w\-_]+)(.git)?'
)
re_commit_author = re.compile(
r'^author (?P<name>.+) <(?P<email>.+)> (?P<time>\d+) (?P<tz>[+-]\d+)$',
re.MULTILINE
@ -151,7 +146,18 @@ for app, info in apps_list.items():
app_level = info.get("level")
app_maintained = info.get("maintained", True)
github_repo = re_github_repo.match(app_url)
forge_site = app_url.split('/')[2]
owner = app_url.split('/')[3]
repo = app_url.split('/')[4]
if forge_site == "github.com":
forge_type = "github"
elif forge_site == "framagit.org":
forge_type = "gitlab"
elif forge_site == "code.ffdn.org":
forge_type = "gogs"
else:
forge_type = "unknown"
previous_state = already_built_file.get(app, {}).get("state", {})
manifest = {}
@ -162,14 +168,11 @@ for app, info in apps_list.items():
previous_level = already_built_file.get(app, {}).get("level")
previous_maintained = already_built_file.get(app, {}).get("maintained")
if github_repo and app_rev == "HEAD":
if forge_type == "github" and app_rev == "HEAD":
if previous_rev is None:
previous_rev = 'HEAD'
owner = github_repo.group('owner')
repo = github_repo.group('repo')
url = "https://api.github.com/repos/{}/{}/git/refs/heads/{}".format(owner, repo, app_branch)
head = get_json(url)
app_rev = head["object"]["sha"]
@ -206,7 +209,7 @@ for app, info in apps_list.items():
print("... but has changed of level, updating it from '%s' to '%s'" % (previous_level, app_level))
if previous_maintained != app_maintained:
result_dict[app]["maintained"] = app_maintained
print("... but maintained status changed, updatinng it from '%s' to '%s'" % (previous_maintained, app_maintained))
print("... but maintained status changed, updating it from '%s' to '%s'" % (previous_maintained, app_maintained))
print "update translations but don't download anything"
result_dict[app]['manifest'] = include_translations_in_manifest(app, result_dict[app]['manifest'])
@ -216,9 +219,7 @@ for app, info in apps_list.items():
print("Revision changed ! Updating...")
# Hosted on GitHub
if github_repo:
owner = github_repo.group('owner')
repo = github_repo.group('repo')
if forge_type == "github":
raw_url = 'https://raw.githubusercontent.com/%s/%s/%s/manifest.json' % (
owner, repo, app_rev
@ -239,8 +240,24 @@ for app, info in apps_list.items():
commit_date = parse(info2['commit']['author']['date'])
timestamp = int(time.mktime(commit_date.timetuple()))
# Git repository with HTTP/HTTPS (Gogs, GitLab, ...)
elif app_url.startswith('http'):
# Gitlab-type forge
elif forge_type == "gitlab":
raw_url = '%s/raw/%s/manifest.json' % (app_url, app_rev)
manifest = get_json(raw_url, verify=True)
if manifest is None:
continue
api_url = 'https://%s/api/v4/projects/%s%%2F%s/repository/commits/%s' % (forge_site, owner, repo, app_rev)
commit = get_json(api_url)
if commit is None:
continue
commit_date = parse(commit["authored_date"])
timestamp = int(time.mktime(commit_date.timetuple()))
# Gogs-type forge
elif forge_type == "gogs":
if not app_url.endswith('.git'):
app_url += ".git"
@ -284,6 +301,12 @@ for app, info in apps_list.items():
print("-> Error: unsupported VCS and/or protocol")
continue
if manifest["id"] != app or manifest["id"] != repo.replace("_ynh", ""):
print("Warning: IDs different between community.json, manifest and repo name")
print(" Manifest id : %s" % manifest["id"])
print(" Name in community json : %s" % app)
print(" Repo name : %s" % repo.replace("_ynh", ""))
try:
result_dict[manifest['id']] = {
'git': {

View file

@ -147,7 +147,7 @@
"couchpotato_manifest_description": "Automatic movie downloader",
"cowyo_manifest_arguments_install_domain": "Choose a domain name dedicated to cowyo",
"cowyo_manifest_arguments_install_is_public": "Is it a public application?",
"cowyo_manifest_description": "A feature-rich wiki webserver for minimalists, packaged for YunoHost",
"cowyo_manifest_description": "A feature-rich wiki webserver for minimalists.",
"cryptpad_manifest_arguments_install_domain": "Choose a domain name for CryptPad",
"cryptpad_manifest_arguments_install_is_public": "Is it a public site? ",
"cryptpad_manifest_arguments_install_path": "Choose a path for CryptPad, only / is allowed.",
@ -212,6 +212,7 @@
"dynette_manifest_description": "Dynette is a dyndns server",
"emailpoubelle_manifest_arguments_install_admin": "Choose an admin user for emailpoubelle",
"emailpoubelle_manifest_arguments_install_domain": "Choose a domain for emailpoubelle",
"emailpoubelle_manifest_arguments_install_password": "Enter a password to access the admin panel",
"emailpoubelle_manifest_arguments_install_path": "Choose a path for emailpoubelle",
"emailpoubelle_manifest_arguments_install_public_site": "Should this application be public ?",
"emailpoubelle_manifest_description": "Create throwable email address redirected to your real one",
@ -859,6 +860,11 @@
"pihole_manifest_arguments_install_path": "Choose a path for the admin interface of Pi-hole",
"pihole_manifest_arguments_install_query_logging": "Do you want to log queries ?",
"pihole_manifest_description": "Network-wide ad blocking via your own DNS server.",
"pilea_manifest_arguments_install_admin": "Choose the Pilea administrator",
"pilea_manifest_arguments_install_domain": "Choose a domain for Pilea",
"pilea_manifest_arguments_install_is_public": "Is it a public website?",
"pilea_manifest_arguments_install_path": "Choose a path for Pilea",
"pilea_manifest_description": "A little dashboard to analyse your electricity consumption data from Linky & weather",
"piratebox_manifest_arguments_install_domain": "Choose a domain for the web administration",
"piratebox_manifest_arguments_install_opt_chat": "Enable the chat? (yes/no)",
"piratebox_manifest_arguments_install_opt_deleting": "Can users delete files? (yes/no)",