Compare commits

...

26 Commits

Author SHA1 Message Date
4838e809c6
build_gitea: multi arch/cross-compile support 2024-11-08 17:39:47 +07:00
c78984fcdd
alpine-initramfs-dropbear: update diff 2024-11-04 00:41:49 +07:00
5710be8871
alpine-initramfs-dropbear: fix struck nlplug-findfs, dropbear process alive after boot stage 2024-11-04 00:39:03 +07:00
8b37e1131e
alpine-initramfs-dropbear: add note on grub 2024-11-03 22:36:01 +07:00
dcbb6c1815
alpine-initramfs-dropbear: fix README 2024-11-03 22:27:01 +07:00
87c2f296b7
alpine-initramfs-dropbear: fix README 2024-11-03 22:25:23 +07:00
271e8eef2d
alpine-initramfs-dropbear: init 2024-11-03 22:17:34 +07:00
a2aea661e2
build_gitea: support patch url 2024-10-30 20:08:41 +07:00
5d9c20cd0f
cryptsetup-veracrypt: init 2024-10-29 22:21:00 +07:00
b62271c732
gitea-patches: add activitypub patch 2024-10-28 20:59:19 +07:00
732fe5c17d
gitea-patches: add patch 2024-10-28 15:55:45 +07:00
62464117d3
gitea-patches: init 2024-10-28 12:16:45 +07:00
98feebacf6
build_gitea: support adding patches to build 2024-10-28 12:04:16 +07:00
33125f2154
nginx_build_script: handle make error 2024-10-13 19:10:31 +07:00
fa049f97aa
nginx_build_script: enhance: not longer build lua/modsecurity by default 2024-10-10 21:55:06 +07:00
6510607877
build_gitea: fix: missing dependency(Alpine), init.d / nginx_build_script: add: init.d 2024-10-03 13:22:26 +07:00
9a47f97982
build_gitea: fix: destination 2024-10-03 00:21:31 +07:00
f2020beb4c
build_gitea: fix: recognize correct format 2024-10-03 00:20:45 +07:00
0eae506a34
build_gitea: fix: proper link directory 2024-10-03 00:19:38 +07:00
3eaf559ba6
build_gitea: fix: tar 2024-10-03 00:17:25 +07:00
6d110b1f0e
build_gitea: fix: remove Temporary dir 2024-10-03 00:15:05 +07:00
847cd3eebb
build_gitea: add: forgejo, alpine 2024-10-03 00:08:18 +07:00
90aa47c703
nginx_build_script: add: alpine support 2024-10-02 17:54:43 +07:00
4b873606f2
nginx_build_script: add: os detection/no longer install golang in /usr/local 2024-09-22 13:42:55 +07:00
0d322d34e7
nginx_build_script: update README 2024-09-21 14:57:23 +07:00
4cb2beea61
nginx_build_script: move nginx repository/add freenginx/misc (#3)
Notable changes:
-> move Nginx build repository from hg.nginx.org to github
-> add freenginx

Minor changes:
-> force lower case on user input variable
-> Permission fix
---------

Signed-off-by: minoplhy <c@3qx.nl>
2024-09-21 07:47:19 +00:00
15 changed files with 2010 additions and 120 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
#!/bin/sh
set -- $(cat /proc/cmdline)
for opt; do
case "$opt" in
cryptroot=*)
KOPT_cryptroot=${opt#cryptroot=}
continue
;;
cryptdm=*)
KOPT_cryptdm=${opt#cryptdm=}
continue
;;
root=*)
KOPT_root=${opt#root=}
continue
;;
esac
done
while [ ! -b /dev/mapper/${KOPT_cryptdm} ]; do
/sbin/nlplug-findfs -c ${KOPT_cryptroot} -m ${KOPT_cryptdm} ${KOPT_debug_init:+-d} -p /sbin/mdev ${KOPT_root}
sleep 2
done
# Kill all struck nlplug-findfs jobs and dropbear
killall -9 nlplug-findfs
killall -9 dropbear

View File

@ -0,0 +1,3 @@
/usr/sbin/dropbear
/sbin/cryptsetup
/etc/dropbear/*

View File

@ -0,0 +1,3 @@
kernel/crypto/*
kernel/arch/*/crypto/*
kernel/drivers/md/dm-crypt.ko

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,32 @@
#!/sbin/openrc-run
supervisor=supervise-daemon
name=gitea
command="/usr/bin/gitea"
command_user="${GITEA_USER:-gitea}"
command_args="web --config '${GITEA_CONF:-/etc/gitea/app.ini}'"
supervise_daemon_args="--env GITEA_WORK_DIR='${GITEA_WORK_DIR:-/var/lib/gitea}' --chdir '${GITEA_WORK_DIR:-/var/lib/gitea}' --stdout '${GITEA_LOG_FILE:-/var/log/gitea/http.log}' --stderr '${GITEA_LOG_FILE:-/var/log/gitea/http.log}'"
pidfile="/run/gitea.pid"
extra_started_commands="reopen_log"
capabilities="^cap_net_bind_service"
depend() {
use logger dns
need net
after firewall mysql postgresql
}
#https://github.com/go-gitea/gitea/issues/17976
#reload() {
# ebegin "Reloading ${RC_SVCNAME}"
# ${supervisor} ${RC_SVCNAME} --signal HUP --pidfile "${pidfile}"
# eend $?
#}
reopen_log() {
ebegin "Reopening logfile for ${RC_SVCNAME}"
${supervisor} ${RC_SVCNAME} --signal USR1 --pidfile "${pidfile}"
eend $?
}
# Taken from https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/community/gitea/gitea.initd

View File

@ -15,21 +15,63 @@ curl -L https://github.com/minoplhy/scriptbox/raw/main/build_gitea/Linux/build.s
```bash
while [ ${#} -gt 0 ]; do
case "$1" in
--git-tag | -v)
--git-tag | -v)
shift
GITEA_GIT_TAG=$1
;; # Gitea Git Tag
--golang-version | -g)
--golang-version | -g)
shift
GO_VERSION=$1
GO_VERSION=$1
;; # GOLANG Version
--nodejs-version | -n)
--nodejs-version | -n)
shift
NODEJS_VERSION=$1
NODEJS_VERSION=$1
;; # NodeJS Version
--static | -s)
BUILD_STATIC=true
;; # Build as Static Assets file
--static | -s)
BUILD_STATIC=true
;; # Also Build Static Assets file
--type=* )
BUILD_TYPE="${1#*=}"
BUILD_TYPE="${BUILD_TYPE,,}"
case $BUILD_TYPE in
"gitea") BUILD_TYPE="gitea" ;;
"forgejo") BUILD_TYPE="forgejo" ;;
"")
echo "ERROR : --type= is empty!"
exit 1
;;
*)
echo "ERROR : Vaild values for --type are -> gitea, forgejo"
exit 1
;;
esac
;;
--patch=* )
PATCH_FILES="${1#*=}"
case $PATCH_FILES in
"")
echo "ERROR: --patch= is empty!"
exit 1
;;
*)
;;
esac # Add Patches to your Gitea build. Format -> patch1.patch or patch1.patch,https://patch (Absolute path)
;;
--build-arch=* )
BUILD_ARCH="${1#*=}"
case $BUILD_ARCH in
"x86_64") BUILD_ARCH="x86_64" ;;
"aarch64") BUILD_ARCH="aarch64" ;;
"")
echo "ERROR : --build-arch= is empty!"
exit 1
;;
*)
echo "ERROR : Vaild values for --build-arch are -> x86_64, aarch64"
exit 1
;;
esac # Architect for your binary to be build. This is for Cross-compiling etc.
;;
*)
;;
esac
@ -39,4 +81,5 @@ done
# Known Issues
- For Alpine Linux: to get `npm` installation working, please ensure community package is enable in `/etc/apk/repositories`
- This script required root privileges because of dependencies installation, which is hard to avoid.

View File

@ -0,0 +1,82 @@
#!/bin/bash
# Veracrypt Cryptsetup script.
#
# Mount Veracrypt drive using cryptsetup
# Currently, only working as promting script, CLI style is not Yet supported.
mount(){
${SUDOERS} cryptsetup --type tcrypt --veracrypt open /dev/$drive $container_name
if [ -e "/dev/mapper/$container_name" ]; then
${SUDOERS} mkdir -p "/mnt/$container_name"
printf "Directory /mnt/%s created.\n" $container_name
else
printf "Device /dev/mapper/%s does not exist.\n" $container_name
exit 1
fi
${SUDOERS} mount ${MOUNT_PARAMETERS[@]} /dev/mapper/$container_name /mnt/$container_name
}
unmount(){
${SUDOERS} umount /mnt/$container_name
if [ -e "/dev/mapper/$container_name" ]; then
DIRECTORY_CLEANUP=true
else
printf "Device /dev/mapper/%s does not exist.\n" $container_name
exit 1
fi
${SUDOERS} cryptsetup close /dev/mapper/$container_name
if [[ "$DIRECTORY_CLEANUP" == true ]]; then
${SUDOERS} rmdir /mnt/$container_name
fi
}
prompting() {
MODE=$1
printf "Available Disks:\n%s\n\nChoose: " "$DISKS"
read drive
printf "\nSelect Container Name: "
read container_name
case $MODE in
"mount") mount_permission_prompt && mount;;
"unmount") unmount;;
esac
}
mount_permission_prompt() {
printf "Currently the Mount Parameters is hardcoded, so you have not much choice!\n"
printf "Mounting with '-o umask=000' (Y/n)? "
read mount_permission
case $mount_permission in
"Y"|"y") MOUNT_PARAMETERS+="-o umask=000" ;;
"N"|"n") ;;
*) mount_permission_prompt ;;
esac
}
if sudo --validate; then
SUDOERS=sudo
else
SUDOERS=""
fi
DISKS=$(lsblk -n -o NAME,SIZE,TYPE)
MOUNT_PARAMETERS=()
printf "NOTICE! This script is intended to work with Veracrypt drives in linux only!\n"
printf "Mode: mount/unmount -> "
read MODE
MODE="${MODE,,}"
case $MODE in
"mount") prompting "mount";;
"unmount"|"umount") prompting "unmount";;
esac

7
gitea-patches/Readme.md Normal file
View File

@ -0,0 +1,7 @@
# Gitea Patches
`gitea-v1.22.3-activitypub.patch` Security/Privacy improvement for Gitea and Forgejo(the patch is focused on Gitea but should've work on forgejo too!). Return a fake 404 Page when user visiblity is either "private" or "limited"
`gitea-v1.22.3-no-contributorStats.patch` Gitea's Activity: "Recent Commit" "Code Frequency" "Contributors" is a resource-intensive tasks. This could turn small device into flames! This patch is remove 'ContributorStats'.
`gitea-v1.22.3-no-contributorStats-all.patch` same as above, But this patch also remove paths from web.go and templates

View File

@ -0,0 +1,27 @@
diff --git a/routers/api/v1/activitypub/person.go b/routers/api/v1/activitypub/person.go
index 995a148f0b..10043fcbe1 100644
--- a/routers/api/v1/activitypub/person.go
+++ b/routers/api/v1/activitypub/person.go
@@ -8,6 +8,7 @@ import (
"net/http"
"strings"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/activitypub"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
@@ -36,6 +37,14 @@ func Person(ctx *context.APIContext) {
// TODO: the setting.AppURL during the test doesn't follow the definition: "It always has a '/' suffix"
link := fmt.Sprintf("%s/api/v1/activitypub/user-id/%d", strings.TrimSuffix(setting.AppURL, "/"), ctx.ContextUser.ID)
+
+ // Fake 404 Error when user visiblity is private/limited
+ if ctx.ContextUser.Visibility.IsPrivate() || ctx.ContextUser.Visibility.IsLimited() {
+ // ctx.Error(status, title, obj)
+ ctx.Error(http.StatusNotFound, "", user_model.ErrUserNotExist{UID: ctx.ContextUser.ID}.Error())
+ return
+ }
+
person := ap.PersonNew(ap.IRI(link))
person.Name = ap.NaturalLanguageValuesNew()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff