Licensing and Makefile standards

This commit is contained in:
DarkFeather 2017-06-19 13:16:04 -05:00
parent df2b56ee92
commit 0aa26c388d
2 changed files with 69 additions and 29 deletions

27
LICENSE Normal file
View File

@ -0,0 +1,27 @@
# http://www.wtfpl.net/about/
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
ANINIX ADDENDUM
Trademark Pending 2017 (https://aninix.net/irc/)
The "AniNIX" name and |> logo is trademark-pending as of 2017. All
AniNIX materials can be reproduced and re-used, though you must
contact the admins of the network to get written permission to use
the AniNIX name.
Attribution is appreciated for other materials but not legally
required or necessary.

View File

@ -1,71 +1,84 @@
SHELL := /bin/bash SHELL := /bin/bash
BACKUPDIR := /usr/local/backup BACKUPDIR := /usr/local/backup
INSTALLER != curl -s https://aninix.net/foundation/installer-test.bash
compile: compile:
pacman -S openssl gzip tar openssh ${INSTALLER} -S openssl gzip tar openssh
make keys
install: install: compile
@echo You must specify client or server in a call to make. @echo You must specify client or server in a call to make.
client: user aether.bash client: user aether.bash
cp aether.bash /home/aether/aether.bash cp aether.bash /home/aether/aether.bash
chown aether /home/aether/aether.bash
chmod 0700 /home/aether/aether.bash
/home/aether/aether.bash /home/aether/aether.bash
crontab -l > /tmp/cronie sudo -u aether crontab -l > /tmp/cronie
grep aether.bash /tmp/cronie || echo '0 1 * * * /home/aether/aether.bash &>> /var/log/aether.log' >> /tmp/cronie grep aether.bash /tmp/cronie || echo '0 1 * * * /home/aether/aether.bash &>> /var/log/aether.log' >> /tmp/cronie
crontab /tmp/cronie sudo -u aether crontab /tmp/cronie
rm /tmp/cronie rm /tmp/cronie
touch /var/log/aether.log touch /var/log/aether.log
chown aether:aether /var/log/aether.log chown aether:aether /var/log/aether.log
make checkperm
server: scripts user ./aether-gen.bash ./aether.pub ./server-backup server: keys scripts user ./aether-gen.bash ./aether.pub ./server-backup
bash ./aether-gen.bash bash ./aether-gen.bash
cp ./aether.pub /home/aether/.ssh/authorized_keys cp ./aether.pub /home/aether/.ssh/authorized_keys
chmod 0600 /home/aether/.ssh/authorized_keys cp ./aether-gen.bash /root/bin/aether-gen.bash
chown aether /home/aether/.ssh/authorized_keys
mkdir /usr/local/etc/Aether mkdir /usr/local/etc/Aether
chown aether /usr/local/etc/Aether
chmod 0700 /usr/local/etc/Aether
touch /usr/local/etc/Aether/nodeslist touch /usr/local/etc/Aether/nodeslist
@echo You have the files. Add aether-gen.bash and server-backup to root's crontab. mkdir -p ${BACKUPDIR};
make checkperm
@echo You have the files. Add aether-gen.bash and server-backup to root\'s crontab.
@echo Track client nodes in /usr/local/etc/Aether/nodeslist @echo Track client nodes in /usr/local/etc/Aether/nodeslist
user: aether make-user.bash user: aether make-user.bash
/bin/bash ./make-user.bash /bin/bash ./make-user.bash
tar: aether.bash aether make-user.bash
tar cvf aether.tar aether.bash aether Makefile make-user.bash
gzip aether.tar
node-command: node-command:
@echo -ne 'bzr checkout bzr://aninix.net/Aether' @echo USE THE FOLLOWING COMMANDS TO SET UP A NODE.
@echo -ne 'git clone https://aninix.net/foundation/Aether;'
@echo @echo
@echo -ne 'cd Aether; cat > aether # Paste the private key' @echo -ne 'cd Aether; cat > aether # Paste the private key'
@echo @echo
@echo -ne 'make client' @echo -ne 'make client'
@echo @echo
@echo MAKE SURE TO ADD THE NODE TO /usr/local/etc/Aether/nodes.list
keys: keys:
ssh-keygen -t rsa -P "" -f aether if [ ! -f ./aether ]; then ssh-keygen -t rsa -P "" -f aether
scripts: ./server-backup ./remote-backup scripts: ./server-backup ./remote-backup
cp ./server-backup /root/bin cp ./server-backup /root/bin
chmod 0700 /root/bin/server-backup
cp ./remote-backup /root/bin cp ./remote-backup /root/bin
chmod 0700 /root/bin/remote-backup make checkperm
reverse: reverse:
cp /root/bin/server-backup . if [ -f /root/bin/server-backup ]; then cp /root/bin/server-backup .; fi
cp /root/bin/remote-backup . if [ -f /root/bin/remote-backup ]; then cp /root/bin/remote-backup .; fi
if [ -f /root/bin/aether-gen.bash ]; then cp /root/bin/aether-gen.bash .; fi
if [ -f /home/aether/aether.bash ]; then cp /home/aether/aether.bash .; fi
diff:
if [ -f /root/bin/server-backup ]; then diff ./server-backup /root/bin/server-backup; fi
if [ -f /root/bin/remote-backup ]; then diff ./remote-backup /root/bin/remote-backup; fi
if [ -f /root/bin/aether-gen.bash ]; then diff ./aether-gen.bash /root/bin/aether-gen.bash; fi
if [ -f /home/aether/aether.bash ]; then diff ./aether.bash /home/aether/aether.bash; fi
checkperm: checkperm:
chmod 0700 /root/bin/remote-backup /root/bin/remote-backup id aether;
chown root:root /root/bin/server-backup /root/bin/remote-backup if [ -d /home/aether ]; then chmod 0600 /home/aether/.ssh/authorized_keys; chmod 0700 /home/aether/.ssh /home/aether; chown -R aether:aether /home/aether; fi
chmod -R 0700 /usr/local/etc/Aether if [ -f /root/bin/remote-backup ]; then chmod 0700 /root/bin/remote-backup; chown root:root /root/bin/remote-backup; fi
chown -R aether:aether /usr/local/etc/Aether if [ -f /root/bin/server-backup ]; then chmod 0700 /root/bin/server-backup; chown root:root /root/bin/server-backup; fi
chown postgres:root ${BACKUPDIR} if [ -d /usr/local/etc/Aether ]; then chmod -R 0700 /usr/local/etc/Aether; chown -R aether:aether /usr/local/etc/Aether; fi
chmod 0770 ${BACKUPDIR} if [ -d ${BACKUPDIR} ]; then chmod 0770 ${BACKUPDIR}; chown postgres:root ${BACKUPDIR}; fi
if [ -f /var/log/aether.log ]; then chown aether:aether /var/log/aether.log; chmod 0750 /var/log/aether.log; fi
clean:
@bash -c 'printf "This will irreversibly destroy all backups. Confirm? [YES/no] " ; read answer; [ "$$answer" == "YES" ] && exit 0; exit 1'
for i in `ls /home/aether/aether*`; do shred $$i; done
rm -Rf /home/aether
userdel aether
find /usr/local/backup -type f -exec shred {} \;
rm -Rf /usr/local/backup; fi
test:
echo bye | sftp -o IdentityFile=/home/aether/.ssh/aether aether@aninix.net