pub / stagit-scripts

Building src.jayvii.de with stagit
git clone https://src.jayvii.de/pub/stagit-scripts.git
Home | Log | Files | Exports | Refs | README | RSS

commit fab0814b0200bb0865ef90e38507da6ae1af2241
parent 9fa70eb4dd55096d589c42e923a33807e2470853
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Fri, 10 May 2024 11:55:52 +0200

Move private repositories to "prv/"

Diffstat:
M.htaccess | 4++++
MREADME | 4++--
Mbin/git_create_repo.sh | 2+-
Mbin/git_export_tarball.sh | 2+-
Mbin/git_post_push.sh | 2+-
Mbin/git_post_push_all.sh | 2+-
Mbin/git_update_index_html.sh | 2+-
Mbin/git_update_repo.sh | 2+-
Mbin/git_update_repo_html.sh | 2+-
Mcreate_repo/index.php | 6+++---
Mindex.html | 4++--
Dpriv/.htaccess | 8--------
Aprv/.htaccess | 9+++++++++
13 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/.htaccess b/.htaccess @@ -20,3 +20,6 @@ RedirectMatch 404 ^/.bash_history$ # Style filebrowser IndexStyleSheet /assets/index.css + +# Workaround: new directory for private repos +RewriteRule ^priv/(.*)$ /prv/$1 [R=301,L] +\ No newline at end of file diff --git a/README b/README @@ -63,12 +63,12 @@ the remote repository. Private Repositories -------------------- -Private repositories reside within priv/, while your public repositories +Private repositories reside within prv/, while your public repositories are in pub/. Access to the private repositories is restricted via HTTP Basic Authentication (https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). -A .htaccess file is provided within the priv/ directory, however you also need +A .htaccess file is provided within the prv/ directory, however you also need to set up a user/password for the web-access, e.g. here for the user "username": sudo htpasswd -c /etc/apache2/.htpassword username diff --git a/bin/git_create_repo.sh b/bin/git_create_repo.sh @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2021-2024 JayVii <jayvii[AT]posteo[DOT]de> # $1 - HTML Root -# $2 - priv/pub +# $2 - prv/pub # $3 - repo name # $4 - description # $5 - owner/maintainer diff --git a/bin/git_export_tarball.sh b/bin/git_export_tarball.sh @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2021-2024 JayVii <jayvii[AT]posteo[DOT]de> # $1 - HTML Root -# $2 - priv/pub +# $2 - prv/pub # $3 - repo name # Error out if not all options are given diff --git a/bin/git_post_push.sh b/bin/git_post_push.sh @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2021-2024 JayVii <jayvii[AT]posteo[DOT]de> # $1 - HTML Root -# $2 - priv/pub +# $2 - prv/pub # $3 - repo name # Error out if not all options are given diff --git a/bin/git_post_push_all.sh b/bin/git_post_push_all.sh @@ -14,5 +14,5 @@ git_post_push_all.sh \\ fi find "${1}/pub" -maxdepth 1 -type d -name "*.git" -exec {}/hooks/post-update \; -find "${1}/priv" -maxdepth 1 -type d -name "*.git" -exec {}/hooks/post-update \; +find "${1}/prv" -maxdepth 1 -type d -name "*.git" -exec {}/hooks/post-update \; diff --git a/bin/git_update_index_html.sh b/bin/git_update_index_html.sh @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2021-2024 JayVii <jayvii[AT]posteo[DOT]de> # $1 - HTML Root -# $2 - priv/pub +# $2 - prv/pub # Error out if not all options are given if [ -z "$2" ]; then diff --git a/bin/git_update_repo.sh b/bin/git_update_repo.sh @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2021-2024 JayVii <jayvii[AT]posteo[DOT]de> # $1 - HTML Root -# $2 - priv/pub +# $2 - prv/pub # $3 - repo name # Error out if not all options are given diff --git a/bin/git_update_repo_html.sh b/bin/git_update_repo_html.sh @@ -3,7 +3,7 @@ # SPDX-FileCopyrightText: 2021-2024 JayVii <jayvii[AT]posteo[DOT]de> # $1 - HTML Root -# $2 - priv/pub +# $2 - prv/pub # $3 - repo name # Error out if not all options are given diff --git a/create_repo/index.php b/create_repo/index.php @@ -3,14 +3,14 @@ <?php -// Fetch Repository Type (may only be "pub" or "priv") +// Fetch Repository Type (may only be "pub" or "prv") $repo_type = preg_replace( '/[^a-z]/', '', rawurldecode(basename($_GET["type"])) ); if ($repo_type != "pub") { - $repo_type = "priv"; + $repo_type = "prv"; } // Fetch Repository Name @@ -84,7 +84,7 @@ $repo_owner = preg_replace( <input type="text" id="owner" name="owner" maxlength="30" placeholder="Me" default=<?php echo "\"" . $repo_owner . "\""; ?> required><br> <label for="type">Repository Type</label><br> <select name="type" required> - <option value="priv" selected>Private</option> + <option value="prv" selected>Private</option> <option value="pub">Public</option> </select><br><br> <input type="submit" value="Submit"> diff --git a/index.html b/index.html @@ -20,8 +20,8 @@ <hr/> <div id="content"> <p>This section is non-public. You are probably looking for the public section.</p> -<p>If you are not being redirected now, please click <a href="/pub/">HERE</a>.</p> +<p>If you are not being redirected now, please click <a href="pub/">HERE</a>.</p> </div> </body> -<meta http-equiv="Refresh" content="0; url='/pub/'" /> +<meta http-equiv="Refresh" content="0; url='pub/'" /> </html> diff --git a/priv/.htaccess b/priv/.htaccess @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later -# SPDX-FileCopyrightText: 2021-2024 JayVii <jayvii[AT]posteo[DOT]de> - -# Protected / Private repositories -AuthType Basic -AuthName "Private Repositories! You need a password to access them." -AuthUserFile /etc/apache2/.htpassword -Require valid-user diff --git a/prv/.htaccess b/prv/.htaccess @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +# SPDX-FileCopyrightText: 2021-2024 JayVii <jayvii[AT]posteo[DOT]de> + +# Protected / Private repositories +AuthType Basic +AuthName "Private Repositories! You need a password to access them." +AuthUserFile /etc/apache2/.htpassword +Require valid-user +\ No newline at end of file