[aur-dev] [PATCH v4 0/5] Fix FS#45322
This is a reroll of Johannes's recent patch series that fixes FS#45322. I did change a couple of minor things, so I am submitting this for review. Johannes Löthberg (5): confparser: Split loading of config into own function confparser: Add function for checking if config section exists confparser: Add function for getting the items of a section home: Add submitting packages section config.proto: Add sample fingerprints section conf/config.proto | 5 +++++ web/html/home.php | 22 ++++++++++++++++++++++ web/lib/confparser.inc.php | 21 ++++++++++++++++++++- 3 files changed, 47 insertions(+), 1 deletion(-) -- 2.4.3
From: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> --- web/lib/confparser.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/lib/confparser.inc.php b/web/lib/confparser.inc.php index 3977911..790aa0e 100644 --- a/web/lib/confparser.inc.php +++ b/web/lib/confparser.inc.php @@ -1,11 +1,16 @@ <?php -function config_get($section, $key) { +function config_load() { global $AUR_CONFIG; if (!isset($AUR_CONFIG)) { $AUR_CONFIG = parse_ini_file("../../conf/config", true, INI_SCANNER_RAW); } +} + +function config_get($section, $key) { + global $AUR_CONFIG; + config_load(); return $AUR_CONFIG[$section][$key]; } -- 2.4.3
From: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> --- web/lib/confparser.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/lib/confparser.inc.php b/web/lib/confparser.inc.php index 790aa0e..db44b36 100644 --- a/web/lib/confparser.inc.php +++ b/web/lib/confparser.inc.php @@ -23,3 +23,10 @@ function config_get_bool($section, $key) { $val = strtolower(config_get($section, $key)); return ($val == 'yes' || $val == 'true' || $val == '1'); } + +function config_section_exists($key) { + global $AUR_CONFIG; + config_load(); + + return array_key_exists($key, $AUR_CONFIG); +} -- 2.4.3
From: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> --- web/lib/confparser.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/lib/confparser.inc.php b/web/lib/confparser.inc.php index db44b36..6368b86 100644 --- a/web/lib/confparser.inc.php +++ b/web/lib/confparser.inc.php @@ -24,6 +24,13 @@ function config_get_bool($section, $key) { return ($val == 'yes' || $val == 'true' || $val == '1'); } +function config_items($section) { + global $AUR_CONFIG; + config_load(); + + return $AUR_CONFIG[$section]; +} + function config_section_exists($key) { global $AUR_CONFIG; config_load(); -- 2.4.3
From: Johannes Löthberg <johannes@kyriasis.com> Link to the ArchWiki and lists any SSH fingerprints configured in the AUR configuration file. Fixes FS#45322. Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> --- web/html/home.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/web/html/home.php b/web/html/home.php index 6b54af3..3252876 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -71,6 +71,28 @@ html_header( __("Home") ); ?> </p> </div> + <h4><?= __('Submitting Packages') ?></h4> + <div class="article-content"> + <p> + <?php + echo __( + 'Git over SSH is now used to submit packages to the AUR. See the %sSubmitting packages%s section of the Arch User Repository ArchWiki page for more details.', + '<a href="https://wiki.archlinux.org/index.php/Arch_User_Repository#AUR_4">', + '</a>' + ); + ?> + </p> + <?php if (config_section_exists('fingerprints')): ?> + <p> + <?= __('The following SSH fingerprints are used for the AUR:') ?> + </p> + <ul> + <?php foreach (config_items('fingerprints') as $type => $fingerprint): ?> + <li><code><?= htmlspecialchars($type) ?></code>: <code><?= htmlspecialchars($fingerprint) ?></code></li> + <?php endforeach; ?> + </ul> + <?php endif; ?> + </div> <h4><?= __('Discussion') ?></h4> <div class="article-content"> <p> -- 2.4.3
From: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org> --- conf/config.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/config.proto b/conf/config.proto index 628dac3..25c8830 100644 --- a/conf/config.proto +++ b/conf/config.proto @@ -31,6 +31,11 @@ snapshot_uri = https://aur.archlinux.org/cgit/aur.git/snapshot/%s.tar.gz enable-maintenance = 1 maintenance-exceptions = 127.0.0.1 +[fingerprints] +Ed25519 = SHA256:HQ03dn6EasJHNDlt51KpQpFkT3yBX83x7BoIkA1iv2k +ECDSA = SHA256:L71Q91yHwmHPYYkJMDgj0xmUuw16qFOhJbBr1mzsiOI +RSA = SHA256:Ju+yWiMb/2O+gKQ9RJCDqvRg7l+Q95KFAeqM5sr6l2s + [auth] valid-keytypes = ssh-rsa ssh-dss ecdsa-sha2-nistp256 ecdsa-sha2-nistp384 ecdsa-sha2-nistp521 ssh-ed25519 username-regex = [a-zA-Z0-9]+[.\-_]?[a-zA-Z0-9]+$ -- 2.4.3
participants (1)
-
Lukas Fleischer