🗃️ Committing everything that changed 🗃️

applications/
configs/
lists/
wwwroot/
This commit is contained in:
casjay 2023-08-22 17:53:03 -04:00
parent 13eaf166f5
commit 5eb3ff1598
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145
265 changed files with 48486 additions and 0 deletions

View File

@ -0,0 +1,23 @@
if __file_exists_with_content "/config/secure/ampache_secret.key"; then
secret_key="$(<"/config/secure/ampache_secret.key")"
else
secret_key="$(__random_password 32)"
echo "$secret_key" >"/config/secure/ampache_secret.key"
fi
if __file_exists_with_content "$CONF_DIR/ampache.cfg.php"; then
__sed "s|REPLACE_DB_HOST|127.0.0.1|g" "$CONF_DIR/ampache.cfg.php"
__sed "s|REPLACE_SECURITY_CODE|$secret_key|" "$CONF_DIR/ampache.cfg.php"
[ -n "$root_user_pass" ] && __sed 's|REPLACE_PASSWORD|'$root_user_pass'|g' "$CONF_DIR/ampache.cfg.php"
else
__sed "s|REPLACE_DB_HOST|127.0.0.1|g" "$ETC_DIR/ampache.cfg.php.dist"
__sed "s|REPLACE_SECURITY_CODE|$secret_key|" "$ETC_DIR/ampache.cfg.php.dist"
[ -n "$root_user_pass" ] && __sed 's|REPLACE_PASSWORD|'$root_user_pass'|g' "$ETC_DIR/ampache.cfg.php.dist"
fi
### POST
(
while :; do __file_exists_with_content "$ETC_DIR/ampache.cfg.php" && cp -Rf "$ETC_DIR/ampache.cfg.php" "$CONF_DIR/ampache.cfg.php" && break || sleep 120; done
secret_key="$(grep --no-filename -s "secret_key = " "$ETC_DIR/ampache.cfg.php" | awk -F ' = ' '{print $2}' | sed 's| ||g;s|"||g')"
[ -n "$secret_key" ] && echo "$secret_key" >"/config/secure/ampache_secret.key"
)

View File

@ -0,0 +1 @@
curl -q -LSsf "https://api.github.com/repos/ampache/ampache/releases/latest" | grep browser_download_url | sed 's|^.* ||g;s|"||g'

View File

@ -0,0 +1,15 @@
apache2 apache2-ctl apache2-lua apache2-ssl apache2-ldap apache2-icons apache2-http2 apache2-error \
apache2-proxy apache2-brotli apache2-webdav apache2-mod-wsgi apache-mod-fcgid apache2-proxy-html \
${PHP_VERSION}-apache2 ${PHP_VERSION}-bcmath ${PHP_VERSION}-bz2 ${PHP_VERSION}-calendar ${PHP_VERSION}-cgi \
${PHP_VERSION}-common ${PHP_VERSION}-ctype ${PHP_VERSION}-curl ${PHP_VERSION}-dba ${PHP_VERSION}-dev ${PHP_VERSION}-doc \
${PHP_VERSION}-dom ${PHP_VERSION}-embed ${PHP_VERSION}-enchant ${PHP_VERSION}-exif ${PHP_VERSION}-ffi \
${PHP_VERSION}-fileinfo ${PHP_VERSION}-fpm ${PHP_VERSION}-ftp ${PHP_VERSION}-gd ${PHP_VERSION}-gettext ${PHP_VERSION}-gmp \
${PHP_VERSION}-iconv ${PHP_VERSION}-imap ${PHP_VERSION}-intl ${PHP_VERSION}-ldap ${PHP_VERSION}-litespeed ${PHP_VERSION}-mbstring \
${PHP_VERSION}-mysqli ${PHP_VERSION}-mysqlnd ${PHP_VERSION}-odbc ${PHP_VERSION}-opcache ${PHP_VERSION}-openssl \
${PHP_VERSION}-pcntl ${PHP_VERSION}-pdo ${PHP_VERSION}-pdo_dblib ${PHP_VERSION}-pdo_mysql ${PHP_VERSION}-pdo_odbc \
${PHP_VERSION}-pdo_pgsql ${PHP_VERSION}-pdo_sqlite ${PHP_VERSION}-pear ${PHP_VERSION}-pgsql ${PHP_VERSION}-phar \
${PHP_VERSION}-phpdbg ${PHP_VERSION}-posix ${PHP_VERSION}-pspell ${PHP_VERSION}-session ${PHP_VERSION}-shmop \
${PHP_VERSION}-simplexml ${PHP_VERSION}-snmp ${PHP_VERSION}-soap ${PHP_VERSION}-sockets ${PHP_VERSION}-sodium \
${PHP_VERSION}-sqlite3 ${PHP_VERSION}-sysvmsg ${PHP_VERSION}-sysvsem ${PHP_VERSION}-sysvshm ${PHP_VERSION}-tidy \
${PHP_VERSION}-tokenizer ${PHP_VERSION}-xml ${PHP_VERSION}-xmlreader ${PHP_VERSION}-xmlwriter ${PHP_VERSION}-xsl \
${PHP_VERSION}-zip ${PHP_VERSION}-pecl-memcached ${PHP_VERSION}-pecl-mongodb ${PHP_VERSION}-pecl-redis

View File

@ -0,0 +1,2 @@
EXEC_CMD_BIN="httpd" # command to execute
EXEC_CMD_ARGS="-f $ETC_DIR/httpd.conf -DFOREGROUND" # command arguments

View File

View File

@ -0,0 +1,15 @@
apache2 apache2-ctl apache2-lua apache2-ssl apache2-ldap apache2-icons apache2-http2 apache2-error \
apache2-proxy apache2-brotli apache2-webdav apache2-mod-wsgi apache-mod-fcgid apache2-proxy-html \
${PHP_VERSION}-apache2 ${PHP_VERSION}-bcmath ${PHP_VERSION}-bz2 ${PHP_VERSION}-calendar ${PHP_VERSION}-cgi \
${PHP_VERSION}-common ${PHP_VERSION}-ctype ${PHP_VERSION}-curl ${PHP_VERSION}-dba ${PHP_VERSION}-dev ${PHP_VERSION}-doc \
${PHP_VERSION}-dom ${PHP_VERSION}-embed ${PHP_VERSION}-enchant ${PHP_VERSION}-exif ${PHP_VERSION}-ffi \
${PHP_VERSION}-fileinfo ${PHP_VERSION}-fpm ${PHP_VERSION}-ftp ${PHP_VERSION}-gd ${PHP_VERSION}-gettext ${PHP_VERSION}-gmp \
${PHP_VERSION}-iconv ${PHP_VERSION}-imap ${PHP_VERSION}-intl ${PHP_VERSION}-ldap ${PHP_VERSION}-litespeed ${PHP_VERSION}-mbstring \
${PHP_VERSION}-mysqli ${PHP_VERSION}-mysqlnd ${PHP_VERSION}-odbc ${PHP_VERSION}-opcache ${PHP_VERSION}-openssl \
${PHP_VERSION}-pcntl ${PHP_VERSION}-pdo ${PHP_VERSION}-pdo_dblib ${PHP_VERSION}-pdo_mysql ${PHP_VERSION}-pdo_odbc \
${PHP_VERSION}-pdo_pgsql ${PHP_VERSION}-pdo_sqlite ${PHP_VERSION}-pear ${PHP_VERSION}-pgsql ${PHP_VERSION}-phar \
${PHP_VERSION}-phpdbg ${PHP_VERSION}-posix ${PHP_VERSION}-pspell ${PHP_VERSION}-session ${PHP_VERSION}-shmop \
${PHP_VERSION}-simplexml ${PHP_VERSION}-snmp ${PHP_VERSION}-soap ${PHP_VERSION}-sockets ${PHP_VERSION}-sodium \
${PHP_VERSION}-sqlite3 ${PHP_VERSION}-sysvmsg ${PHP_VERSION}-sysvsem ${PHP_VERSION}-sysvshm ${PHP_VERSION}-tidy \
${PHP_VERSION}-tokenizer ${PHP_VERSION}-xml ${PHP_VERSION}-xmlreader ${PHP_VERSION}-xmlwriter ${PHP_VERSION}-xsl \
${PHP_VERSION}-zip ${PHP_VERSION}-pecl-memcached ${PHP_VERSION}-pecl-mongodb ${PHP_VERSION}-pecl-redis

View File

@ -0,0 +1,4 @@
EXEC_CMD_ARGS="apprise" # command arguments
EXEC_PRE_SCRIPT="gunicorn -c $WORK_DIR/gunicorn.conf.py -b :$SERVICE_PORT --worker-tmp-dir /dev/shm core.wsgi" # execute script before
__replace "0.0.0.0:8000" "0.0.0.0:$SERVICE_PORT" "$WORK_DIR/gunicorn.conf.py"

View File

@ -0,0 +1 @@
git clone https://github.com/caronc/apprise-api /usr/share/apprise -q

View File

@ -0,0 +1 @@
apk add py3-pip django apprise gevent gunicorn paho-mqtt gntp cryptography

View File

@ -0,0 +1,32 @@
EXEC_CMD_BIN="aria2c" # command to execute
EXEC_CMD_ARGS="--conf-path=$ETC_DIR/aria2.conf" # command arguments
#
RPC_SECRET="${RPC_SECRET:-}"
GET_WEB_CONFIG="$(find "$WWW_DIR/js" -name 'aria-ng*.js' | grep -v '^$')"
[ -n "$RPC_SECRET" ] && RPC_SECRET_BASE64=$(echo -n "${RPC_SECRET}" | base64 -w 0)
#
__replace "6800" "$SERVICE_PORT" $GET_WEB_CONFIG
__replace "REPLACE_RPC_PORT" "$SERVICE_PORT" "$ETC_DIR/aria2.conf"
# replace variables recursively
# __find_replace "" "" "$CONF_DIR/"
if grep -qs "REPLACE_RPC_SECRET" "$GET_WEB_CONFIG"; then
__find_replace "REPLACE_RPC_SECRET" "$RPC_SECRET_BASE64" "$GET_WEB_CONFIG"
else
sed -i 's,secret:"[^"]*",secret:"'"${RPC_SECRET_BASE64}"'",g' "$GET_WEB_CONFIG"
fi
if [ -n "$RPC_SECRET" ]; then
echo "Changing rpc secret to $RPC_SECRET"
if grep -sq "rpc-secret=" "$ETC_DIR/aria2.conf"; then
__replace "REPLACE_RPC_SECRET" "$RPC_SECRET" "$ETC_DIR/aria2.conf"
else
echo "rpc-secret=$RPC_SECRET" >>"$ETC_DIR/aria2.conf"
fi
else
__replace "rpc-secret=" "#rpc-secret=" "$ETC_DIR/aria2.conf"
fi
# custom commands
touch "$CONF_DIR/aria2.session"
ln -sf "$CONF_DIR/aria2.session" "$ETC_DIR/aria2.session"

View File

@ -0,0 +1 @@
curl -q -LSsf https://api.github.com/repos/mayswind/AriaNg/releases/latest | grep 'browser_download_url' | grep '[0-9]\.zip' | sed 's|^.* ||g;s|"||g'

View File

@ -0,0 +1 @@
aria2 unzip nginx

View File

View File

@ -0,0 +1 @@
sh -c "/root/.config/tmux/plugins.sh"

View File

@ -0,0 +1 @@
bash tmux

View File

@ -0,0 +1,70 @@
__rndc_key() { grep -s 'key "rndc-key" ' "$ETC_DIR/rndc.key" | grep -v 'KEY_RNDC' | sed 's|.*secret ||g;s|"||g;s|;.*||g' | grep '^' || return 1; }
__tsig_key() { tsig-keygen -a hmac-sha256 | grep 'secret' | sed 's|.*secret "||g;s|"||g;s|;||g' | grep '^' || echo 'wp/HApbthaVPjwqgp6ziLlmnkyLSNbRTehkdARBDcpI='; }
EXEC_CMD_BIN="named" # command to execute
EXEC_CMD_ARGS="-f -c $ETC_DIR/named.conf" # command arguments
VAR_DIR="/var/bind"
KEY_RNDC="${KEY_RNDC:-$(__tsig_key)}"
KEY_DHCP="${KEY_DHCP:-$(__tsig_key)}"
KEY_BACKUP="${KEY_BACKUP:-$(__tsig_key)}"
KEY_CERTBOT="${KEY_CERTBOT:-$(__tsig_key)}"
local zone_files=""
local serial="$(date +'%Y%m%d%S')"
local HOSTNAME="${SERVER_NAME:-$HOSTNAME}"
local ip_address="${CONTAINER_IP4_ADDRESS:-127.0.0.1}"
[ -f "$CONF_DIR/set_rndc.key" ] && GET_RNDC_KEY="$(<"$CONF_DIR/set_rndc.key")"
__replace "REPLACE_KEY_DHCP" "$KEY_DHCP" "$ETC_DIR/named.conf" #&>/dev/null
__replace "REPLACE_KEY_BACKUP" "$KEY_BACKUP" "$ETC_DIR/named.conf" #&>/dev/null
__replace "REPLACE_KEY_CERTBOT" "$KEY_CERTBOT" "$ETC_DIR/named.conf" #&>/dev/null
__replace "REPLACE_KEY_RNDC" "${GET_RNDC_KEY:-$KEY_RNDC}" "$ETC_DIR/rndc.key" #&>/dev/null
__replace "REPLACE_KEY_RNDC" "${GET_RNDC_KEY:-$KEY_RNDC}" "$ETC_DIR/named.conf" #&>/dev/null
[ -f "$ETC_DIR/custom.conf" ] && mv -f "$ETC_DIR/custom.conf" "$ETC_DIR/named.conf"
GET_RNDC_KEY="${GET_RNDC_KEY:-$(__rndc_key || echo '')}"
if [ -n "$GET_RNDC_KEY" ]; then
echo "$GET_RNDC_KEY" >"$CONF_DIR/set_rndc.key"
fi
zone_files="$(find "$DATA_DIR/zones/" -type f | wc -l)"
if [ $zone_files = 0 ] && [ ! -f "$DATA_DIR/zones/$HOSTNAME.zone" ]; then
cat <<EOF | tee "$DATA_DIR/zones/$HOSTNAME.zone" &>/dev/null
; config for $HOSTNAME
@ IN SOA $HOSTNAME. root.$HOSTNAME. ( $serial 10800 3600 1209600 38400)
IN NS $HOSTNAME.
$HOSTNAME. IN A $ip_address
EOF
fi
#
for dns_file in "$DATA_DIR/zones"/*; do
file_name="$(basename "$dns_file")"
domain_name="$(grep -Rs '\$ORIGIN' "$dns_file" | awk '{print $NF}' | sed 's|.$||g')"
if [ -f "$dns_file" ]; then
cp -Rf "$dns_file" "$VAR_DIR/zones/$file_name"
if [ -n "$domain_name" ] && ! grep -qs "$domain_name" "$ETC_DIR/named.conf"; then
cat <<EOF >>"$ETC_DIR/named.conf"
# ********** begin $domain_name **********
zone "$domain_name" {
type master;
file "$VAR_DIR/zones/$file_name";
notify yes;
allow-update {key "certbot."; key "dhcp-key"; trusted;};
allow-transfer { any; key "backup-key"; };
};
# ********** end $domain_name **********
EOF
grep -qs "$domain_name" "$ETC_DIR/named.conf" && echo "Added $domain_name to $ETC_DIR/named.conf"
fi
fi
done
if named-checkconf -z "$ETC_DIR/named.conf" &>/dev/null; then
echo "named-checkconf has succeeded"
else
echo "named-checkconf has failed:"
named-checkconf -z "$ETC_DIR/named.conf"
fi

View File

@ -0,0 +1,8 @@
etc_dir="/etc/bind" var_dir="/var/bind" data_dir="/data/named" conf_dir="/config/named"
rm -Rf "/etc/rndc"* "/etc/bind/"* "/var/bind/"*
mkdir -p "$etc_dir" "$var_dir" "${DEFAULT_CONF_DIR}/named" "${DEFAULT_DATA_DIR}/named" "/run/named" "/tmp/etc/named" "/tmp/var/named" "/tmp/etc/named/keys" "/tmp/var/named/zones"
[ -d "/tmp/etc/named" ] && cp -Rf "/tmp/etc/named/." "$etc_dir/" && cp -Rf "/tmp/etc/named/." "${DEFAULT_CONF_DIR}/named/"
[ -d "/tmp/var/named" ] && cp -Rf "/tmp/var/named/." "$var_dir/" && cp -Rf "/tmp/var/named/." "${DEFAULT_DATA_DIR}/named/"
chown -Rf named:named "$etc_dir" "$var_dir" "${DEFAULT_CONF_DIR}/named" "${DEFAULT_DATA_DIR}/named" "/run/named"
find "$etc_dir" "$var_dir" "/run/named" "${DEFAULT_CONF_DIR}/named" "${DEFAULT_DATA_DIR}/named" -type d -exec chmod -Rf 777 {} \; && echo "changed folder permissions to 777"
find "$etc_dir" "$var_dir" "/run/named" "${DEFAULT_CONF_DIR}/named" "${DEFAULT_DATA_DIR}/named" -type f -exec chmod -Rf 664 {} \; && echo "changed file permissions to 664"

View File

@ -0,0 +1 @@
bind bind-tools bind-dnssec-root bind-plugins nginx ${PHP_VERSION}-fpm

View File

View File

@ -0,0 +1,2 @@
EXEC_CMD_BIN="buildah" # command to execute
EXEC_CMD_ARGS="build $*" # command arguments

View File

@ -0,0 +1 @@
buildah

View File

@ -0,0 +1,20 @@
EXEC_CMD_BIN="bun" # command to execute
EXEC_CMD_ARGS="dev $DATA_DIR/index.ts" # command arguments
# define commands
[ -d "$DATA_DIR" ] && cd "$DATA_DIR" || exit 1
if [ -n "$START_SCRIPT" ]; then
RUN_SCRIPT="$START_SCRIPT"
elif [ -f "./src/index.ts" ]; then
RUN_SCRIPT="./index.ts"
elif [ -f "./index.ts" ]; then
RUN_SCRIPT="./index.ts"
elif [ -f "./app.ts" ]; then
RUN_SCRIPT="./app.ts"
elif [ -f "./server.ts" ]; then
RUN_SCRIPT="./server.ts"
fi
# Run bun install
__exec_command $EXEC_CMD_BIN install
EXEC_CMD_ARGS="dev $RUN_SCRIPT"

View File

@ -0,0 +1,7 @@
curl -q -fsSL "https://bun.sh/install" | bash &&
ln -sf /usr/local/share/bun/bin/bun /usr/local/bin &&
mkdir -p "${DEFAULT_DATA_DIR}/htdocs/www" &&
git clone "https://github.com/casjay-templates/bunjs" "${DEFAULT_DATA_DIR}/htdocs/www/" &&
rm -Rf ${DEFAULT_DATA_DIR}/htdocs/www/.git &&
cd "${DEFAULT_DATA_DIR}/htdocs/www" &&
/usr/local/bin/bun install

View File

View File

@ -0,0 +1,6 @@
EXEC_CMD_BIN="caddy" # command to execute
EXEC_CMD_ARGS="run --config $ETC_DIR/Caddyfile" # command arguments
[ -d "$WWW_DIR/health" ] || mkdir -p "$WWW_DIR/health"
[ -f "$WWW_DIR/health/index.txt" ] || echo 'ok' >"$WWW_DIR/health/index.txt"
[ -f "$WWW_DIR/health/index.json" ] || echo '{ "status": "ok" }' >"$WWW_DIR/health/index.json"

View File

@ -0,0 +1,10 @@
version=$(curl -q -LSsf "https://api.github.com/repos/caddyserver/caddy/releases/latest" | grep .tag_name | sed 's|.*: ||g;s|"||g;s|,||g')
export version XCADDY_SETCAP=1 GO111MODULE=auto
echo ">>>>>>>>>>>>>>> ${version} ###############"
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest || exit 10
xcaddy build ${version} \
--output /usr/local/bin/caddy \
--with github.com/caddy-dns/rfc2136 \
--with github.com/caddy-dns/cloudflare \
--with github.com/caddyserver/nginx-adapter \
--with github.com/hairyhenderson/caddy-teapot-module

View File

@ -0,0 +1 @@
curl libcap

View File

@ -0,0 +1,2 @@
EXEC_CMD_BIN="cherokee" # command to execute
EXEC_CMD_ARGS="-C $ETC_DIR/cherokee.conf" # command arguments

View File

View File

View File

@ -0,0 +1,3 @@
SERVICE_USER="x11user" # execute command as another user
EXEC_CMD_BIN="code" # command to execute
EXEC_CMD_ARGS="-wn $DATA_DIR" # command arguments

View File

@ -0,0 +1,5 @@
apt-get install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor >/tmp/packages.microsoft.gpg
install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f /tmp/packages.microsoft.gpg

View File

@ -0,0 +1 @@
wget gpg

View File

@ -0,0 +1,11 @@
EXEC_CMD_BIN="python3" # command to execute
EXEC_CMD_ARGS="$WWW_DIR/commit.py" # command arguments
__replace "5000" "$SERVICE_PORT" "$WWW_DIR/commit.py"
if [ -f "$CONF_DIR/messages.local" ]; then
cat "$CONF_DIR/messages.local" "$WWW_DIR/commit_messages.txt" 2>/dev/null | sort -u >"$WWW_DIR/commit_messages.txt.tmp"
mv -f "$WWW_DIR/commit_messages.txt.tmp" "$WWW_DIR/commit_messages.txt"
fi
if [ -f "$CONF_DIR/humans.local" ]; then
mv -f "$CONF_DIR/humans.local" "$WWW_DIR/main/static/humans.txt"
fi

View File

@ -0,0 +1,28 @@
SERVICE_PORT="3000,9000-9100"
EXEC_CMD_BIN="dockerd" # command to execute
EXEC_CMD_ARGS="" # command arguments
EXEC_PRE_SCRIPT="dockerd-entrypoint.sh" # execute script before
COOLIFY_ENV_FILE="${COOLIFY_ENV_FILE:-/root/coolify.env}"
COLLIFY_IMAGE="${COLLIFY_IMAGE:-ghcr.io/coollabsio/coolify:latest}"
COOLIFY_APP_ID="${COOLIFY_APP_ID:-$(cat /proc/sys/kernel/random/uuid)}"
COOLIFY_DATABASE_URL="${COOLIFY_DATABASE_URL:-$DATABASE_DIR/prod.db}"
COOLIFY_WHITE_LABELED_ICON="${COOLIFY_WHITE_LABELED_ICON:-$COOLIFY_WHITE_LABELED_ICON}"
COOLIFY_SECRET_KEY="${COOLIFY_SECRET_KEY:-$(echo $(($(date +%s%N) / 1000000)) | sha256sum | base64 | head -c 32)}"
export COOLIFY_ENV_FILE COLLIFY_IMAGE COOLIFY_APP_ID COOLIFY_DATABASE_URL COOLIFY_WHITE_LABELED_ICON COOLIFY_SECRET_KEY
if [ -f "$CONF_DIR/env" ]; then
cp -Rf "$CONF_DIR/env" "$COOLIFY_ENV_FILE"
elif [ ! -f "$COOLIFY_ENV_FILE" ]; then
cat <<EOF | tee "$COOLIFY_ENV_FILE" "$CONF_DIR/env" >/dev/null
COOLIFY_HOSTED_ON="${COOLIFY_HOSTED_ON:-docker}"
COOLIFY_AUTO_UPDATE="${COOLIFY_AUTO_UPDATE:-false}"
COOLIFY_APP_ID="$COOLIFY_APP_ID"
COOLIFY_SECRET_KEY="$COOLIFY_SECRET_KEY"
COOLIFY_WHITE_LABELED_ICON="$COOLIFY_WHITE_LABELED_ICON"
COOLIFY_DATABASE_URL="${COOLIFY_DATABASE_URL:-$DATABASE_DIR/prod.db}"
EOF
fi
docker compose -f "/root/coolify.yaml" up | tee -a /dev/stdout

View File

@ -0,0 +1,11 @@
curl -q -LSsf https://cdn.coollabs.io/coolify/install.sh >"/tmp/init.sh" && sh "/tmp/init.sh" || exit 1
install -m 0755 -d /etc/apt/keyringscurl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpgsudo chmod a+r /etc/apt/keyrings/docker.gpg
echo 'deb [arch="'$(dpkg --print-architecture)'" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian '$(. /etc/os-release && echo "$VERSION_CODENAME")''" stable" | tee /etc/apt/sources.list.d/docker.list >/dev/null
rm -Rf "/etc/rndc"* "/etc/bind/"* "/var/bind/"*
etc_dir="/etc/bind" var_dir="/var/bind" data_dir="/data/named" conf_dir="/config/named"
mkdir -p "$etc_dir" "$var_dir" "${DEFAULT_CONF_DIR}/named" "${DEFAULT_DATA_DIR}/named" "/run/named" "/tmp/etc/named" "/tmp/var/named" "/tmp/etc/named/keys" "/tmp/var/named/zones"
[ -d "/tmp/etc/named" ] && cp -Rf "/tmp/etc/named/." "$etc_dir/" && cp -Rf "/tmp/etc/named/." "${DEFAULT_CONF_DIR}/named/"
[ -d "/tmp/var/named" ] && cp -Rf "/tmp/var/named/." "$var_dir/" && cp -Rf "/tmp/var/named/." "${DEFAULT_DATA_DIR}/named/"
chown -Rf named:named "$etc_dir" "$var_dir" "${DEFAULT_CONF_DIR}/named" "${DEFAULT_DATA_DIR}/named" "/run/named"
find "$etc_dir" "$var_dir" "/run/named" "${DEFAULT_CONF_DIR}/named" "${DEFAULT_DATA_DIR}/named" -type d -exec chmod -Rf 777 {} \; && echo "changed folder permissions to 777"
find "$etc_dir" "$var_dir" "/run/named" "${DEFAULT_CONF_DIR}/named" "${DEFAULT_DATA_DIR}/named" -type f -exec chmod -Rf 664 {} \; && echo "changed file permissions to 664"

View File

@ -0,0 +1 @@
bind bind-tools bind-dnssec-root bind-plugins ca-certificates curl gnupg docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

View File

@ -0,0 +1,71 @@
__curl() { curl -q -LSsf --user "$root_user_name:$root_user_pass" "$@"; }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__curl_users() { __curl -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' 'http://'$COUCHDB_SERVER':'$SERVICE_PORT'/_users/org.couchdb.user:'$1'' -d "{\"name\": \"$1\", \"password\": \"$2\", \"roles\": [], \"type\": \"user\"}" || return 2; }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__curl_database() { curl -q -LSsf -X PUT 'http://'$root_user_name:$root_user_pass'@'$COUCHDB_SERVER':'$SERVICE_PORT'/'$1'' || return 2; }
SERVICE_PORT="5984"
EXEC_CMD_BIN="couchdb" # command to execute
EXEC_CMD_ARGS="-vvvvv" # command arguments
IS_DATABASE_SERVICE="yes"
NODENAME="${NODENAME:-}"
CREATE_DATABASE="${CREATE_DATABASE:-}"
COUCHDB_SERVER="${COUCHDB_SERVER:-localhost}"
COUCHDB_ROOT_USER_NAME="${COUCHDB_USER:-root}"
COUCHDB_ROOT_PASS_WORD="${COUCHDB_PASSWORD:-$(__random_password)}"
COUCHDB_ERLANG_COOKIE="${COUCHDB_ERLANG_COOKIE:-}"
user_name="${COUCHDB_USER_NAME:-}" # normal user name
root_user_name="${COUCHDB_ROOT_USER_NAME:-}" # root user name
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# passwords [password/random]
user_pass="${COUCHDB_USER_PASS_WORD:-}" # normal user password
root_user_pass="${COUCHDB_ROOT_PASS_WORD:-}" # root user password
__replace "REPLACE_DATABASE_DIR" "$DATABASE_DIR" "$ETC_DIR/default.ini"
# custom commands
touch "$ETC_DIR/local.d/docker.ini" 2>/dev/null
ln -sf "$DATABASE_DIR" "/opt/couchdb/data" 2>/dev/null
local user_name="${user_name:-$root_user_name}" # set user name
local user_pass="${user_pass:-$root_user_pass}" # set user pass
if ! __curl "http://$COUCHDB_SERVER:$SERVICE_PORT/_users" | grep -q 'db_name":"_users'; then
echo "Creating the _users databases"
if __curl_database "_users" | grep -qE '200|"ok":true'; then
echo "Created database _users"
else
echo "Failed to create database _users" >&2
fi
sleep 1
fi
if ! __curl "http://$COUCHDB_SERVER:$SERVICE_PORT/_replicator" | grep -q 'db_name":"_replicator'; then
echo "Creating the _replicator databases"
if __curl_database "_replicator" | grep -qE '200|"ok":true'; then
echo "Created database _replicator"
else
echo "Failed to create database _replicator" >&2
fi
sleep 1
fi
if ! __curl "http://$COUCHDB_SERVER:$SERVICE_PORT/_global_changes" | grep -q 'db_name":"_global_changes'; then
echo "Creating the _global_changes databases"
if __curl_database "_global_changes" | grep -qE '200|"ok":true'; then
echo "Created database _global_changes"
else
echo "Failed to create database _global_changes" >&2
fi
sleep 1
fi
if [ -n "$user_name" ] && [ -n "$user_pass" ]; then
echo "Creating new user $username"
if __curl_users "$user_name" "$user_pass"; then
echo "Created user: $user_name"
else
echo "Failed to create user: $user_name" >&2
fi
fi
if [ -n "$CREATE_DATABASE" ]; then
echo "Creating database: $CREATE_DATABASE"
__curl_database "$CREATE_DATABASE" || echo "Failed to create database: $CREATE_DATABASE" >&2
fi

View File

@ -0,0 +1,8 @@
[ -d "/etc/nginx" ] || mkdir -p "/etc/nginx"
[ -d "/etc/couchdb" ] && rm -Rf "/etc/couchdb"
[ -d "/tmp/etc/nginx" ] && cp -Rf "/tmp/etc/nginx/." "/etc/nginx/"
[ -f "/docker-entrypoint.sh" ] && rm -Rf "/docker-entrypoint.sh"
for f in $(ls -A /opt/couchdb/bin); do ln -sf "/opt/couchdb/bin/$f" "/usr/local/bin/$f"; done
for f in conf.d modules-available modules-enabled sites-available sites-enabled snippets; do if [ -e "/etc/nginx/$f" ]; then rm -Rf "/etc/nginx/$f"; fi; done
chown -Rf couchdb:couchdb /opt/couchdb
chown -Rf www-data:www-data /etc/nginx

View File

@ -0,0 +1 @@
postfix nginx

View File

View File

View File

View File

@ -0,0 +1,17 @@
EXEC_CMD_BIN="deno" # command to execute
EXEC_CMD_ARGS="task start" # command arguments
server_files="$(find "$DATA_DIR" "$DATA_DIR/src" -maxdepth 1 -type f -iname 'app.ts' -iname 'server.ts' -iname'index.tx' | head -n1)"
[ -d "$DATA_DIR" ] && cd "$DATA_DIR" || exit 1
if [ -n "$START_SCRIPT" ] && [ -f "$START_SCRIPT" ]; then
EXEC_CMD_BIN="$START_SCRIPT"
elif [ -f "$server_files" ]; then
EXEC_CMD_ARGS="$server_files"
elif [ -f "src/index.ts" ]; then
EXEC_CMD_ARGS="src/index.ts"
elif [ -f "index.ts" ]; then
EXEC_CMD_ARGS="index.ts"
elif [ -f "app.ts" ]; then
EXEC_CMD_ARGS="app.ts"
elif [ -f "server.ts" ]; then
EXEC_CMD_ARGS="server.ts"
fi

View File

@ -0,0 +1,39 @@
ARG DENO_VERSION="v1.36.2"
DENO_VERSION="${DENO_VERSION:-$(curl -q -LSsf https://api.github.com/repos/denoland/deno/releases/latest | grep '"name"' | sed 's|.*: ||g;s|"||g;s|,||g' | sort -Vr | head -n1 | grep '^' || echo "v1.36.2")}"
if [ "$(uname -m)" = "amd64" ] || [ "$(uname -m)" = "x86_64" ]; then
ARCH="x86_64"
CHANNEL="github.com/denoland/deno"
URL="https://github.com/denoland/deno/releases/download/$DENO_VERSION/deno-$ARCH-unknown-linux-gnu.zip"
LATEST="$(curl -q -LSsf https://api.github.com/repos/denoland/deno/releases/latest | grep 'browser_download_url' | grep 'linux' | grep "$ARCH" | sed 's|.*: ||g;s|"||g;s|,||g' | sort -Vr | head -n1)"
BIN_FILE="/usr/bin/deno"
TMP_DIR="/tmp/deno-$ARCH"
TMP_FILE="/tmp/deno-$ARCH.zip"
elif [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "aarch64" ]; then
ARCH="arm64"
CHANNEL="github.com/LukeChannings/deno-arm64"
URL="https://github.com/LukeChannings/deno-arm64/releases/download/$DENO_VERSION/deno-linux-$ARCH.zip"
LATEST="$(curl -q -LSsf https://api.github.com/repos/LukeChannings/deno-arm64/releases/latest | grep 'browser_download_url' | grep 'linux' | grep "$ARCH" | sed 's|.*: ||g;s|"||g;s|,||g' | sort -Vr | head -n1)"
BIN_FILE="/usr/bin/deno"
TMP_DIR="/tmp/deno-$ARCH"
TMP_FILE="/tmp/deno-$ARCH.zip"
else
echo "Unsupported architecture"
exit 1
fi
echo "grabbing deno $DENO_VERSION from $CHANNEL for $ARCH"
if curl -q -LSsf -o "$TMP_FILE" "$URL" && [ -f "$TMP_FILE" ]; then
mkdir -p "$TMP_DIR" && cd "$TMP_DIR" || exit 10
unzip -q "$TMP_FILE"
if [ -f "$TMP_DIR/deno" ]; then
cp -Rf "$TMP_DIR/deno" "$BIN_FILE" && chmod -Rf 755 "$BIN_FILE" || exitCode=10
[ -f "$BIN_FILE" ] && $BIN_FILE upgrade && exitCode=0 || exitCode=10
else
echo "Failed to extract deno from $TMP_FILE"
exitCode=10
fi
else
echo "Failed to download deno from $URL"
exitCode=2
fi
rm -Rf "$TMP_FILE" "$TMP_DIR"

View File

View File

@ -0,0 +1,6 @@
SERVICE_PORT="2628"
EXEC_CMD_BIN="dictd" # command to execute
EXEC_CMD_ARGS="-dnodetach" # command arguments
[ -f "/config/dict.conf" ] && cp -Rf "/config/dict.conf" "/etc/dictd/dict.conf" || cp -Rf "/etc/dictd/dict.conf" "/config/dict.conf"
[ -f "/config/dictd.conf" ] && cp -Rf "/config/dictd.conf" "/etc/dictd/dictd.conf" || cp -Rf "/etc/dictd/dictd.conf" "/config/dictd.conf"

View File

View File

@ -0,0 +1 @@
dictd

View File

@ -0,0 +1,20 @@
SERVICE_PORT="2375"
EXEC_CMD_BIN="dockerd" # command to execute
EXEC_CMD_ARGS="-H tcp://127.0.0.1:$SERVICE_PORT -H unix:///var/run/docker.sock " # command arguments
EXEC_CMD_ARGS+="-H unix:///tmp/docker.sock --config-file $HOME/.docker/daemon.json" #
REGISTERY="${REGISTERY:-REGISTERIES}"
DOCKER_HUB_TOKEN="${DOCKER_HUB_TOKEN:-DOCKER_TOKEN}"
__file_copy "$CONF_DIR/daemon.json" "$HOME/.docker/" |& tee -a "$LOG_DIR/init.txt" &>/dev/null
# custom commands
if [ ! -f "$HOME/.docker/config.json" ]; then
cat <<EOF | tee "$HOME/.docker/config.json" &>/dev/null
{
"auths": { "https://index.docker.io/v1/": { "auth": "$DOCKER_HUB_TOKEN" } },
"HttpHeaders": { "User-Agent": "Docker-Client/23.0.1 (linux)" },
"insecure-registries" : [$registries]
}
EOF
fi
[ -f "$CONF_DIR/daemon.json" ] || cp -Rf "$HOME/.docker/config.json" "$CONF_DIR/daemon.json"

View File

View File

@ -0,0 +1 @@
docker dockerize docker-cli docker-engine docker-cli-buildx docker-cli-compose docker-cli-buildx

View File

@ -0,0 +1,2 @@
./opengist --config /path/to/config.yml
OG_OPENGIST_HOME=/data/opengist

View File

@ -0,0 +1 @@
copy --from=opengist /app/opengist/opengist /usr/local/bin/opengist

View File

View File

@ -0,0 +1,42 @@
SERVICE_PORT=80
EXEC_CMD_ARGS="--port $SERVICE_PORT --config $ETC_DIR/app.ini " # command arguments
EXEC_CMD_ARGS+="--custom-path $ETC_DIR/custom --work-path $DATA_DIR/gitea " # continued
GITEA_USER="$SERVICE_USER"
GITEA_TZ="${TZ:-America/New_York}"
GITEA_PROTO="${GITEA_PROTO:-http}"
GITEA_EMAIL_CONFIRM="${GITEA_EMAIL_CONFIRM:-false}"
GITEA_DB_TYPE="${GITEA_DB_TYPE:-sqlite3}"
GITEA_HOSTNAME="${DOMAINNAME:-$HOSTNAME}"
GITEA_PORT="${GITEA_PORT:-$SERVICE_PORT}"
GITEA_NAME="${GITEA_NAME:-Gitea - GIT Server}"
GITEA_SQL_DB_HOST="${GITEA_SQL_DB_HOST:-localhost}"
GITEA_ADMIN="${GITEA_ADMIN:-gitea@${DOMAINNAME:-$HOSTNAME}}"
GITEA_EMAIL_RELAY="${GITEA_EMAIL_RELAY:-${EMAIL_RELAY:-localhost}}"
GITEA_LFS_JWT_SECRET="${GITEA_LFS_JWT_SECRET:-$($EXEC_CMD_BIN generate secret LFS_JWT_SECRET)}"
GITEA_INTERNAL_TOKEN="${GITEA_INTERNAL_TOKEN:-$($EXEC_CMD_BIN generate secret INTERNAL_TOKEN)}"
[ "$GITEA_EMAIL_CONFIRM" = "yes" ] && GITEA_EMAIL_CONFIRM="true"
export CUSTOM_PATH="$ETC_DIR"
export WORK_DIR="$DATA_DIR/gitea"
export GITEA_WORK_DIR="$WORK_DIR"
sed -i "s|REPLACE_GITEA_NAME|$GITEA_NAME|g" "$ETC_DIR/app.ini"
#
__replace "REPLACE_GITEA_TZ" "$GITEA_TZ" "$ETC_DIR/app.ini"
__replace "REPLACE_GITEA_PORT" "$GITEA_PORT" "$ETC_DIR/app.ini"
__replace "REPLACE_GITEA_USER" "$GITEA_USER" "$ETC_DIR/app.ini"
__replace "REPLACE_GITEA_PROTO" "$GITEA_PROTO" "$ETC_DIR/app.ini"
__replace "REPLACE_GITEA_ADMIN" "$GITEA_ADMIN" "$ETC_DIR/app.ini"
__replace "REPLACE_GITEA_SERVER" "$GITEA_SERVER" "$ETC_DIR/app.ini"
__replace "REPLACE_GITEA_EMAIL_RELAY" "$GITEA_EMAIL_RELAY" "$ETC_DIR/app.ini"
__replace "REPLACE_GITEA_EMAIL_CONFIRM" "$GITEA_EMAIL_CONFIRM" "$ETC_DIR/app.ini"
__replace "REPLACE_GITEA_INTERNAL_TOKEN" "$GITEA_INTERNAL_TOKEN" "$ETC_DIR/app.ini"
__replace "REPLACE_GITEA_LFS_JWT_SECRET" "$GITEA_LFS_JWT_SECRET" "$ETC_DIR/app.ini"
# database settings
__replace "REPLACE_DB_TYPE" "$GITEA_DB_TYPE" "$ETC_DIR/app.ini"
[ -n "$GITEA_SQL_DB" ] && __replace "REPLACE_SQL_DB" "$GITEA_SQL_DB" "$ETC_DIR/app.ini"
[ -n "$GITEA_SQL_USER" ] && __replace "REPLACE_SQL_USER" "$GITEA_SQL_USER" "$ETC_DIR/app.ini"
[ -n "$GITEA_SQL_PASS" ] && __replace "REPLACE_SQL_PASS" "$GITEA_SQL_PASS" "$ETC_DIR/app.ini"
[ -n "$GITEA_SQL_DB_HOST" ] && __replace "REPLACE_SQL_HOST" "$GITEA_SQL_DB_HOST" "$ETC_DIR/app.ini"
[ -f "$CONF_DIR/app.ini" ] || cp -Rf "$ETC_DIR/app.ini" "$CONF_DIR/app.ini"

View File

@ -0,0 +1,6 @@
ARG GITEA_VERSION="current"
mkdir -p "/etc/gitea" "/etc/docker"
cp -Rf "/tmp/etc/gitea/app.ini" "/etc/gitea/"
touch "/etc/docker/daemon.json"
GITEA_VERSION="${GITEA_VERSION}" bash "/tmp/setup_gitea.sh"

View File

@ -0,0 +1 @@
docker

View File

@ -0,0 +1,9 @@
EXEC_CMD_BIN="gohttpserver" # command to execute
EXEC_CMD_ARGS="--title=DevSystem --cors --xheaders --theme=black " # command arguments
EXEC_CMD_ARGS+="--addr=0.0.0.0 --port=$SERVICE_PORT --root=$WWW_DIR " #
user_name="${GOHTTPSERVER_USER_NAME:-}" # normal user name
root_user_name="${GOHTTPSERVER_ROOT_USER_NAME:-}" # root user name
user_pass="${GOHTTPSERVER_USER_PASS_WORD:-}" # normal user password
root_user_pass="${GOHTTPSERVER_ROOT_PASS_WORD:-}" # root user password

View File

View File

View File

View File

View File

View File

View File

@ -0,0 +1,8 @@
EXEC_CMD_BIN="echoip" # command to execute
EXEC_CMD_ARGS="-t /opt/echoip/html -H x-forwarded-for -r -s -p " # command arguments
EXEC_CMD_ARGS+="-a /opt/echoip/geoip/GeoLite2-ASN.mmdb " #
EXEC_CMD_ARGS+="-c /opt/echoip/geoip/GeoLite2-City.mmdb " #
EXEC_CMD_ARGS+=" -f /opt/echoip/geoip/GeoLite2-Country.mmdb " #
[ -d "/data/geoip" ] && cp -Rf "/data/geoip/." "/opt/echoip/geoip/"
[ -d "/data/htdocs/html" ] && cp -Rf "/data/htdocs/html/." "/opt/echoip/html/"

View File

@ -0,0 +1,11 @@
FROM golang:1.15-buster AS src
ENV GO111MODULE=on CGO_ENABLED=0
WORKDIR /go/src/github.com/mpolden/echoip
RUN apt update && apt install -yy git
RUN git clone -q https://github.com/mpolden/echoip /go/src/github.com/mpolden/echoip
RUN cd /go/src/github.com/mpolden/echoip && make
ln -sf /opt/echoip/echoip /usr/local/bin/echoip
ln -sf /opt/echoip/echoip /usr/local/bin/ifconfig
sed -i "s|REPLACE_MODIFIED|$(date +'%Y-%m-%d at %H:%M')|g" /opt/echoip/html/index.html

View File

@ -0,0 +1,21 @@
EXEC_CMD_BIN="jekyll" # command to execute
EXEC_CMD_ARGS="serve --force_polling -H 0.0.0.0 -P $SERVICE_PORT" # command arguments
[ -f "$WORK_DIR/.nojekyll" ] && HAS_HTML="true"
[ -f "$WORK_DIR/Gemfile" ] && HAS_GEMFILE="true"
[ -f "$WORK_DIR/_config.yml" ] && HAS_JEKYLL="true"
[ -f "$WORK_DIR/.env" ] && . "$WORK_DIR/.env"
if [ -z "$HAS_HTML" ] && [ -z "$HAS_GEMFILE" ] && [ -z "$HAS_JEKYLL" ]; then
echo "NOTE: I don't see a .nojekyll, Gemfile, or a _config.yml so I don't think there's a jekyll site here"
echo "Either you didn't mount a volume, or you mounted it incorrectly."
echo "Be sure you're in your jekyll site root and use something like this to launch"
echo ""
echo "docker run --name jekyll --rm -p 15999:$SERVICE_PORT -v \$PWD:/app casjaysdevdocker/jekyll"
exit 1
else
mkdir -p "$WORK_DIR" && cd "$WORK_DIR" || exit 1
if [ ! -f "$workdir/.nojekyll" ]; then
bundle install --retry 5 --jobs 20
fi
fi

View File

View File

View File

@ -0,0 +1,25 @@
RUN_CMD="$RUN_CMD -address $HOSTNAME"
RUN_CMD="$RUN_CMD -db-driver sqlite3"
RUN_CMD="$RUN_CMD -db-source /data/lenpaste.db"
[ -f "/data/about" ] && RUN_CMD="$RUN_CMD -server-about /data/about"
[ -f "/data/rules" ] && RUN_CMD="$RUN_CMD -server-rules /data/rules"
[ -f "/data/terms" ] && RUN_CMD="$RUN_CMD -server-terms /data/terms"
[ -d "/data/themes" ] && RUN_CMD="$RUN_CMD -ui-themes-dir /data/themes"
[ -f "/data/lenpasswd" ] && RUN_CMD="$RUN_CMD -lenpasswd-file /data/lenpasswd"
[ "$LENPASTE_ROBOTS_DISALLOW" = "true" ] && RUN_CMD="$RUN_CMD -robots-disallow"
[ -n "$LENPASTE_ADMIN_NAME" ] && RUN_CMD="$RUN_CMD -admin-name '$LENPASTE_ADMIN_NAME'"
[ -n "$LENPASTE_ADMIN_MAIL" ] && RUN_CMD="$RUN_CMD -admin-mail '$LENPASTE_ADMIN_MAIL'"
[ -n "$LENPASTE_BODY_MAX_LENGTH" ] && RUN_CMD="$RUN_CMD -body-max-length '$LENPASTE_BODY_MAX_LENGTH'"
[ -n "$LENPASTE_TITLE_MAX_LENGTH" ] && RUN_CMD="$RUN_CMD -title-max-length '$LENPASTE_TITLE_MAX_LENGTH'"
[ -n "$LENPASTE_DB_MAX_OPEN_CONNS" ] && RUN_CMD="$RUN_CMD -db-max-open-conns '$LENPASTE_DB_MAX_OPEN_CONNS'"
[ -n "$LENPASTE_DB_MAX_IDLE_CONNS" ] && RUN_CMD="$RUN_CMD -db-max-idle-conns '$LENPASTE_DB_MAX_IDLE_CONNS'"
[ -n "$LENPASTE_DB_CLEANUP_PERIOD" ] && RUN_CMD="$RUN_CMD -db-cleanup-period '$LENPASTE_DB_CLEANUP_PERIOD'"
[ -n "$LENPASTE_MAX_PASTE_LIFETIME" ] && RUN_CMD="$RUN_CMD -max-paste-lifetime '$LENPASTE_MAX_PASTE_LIFETIME'"
[ -n "$LENPASTE_GET_PASTES_PER_5MIN" ] && RUN_CMD="$RUN_CMD -get-pastes-per-5min '$LENPASTE_GET_PASTES_PER_5MIN'"
[ -n "$LENPASTE_NEW_PASTES_PER_5MIN" ] && RUN_CMD="$RUN_CMD -new-pastes-per-5min '$LENPASTE_NEW_PASTES_PER_5MIN'"
[ -n "$LENPASTE_GET_PASTES_PER_15MIN" ] && RUN_CMD="$RUN_CMD -get-pastes-per-15min '$LENPASTE_GET_PASTES_PER_15MIN'"
[ -n "$LENPASTE_NEW_PASTES_PER_15MIN" ] && RUN_CMD="$RUN_CMD -new-pastes-per-15min '$LENPASTE_NEW_PASTES_PER_15MIN'"
[ -n "$LENPASTE_GET_PASTES_PER_1HOUR" ] && RUN_CMD="$RUN_CMD -get-pastes-per-1hour '$LENPASTE_GET_PASTES_PER_1HOUR'"
[ -n "$LENPASTE_NEW_PASTES_PER_1HOUR" ] && RUN_CMD="$RUN_CMD -new-pastes-per-1hour '$LENPASTE_NEW_PASTES_PER_1HOUR'"
[ -n "$LENPASTE_UI_DEFAULT_LIFETIME" ] && RUN_CMD="$RUN_CMD -ui-default-lifetime '$LENPASTE_UI_DEFAULT_LIFETIME'"
[ -n "$LENPASTE_UI_DEFAULT_THEME" ] && RUN_CMD="$RUN_CMD -ui-default-theme $LENPASTE_UI_DEFAULT_THEME"

View File

@ -0,0 +1,9 @@
FROM git.lcomrade.su/root/lenpaste:latest AS build
ARG ALPINE_VERSION=edge
[ -f "/entrypoint.sh" ] && rm -Rf "/entrypoint.sh"
[ -d "$DEFAULT_CONF_DIR/html" ] || mkdir -p "$DEFAULT_CONF_DIR/html"
[ -f "$DEFAULT_CONF_DIR/html/about" ] || touch "$DEFAULT_CONF_DIR/html/about"
[ -f "$DEFAULT_CONF_DIR/html/rules" ] || touch "$DEFAULT_CONF_DIR/html/rules"
[ -f "$DEFAULT_CONF_DIR/html/terms" ] || touch "$DEFAULT_CONF_DIR/html/terms"

View File

@ -0,0 +1,7 @@
EXEC_CMD_BIN="lighttpd" # command to execute
EXEC_CMD_ARGS="/etc/lighttpd/lighttpd.conf -D" # command arguments
if [ -z "$PHP_BIN_DIR" ]; then
[ -f "$WWW_DIR/www/info.php" ] && echo "PHP support is not enabled" >"$WWW_DIR/info.php"
[ -f "$ETC_DIR/conf.d/php-fpm.conf" ] && echo "# PHP support is not enabled" >"$ETC_DIR/conf.d/php-fpm.conf"
fi

View File

@ -0,0 +1 @@
cp -Rf "/etc/lighttpd" "$DEFAULT_TEMPLATE_DIR/lighttpd"

View File

@ -0,0 +1 @@
spawn-fcgi lighttpd lighttpd-mod_auth lighttpd-mod_webdav python3 ruby perl perl-cgi php8-cgi

View File

@ -0,0 +1,37 @@
SERVICE_USER="mysql" # execute command as another user
EXEC_CMD_BIN="mysqld" # command to execute
EXEC_CMD_ARGS="--user=$SERVICE_USER --datadir=$DATABASE_DIR" # command arguments
if [ ! -d "$DATABASE_DIR/mysql" ] || [ ! -f "$DATABASE_DIR/ibdata1" ]; then
mkdir -p "$DATABASE_DIR" && chown -Rf $user:$user "$DATABASE_DIR"
mysql_install_db --datadir=$DATABASE_DIR --user=$user 2>/dev/null
fi
(
if [ -f "$CONF_DIR/mysql/init.sh" ]; then
bash -c "$CONF_DIR/mysql/init.sh"
fi
if [ -n "$DATABASE_CREATE" ]; then
mysql -v -u $runas <<MYSQL_SCRIPT
CREATE DATABASE IF NOT EXISTS $DATABASE_CREATE;
MYSQL_SCRIPT
fi
if [ "$user_name" != "root" ] && [ -n "$user_name" ]; then
mysql -v -u $runas <<MYSQL_SCRIPT
CREATE USER IF NOT EXISTS '$user_name'@'%' IDENTIFIED BY '$user_pass';
MYSQL_SCRIPT
fi
if [ "$user_name" != "root" ] && [ -n "$DATABASE_CREATE" ]; then
mysql -v -u $runas <<MYSQL_SCRIPT
GRANT ALL PRIVILEGES ON $DATABASE_CREATE.* TO '$user_name'@'%';
MYSQL_SCRIPT
elif [ "$user_name" = "root" ] && [ -n "$DATABASE_CREATE" ]; then
mysql -v -u $runas <<MYSQL_SCRIPT
GRANT ALL PRIVILEGES ON $DATABASE_CREATE.* TO 'root'@'localhost';
MYSQL_SCRIPT
fi
mysql -v -u $runas <<MYSQL_SCRIPT
ALTER USER 'root'@'localhost' IDENTIFIED BY '$root_user_pass';
FLUSH PRIVILEGES;
MYSQL_SCRIPT
) 2>/dev/stderr >/dev/null

View File

@ -0,0 +1,23 @@
ARG PHPMYADMIN_VERSION="5.2.1"
PHPMYADMIN_VERSION="${PHPMYADMIN_VERSION:-$(curl -q -LSsf https://api.github.com/repos/phpmyadmin/phpmyadmin/releases | grep '"name"' | sed 's|.*: ||g;s|"||g;s|,||g' | sort -Vr | head -n1 | grep '^' || echo "5.2.1")}"
mkdir -p "/var/www" "/etc/phpmyadmin"
[ -e "/etc/php" ] && rm -Rf "/etc/php"
[ -e "/etc/my.cnf" ] && rm -Rf "/etc/my.cnf"
[ -d "/etc/apache2/conf.d" ] && rm -Rf "/etc/apache2/conf.d"
[ -d "/var/www/phpmyadmin" ] && rm -Rf "/var/www/phpmyadmin"
[ -d "/tmp/etc/php" ] && mv -f "/tmp/etc/php" "/tmp/etc/${PHP_VERSION}"
[ -d "/etc/${PHP_VERSION}" ] && ln -sf "/etc/${PHP_VERSION}" "/etc/php"
curl -q -LSsf "https://files.phpmyadmin.net/phpMyAdmin/${PHPMYADMIN_VERSION}/phpMyAdmin-${PHPMYADMIN_VERSION}-all-languages.zip" -o "/tmp/phpmyadmin.zip" &&
unzip -q "/tmp/phpmyadmin.zip" -d "/tmp" && rm -Rf "/tmp/phpmyadmin.zip"
mv -f "/tmp/phpMyAdmin-${PHPMYADMIN_VERSION}-all-languages" "/var/www/phpmyadmin"
git clone --depth 1 "https://github.com/phpmyadmin/themes" "/tmp/themes"
for d in blueberry boodark bootstrap dark-orange darkmod-neo darkwolf eyed fallen fistu metro mhn; do
mkdir -p "/var/www/phpmyadmin/themes/$d" &&
[ -d "/tmp/themes/$d" ] && cp -Rf "/tmp/themes/$d/." "/var/www/phpmyadmin/themes/$d/"
done
cp -Rf "/tmp/etc/." "/etc/"
cp -Rf "/etc/mysql" "/usr/local/share/template-files/config/mysql"
ln -sf "/etc/phpmyadmin/config.php" "/var/www/phpmyadmin/config.inc.php"
chmod -f 777 "/var/www/phpmyadmin"
chown -Rf apache:apache "/var/www"

View File

@ -0,0 +1,14 @@
nginx mariadb-server-utils mariadb-client mariadb pwgen composer \
${PHP_VERSION}-bcmath ${PHP_VERSION}-bz2 ${PHP_VERSION}-calendar ${PHP_VERSION}-cgi \
${PHP_VERSION}-common ${PHP_VERSION}-ctype ${PHP_VERSION}-curl ${PHP_VERSION}-dba ${PHP_VERSION}-dev \
${PHP_VERSION}-dom ${PHP_VERSION}-embed ${PHP_VERSION}-enchant ${PHP_VERSION}-exif ${PHP_VERSION}-ffi \
${PHP_VERSION}-fileinfo ${PHP_VERSION}-fpm ${PHP_VERSION}-ftp ${PHP_VERSION}-gd ${PHP_VERSION}-gettext \
${PHP_VERSION}-gmp ${PHP_VERSION}-iconv ${PHP_VERSION}-imap ${PHP_VERSION}-intl ${PHP_VERSION}-ldap \
${PHP_VERSION}-litespeed ${PHP_VERSION}-mbstring ${PHP_VERSION}-mysqli ${PHP_VERSION}-mysqlnd ${PHP_VERSION}-odbc \
${PHP_VERSION}-opcache ${PHP_VERSION}-openssl ${PHP_VERSION}-pcntl ${PHP_VERSION}-pdo ${PHP_VERSION}-pdo_dblib \
${PHP_VERSION}-pdo_mysql ${PHP_VERSION}-pdo_odbc ${PHP_VERSION}-pdo_pgsql ${PHP_VERSION}-pdo_sqlite ${PHP_VERSION}-pear \
${PHP_VERSION}-pgsql ${PHP_VERSION}-phar ${PHP_VERSION}-phpdbg ${PHP_VERSION}-posix ${PHP_VERSION}-pspell ${PHP_VERSION}-session \
${PHP_VERSION}-shmop ${PHP_VERSION}-simplexml ${PHP_VERSION}-snmp ${PHP_VERSION}-soap ${PHP_VERSION}-sockets ${PHP_VERSION}-sodium \
${PHP_VERSION}-sqlite3 ${PHP_VERSION}-sysvmsg ${PHP_VERSION}-sysvsem ${PHP_VERSION}-sysvshm ${PHP_VERSION}-tidy \
${PHP_VERSION}-tokenizer ${PHP_VERSION}-xml ${PHP_VERSION}-xmlreader ${PHP_VERSION}-xmlwriter ${PHP_VERSION}-xsl \
${PHP_VERSION}-zip ${PHP_VERSION}-pecl-memcached ${PHP_VERSION}-pecl-mongodb ${PHP_VERSION}-pecl-redis

View File

@ -0,0 +1,19 @@
EXEC_CMD_BIN="mongod" # command to execute
EXEC_CMD_ARGS="-vvvv" # command arguments
ME_CONFIG_EDITORTHEME="${ME_CONFIG_EDITORTHEME:-dracula}"
ME_CONFIG_MONGODB_URL="${ME_CONFIG_MONGODB_URL:-mongodb://127.0.0.1:27017}"
ME_CONFIG_MONGODB_ENABLE_ADMIN="${ME_CONFIG_MONGODB_ENABLE_ADMIN:-true}"
ME_CONFIG_BASICAUTH_USERNAME="${ME_CONFIG_BASICAUTH_USERNAME:-}"
ME_CONFIG_BASICAUTH_PASSWORD="${ME_CONFIG_BASICAUTH_PASSWORD:-}"
ME_CONFIG_BASICAUTH_USERNAME_FILE="${ME_CONFIG_BASICAUTH_USERNAME_FILE:-}"
ME_CONFIG_BASICAUTH_PASSWORD_FILE="${ME_CONFIG_BASICAUTH_PASSWORD_FILE:-}"
ME_CONFIG_MONGODB_ADMINUSERNAME_FILE="${ME_CONFIG_MONGODB_ADMINUSERNAME_FILE:-}"
ME_CONFIG_MONGODB_ADMINPASSWORD_FILE="${ME_CONFIG_MONGODB_ADMINPASSWORD_FILE:-}"
ME_CONFIG_MONGODB_AUTH_USERNAME_FILE="${ME_CONFIG_MONGODB_AUTH_USERNAME_FILE:-}"
ME_CONFIG_MONGODB_AUTH_PASSWORD_FILE="${ME_CONFIG_MONGODB_AUTH_PASSWORD_FILE:-}"
ME_CONFIG_MONGODB_CA_FILE="${ME_CONFIG_MONGODB_CA_FILE:-}"
VCAP_APP_HOST="${VCAP_APP_HOST:-0.0.0.0}"
VCAP_APP_PORT="${VCAP_APP_PORT:-19054}"
cd /usr/share/mongo-express && yarn start &

View File

@ -0,0 +1,9 @@
mkdir -p "/etc/mongodb"
sh -c "$(curl -q -LSsf "https://rpm.nodesource.com/setup_${NODE_VERSION}.x")" &&
curl -q -LSsf "https://dl.yarnpkg.com/rpm/yarn.repo" -o /etc/yum.repos.d/yarn.repo &&
rpm --import "https://dl.yarnpkg.com/rpm/pubkey.gpg" &&
yum install -yy nodejs yarn &&
bash /tmp/setup_mongodb.sh
cp -Rf "/tmp/mongo-express" "/usr/local/share/template-files/config"
cp -Rf "/usr/local/share/template-files/config/mongodb/." "/etc/mongodb/"
ln -sf "/etc/mongodb/mongod.conf" "/etc/mongod.conf"

View File

View File

@ -0,0 +1 @@
EXEC_CMD_BIN="mpd" # command to execute

View File

@ -0,0 +1 @@
mpd

View File

View File

View File

View File

@ -0,0 +1 @@
neovim

View File

@ -0,0 +1,47 @@
[global]
error_log = /var/log/nextcloud/php-fpm.log
log_level = warning
emergency_restart_threshold = 10
emergency_restart_interval = 1m
process_control_timeout = 10s
[nextcloud]
user = nextcloud
group = www-data
listen = 127.0.0.1:9000
pm = ondemand
pm.max_children = 10
pm.process_idle_timeout = 120s
pm.max_requests = 500
pm.status_path =
ping.path = /ping
;request_terminate_timeout = 0
;request_slowlog_timeout = 0
;slowlog = /var/log/nextcloud/php-fpm.slow.log
;catch_workers_output = yes
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
php_admin_flag[file_uploads] = true
php_admin_value[memory_limit] = 10G
php_admin_value[post_max_size] = 10G
php_admin_value[upload_max_filesize] = 10G
php_admin_value[session.save_path] = /var/tmp/nextcloud
php_admin_value[sys_temp_dir] = /var/tmp/nextcloud
php_admin_value[upload_tmp_dir] = /var/tmp/nextcloud
php_admin_flag[log_errors] = on
php_admin_value[error_log] = /var/log/nextcloud/php.error.log
php_admin_value[opcache.error_log] = /var/log/nextcloud/php.error.log
php_admin_flag[output_buffering] = false
php_admin_flag[mbstring.func_overload] = false
php_admin_value[always_populate_raw_post_data] = -1
php_admin_value[disable_functions] = exec,passthru,shell_exec,system,proc_open,curl_multi_exec,show_source
php_admin_flag[opcache.enable] = true
php_admin_flag[opcache.enable_cli] = true
php_admin_flag[opcache.save_comments] = true
php_admin_value[opcache.interned_strings_buffer] = 8
php_admin_value[opcache.max_accelerated_files] = 10000
php_admin_value[opcache.memory_consumption] = 128
php_admin_value[opcache.revalidate_freq] = 1

View File

@ -0,0 +1,9 @@
apk add nginx php82-fpm \
nextcloud nextcloud-activity nextcloud-admin_audit nextcloud-circles nextcloud-comments nextcloud-dashboard \
nextcloud-doc nextcloud-encryption nextcloud-federation nextcloud-files_external nextcloud-files_pdfviewer \
nextcloud-files_rightclick nextcloud-files_sharing nextcloud-files_trashbin nextcloud-files_versions \
nextcloud-firstrunwizard nextcloud-initscript nextcloud-logreader nextcloud-mysql \
nextcloud-nextcloud_announcements nextcloud-notifications nextcloud-password_policy nextcloud-photos \
nextcloud-privacy nextcloud-recommendations nextcloud-serverinfo nextcloud-sharebymail nextcloud-support \
nextcloud-survey_client nextcloud-suspicious_login nextcloud-systemtags nextcloud-text nextcloud-user_ldap \
nextcloud-user_status nextcloud-weather_status

Some files were not shown because too many files have changed in this diff Show More