[aur-dev] [PATCH] Remove hostname from URLPath in JSON RPC

Lukas Fleischer lfleischer at archlinux.org
Thu Jun 18 13:14:24 UTC 2015


On Thu, 18 Jun 2015 at 14:24:01, Mikkel Oscar Lyderik wrote:
> Prior to aur4 URLPath in the JSON RPC didn't include the hostname, only
> the path.
> 
> This removes the hostname and make aur4 compatible with programs
> expecting the old (and documented) semantics (e.i. cower)
> 
> Fixes FS#45333

Thanks for looking into this!

> ---
>  conf/config.proto                | 2 +-
>  web/template/pkg_details.php     | 2 +-
>  web/template/pkgbase_details.php | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/conf/config.proto b/conf/config.proto
> index 25c8830..2fbc27a 100644
> --- a/conf/config.proto
> +++ b/conf/config.proto
> @@ -27,7 +27,7 @@ auto_orphan_age = 15552000
>  auto_delete_age = 86400
>  pkgbuild_uri = https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=%s
>  log_uri = https://aur.archlinux.org/cgit/aur.git/log/?h=%s
> -snapshot_uri = https://aur.archlinux.org/cgit/aur.git/snapshot/%s.tar.gz
> +snapshot_uri = /cgit/aur.git/snapshot/%s.tar.gz
>  enable-maintenance = 1
>  maintenance-exceptions = 127.0.0.1
>  
> diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php
> index 90e5729..eafccbe 100644
> --- a/web/template/pkg_details.php
> +++ b/web/template/pkg_details.php
> @@ -2,7 +2,7 @@
>  
>  $pkgbuild_uri = sprintf(config_get('options', 'pkgbuild_uri'), urlencode($row['BaseName']));
>  $log_uri = sprintf(config_get('options', 'log_uri'), urlencode($row['BaseName']));
> -$snapshot_uri = sprintf(config_get('options', 'snapshot_uri'), urlencode($row['BaseName']));
> +$snapshot_uri = config_get('options', 'aur_location') . sprintf(config_get('options', 'snapshot_uri'), urlencode($row['BaseName']));

This change makes it impossible to host the snapshots under a different
domain. However, shouldn't it be sufficient to just change the default
value and use relative URIs (with absolute paths) on the package details
pages as well?

>  $git_clone_uri_anon = sprintf(config_get('options', 'git_clone_uri_anon'), htmlspecialchars($row['BaseName']));
>  $git_clone_uri_priv = sprintf(config_get('options', 'git_clone_uri_priv'), htmlspecialchars($row['BaseName']));
>  
> diff --git a/web/template/pkgbase_details.php b/web/template/pkgbase_details.php
> index 9989369..b008677 100644
> --- a/web/template/pkgbase_details.php
> +++ b/web/template/pkgbase_details.php
> @@ -2,7 +2,7 @@
>  
>  $pkgbuild_uri = sprintf(config_get('options', 'pkgbuild_uri'), urlencode($row['Name']));
>  $log_uri = sprintf(config_get('options', 'log_uri'), urlencode($row['Name']));
> -$snapshot_uri = sprintf(config_get('options', 'snapshot_uri'), urlencode($row['Name']));
> +$snapshot_uri = config_get('options', 'aur_location') . sprintf(config_get('options', 'snapshot_uri'), urlencode($row['Name']));
>  $git_clone_uri_anon = sprintf(config_get('options', 'git_clone_uri_anon'), htmlspecialchars($row['Name']));
>  $git_clone_uri_priv = sprintf(config_get('options', 'git_clone_uri_priv'), htmlspecialchars($row['Name']));
>  
> -- 
> 2.4.4


More information about the aur-dev mailing list