meta-bug pour repositories sans licenses #19

Open
opened 2024-02-17 00:12:17 +01:00 by neox · 0 comments
Owner

Notes : il faut actualiser les liens

En regardant de plus près on à beaucoup de repositories sans license.

On a au moins les projets suivants:

J'ai généré cette liste avec ce code python:

#!/usr/bin/env python3
# Copyright (C) 2022 Denis 'GNUtoo' Carikli
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

import os
import sys

import bs4
import curl
import gitlab

def check_instance(config_section):
    # results = {} # url : license

    config = gitlab.config.GitlabConfigParser(config_section)
    instance = gitlab.Gitlab(config.url)

    public_projects = instance.projects.list(get_all=True)
    for project in public_projects:
        # results[project.web_url] = None
        page = curl.Curl(project.web_url)
        html = page.get()
        soup = bs4.BeautifulSoup(html, 'html.parser')
        found_approximate_license = False
        for link in soup.find_all('a'):
            if link.has_attr('itemprop'):
                # results[project.web_url] = config.url + link['href']
                # print("{} {}".format(project.web_url, config.url + link['href']))
                found_approximate_license = True
        if not found_approximate_license:
            print("* {}".format(project.web_url))

    # for k, v in results:
    #     print("{}: {}".format(k, v))
    
if __name__ == '__main__':
    check_instance('alec')

Et cette configuration dans /etc/python-gitlab.cfg:

[global]
default = alec
ssl_verify = true
timeout = 5

[alec]
url = https://git.a-lec.org
private_token = aAbBcC`

Pour faire tourner ça:

  • Il faut créer un token dans https://git.a-lec.org/-/profile/personal_access_tokens (dans mon cas j'ai donné tous les accès au token plur faire plus simple)
  • mettre le token dans le fichier de config dans private_token
  • installer python3, python-beautifulsoup4, python-gitlab, python-pycurl

edit1: clarification d'ou va la config.

Originally posted by @neox (in fact @gnutoo) in cominfra/git#15 (comment)

**Notes : il faut actualiser les liens** En regardant de plus près on à beaucoup de repositories sans license. On a au moins les projets suivants: * https://git.a-lec.org/a-lec/commissions/chalec/status * https://git.a-lec.org/human-geek/www * https://git.a-lec.org/odile/gestion-de-commission * https://git.a-lec.org/odile/www * https://git.a-lec.org/a-lec/commissions/communication/campagnes/actus-alec * https://git.a-lec.org/a-lec/commissions/communication/campagnes/campagne-retroactu * https://git.a-lec.org/julian/rateyourmusic.com-4.7-rated-tracks * https://git.a-lec.org/human-geek/stats * https://git.a-lec.org/a-lec/commissions/communication/supports-publicitaires/autocollants * https://git.a-lec.org/a-lec/commissions/communication/supports-publicitaires/depliant-chalec * https://git.a-lec.org/a-lec/commissions/communication/supports-publicitaires/mini-affichette-chalec * https://git.a-lec.org/a-lec/commissions/communication/supports-publicitaires/mini-affichette-alec * https://git.a-lec.org/a-lec/commissions/communication/supports-publicitaires/cubafiche * https://git.a-lec.org/a-lec/commissions/infrastructure/adhesion.a-lec.org * https://git.a-lec.org/a-lec/commissions/infrastructure/don.a-lec.org * https://git.a-lec.org/a-lec/commissions/communication/gestion-de-commission * https://git.a-lec.org/a-lec/commissions/chalec/www * https://git.a-lec.org/a-lec/commissions/chalec/petition * https://git.a-lec.org/echolib/bash-tools * https://git.a-lec.org/neox/fpga * https://git.a-lec.org/a-lec/commissions/chalec/stats * https://git.a-lec.org/a-lec/commissions/chalec/pad * https://git.a-lec.org/a-lec/commissions/chalec/identite-visuelle * https://git.a-lec.org/a-lec/commissions/infrastructure/isengard * https://git.a-lec.org/a-lec/commissions/chalec/libreverse * https://git.a-lec.org/a-lec/commissions/chalec/video * https://git.a-lec.org/a-lec/commissions/chalec/visio * https://git.a-lec.org/a-lec/commissions/chalec/sondage * https://git.a-lec.org/a-lec/commissions/chalec/ctrlv * https://git.a-lec.org/a-lec/commissions/chalec/audio * https://git.a-lec.org/a-lec/commissions/chalec/forge * https://git.a-lec.org/a-lec/commissions/chalec/toot * https://git.a-lec.org/a-lec/commissions/chalec/nuage * https://git.a-lec.org/a-lec/commissions/chalec/doc-chalec * https://git.a-lec.org/a-lec/commissions/chalec/gestion-de-commission * https://git.a-lec.org/a-lec/commissions/chalec/chatons * https://git.a-lec.org/a-lec/commissions/infrastructure/mail * https://git.a-lec.org/a-lec/commissions/infrastructure/xmpp * https://git.a-lec.org/a-lec/commissions/infrastructure/git * https://git.a-lec.org/a-lec/commissions/infrastructure/toot * https://git.a-lec.org/a-lec/commissions/infrastructure/audio * https://git.a-lec.org/neox/projet-vlsi * https://git.a-lec.org/a-lec/commissions/infrastructure/www * https://git.a-lec.org/a-lec/commissions/infrastructure/infra-generale * https://git.a-lec.org/a-lec/commissions/infrastructure/gestion-de-commission * https://git.a-lec.org/julian/are-dynamic-2017 * https://git.a-lec.org/a-lec/commissions/communication/identite-visuelle * https://git.a-lec.org/a-lec/vie-associative/administratif * https://git.a-lec.org/gem-graph/gem-graph-server J'ai généré cette liste avec ce code python: ```` #!/usr/bin/env python3 # Copyright (C) 2022 Denis 'GNUtoo' Carikli # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. import os import sys import bs4 import curl import gitlab def check_instance(config_section): # results = {} # url : license config = gitlab.config.GitlabConfigParser(config_section) instance = gitlab.Gitlab(config.url) public_projects = instance.projects.list(get_all=True) for project in public_projects: # results[project.web_url] = None page = curl.Curl(project.web_url) html = page.get() soup = bs4.BeautifulSoup(html, 'html.parser') found_approximate_license = False for link in soup.find_all('a'): if link.has_attr('itemprop'): # results[project.web_url] = config.url + link['href'] # print("{} {}".format(project.web_url, config.url + link['href'])) found_approximate_license = True if not found_approximate_license: print("* {}".format(project.web_url)) # for k, v in results: # print("{}: {}".format(k, v)) if __name__ == '__main__': check_instance('alec') ```` Et cette configuration dans /etc/python-gitlab.cfg: ```` [global] default = alec ssl_verify = true timeout = 5 [alec] url = https://git.a-lec.org private_token = aAbBcC` ```` Pour faire tourner ça: * Il faut créer un token dans https://git.a-lec.org/-/profile/personal_access_tokens (dans mon cas j'ai donné tous les accès au token plur faire plus simple) * mettre le token dans le fichier de config dans private_token * installer python3, python-beautifulsoup4, python-gitlab, python-pycurl edit1: clarification d'ou va la config. _Originally posted by @neox (in fact @gnutoo) in https://forge.a-lec.org/cominfra/git/issues/15#issue-1142_
neox added the
bogue
FSDG/RYF/libre
planifié
labels 2024-02-17 00:12:41 +01:00
Sign in to join this conversation.
No description provided.