From 49f9f6d31530e5e55e7a731180e44402a6573ed5 Mon Sep 17 00:00:00 2001 From: DarkFeather Date: Sat, 8 Feb 2020 13:34:58 -0600 Subject: [PATCH] Standardizing round 1 --- .gitignore | 3 +++ LICENSE | 14 +++++++++----- Makefile | 17 ++++++++--------- PKGBUILD | 46 +++++++++++++++++++++++++++++++++++++++++++++ README | 3 --- README.md | 29 ++++++++++++++++++++++++++++ tests/test_units.py | 11 +++++++++++ 7 files changed, 106 insertions(+), 17 deletions(-) create mode 100644 PKGBUILD delete mode 100644 README create mode 100644 README.md create mode 100644 tests/test_units.py diff --git a/.gitignore b/.gitignore index 6b2a8b4..9be8205 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ aether aether.pub aether.tar.gz nodeslist +*.tar.xz +pkg/ +src/ diff --git a/LICENSE b/LICENSE index 878d895..bffb679 100644 --- a/LICENSE +++ b/LICENSE @@ -16,12 +16,16 @@ ANINIX ADDENDUM - Trademark Pending 2017 (https://aninix.net/irc/) + Trademark 2017 (https://aninix.net/) - 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. + The "AniNIX" name and |> logo are trademarked as of 2017/11/21. + AniNIX materials may be reproduced and re-used (though you must + contact the admins of the network to get written permission to use + the AniNIX name or logo) so long as such reproduction or re-use + does not inhibit the original AniNIX use of the same. Attribution is appreciated for other materials but not legally required or necessary. + + "AniNIX" trademark serial: 87177883 + |> Logo trademark serial: 87177887 diff --git a/Makefile b/Makefile index 13abcf4..8376eae 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,5 @@ SHELL := /bin/bash BACKUPDIR := /usr/local/backup -INSTALLER != curl -s https://aninix.net/foundation/installer-test.bash - -compile: - ${INSTALLER} -S openssl gzip tar openssh - -install: compile - @echo You must specify client or server in a call to make. client: user aether.bash cp aether.bash /home/aether/aether.bash @@ -19,6 +12,12 @@ client: user aether.bash chown aether:aether /var/log/aether.log make checkperm +compile: + @echo Nothing to do + +install: compile + @echo You must specify client or server in a call to make. + server: keys scripts user ./aether-gen.bash ./aether.pub ./server-backup bash ./aether-gen.bash cp ./aether.pub /home/aether/.ssh/authorized_keys @@ -45,7 +44,7 @@ node-command: @echo MAKE SURE TO ADD THE NODE TO /usr/local/etc/Aether/nodes.list keys: - if [ ! -f ./aether ]; then ssh-keygen -t rsa -P "" -f aether + if [ ! -f ./aether ]; then ssh-keygen -t rsa -P "" -f aether; fi scripts: ./server-backup ./remote-backup cp ./server-backup /root/bin @@ -82,4 +81,4 @@ clean: rm -Rf /usr/local/backup; fi test: - echo bye | sftp -o IdentityFile=/home/aether/.ssh/aether aether@aninix.net + python3 -m pytest diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..902729d --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,46 @@ +depends=('bash>=4.4','openssl','gzip','tar','openssh') +makedepends=('make>=4.2') +checkdepends=() +optdepends=() +pkgname="$(git config remote.origin.url | rev | cut -f 1 -d '/' | rev | sed 's/.git$//')" +pkgver="$(git describe --tag --abbrev=0)"."$(git rev-parse --short HEAD)" +pkgrel=1 +pkgrel() { + echo $(( `git log "$(git describe --tag --abbrev=0)"..HEAD | grep -c commit` + 1 )) +} +epoch="$(git log | grep -c commit)" +pkgdesc="$(head -n 1 README.md)" +arch=("x86_64") +url="$(git config remote.origin.url | sed 's/.git$//')" +license=('custom') +groups=() +provides=("${pkgname}") +conflicts=() +replaces=("${pkgname,,}", "aninix-${pkgname,,}") +backup=() +options=() +install= +changelog= +source=() +noextract=() +md5sums=() +validpgpkeys=() + +prepare() { + git pull +} + +build() { + make -C .. +} + +check() { + chmod -R u+r ../pkg + make -C .. test +} + +package() { + export pkgdir="${pkgdir}" + make -C .. install + install -D -m644 ../LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/README b/README deleted file mode 100644 index 4391209..0000000 --- a/README +++ /dev/null @@ -1,3 +0,0 @@ -The Aether project is a way to back up server configuration, source code, and file lists to remote locations. These remote locations should be securely controlled by the same administrative staff as the server owner. - -To create the aether and aether.pub files, run "make keys". This should not be repeated. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4c0f1dd --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +The Aether project is a way to back up server configuration, source code, and file lists to remote locations. These remote locations should be securely controlled by the same administrative staff as the server owner. + +# Etymology +The Aether project is the AniNIX's implementation of the "cloud." While its admins consider the computing cloud to be Computers Living On Unknown Datacenters, aka. with unknown controls and thereby insecure, distributing backups to many locations makes the AniNIX more resilient. + +Dictionary.com translates Aether as the Greek personification of the clear sky, and this project lives a wide array of locations across the nebulous Internet, giving it no physical form to hold onto. + +# Installing +You have two options to install this project: +* Arch Linux and related distros: Run `makepkg -sri` +* Other operating systems: Run `make install` + +# Initial setup +To create the aether and aether.pub files, run "make keys". This should not be repeated. + +# Adding backup configurations +Individual projects wanting to be backed up by the Aether system should add a file to their package into `/usr/local/etc/Aether/backups/`. + +# Relevant Files and Software +Aether installs a script for rsync-based remote backups. We implement this policy through the two 4TB hard-drives, at least one of which is always off-site, that can be plugged into the [Maat](/Wiki/Hosts/Maat.md) hotswap bay along with a virtual machine that mounts the ArchLinux iso and the drive in the bay. + +# Available Clients +The only client is direct server access on one of the client nodes. + +# Equivalents or Competition +Equivalent services are DropBox, Google Drive, or Barracuda. + +# Notes +Those deploying Aether should maintain a nodeslist file that only root can read. diff --git a/tests/test_units.py b/tests/test_units.py new file mode 100644 index 0000000..40b35ef --- /dev/null +++ b/tests/test_units.py @@ -0,0 +1,11 @@ +import pytest +import os +import subprocess + +# TODO Still need to devise a testing strategy (https://foundation.aninix.net/AniNIX/Aether/issues/1) +def test_aether(): + print(os.getcwd()) + fh = os.popen("echo bye | sftp -o IdentityFile=./aether aether@aninix.net", mode='r', buffering=-1) + output = fh.read() + retcode = fh.close() + assert retcode == None and CheckOutput(output)