commit dea50d88f0499f3ecd79356b670046ccab98974b Author: zj <1052308357@qq.com> Date: Sat Dec 27 16:57:48 2025 +0800 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..453792e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/*.pkg.tar.zst +/src/ +/pkg/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..3fda5b1 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,40 @@ +# Maintainer: zj <1052308357@qq.com> + +pkgname=tms-vsftpd-config +pkgver=12 +pkgrel=27 +pkgdesc="vsftpd tms conifg." +arch=('x86_64') +url="https://yuyujing.cn" +license=('Proprietary') + +depends=('vsftpd') + +source=("${pkgname}.tar.gz") + +sha256sums=('e2feb09b718838aed42d25228f033b50629d5e45870841955b19962cd88a56e5') + +install="${pkgname}.install" + +prepare() { + cd "${srcdir}/${pkgname}" +} + +build() { + msg "No build step required for this package." +} + +package() { + + local _config="/etc" + local _config_base_dir="/etc/pam.d" + + install -d -m755 "${pkgdir}${_config}" + install -d -m755 "${pkgdir}${_config_base_dir}" + + cd "${srcdir}/${pkgname}" + + install -m644 vsftpd "${pkgdir}${_config_base_dir}/vsftpd.tms" + install -m644 vsftpd.conf "${pkgdir}${_config}/vsftpd.conf.tms" + +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..9d5ad54 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# pure-ftpd 的tms配置文件 \ No newline at end of file diff --git a/tms-vsftpd-config.install b/tms-vsftpd-config.install new file mode 100644 index 0000000..1820559 --- /dev/null +++ b/tms-vsftpd-config.install @@ -0,0 +1,50 @@ +# pre_install 钩子在安装文件复制到系统之前运行 +pre_install() { + echo "stop ftp service" + systemctl stop vsftpd.service + +} + +# post_install: 在软件包安装后执行 +post_install() { + + echo "user add tms and kdm" + + useradd tms + usermod -m -d /media/cinema tms + usermod -m -d /media/cinema tms + useradd kdm + usermod -m -d /media/kdm kdm + usermod -m -d /media/kdm kdm + + + echo "Checking vsftpd config and bakup" + + [ -f /etc/vsftpd.conf ] && mv /etc/vsftpd.conf /etc/vsftpd.conf.bakup + [ -f /etc/pam.d/vsftpd ] && mv /etc/pam.d/vsftpd /etc/pam.d/vsftpd.bakup + + + mv /etc/vsftpd.conf.tms /etc/vsftpd.conf + mv /etc/pam.d/vsftpd.tms /etc/pam.d/vsftpd + + + echo "start vsftpd.service" + + systemctl start vsftpd.service + systemctl enable vsftpd.service +} + +# pre_remove: 在软件包卸载前执行 +pre_remove() { + echo "Stopping and disabling pure-ftpd.service..." + systemctl stop vsftpd.service + systemctl disable vsftpd.service +} + +# post_remove: 在软件包卸载后执行 +post_remove() { + echo "Reloading systemd configuration after removal..." + [ -f /etc/vsftpd.conf.bakup ] && mv /etc/vsftpd.conf.bakup /etc/vsftpd.conf + [ -f /etc/pam.d/vsftpd.bakup ] && mv /etc/pam.d/vsftpd.bakup /etc/pam.d/vsftpd + +} diff --git a/tms-vsftpd-config.tar.gz b/tms-vsftpd-config.tar.gz new file mode 100644 index 0000000..2c71af0 Binary files /dev/null and b/tms-vsftpd-config.tar.gz differ diff --git a/tms-vsftpd-config/vsftpd b/tms-vsftpd-config/vsftpd new file mode 100644 index 0000000..5cf8b49 --- /dev/null +++ b/tms-vsftpd-config/vsftpd @@ -0,0 +1,6 @@ +#%PAM-1.0 +auth required /lib/security/pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed +auth required /lib/security/pam_unix.so shadow nullok +auth required /lib/security/pam_nologin.so +account required /lib/security/pam_unix.so +session required /lib/security/pam_unix.so diff --git a/tms-vsftpd-config/vsftpd.conf b/tms-vsftpd-config/vsftpd.conf new file mode 100644 index 0000000..35e9f49 --- /dev/null +++ b/tms-vsftpd-config/vsftpd.conf @@ -0,0 +1,21 @@ +# 基本设置 +listen=YES +anonymous_enable=NO +local_enable=YES +write_enable=YES +local_umask=022 + +chroot_local_user=YES +allow_writeable_chroot=YES + +pasv_enable=YES +pasv_min_port=40000 +pasv_max_port=50000 + +ssl_enable=NO + +xferlog_enable=YES +xferlog_file=/var/log/vsftpd.log +xferlog_std_format=YES + +pam_service_name=vsftpd diff --git a/up+.sh b/up+.sh new file mode 100755 index 0000000..1a6d204 --- /dev/null +++ b/up+.sh @@ -0,0 +1,68 @@ +#!/bin/bash +#set -e +################################################################################################################## +# Author : Erik Dubois +# Website : https://www.erikdubois.be +# Website : https://www.alci.online +# Website : https://www.ariser.eu +# Website : https://www.arcolinux.info +# Website : https://www.arcolinux.com +# Website : https://www.arcolinuxd.com +# Website : https://www.arcolinuxb.com +# Website : https://www.arcolinuxiso.com +# Website : https://www.arcolinuxforum.com +################################################################################################################## +# +# DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK. +# +################################################################################################################## +#tput setaf 0 = black +#tput setaf 1 = red +#tput setaf 2 = green +#tput setaf 3 = yellow +#tput setaf 4 = dark blue +#tput setaf 5 = purple +#tput setaf 6 = cyan +#tput setaf 7 = gray +#tput setaf 8 = light blue +################################################################################################################## + +# reset - commit your changes or stash them before you merge +# git reset --hard - personal alias - grh + +echo "Deleting the work folder if one exists" +[ -d work ] && rm -rf work + +# checking if I have the latest files from github +echo "Checking for newer files online first" +git pull + +# Below command will backup everything inside the project folder +git add --all . + +# Give a comment to the commit if you want +echo "####################################" +echo "Write your commit comment!" +echo "####################################" + +read input + +# Committing to the local repository with a message containing the time details and commit text + +git commit -m "$input" + +# Push the local files to github + +if grep -q main .git/config; then + echo "Using main" + git push -u origin main +fi + +if grep -q master .git/config; then + echo "Using master" + git push -u origin master +fi + +echo "################################################################" +echo "################### Git Push Done ######################" +echo "################################################################"