Compare commits

..

No commits in common. "8124a4d09091c85efaaed88ba40c4660673148a1" and "c7326c7bdce373455179b6e033eafea736ff26f0" have entirely different histories.

2 changed files with 0 additions and 163 deletions

View File

@ -1,127 +0,0 @@
# Install using: sudo su -c "bash <(wget -qO- /url/to/install-apache.sh)"
REALUSER=$(logname)
mkdir /home/$REALUSER/www 2>>install.log &
#apt install docker.io
# apt update 2>>install.log &&
apt install apache2 -y 2>>install.log &&
apt install samba -y 2>>install.log &&
# Setting up Samba shares
if ! grep -q "/home/$REALUSER/www" "/etc/samba/smb.conf"; then
cat <<EOT >> "/etc/samba/smb.conf"
[$REALUSER-www]
comment = Samba File Server Share
path = /home/$REALUSER/www
browsable = yes
guest ok = yes
read only = no
create mask = 777
force create mode = 777
directory mask = 777
force directory mode = 777
[/$REALUSER-www]
EOT
fi
if ! grep -q "/var/www" "/etc/samba/smb.conf"; then
cat <<EOT >> "/etc/samba/smb.conf"
[www]
comment = Samba File Server Share
path = /var/www
browsable = yes
guest ok = yes
read only = no
create mask = 777
force create mode = 777
directory mask = 777
force directory mode = 777
valid users = $REALUSER, root
force user = root
force group = root
writeable = yes
admin users = root
[/www]
EOT
fi
if ! grep -q "/etc/apache2" "/etc/samba/smb.conf"; then
cat <<EOT >> "/etc/samba/smb.conf"
[apache2]
comment = Samba File Server Share
path = /etc/apache2
browsable = yes
guest ok = yes
read only = no
create mask = 777
force create mode = 777
directory mask = 777
force directory mode = 777
valid users = $REALUSER, root
force user = root
force group = root
writeable = yes
admin users = root
[/apache2]
EOT
fi
sed -i -e 's/obey pam restrictions = yes/obey pam restrictions = no/g' /etc/samba/smb.conf
service smbd restart 2>>install.log &&
ufw allow samba 2>>install.log
if ! pdbedit "$REALUSER" &>/dev/null; then
sudo smbpasswd -a $REALUSER 2>>install.log
fi
mkdir -p /var/www/cms/www 2>>install.log &&
mkdir -p /var/www/cms/log 2>>install.log &&
chmod -R uga+rwx /home/$REALUSER/www/ 2>>install.log &&
chmod -R uga+rwx /var/www/ 2>>install.log &&
# chmod -R 775 /var/www/
# chown -R $REALUSER:$REALUSER /var/www/
# chown -R $REALUSER:$REALUSER /etc/apache2/
service apache2 restart 2>>install.log &&
apt install libcgi-session-perl -y 2>>install.log &&
apt install libapache2-mod-perl2 -y 2>>install.log &&
apt install libarchive-zip-perl -y 2>>install.log &&
apt install libdbd-sqlite2-perl -y 2>>install.log &&
apt install libdbd-sqlite3-perl -y 2>>install.log &&
apt install libdbd-mysql-perl -y 2>>install.log &&
apt install libio-string-perl -y 2>>install.log &&
apt install libjson-perl -y 2>>install.log &&
apt install libmime-lite-perl -y 2>>install.log &&
apt install libexcel-writer-xlsx-perl -y 2>>install.log &&
a2enmod rewrite 2>>install.log &&
a2enmod headers 2>>install.log &&
a2enmod expires 2>>install.log &&
a2enmod cgi.load 2>>install.log &&
if [ ! -f "/etc/apache2/sites-enabled/cms.conf" ]; then
cat <<EOT > "/etc/apache2/sites-enabled/cms.conf"
Listen 8090
<VirtualHost *:8090>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/cms/www
ErrorLog /var/www/cms/log/error.log
CustomLog /var/www/cms/log/access.log combined
<Directory /var/www/cms/www>
Options Indexes FollowSymLinks MultiViews
DirectoryIndex index.html index.pl
AllowOverride All
Require all granted
</Directory>
<Files ~ "\.(pl|cgi)$">
AddHandler cgi-script .pl
Options +ExecCGI
</Files>
</VirtualHost>
EOT
fi
systemctl restart apache2 2>>install.log &&
echo 'Installation complete'

View File

@ -1,36 +0,0 @@
let dig = (value, startObject=window) => {
var stack = [[startObject, '']];
var searched = [];
var found = false;
var isArray = function (test) {
return Object.prototype.toString.call(test) === '[object Array]';
}
while (stack.length) {
var fromStack = stack.pop();
var obj = fromStack[0];
var address = fromStack[1];
if (typeof obj == typeof value && obj == value || typeof obj === 'string' && value instanceof RegExp && value.test(obj)) {
var found = address;
break;
} else if (typeof obj == "object" && searched.indexOf(obj) == -1) {
if (isArray(obj)) {
var prefix = '[';
var postfix = ']';
} else {
var prefix = '.';
var postfix = '';
}
for (i in obj) {
try {
stack.push([obj[i], address + prefix + i + postfix]);
}
catch {}
}
searched.push(obj);
}
}
return found == '' ? true : found;
}