diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .gitlab-ci-pages.yml | 10 | ||||
-rw-r--r-- | .gitlab-ci.yml | 3 | ||||
-rw-r--r-- | ChangeLog.md | 5 | ||||
-rw-r--r-- | LICENSE | 6 | ||||
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | TODO.md | 1 | ||||
-rw-r--r-- | docs/README.md | 16 | ||||
-rw-r--r-- | docs/README.pt.md | 17 | ||||
-rw-r--r-- | kvmxfile | 250 | ||||
-rw-r--r-- | mkdocs.yml | 61 | ||||
-rwxr-xr-x | scripts/provision | 44 |
12 files changed, 420 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a48cf0d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +public diff --git a/.gitlab-ci-pages.yml b/.gitlab-ci-pages.yml new file mode 100644 index 0000000..6334a45 --- /dev/null +++ b/.gitlab-ci-pages.yml @@ -0,0 +1,10 @@ +pages: + image: debian:bullseye + script: + - scripts/provision + - mkdocs build + artifacts: + paths: + - public + only: + - main diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..9b4b205 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,3 @@ +--- +include: + - local: '.gitlab-ci-pages.yml' diff --git a/ChangeLog.md b/ChangeLog.md new file mode 100644 index 0000000..5cc6160 --- /dev/null +++ b/ChangeLog.md @@ -0,0 +1,5 @@ +# ChangeLog + +## YYYY-MM-DD - Unreleased + +* Initial version. @@ -0,0 +1,6 @@ +# LICENSE + +This repository is under the Copy Far "AI" license specified by this +repository, where `$licence` is Creative Commons Attribution 4.0 International +License (CC BY 4.0) - https://creativecommons.org/licenses/by/4.0/ + diff --git a/README.md b/README.md new file mode 100644 index 0000000..e012922 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Copy Far "AI" + +Copy Far "AI" - A copyleft license, but far from the so-called "Artificial +Intelligences". + +See [docs/](docs) for details. @@ -0,0 +1 @@ +# TODO diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..d7d0625 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,16 @@ +# Copy Far "AI" + +Copy Far "AI" - A copyleft license, but far from the so-called +"Artificial Intelligences" + +## The license + +Use and adapt this license as necessary: + +> Copy Far "AI" - v0.0.1 - Copyleft license far from the so-called +> "Artificial Intelligences" +> +> This work, in the present or previous versions, cannot be used for +> procedures known as "machine learning" and stylometric analysis +> without the previous authorization. For all other uses, this +> version is available under the License $license. diff --git a/docs/README.pt.md b/docs/README.pt.md new file mode 100644 index 0000000..e9ec473 --- /dev/null +++ b/docs/README.pt.md @@ -0,0 +1,17 @@ +# Copy Far "AI" + +Copy Far "AI" - uma licença de copyleft, mas longe das ditas +"Inteligências Artificiais". + +## A licença + +Use esta licença e adapte-a conforme necessário: + +> Copy Far "AI" - v0.0.1 - Licença copyleft longe das ditas +> "Inteligências Artificiais" +> +> Esta obra, na presente versão assim como nas anteriores, não pode +> ser usada para procedimentos conhecidos como "treinamento ou +> aprendizado de máquina" e análise estilométrica sem a prévia +> autorização. Para todos os outros meios e fins, esta versão está +> disponível sob a Licença $license. diff --git a/kvmxfile b/kvmxfile new file mode 100644 index 0000000..47890f9 --- /dev/null +++ b/kvmxfile @@ -0,0 +1,250 @@ +# +# Sample kvmx file - https://0xacab.org/rhatto/kvmx +# + +# Hostname +hostname="copyfarai" + +# Which base box you should use. Leave unconfigured to use kvmx-create instead. +basebox="dev" + +# First user name +user="user" + +# First user password +password="`head -c 40 /dev/urandom | base64`" + +# Networking +#net="tap" +net="user" + +# DNS config +#net_dns="192.168.1.1" +#net_dns="host" # copy /etc/resolv.conf from host when creating the box + +# Networking: tap config only +# This setting is used during virtual machine bootstrapping by kvmx-create. +#net_ip="10.1.1.2" +#net_mask="255.255.255.0" +#net_gateway="10.1.1.1" + +# Set this is you want to be able to share a single folder between host and guest. +# Needs ssh_support set to "y" and a workable SSH connection to the guest. +shared_folder="." +#shared_folder_mountpoint="/home/$user/code/$VM" +#shared_folder="$HOME/temp/shared/$VM" +#shared_folder_mountpoint="/home/$user/temp/shared/$VM" +shared_folder_mountpoint="/srv/shared" +#shared_folder_mountpoint="/srv/kvmx" +#shared_folder_mountpoint="/vagrant" + +# Set this is you want to be able to share multiple folders between host and guest using 9p. +# Needs ssh_support set to "y" and a workable SSH connection to the guest. +# Format: <id1>:<host-folder1>:<guest-mountpoint1>,<id2>:<host-folder2>:<guest-mountpoint2>[,...] +#shared_folders="shared1:.:/home/$user/code/$VM,shared2:$HOME/.local/share/app:/home/$user/.local/share/app" + +# Maximum packet size including any headers for shared folders using 9p +# See https://forums.lime-technology.com/topic/34691-9p-sharing-speed-not-what-i-expected/ +# https://github.com/clearcontainers/hyperstart/pull/25 +#shared_folders_msize="524288" + +# Shared folders caching +# See https://www.kernel.org/doc/Documentation/filesystems/9p.txt +#shared_folders_cache="none" + +# Set this is you want to be able to share multiple folders between host and guest using SSHFS. +# Needs ssh_support set to "y" and a workable SSH connection to the guest. +# Format: <id1>:<guest-folder1>:<host-mountpoint1>,<id2>:<guest-folder2>:<host-mountpoint2>[,...] +#shared_folders_sshfs="shared1:/home/$user/code/$VM:.,shared2:/home/$user/.local/share/app:$HOME/.local/share/app" + +# Folder to sync during provisioning in the format "/host/folder1 /guest/folder1,/host/folder2 /guest/folder2[,...]". +# Needs ssh_support set to "y" and a workable SSH connection to the guest. +#provision_rsync="$KVMX_BASE/share/provision/ /usr/local/share/kvmx/provision/" +#provision_rsync="puppet/ /etc/puppet/" + +# Options for provision_rsync +#provision_rsync_opts="--exclude=somefolder" + +# Absolute path for a provision script located inside the guest. +# Needs ssh_support set to "y" and a workable SSH connection to the guest. +#provision_command="sudo apt-get update && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo apt-get clean" +#provision_command="/usr/local/share/kvmx/provision/debian/development && /etc/puppet/bin/provision && /etc/puppet/bin/deploy" +#provision_command="/usr/local/share/kvmx/provision/debian/development && /etc/puppet/bin/deploy" +#provision_command="/usr/local/share/kvmx/provision/debian/development && /home/$user/code/$VM/bin/custom-provisioner" +#provision_command="/usr/local/share/kvmx/provision/debian/development" +#provision_command="/usr/local/share/kvmx/provision/debian/trashman" +#provision_command="/usr/local/share/kvmx/provision/debian/desktop-basic" +provision_command="/usr/local/share/kvmx/provision/debian/development && /srv/shared/scripts/provision" + +# Startup command +#startup_command="/path/to/custom/command" +#startup_command="hydractl aperiodic-upgrade" + +# Pre-poweroff command +#poweroff_pre_command="/path/to/custom/command" + +# Rsync commands to be run on startup or poweroff, useful to keep files synced between host and guest +#startup_rsync_to_guest="data:data:/var/data,code:$HOME/code:/home/user/code" +#poweroff_rsync_from_guest="data:/var/data:data,code:/home/user/code:$HOME/code" + +# Graphics +# See https://wiki.archlinux.org/index.php/QEMU#Graphics +#graphics="-vga std -nographic -vnc :$GUEST_DISPLAY" +graphics="-vga qxl" + +# VNC Client +#vnc_client="xtightvncviewer" +#vnc_client="xvnc4viewer" +#vnc_client="xvncviewer" +#vnc_client="vncviewer" +vnc_client="virt-viewer" + +# SPICE support +spice="1" + +# Set this if you want to attach an spice client when the machine boots. +run_spice_client="0" + +# SPICE client +#spice_client="remote-viewer" +#spice_client="virt-viewer" +spice_client="spicy" + +# Set this if you want that kvmx-vdagent is triggered after the machine boots. +kvmx_vdagent="1" + +# Set this if you want to start an xpra session when the machine boots. +run_xpra="0" + +# Set this if you want to start an xephyr session when the machine boots. +run_xephyr="0" + +# Set this if you want kvmx to redimension the guest screen according to host's screen dimension +# Requires ssh_support and xrandr installed on both host and guest +xrandr="0" + +# Xrandr device +#xrandr_device="qxl-0" +#xrandr_device="Virtual-0" + +# Set screen resolution +#resolution="1280x785" + +# Sound +#sound="0" +#sound="ac97" + +# Set additional hostfwd mappings +#port_mapping="hostfwd=tcp:127.0.0.1:8080-:80,hostfwd=tcp:127.0.0.1:8443-:443" + +# Where the guest image is stored +#image="$HOME/.local/share/kvmx/$VM/box.img" + +# Use basebox image as a backing file for overlay images +# See https://wiki.archlinux.org/index.php/QEMU#Overlay_storage_images +backing_file="1" + +# Where datafiles are stored: just set this if you know what you're doing +#datadir="$HOME/.local/share/kvmx/$VM" + +# Drive type: use this if you want to run a Live CD/DVD/USB +#image_drive="cdrom" + +# Image type: file or device (kvmx-create only) +image_type="file" + +# Discards support +# See https://jschumacher.info/2020/11/debian-qemu-libvirt-qcow2-and-fstrim/ +# https://chrisirwin.ca/posts/discard-with-kvm-2020/ +image_discards="y" + +# Image size +size="10G" + +# Image format: raw or qcow2 +format="qcow2" + +# Image compression (qcow2 only) +qcow2_compression="1" + +# Bootstrap method: custom or vmdeboostrap +method="custom" + +# Domain +domain="example.org" + +# System arch +arch="amd64" + +# Box distribution when bootstraping a new image +version="bookworm" + +# Debian mirror +mirror="https://deb.debian.org/debian/" + +# Memory +memory="2048" + +# Enables remote administration using SSH. With this configuration enabled, +# kvmx will be able to administer a running virtual machine using SSH access +# inside the virtual machine. +ssh_support="y" + +# Use a custom, per-virtual-machine generated SSH keypair. If you disable this +# configuration but still want guest administration using SSH, the default +# insecure keypair will be used. +# +# Please note that this setting won't take effect if you're using a basebox. +# In that case the basebox keypair will be used if it exists, otherwise kvmx +# fallsback to the default insecure keypair. +# +# This setting is used during virtual machine bootstrapping by kvmx-create. +ssh_custom="y" + +# Use this config if you want kvmx-create to include a specif SSH pubkey +# It might be a path for an existing pubkey file or the public key itself. +# +# Make sure to have this key available when trying to SSH into the guest using kvmx +#ssh_custom_pubkey="/home/myhostuser/.ssh/id_rsa.pub" +#ssh_custom_pubkey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDVFmJ2UDn2dK3nHHAkHzt8F4AfrXTFiGa+guem92S/pztMGAUDjEZBYEW3mZ8ATyo4GoPZ92tkjmra0Fgv6ETIox+SPWbzzjhzbv2CQUTWvF6PEVwJbT1PTzaIVRiDYf+yX7e3Y8HcmkAi60Cxs5Xr3HLkqdi2jYKFofCm58R+HGnRv1WSurPnf7C7KQBSW7E1S2CafW9VFHhGCzezyThjN+n3bJjgYFzPxdTlWyfW1T7Yv61/fqfuara0kpZx1l5pblpgbCTT7WKRIhwj1x0QTo/qDQ6k52tffiCVyMGJKvires9yp5qT5Y+ldssBKDa8muRF/dh7/UCyxvcm3HTDjWG24Sr4r9JWbhkqF89UePlOw5j73qw4gzT7YQ38tzz2XI5weAL1OXM6qhCbOwfPXwYbB5xM4g62WZugtcCLan6Iy8hvoiRIJ1MU2ar73wunghQQ84oNIrEVezJsuZxwxVbe45ulnM7x4Hqeu6jmOutWFkdkAHsqd1E3zTOS1RURwi0TpnD+iWwD7FOA9c8B6AWP4i9XVW6BLi1waARrS3bVnOh3djc20fVsClfEDDXFg2KiTeQaAWfjLguyUmxysSiUC2pnibd1bEDtdfPlkA2jaE2nAn6Tw7Vp5zd8P1d1trLMx3YkRq5uQSPqnfQDKoYH5FPMlNTbMINLC56ijw== user@kvmx" + +# Bootloader (used only during bootstrapping by kvmx-create). +bootloader="grub" + +# Drive interface +#drive_interface="ide" # Needed by some systems like NetBSD and FreeBSD +#drive_interface="virtio,cache=none,index=0,format=raw" # For raw devices + +# See http://www.reactos.org/wiki/QEMU#Setting_up_network +#nic_model="ne2k_pci" + +# USB support +# +# Allowed values: +# +# 0 - No USB support +# 1 - Support for USB 1.0 +# 2 - Support for USB 1.0 and 2.0 +# 3 - Support for USB 1.0, 2.0 and 3.0 +# +#usb="0" + +# Additional qemu opts +# Example: http://www.linux-kvm.org/page/USB_Host_Device_Assigned_to_Guest +# See also: https://qemu.readthedocs.io/en/latest/system/usb.html +# https://wiki.gentoo.org/wiki/QEMU/Windows_guest +#qemu_opts="-device usb-host,hostbus=2,hostaddr=3" # Automatically attach an specific USB device +#qemu_opts="" + +# Number of CPUs +#smp="4" + +# Enviroment passed to SSH commands +#ssh_env="TERM=xterm" + +# Whether to be managed by kvmx-supervise +#supervise_manage="1" + +# VirtIO RNG parameters +# See https://wiki.qemu.org/Features/VirtIORNG +#virtio_rng="max-bytes=128,period=1000" diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..44283ab --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,61 @@ +# +# Mkdocs configuration +# + +site_name: Copy Far "AI" +docs_dir : docs +site_dir : public +dev_addr : '127.0.0.1:8030' + +theme: + name : material + collapse_navigation: true + titles_only : false + palette: + + # Palette toggle for light mode + - scheme: default + primary: black + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Palette toggle for dark mode + - scheme: slate + primary: black + toggle: + icon: material/brightness-4 + name: Switch to light mode + + # Do not use external fonts + # Usefult for offline operation + # See https://squidfunk.github.io/mkdocs-material/setup/changing-the-fonts/#autoloading + #font: false + +extra_css: + - site.css + +plugins: + - search + + - awesome-pages: + collapse_single_pages: true + + - i18n: + docs_structure: suffix + languages: + - locale: en + name: English + build: true + default: true + - locale: pt + name: Português + build: true + +markdown_extensions: + - footnotes + +copyright: Copy Far "AI" © 2023+ + +extra: + generator: false diff --git a/scripts/provision b/scripts/provision new file mode 100755 index 0000000..2bd7dbd --- /dev/null +++ b/scripts/provision @@ -0,0 +1,44 @@ +#!/bin/bash +# +# Provisioner +# + +# Parameters +DIRNAME="`dirname $0`" + +# Basic dependencies +DEPENDENCIES="mkdocs apache2 python3-pip pandoc pandoc-citeproc" + +# PyPI dependencies +DEPENDENCIES_PIP="mkdocs-bibtex mkdocs-material mkdocs-awesome-pages-plugin mkdocs-static-i18n" + +# Ensure an up-to-date system +sudo apt-get update && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo apt-get clean + +# Install dependencies +sudo apt install -y $DEPENDENCIES + +# Install python dependencies +pip3 install $DEPENDENCIES_PIP + +# Configure virtual host for the local service +cat <<-EOF | sudo tee /etc/apache2/sites-available/local.conf > /dev/null +<VirtualHost *:80> + ServerName estudo.local + DocumentRoot "/srv/shared/site" + + <Directory /srv/shared/site> + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + </Directory> +</VirtualHost> +EOF + +# Enable virtual host +sudo a2ensite local +sudo systemctl reload apache2 + +# Configure PATH +mkdir -p ~/.custom +echo 'export PATH=$PATH:/srv/shared/scripts' > ~/.custom/profile |