Compare commits

..

No commits in common. "4bea6229022caff8ba8adeb0e985926c511af602" and "1d1250a3e07df7f8fe1b07e7e65bb502c04652ca" have entirely different histories.

6 changed files with 17 additions and 36 deletions

View file

@ -6,7 +6,7 @@ begin
function configureSW -V dir
source "$dir/../bash/profile.fish"
source "$dir/../fish/profile.fish"
set -l file (pwsh -NoProfile -CommandWithArgs '. $args[0]; Get-GlobalConfigPath' "$dir/Constants.ps1")
set -l file (pwsh -CommandWithArgs '. $args[0]; Get-GlobalConfigPath' "$dir/Constants.ps1")
sudo install -Dm644 "$dir/aliae.yml" "$file"
begin

View file

@ -24,7 +24,7 @@ services:
- ./data/forgejo:/data
- config:/data/gitea/conf
- /etc/timezone:/etc/timezone:ro
- /srv/git/.ssh:/data/git/.ssh
- /home/forgejo/.ssh:/data/git/.ssh
db:
image: mariadb
restart: unless-stopped

View file

@ -1,10 +1,10 @@
#!/bin/env fish
begin
set -l dir (status dirname)
set -l user git
set -l user forgejo
set -l domain git
set -l server "$domain" ""
set -l service "forgejo"
set -l service $user
source "$dir/../service.fish"
function getSSHPortKey -V service
@ -48,9 +48,6 @@ begin
set -l port
set -l file (mktemp)
set -l root (getServiceRoot $argv)
set -l home /srv/git
set -l sshDir "$home/.ssh"
set -l keyFile "$sshDir/id_rsa"
set -l dir "$root/data"
set -l bin /usr/local/bin/forgejo
set -l config "$root/docker-compose.base.yml"
@ -63,37 +60,29 @@ begin
--system \
--shell /bin/bash \
--comment 'Git Version Control' \
--create-home \
$user
set uid (id -u $user)
set gid (id -g $user)
and sudo usermod -d "$home" "$user"
and yq "$envKey.USER_UID = $uid" "$file" |
yq "$envKey.USER_GID = $gid" |
sudo tee "$config" >/dev/null
rm "$file"
and sudo mkdir -p "$dir"
and sudo mkdir -p "$home"
sudo mkdir -p "$dir"
and sudo chown -R $uid:$gid "$dir"
and sudo chown -R $uid:$gid "$home"
and sudo -u "#$uid" mkdir -p "$sshDir"
and sudo -u "#$uid" ssh-keygen -t rsa -b 4096 -C "Forgejo Host Key" -f "$keyFile" -N ""
and sudo -u "#$uid" cat "$keyFile.pub" | sudo -u "#$uid" tee -a "$sshDir/authorized_keys"
and sudo chmod 600 "$sshDir/authorized_keys"
rm "$file"
set port (yq (getSSHPortKey) "$overrides" | extractPort)
begin
printf "%s\n" \
"#!/bin/sh" \
"ssh -p $port -o StrictHostKeyChecking=no git@127.0.0.1 \"SSH_ORIGINAL_COMMAND=\\\"\$SSH_ORIGINAL_COMMAND\\\" \$0 \$@\""
"ssh -p $port -o StrictHostKeyChecking=no git@127.0.0.1 \"SSH_ORIGINAL_COMMAND=\\\"$SSH_ORIGINAL_COMMAND\\\" \$0 \$@\""
end | sudo tee "$bin" >/dev/null
sudo chmod +x "$bin"
sudo ln -s "$bin" "$(dirname "$bin")/gitea"
end
function getServiceServers -V server

View file

@ -83,7 +83,6 @@ begin
"$_flag_name" / "" (
for app in $servarr
printf "%s\n" "$app" "/$app" ""
printf "%s\n" "$app" "/$app/signalr" ""
end) \
flood "/flood/"
end
@ -108,29 +107,22 @@ begin
'return 302 $scheme://$host$uri/$is_args$args;' \
"}"
else
getServiceDefaultProxy $argv
getServiceDefaultProxy $argv --path "$location"
end
end
function getExtraLocationSettings -a domain s location -V service -V servarr
set -l wsConfig (
printf "%s\n" \
'# Websocket' \
"proxy_http_version 1.1;" \
'proxy_set_header Upgrade $http_upgrade;' \
'proxy_set_header Connection "upgrade";')
function getExtraLocationSettings -a domain s location -V service
if [ "$s" = "$service" ]
if [ "$location" = / ]
printf "%s\n" \
"# Disable buffering when the nginx proxy gets very resource heavy upon streaming" \
"proxy_buffering off;"
else if [ "$location" = /socket ]
echo "$wsConfig"
end
else if contains "$s" $servarr
if string match --regex ".*/signalr^" "$location" >/dev/null
echo "$wsConfig"
printf "%s\n" \
'# Websocket' \
"proxy_http_version 1.1;" \
'proxy_set_header Upgrade $http_upgrade;' \
'proxy_set_header Connection "upgrade";'
end
end
end

View file

@ -8,7 +8,7 @@ begin
set -l file (mktemp)
if [ -z "$title" ]
set title "$name"
set -l title "$name"
end
if [ -z "$content" ]

View file

@ -73,7 +73,7 @@ begin
set _flag_script $argv[1]
end
pwsh -NoProfile -CommandWithArgs '& $args[0] $args[1] @{ name=$args[2]; }' "$_flag_script" "$_flag_action" "$_flag_user"
pwsh -CommandWithArgs '& $args[0] $args[1] @{ name=$args[2]; }' "$_flag_script" "$_flag_action" "$_flag_user"
end
function runPSUserConfig