Compare commits

..

1 Commits

Author SHA1 Message Date
poka 8db35d854a update submodule iptubes 2020-03-22 02:41:16 +01:00
4523 changed files with 685 additions and 834580 deletions

6
.gitignore vendored
View File

@ -1,6 +0,0 @@
.profile
www/LOVELand/jukebox/prefs
www/LOVELand/jukebox/albumart
www/LOVELand/g1barre/img/qrcodes
zen/tools/scraping/transiscope/transiscope.json
zen/tools/__pycache__

6
.gitmodules vendored
View File

@ -1,6 +1,6 @@
[submodule "astroport-iptubes"]
path = iptubes
url = https://git.p2p.legal/axiom-team/astroport-iptubes
[submodule "ssb-g1-tip"]
path = ssb-g1-tip
url = https://git.p2p.legal/axiom-team/ssb-g1-tip
[submodule "ssb-g1like"]
path = ssb-g1like
url = https://git.p2p.legal/axiom-team/ssb-g1like

View File

@ -1,9 +0,0 @@
[Desktop Entry]
Type=Application
Exec=~/.zen/astroport/1stRUNconfig.sh
X-GNOME-Autostart-enabled=true
NoDisplay=false
Hidden=false
Name[fr_FR]=Astroport_X_config.desktop
Comment[fr_FR]=First time RUN config script
X-GNOME-Autostart-Delay=0

View File

@ -1,6 +1,6 @@
#!/bin/bash
[[ -f ~/.bash_aliases && ! -z $(cat ~/.bash_aliases | grep c_red) ]] && exit 0
[[ -f ~/.bash_aliases && ! -z $(cat ~/.bash_aliases | grep c_red) ]] && exit 1
echo 'export c_blinkfast="\033[6m"
export c_light="\033[1m"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

View File

@ -1,31 +0,0 @@
#!/usr/bin/env bash
# Enable camera on Raspberry Pi
# set_config_var taken from raspi-config
set_config_var() {
lua - "$1" "$2" "$3" <<EOF > "$3.bak"
local key=assert(arg[1])
local value=assert(arg[2])
local fn=assert(arg[3])
local file=assert(io.open(fn))
local made_change=false
for line in file:lines() do
if line:match("^#?%s*"..key.."=.*$") then
line=key.."="..value
made_change=true
end
print(line)
end
if not made_change then
print(key.."="..value)
end
EOF
sudo mv "$3.bak" "$3"
}
# Command extracted from raspi-config
sed /boot/config.txt -i -e "s/^startx/#startx/"
sed /boot/config.txt -i -e "s/^fixup_file/#fixup_file/"
set_config_var start_x 1 /boot/config.txt
set_config_var gpu_mem 128 /boot/config.txt

View File

@ -1,52 +0,0 @@
#!/usr/bin/env bash
set -e
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Enable camera on the Raspberry Pi
sudo "$BASE_DIR/enable-camera.sh"
# Install ffmpeg and supporting tools
sudo apt-get install -y ffmpeg lsof inotify-tools nginx
# Copy placeholder for audio-only streams
cp "$BASE_DIR/audio.jpg" "$HOME/audio.jpg"
# Add user to be able to modify nginx directories
sudo usermod -a -G "$USER" www-data
sudo chmod g+rw /var/www/html
# TODO: why is this needed?
sudo chmod a+rw /var/www/html
sudo cp -f "$BASE_DIR/process-stream.sh" /usr/bin/process-stream.sh
sudo cp -f "$BASE_DIR/process-stream.service" /etc/systemd/system/process-stream.service
sudo systemctl daemon-reload
sudo systemctl enable process-stream
# Add hourly job to clear out old data
echo "41 * * * * $USER /usr/local/bin/ipfs repo gc" | sudo tee --append /etc/crontab
# Install the ipfs video player
mkdir "$BASE_DIR/tmp"
current_dir="$(pwd)"
git clone https://github.com/tomeshnet/ipfs-live-streaming.git "$BASE_DIR/tmp/ipfs-live-streaming"
cd "$BASE_DIR/tmp/ipfs-live-streaming"
git checkout b9be352582317e5336ddd7183ecf49042dafb33e
cd "$current_dir"
VIDEO_PLAYER_PATH="$BASE_DIR/tmp/ipfs-live-streaming/terraform/shared/video-player"
sed -i s#__IPFS_GATEWAY_SELF__#/ipfs/# "$VIDEO_PLAYER_PATH/js/common.js"
sed -i s#__IPFS_GATEWAY_ORIGIN__#https://ipfs.io/ipfs/# "$VIDEO_PLAYER_PATH/js/common.js"
IPFS_ID=$(ipfs id | grep ID | head -n 1 | awk -F\" '{print $4}')
sed -i "s#live.m3u8#/ipns/$IPFS_ID#" "$VIDEO_PLAYER_PATH/js/common.js"
sed -i s#__M3U8_HTTP_URLS__#\ # "$VIDEO_PLAYER_PATH/js/common.js"
cp -r "$VIDEO_PLAYER_PATH" /var/www/html/video-player
rm -rf "$BASE_DIR/tmp"
# Add entry into nginx home screen
APP="<div class='app'><h2>IPFS Pi Stream Player</h2>IPFS Video player for Pi Stream. <br />M3U8 Stream located <a href='/ipns/$IPFS_ID'>over ipns</a> <br/><a href='/video-player/'>Go </a> and play with built in video player</div>"
sudo sed -i "s#<\!--APPLIST-->#$APP\n<\!--APPLIST-->#" "/var/www/html/index.html"

View File

@ -1,16 +0,0 @@
[Unit]
Description=Service to process RTMP stream
Wants=network.target
After=ipfs.service
[Service]
Type=simple
User=pi
Group=pi
ExecStart=/usr/bin/process-stream.sh
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=on-failure
RestartSec=10s
[Install]
WantedBy=multi-user.target

View File

@ -1,124 +0,0 @@
#!/usr/bin/env bash
HLS_TIME=40
M3U8_SIZE=3
IPFS_GATEWAY="https://ipfs.io"
# Load settings
# Prepare Pi Camera
sudo modprobe bcm2835-v4l2
sudo v4l2-ctl --set-ctrl video_bitrate=100000
function startFFmpeg() {
while true; do
mv ~/ffmpeg.log ~/ffmpeg.1
echo 1 > ~/stream-reset
# Stream Raspberry Pi Camera
ffmpeg -f video4linux2 -input_format h264 -video_size 1280x720 -framerate 30 -i /dev/video0 -vcodec copy -hls_time "${HLS_TIME}" "${what}.m3u8" > ~/ffmpeg.log 2>&1
# Stream FM Station from a SDR module (see contrib/pi-stream to install drivers)
# Frequency ends in M IE 99.9M
# rtl_fm -f 99.9M -M fm -s 170k -A std -l0 -E deemp -r 44.1k | ffmpeg -r 15 -loop 1 -i ../audio.jpg -f s16le -ac 1 -i pipe:0 -c:v libx264 -tune stillimage -preset ultrafast -hls_time "${HLS_TIME}" "${what}.m3u8" > ~/ffmpeg 2>&1
sleep 0.5
done
}
# Create directory for HLS content
currentpath="$HOME/live"
sudo umount "${currentpath}"
rm -rf "${currentpath}"
mkdir "${currentpath}"
sudo mount -t tmpfs tmpfs "${currentpath}"
# shellcheck disable=SC2164
cd "${currentpath}"
what="$(date +%Y%m%d%H%M)-LIVE"
# Start ffmpeg in background
startFFmpeg &
while true; do
#TODO# Fix this one
# shellcheck disable=SC2086,SC2012
nextfile=$(ls -tr ${what}*.ts 2>/dev/null | head -n 1)
if [ -n "${nextfile}" ]; then
# Check if the next file on the list is still being written to by ffmpeg
if lsof "${nextfile}" | grep -1 ffmpeg; then
# Wait for file to finish writing
# If not finished in 45 seconds something is wrong, timeout
inotifywait -e close_write "${nextfile}" -t ${HLS_TIME}
fi
# Grab the timecode from the m3u8 file so we can add it to the log
timecode=$(grep -B1 "${nextfile}" "${what}.m3u8" | head -n1 | awk -F : '{print $2}' | tr -d ,)
attempts=5
until [[ "${timecode}" || ${attempts} -eq 0 ]]; do
# Wait and retry
sleep 0.5
timecode=$(grep -B1 "${nextfile}" "${what}.m3u8" | head -n1 | awk -F : '{print $2}' | tr -d ,)
attempts=$((attempts-1))
done
if ! [[ "${timecode}" ]]; then
# Set approximate timecode
timecode="${HLS_TIME}.000000"
fi
reset_stream=$(cat ~/stream-reset)
reset_stream_marker=''
if [[ ${reset_stream} -eq '1' ]]; then
reset_stream_marker=" #EXT-X-DISCONTINUITY"
fi
echo 0 > ~/stream-reset
# Current UTC date for the log
time=$(date "+%F-%H-%M-%S")
# Add ts file to IPFS
ret=$(ipfs add --pin=false "${nextfile}" 2>/dev/null > ~/tmp.txt; echo $?)
attempts=5
until [[ ${ret} -eq 0 || ${attempts} -eq 0 ]]; do
# Wait and retry
sleep 0.5
ret=$(ipfs add --pin=false "${nextfile}" 2>/dev/null > ~/tmp.txt; echo $?)
attempts=$((attempts-1))
done
if [[ ${ret} -eq 0 ]]; then
# Update the log with the future name (hash already there)
echo "$(cat ~/tmp.txt) ${time}.ts ${timecode}${reset_stream_marker}" >> ~/process-stream.log
# Remove nextfile and tmp.txt
rm -f "${nextfile}" ~/tmp.txt
# Write the m3u8 file with the new IPFS hashes from the log
totalLines="$(wc -l ~/process-stream.log | awk '{print $1}')"
sequence=0
if ((totalLines>M3U8_SIZE)); then
sequence=$((totalLines-M3U8_SIZE))
fi
{
echo "#EXTM3U"
echo "#EXT-X-VERSION:3"
echo "#EXT-X-TARGETDURATION:${HLS_TIME}"
echo "#EXT-X-MEDIA-SEQUENCE:${sequence}"
} > current.m3u8
tail -n ${M3U8_SIZE} ~/process-stream.log | awk '{print $6"#EXTINF:"$5",\n'${IPFS_GATEWAY}'/ipfs/"$2}' | sed 's/#EXT-X-DISCONTINUITY#/#EXT-X-DISCONTINUITY\n#/g' >> current.m3u8
# Add m3u8 file to IPFS and IPNS publish
m3u8hash=$(ipfs add current.m3u8 | awk '{print $2}')
ipfs name publish --timeout=5s "${m3u8hash}" &
# Copy files to web server
cp current.m3u8 /var/www/html/live.m3u8
cp ~/process-stream.log /var/www/html/live.log
fi
else
sleep 5
fi
done

View File

@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
sudo systemctl stop process-stream
sudo systemctl disable process-stream
sudo rm -f /usr/bin/process-stream.sh
sudo rm -f /etc/systemd/system/process-stream.service
sudo systemctl daemon-reload
# Remove ffmpeg and supporting tools
sudo apt-get -y remove ffmpeg lsof inotify-tools
# Revert permissions
sudo chmod 755 /var/www/html
sed -i "/ipfs repo gc/d" | sudo tee --append /etc/crontab

View File

@ -1,69 +1,30 @@
#!/bin/bash
ipfs() {
# Install IPFS
ipfs() {
echo -e "${c_yellow}Onboarding IPFS...$c_"
[[ -f /usr/local/bin/ipfs ]] && sudo service ipfs stop
if [[ $ARM == "yes" ]]; then
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-arm.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
else
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-amd64.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
fi
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
echo "INSTALL ipfs-update"
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err+="Untar ipfs-update"
rm $MY_PATH/ipfs-update.tar.gz
cd /usr/src/ipfs-update/
sudo ./install.sh || err+="Install ipfs-update"
cd $MY_PATH
## Config
templates="$MY_PATH/.install/templates/ipfs"
echo "INSTALL latest ipfs"
sudo ipfs-update install latest || err+="Install IPFS"
if [ "$EUID" -eq 0 ]
then echo -e "${c_red}DO NOT EXECUTE AS root. Choose a user for your Astroport Station (we like pi)$c_"
exit 1
else echo -e "${c_yellow}OK $USER, let's go!$c_";
fi
echo "CREATE SYSTEMD ipfs SERVICE"
[[ -f /etc/systemd/system/ipfs.service ]] && sudo rm /etc/systemd/system/ipfs.service
sudo cp -f $MY_PATH/templates/1/ipfs.service /etc/systemd/system/
sudo sed -i "s/_USER/$USER/g" /etc/systemd/system/ipfs.service
[[ -d ~/.ipfs ]] && echo "IPFS install exist, please remove backup before execute this script" && exit 1
echo -e "${c_yellow}Onboarding IPFS...$c_"
[[ -f /usr/local/bin/ipfs ]] && sudo service ipfs stop
if [[ $ARM == "yes" ]]; then
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-arm.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
else
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-amd64.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
fi
echo "INSTALL ipfs-update"
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err+="Untar ipfs-update"
rm $MY_PATH/ipfs-update.tar.gz
cd /usr/src/ipfs-update/
sudo ./install.sh || err+="Install ipfs-update"
cd $MY_PATH
echo "INSTALL latest ipfs"
sudo ipfs-update install latest || err+="Install IPFS"
echo "CREATE SYSTEMD ipfs SERVICE"
sudo cp -f $templates/ipfs.service /etc/systemd/system/
sudo sed -i "s/_USER/$USER/g" /etc/systemd/system/ipfs.service
sudo systemctl daemon-reload || err+="Restart IPFS"
sudo systemctl enable ipfs || err+="Enable IPFS daemon"
# INIT ipfs
ipfs init -p lowpower
# ipfs init -p server ## Uncomment for server infrastructure
# ACTIVATE CONFIG OPTIONS
# PUBSUB
ipfs config Pubsub.Router gossipsub
# MAXSTORAGE
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
diskSize="$((availableDiskSize / 2))"
ipfs config Datastore.StorageMax $diskSize
## PORT FORWARD (SSH)
ipfs config --json Experimental.Libp2pStreamMounting true
######### UPDATE BOOTSTRAP LIST ###########
ipfs bootstrap rm --all
sudo systemctl restart ipfs || err+="Restart IPFS daemon"
exit 0
sudo systemctl daemon-reload || err+="Restart IPFS"
sudo systemctl enable ipfs || err+="Enable IPFS daemon"
}
$@

View File

@ -1,137 +0,0 @@
#!/bin/bash
########################################################################
{ # this ensures the entire script is downloaded #
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
# CHECK not root user !!
if [ "$EUID" -eq 0 ]
then echo -e "${c_red}DO NOT EXECUTE AS root. Choose a user for your Astroport Station (we like pi)$c_"
exit 1
else echo -e "${c_yellow}OK $USER, let's go!$c_";
fi
# Ask user password on start
sudo true
## Error funciton
err() {
echo -e "${c_red}$1$c_"
exit 1
}
# CHECK if daemon is already running
if [[ $(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) ]]; then
echo "ipfs daemon already running...! Must STOP ipfs AND remove ~/.ipfs to install again !!"
ipfs id && echo "ipfs swarm peers: " && ipfs swarm peers
echo "ipfs bootstrap list: " && ipfs bootstrap list
echo "Please RUN : sudo systemctl stop ipfs"
exit 1
fi
[[ -d ~/.ipfs ]] && echo "IPFS install exist! Please remove or backup before executing this script" && exit 1
echo -e "${c_yellow}Astroport IPFS Layer installation...$c_"
# CHECK node IP isLAN?
myIP=$(hostname -I | awk '{print $1}')
isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
MACHINE_TYPE=`uname -m`
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-amd64.tar.gz -o $MY_PATH/ipfs-update.tar.gz
elif [ ${MACHINE_TYPE:0:3} == 'arm' ]; then
curl -s https://dist.ipfs.io/ipfs-update/v1.6.0/ipfs-update_v1.6.0_linux-arm.tar.gz -o $MY_PATH/ipfs-update.tar.gz
else
[ ! -f $MY_PATH/ipfs-update.tar.gz ] && err "Your $MACHINE_TYPE is not supported yet... Please add an issue."
fi
echo "INSTALL ipfs-update >>>>>>>>>>>>>>>>>>>>>>>>>>"
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err "Untar ipfs-update"
rm $MY_PATH/ipfs-update.tar.gz
cd /usr/src/ipfs-update/
sudo ./install.sh || err "Install ipfs-update"
cd $MY_PATH
echo "INSTALL ipfs 0.7.0 >>>>>>>>>>>>>>>>>>>>>>>>>>"
sudo ipfs-update install 0.7.0 || err "Install IPFS"
## DEBIAN
echo "CREATE SYSTEMD ipfs SERVICE >>>>>>>>>>>>>>>>>>"
cat > /tmp/ipfs.service <<EOF
[Unit]
Description=IPFS daemon
After=network.target
[Service]
User=_USER_
ExecStart=/usr/local/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub --enable-gc
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
sudo cp -f /tmp/ipfs.service /etc/systemd/system/
sudo sed -i "s/_USER_/$USER/g" /etc/systemd/system/ipfs.service
[[ -d ~/.ipfs ]] && sudo chown -R $USER:$USER ~/.ipfs
## Special Xbian init.d config
if [[ $USER == "xbian" && -f ~/.zen/astroport/.install/templates/ipfs/ipfs-initV.sh ]]; then
sudo cp ~/.zen/astroport/.install/templates/ipfs/ipfs-initV.sh /etc/init.d/ipfs
sudo chmod 755 /etc/init.d/ipfs
sudo touch /var/log/ipfs.log && sudo chown xbian /var/log/ipfs.log
sudo service ipfs enable
else
sudo systemctl daemon-reload || err "Restart IPFS"
sudo systemctl enable ipfs || err "Enable IPFS daemon"
fi
# INIT ipfs
[[ $isLAN ]] && ipfs init -p lowpower \
|| ipfs init -p server
# TODO try ipfs init --profile=badgerds (for better performance)
# https://discuss.ipfs.io/t/adding-content-to-ipfs-is-quite-slow-any-ideas-on-why-and-how-to-speed-things-up/8135/3
sudo chown -R $USER:$USER ~/.ipfs || exit 1
###########################################
# ACTIVATE IPFS OPTIONS: #swarm0 INIT
###########################################
### IMPORTANT !!!!!!! IMPORTANT !!!!!!
###########################################
# DHT PUBSUB mode
ipfs config Pubsub.Router gossipsub
# MAXSTORAGE = 1/2 available
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
diskSize="$((availableDiskSize / 2))"
ipfs config Datastore.StorageMax $diskSize
## Activate Rapid "ipfs p2p"
ipfs config --json Experimental.Libp2pStreamMounting true
ipfs config --json Experimental.P2pHttpProxy true
######### MAKE DEFAULT BOOTSTRAP TO oasis.astroport.com 2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS ###########
ipfs bootstrap rm --all
ipfs bootstrap add /dnsaddr/oasis.astroport.com/tcp/4001/ipfs/12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN
ipfs bootstrap add /ip4/51.15.166.54/tcp/4001/p2p/12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN
ipfs bootstrap add /ip4/51.15.166.54/udp/4001/quic/p2p/12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN
ipfs bootstrap add /ip6/fe80::208:a2ff:fe0c:20d8/tcp/4001/p2p/12D3KooWBYme2BsNUrtx4mEdNX6Yioa9AV7opWzQp6nrPs6ZKabN
###########################################
# TODO: ADD some other bootstrap NODES
###########################################
sudo systemctl start ipfs || err "Start IPFS daemon"
sleep 3
echo "Peers: " && ipfs swarm peers && sleep 0.3
#[[ ! $(ipfs swarm peers) =~ "/ip4/" ]] && err "No peers found in swarm. Please open issue :https://git.p2p.legal/axiom-team/astroport/issues"
} # this ensures the entire script is downloaded #
# IPFS CONFIG documentation: https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#addressesswarm

View File

@ -1,264 +0,0 @@
#!/bin/bash
########################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.3
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
{
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
########################################################################
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || er+=" ipfs daemon not running"
IPFSNODEID=$(ipfs id -f='<id>\n') || er+=" ipfs id problem"
WHOAMI=$(sbotc whoami | jq -r .id) || er+=" sbotc whoami problem"
[[ "$YOU" == "" || "$IPFSNODEID" == "" || "$WHOAMI" == "" ]] && echo "ERROR : $er " && exit 1
########################################################################
#### DO NOT RUN AS ROOT
[[ $USER == "root" ]] && echo "DO NOT RUN AS root!! Use regular USER with sudo AUTHORISATION" && exit 1
#### APACHE NOT SUPPORTED
is_apache_running=$(ps auxf --sort=+utime | grep -w apache | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1);
[[ $is_apache_running ]] && echo "SORRY ONLY nginx is supported. EXIT" && exit 1
#### ARM / X64 NOT USED THERE
MACHINE_TYPE=`uname -m`
[ ${MACHINE_TYPE:0:3} == 'arm' ] && isARM="YES"
### UPDATE apt cache
sudo apt-get update
### Adding YOU to www-data group
sudo adduser $YOU www-data
##################################
## INSTALL RAINBOW ASCII ;)
[[ ! $(which figlet) ]] && sudo apt install figlet -y
[[ ! $(which lolcat) ]] && sudo apt install lolcat -y
echo '
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
______ __ ____ ___
/ ____/___ ____ __ __/ / ____ _/ __ \____ _____/ (_)___
/ / / __ \/ __ \/ / / / / / __ `/ /_/ / __ `/ __ / / __ \
/ /___/ /_/ / /_/ / /_/ / /___/ /_/ / _, _/ /_/ / /_/ / / /_/ /
\____/\____/ .___/\__, /_____/\__,_/_/ |_|\__,_/\__,_/_/\____/
/_/ /____/
Multimedia Layer (https://www.copylaradio.com)
' | lolcat
## MULTIMEDIA
## VIDEO & AUDIO & PLAYLISTS ~/.zen/ DIR
mkdir -p ~/.zen/video
mkdir -p ~/.zen/audio
mkdir -p ~/.zen/playlists
######## YOUTUBE-DL ##########
if [[ ! $(which youtube-dl) ]]; then
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl || err=1
sudo chmod a+rx /usr/local/bin/youtube-dl
sudo chown $YOU /usr/local/bin/youtube-dl
fi
###############################
# MPD/MPC RompR AUDIO LAYER
###############################
if [[ ! $(which mpd) ]]; then
sudo apt-get install libid3-tools mpd mpc lame ffmpeg lsof lltag inotify-tools bc -y || err=1
sudo apt-get install lame sox libsox-fmt-mp3 eyed3 python-chardet imagemagick curl -y || err=1 #libav-tools unavailable on some system
sudo apt-get install ca-certificates git-core binutils rsync alsa-utils bc espeak mpg321 fuse atomicparsley -y || err=1
## CONFIG MPD
sudo cp -f /home/$YOU/.zen/astroport/.install/templates/copylaradio/mpd.conf /etc/mpd.conf
sudo sed -i "s/_USER_/$YOU/g" /etc/mpd.conf || err=1
mkdir ~/.config/mpd && sudo cp -f /etc/mpd.conf ~/.config/mpd/mpd.conf && sudo chown $YOU ~/.config/mpd/mpd.conf
## CHOWN mpd FILES STRUCTURE
sudo chown -R $YOU /var/lib/mpd/ /var/run/mpd /run/mpd /var/log/mpd
sudo service mpd restart || err=1
fi
### INSTALL NGINX
echo '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
_
____ ____ _(_)___ _ __
/ __ \/ __ `/ / __ \| |/_/
/ / / / /_/ / / / / /> <
/_/ /_/\__, /_/_/ /_/_/|_|
/____/
install
' | lolcat
sudo apt-get install fail2ban nginx ssl-cert php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-fpm sqlite -y || err=1
[[ ! $(which nslookup) ]] && sudo apt-get install lolcat dnsutils -y
echo '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
__ ___ _ ___
/ |/ /_ __ ____ ____ _____ ___ ___ (_)___/__ \
/ /|_/ / / / / / __ \/ __ `/ __ `__ \/ _ \ / / ___// _/
/ / / / /_/ / / / / / /_/ / / / / / / __/ / (__ )/_/
/_/ /_/\__, / /_/ /_/\__,_/_/ /_/ /_/\___/ /_/____/(_)
/____/
' | lolcat
myIP=$(hostname -I | awk '{print $1}' | head -n 1)
isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
# Ask to the router its name (BOX DNS or system defined)
[[ -f /home/$YOU/.zen/astroport/zen/tools/nodename ]] && NODENAME=$(/home/$YOU/.zen/astroport/zen/tools/nodename) \
|| NODENAME=$(curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/zen/tools/nodename | bash) ## RUNNING ALONE !!
echo $NODENAME
######################################
### LAUNCHIN OASIS = SSB HTTP interface
######################################
echo '
_
____ ____ ______(_)____
/ __ \/ __ `/ ___/ / ___/
/ /_/ / /_/ (__ ) (__ )
\____/\__,_/____/_/____/
SSB DEMO HTTP interface
' | lolcat
# IN CASE, KILL RUNNING OASIS
isOASIS=$(ps auxf --sort=+utime | grep -w oasis | grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}')
[[ $isOASIS ]] && sudo kill -9 $isOASIS
echo "Starting OASIS with good $NODENAME & network config"
echo "TODO: add to your /etc/rc.local or systemd or initV !!!"
#if [[ ! $isLAN ]]; then
# ### TODO: unlock oasis restrictions!! CANNOT MAKE PRIVATE MESSAGE => Feddless.social CAN add it as module on loveland portal!!)
# oasis --allow-host $NODENAME --host $NODENAME --public 2>&1>/dev/null &
# echo "--public = OASIS STATION IS IN VIEWING MODE ONLY..."
#else
# oasis --allow-host $NODENAME --host $NODENAME 2>&1>/dev/null &
#fi
#sleep 5
echo '
__ ____ _ __________ __
/ / / __ \ | / / ____/ / ____ _____ ____/ /
/ / / / / / | / / __/ / / / __ `/ __ \/ __ /
/ /___/ /_/ /| |/ / /___/ /___/ /_/ / / / / /_/ /
/_____/\____/ |___/_____/_____/\__,_/_/ /_/\__,_/
Portal
' | lolcat
###
echo "INSTALL LOVELand WebSite. Linking to /var/www ..."
if [[ ! -L /var/www/loveland ]]; then
sudo ln -s /home/$YOU/.zen/astroport/www/LOVELand /var/www/loveland
fi
echo "JUKEBOX init"
[[ -d /var/www/loveland/jukebox/albumart ]] && sudo chmod -R 777 /var/www/loveland/jukebox/albumart
[[ -d /var/www/loveland/jukebox/prefs ]] && sudo chmod -R 777 /var/www/loveland/jukebox/prefs
[[ -d /var/www/loveland/g1barre/img/qrcodes ]] && sudo chmod -R 777 /var/www/loveland/g1barre/img/qrcodes
# CONFIG NGINX - LOVE LAND FRONTAL WEB PAGE
echo "$NODENAME" | figlet -f slant | lolcat
## Write NODENAME to IPFS
echo "$NODENAME" > /home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_nodename
PHPVERSION=$(ps auxf | grep php-fpm | grep -v -E 'color=auto|grep' | head -n 1 | grep -oP '(?<=\().*(?=\))' | awk -F '/' '{print $4}')
### ASTROPORT STATION LOVELAND PORTAL
sudo sed "s/_PHPVERSION_/$PHPVERSION/g" /home/$YOU/.zen/astroport/www/loveland.conf > /tmp/loveland.conf
sudo sed -i "s/_MY_NODE_NAME_/$NODENAME/g" /tmp/loveland.conf
sudo sed -i "s/_PORT_/10010/g" /tmp/loveland.conf
sudo sed -i "s/_APPLI_//g" /tmp/loveland.conf
sudo cp -f /tmp/loveland.conf /etc/nginx/conf.d/loveland.conf
### GCHANGE G1 Zen
sudo rm -f /etc/nginx/conf.d/gchange.conf
sudo sed "s/_PHPVERSION_/$PHPVERSION/g" /home/$YOU/.zen/astroport/www/loveland.conf > /tmp/gchange.conf
sudo sed -i "s/_MY_NODE_NAME_/$NODENAME/g" /tmp/gchange.conf
sudo sed -i "s/_PORT_/10020/g" /tmp/gchange.conf
sudo sed -i "s/_APPLI_/gchange/g" /tmp/gchange.conf
sudo cp -f /tmp/gchange.conf /etc/nginx/conf.d/gchange.conf
### CESIUM G1 Zen
sudo sed "s/_PHPVERSION_/$PHPVERSION/g" /home/$YOU/.zen/astroport/www/loveland.conf > /tmp/cesium.conf
sudo sed -i "s/_MY_NODE_NAME_/$NODENAME/g" /tmp/cesium.conf
sudo sed -i "s/_PORT_/10030/g" /tmp/cesium.conf
sudo sed -i "s/_APPLI_/cesium/g" /tmp/cesium.conf
sudo cp -f /tmp/cesium.conf /etc/nginx/conf.d/cesium.conf
### JUKEBOX RompR CopyLaRadio
if [[ $(which mpd) ]]; then
sudo sed "s/_PHPVERSION_/$PHPVERSION/g" /home/$YOU/.zen/astroport/www/loveland.conf > /tmp/jukebox.conf
sudo sed -i "s/_MY_NODE_NAME_/$NODENAME/g" /tmp/jukebox.conf
sudo sed -i "s/_PORT_/10011/g" /tmp/jukebox.conf
sudo sed -i "s/_APPLI_/jukebox/g" /tmp/jukebox.conf
sudo cp -f /tmp/jukebox.conf /etc/nginx/conf.d/jukebox.conf
fi
### SSB OASIS Zen (PROXY MODE 10040 -> 3000)
if [[ $(which oasis) ]]; then
sudo sed "s/_MY_NODE_NAME_/$NODENAME/g" /home/$YOU/.zen/astroport/www/oasis.conf > /tmp/oasis.conf
sudo sed -i "s/_PORT_/10040/g" /tmp/oasis.conf
sudo sed -i "s/_LHOST_/$NODENAME:3000/g" /tmp/oasis.conf
sudo sed -i "s/_APPLI_//g" /tmp/oasis.conf
sudo cp -f /tmp/oasis.conf /etc/nginx/conf.d/oasis.conf
# TRICK: COULD BE USED TO ADD .htpasswod ACCESS CONTROL AND REMOVE --public
# TODO use "ipfs p2p" to AGREGATE ALL OASIS on ONE (not ALL like G1SMS) ?
# NEED G1PUB to be identified with same MEMBER owner in 'zen/ipfs_OPEN_ports.sh'?
fi
### G1SMS propagation to localhost:10099 / 10097 ("ipfs p2p" forwarded)
if [[ $(which gammu) ]]; then
# DIRECT MODE
sudo sed "s/_PHPVERSION_/$PHPVERSION/g" /home/$YOU/.zen/astroport/www/loveland.conf > /tmp/g1sms.conf
sudo sed -i "s/_MY_NODE_NAME_/$NODENAME/g" /tmp/g1sms.conf
sudo sed -i "s/_PORT_/10099/g" /tmp/g1sms.conf
sudo sed -i "s/_APPLI_/g1sms/g" /tmp/g1sms.conf
sudo cp -f /tmp/g1sms.conf /etc/nginx/conf.d/g1sms.conf
else
# PROXY MODE (10099 -> 10097) ### ipfs p2p PROPAGATION WITH 'zen/ipfs_OPEN_ports.sh'
sudo sed "s/_MY_NODE_NAME_/$NODENAME/g" /home/$YOU/.zen/astroport/www/oasis.conf > /tmp/g1sms_proxy.conf
sudo sed -i "s/_PORT_/10099/g" /tmp/g1sms_proxy.conf
sudo sed -i "s/_LHOST_/127\.0\.0\.1\:10097/g" /tmp/g1sms_proxy.conf
sudo sed -i "s/_APPLI_/g1sms/g" /tmp/g1sms_proxy.conf
sudo cp -f /tmp/g1sms_proxy.conf /etc/nginx/conf.d/g1sms_proxy.conf
fi
##### RESTART NGINX
sudo systemctl restart nginx || err=1
if [[ $err ]]; then
echo -e "${c_red}Installation de LOVELand bizarre??$c_"
echo "PLEASE... POST YOUR ISSUE! https://git.p2p.legal/axiom-team/astroport/issues"
exit 1
else
echo -e "${c_green}LOVE Land a été installé avec succès$c_"
echo -e "LoveLand Portal link http://$NODENAME:10010 (TRY ME)
Add ScuttleButt Astroport PUB Invitation:
${c_green}With Patchwork: "Join a server"$c_
Or with Oasis: http://$NODENAME:3000/settings (dev mode, still buggy)
${c_light}oasis.astroport.com:8008::@UeiA9iqZ0/XTjmYBht230KGr44bsr+Tl5BXSUDFv8vo=.ed25519~jd9Z4y/d/xZCF7bfuSgQSiSGLMeWFhwMosKUFhFxeEY=" $c_
fi
# Open LOVEland in browser
URL="http://$NODENAME"
path=$(which xdg-open || which gnome-open)
xo ()
{
for var in "$@"; do
$path "$var";
sleep 0.5
done
}
[[ -n $path ]] && xo $URL:10010 $URL:10020 $URL:10030 > /dev/null
} # for script being completely downloaded before run

View File

@ -1,188 +0,0 @@
#!/bin/bash
########################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.3
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
{
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
########################################################################
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || er+=" ipfs daemon not running"
IPFSNODEID=$(ipfs id -f='<id>\n') || er+=" ipfs id problem"
WHOAMI=$(sbotc whoami | jq -r .id) || er+=" sbotc whoami problem"
[[ "$YOU" == "" || "$IPFSNODEID" == "" || "$WHOAMI" == "" ]] && echo "ERROR : $er " && exit 1
########################################################################
#### DO NOT RUN AS ROOT
[[ $USER == "root" ]] && echo "DO NOT RUN AS root!! Use regular USER with sudo AUTHORISATION" && exit 1
#### APACHE NOT SUPPORTED
is_apache_running=$(ps auxf --sort=+utime | grep -w apache | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1);
[[ $is_apache_running ]] && echo "SORRY ONLY nginx is supported. EXIT" && exit 1
#### ARM / X64 NOT USED THERE
MACHINE_TYPE=`uname -m`
[ ${MACHINE_TYPE:0:3} == 'arm' ] && isARM="YES"
### UPDATE apt cache
sudo apt-get update
### Adding YOU to www-data group
sudo adduser $YOU www-data
##################################
## INSTALL RAINBOW ASCII ;)
[[ ! $(which figlet) ]] && sudo apt install figlet -y
[[ ! $(which lolcat) ]] && sudo apt install lolcat -y
echo '
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
______ __ ____ ___
/ ____/___ ____ __ __/ / ____ _/ __ \____ _____/ (_)___
/ / / __ \/ __ \/ / / / / / __ `/ /_/ / __ `/ __ / / __ \
/ /___/ /_/ / /_/ / /_/ / /___/ /_/ / _, _/ /_/ / /_/ / / /_/ /
\____/\____/ .___/\__, /_____/\__,_/_/ |_|\__,_/\__,_/_/\____/
/_/ /____/
Multimedia Layer (https://www.copylaradio.com)
' | lolcat
## MULTIMEDIA
## VIDEO & AUDIO & PLAYLISTS ~/.zen/ DIR
mkdir -p ~/astroport/films
mkdir -p ~/astroport/animes
mkdir -p ~/astroport/series
mkdir -p ~/astroport/docus
mkdir -p ~/astroport/musiques
mkdir -p ~/.zen/video
mkdir -p ~/.zen/audio
mkdir -p ~/.zen/playlists
######## YOUTUBE-DL ##########
if [[ ! $(which youtube-dl) ]]; then
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl || err=1
sudo chmod a+rx /usr/local/bin/youtube-dl
sudo chown $YOU /usr/local/bin/youtube-dl
fi
###############################
# MPD/MPC RompR AUDIO LAYER
###############################
if [[ ! $(which mpd) ]]; then
sudo apt-get install libid3-tools mpd mpc lame ffmpeg lsof lltag inotify-tools bc -y || err=1
sudo apt-get install lame sox libsox-fmt-mp3 eyed3 python-chardet imagemagick curl -y || err=1 #libav-tools unavailable on some system
sudo apt-get install ca-certificates git-core binutils rsync alsa-utils bc espeak mpg321 fuse atomicparsley -y || err=1
## CONFIG MPD
sudo cp -f /home/$YOU/.zen/astroport/.install/templates/copylaradio/mpd.conf /etc/mpd.conf
sudo sed -i "s/_USER_/$YOU/g" /etc/mpd.conf || err=1
mkdir ~/.config/mpd && sudo cp -f /etc/mpd.conf ~/.config/mpd/mpd.conf && sudo chown $YOU ~/.config/mpd/mpd.conf
## CHOWN mpd FILES STRUCTURE
sudo chown -R $YOU /var/lib/mpd/ /var/run/mpd /run/mpd /var/log/mpd
sudo service mpd restart || err=1
fi
### INSTALL NGINX
echo '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
_
____ ____ _(_)___ _ __
/ __ \/ __ `/ / __ \| |/_/
/ / / / /_/ / / / / /> <
/_/ /_/\__, /_/_/ /_/_/|_|
/____/
install
' | lolcat
sudo apt-get install fail2ban nginx ssl-cert php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-fpm sqlite -y || err=1
[[ ! $(which nslookup) ]] && sudo apt-get install lolcat dnsutils -y
echo '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
__ ___ _ ___
/ |/ /_ __ ____ ____ _____ ___ ___ (_)___/__ \
/ /|_/ / / / / / __ \/ __ `/ __ `__ \/ _ \ / / ___// _/
/ / / / /_/ / / / / / /_/ / / / / / / __/ / (__ )/_/
/_/ /_/\__, / /_/ /_/\__,_/_/ /_/ /_/\___/ /_/____/(_)
/____/
' | lolcat
myIP=$(hostname -I | awk '{print $1}' | head -n 1)
isLAN=$(echo $myIP | grep -E "/(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
# Ask to the router its name (BOX DNS or system defined)
[[ -f /home/$YOU/.zen/astroport/zen/tools/nodename ]] && NODENAME=$(/home/$YOU/.zen/astroport/zen/tools/nodename) \
|| NODENAME=$(curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/zen/tools/nodename | bash) ## RUNNING ALONE !!
echo $NODENAME
echo '
__ ____ _ __________ __
/ / / __ \ | / / ____/ / ____ _____ ____/ /
/ / / / / / | / / __/ / / / __ `/ __ \/ __ /
/ /___/ /_/ /| |/ / /___/ /___/ /_/ / / / / /_/ /
/_____/\____/ |___/_____/_____/\__,_/_/ /_/\__,_/
Portal
' | lolcat
###
echo "INSTALL LOVELand WebSite. Linking to /var/www ..."
if [[ ! -L /var/www/loveland ]]; then
sudo ln -s /home/$YOU/.zen/astroport/www/LOVELand /var/www/loveland
fi
echo "JUKEBOX init"
[[ -d /var/www/loveland/jukebox/albumart ]] && sudo chmod -R 777 /var/www/loveland/jukebox/albumart
[[ -d /var/www/loveland/jukebox/prefs ]] && sudo chmod -R 777 /var/www/loveland/jukebox/prefs
[[ -d /var/www/loveland/g1barre/img/qrcodes ]] && sudo chmod -R 777 /var/www/loveland/g1barre/img/qrcodes
# CONFIG NGINX - LOVE LAND FRONTAL WEB PAGE
echo "$NODENAME" | figlet -f slant | lolcat
## Write NODENAME to IPFS
echo "$NODENAME" > /home/$YOU/.zen/ipfs/.$IPFSNODEID/G1SSB/_nodename
PHPVERSION=$(ps auxf | grep php-fpm | grep -v -E 'color=auto|grep' | head -n 1 | grep -oP '(?<=\().*(?=\))' | awk -F '/' '{print $4}')
### JUKEBOX RompR CopyLaRadio
if [[ $(which mpd) ]]; then
sudo sed "s/_PHPVERSION_/$PHPVERSION/g" /home/$YOU/.zen/astroport/www/loveland.conf > /tmp/jukebox.conf
sudo sed -i "s/_MY_NODE_NAME_/$NODENAME/g" /tmp/jukebox.conf
sudo sed -i "s/_PORT_/80/g" /tmp/jukebox.conf
sudo sed -i "s/_APPLI_/jukebox/g" /tmp/jukebox.conf
sudo cp -f /tmp/jukebox.conf /etc/nginx/conf.d/jukebox.conf
fi
##### RESTART NGINX
sudo systemctl restart nginx || err=1
if [[ $err ]]; then
echo -e "${c_red}Installation de bizarre??$c_"
echo "PLEASE... POST YOUR ISSUE! https://git.p2p.legal/axiom-team/astroport/issues"
exit 1
else
echo -e "${c_green}Installation réalisée avec succès$c_"
echo -e "Astroport JUKEBOX http://$NODENAME (TRY ME)"
fi
# Open in browser
URL="http://$NODENAME"
path=$(which xdg-open || which gnome-open)
xo ()
{
for var in "$@"; do
$path "$var";
sleep 0.5
done
}
[[ -n $path ]] && xo $URL:80 > /dev/null
} # for script being completely downloaded before run

View File

@ -1,35 +0,0 @@
# Automatic install of Nextcloud on Debian 8/9/10
## Use
Set good variables for your use case at the beginning of install.sh:
```
nc_domain="" # Votre nom de domaine pour votre nextcloud. Si vide il prendra le premier argument que vous passerez, sinon le hostname de votre machine
nc_port=80 # Numéro de port d'écoute de nginx
admin_user="admin" # Le pseudo du compte admin
admin_pass="admin" # Le mot de passe que vous désirez pour le compte admin
db_pass="" # Le mot de passe que vous désirez pour MariaDB. Si vide, un mot de passe aléatoire sécurisé sera choisi
isSSL=false # true si nextcloud et nginx doivent être configuré en https
configMaria=auto # Mettez manual ou auto, attention auto est expérimental et vraiment pas recommendé
p2env=false # true si vous êtes dans un environnement p2p.legal
```
Then:
```
chmod u+x install.sh
./install.sh
```
You can change the ssl state of your instance after the installation if you need.
Just execute ssl.sh:
`./ssl.sh`
If you prefere, you can download this script directly via:
```
wget https://dev-nextcloud.p2p.legal/installeur/install-nextcloud.tar.gz
tar -zxvf install-nextcloud.tar.gz
./install.sh 2>&1 | tee loginstall.log
```

View File

@ -1,186 +0,0 @@
#!/bin/bash
################################################################################
# Author: poka (poka@p2p.legal)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
### Variables ###
nc_domain="" # Votre nom de domaine pour votre nextcloud. Si vide il prendra le premier argument que vous passerez, sinon le hostname de votre machine
nc_port=10050 # Numéro de port d'écoute de nginx
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
admin_user="$YOU" # Le pseudo du compte admin
admin_pass="0penS0urce!" # Le mot de passe que vous désirez pour le compte admin
db_pass="" # Le mot de passe que vous désirez pour MariaDB. Si vide, un mot de passe aléatoire sécurisé sera choisi
data_dir="/home/$YOU/.zen/nextcloud" # Le répertoir data de nextcloud, toutes les données utilisateurs s'y trouvent
isSSL=false # true si nextcloud et nginx doivent être configuré en https
configMaria=auto # Mettez manual ou auto, attention auto est expérimental et vraiment pas recommendé
p2env=false # true si vous êtes dans un environnement p2p.legal
#################
if [ "$EUID" -ne 0 ]
then echo -e "${c_red}Veuillez executez ce script en root$c_"
exit 1
fi
## Atroport config
echo -e "${c_yellow}Getting local hostname...$c_"
nc_domain=$(/home/$YOU/.zen/astroport/zen/tools/nodename)
templates="/home/$YOU/.zen/astroport/.install/nextcloud/templates"
## Set var
[[ -z $nc_domain ]] && nc_domain=$1
[[ -z $nc_domain ]] && nc_domain=$(echo $HOSTNAME.p2p.legal)
[[ -z $db_pass ]] && db_pass="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)" && echo "Votre mot de passe mysql nextcloud est : $db_pass" >> /root/nextcloud_mysql_pwd.txt
db_pass_root="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9~!@#$%^&*_-' | fold -w 32 | head -n 1)"
if [[ p2env == "true" ]]; then
cd /nextcloud/templates/
else
[[ ! -e $templates ]] && echo -e "${c_red}Erreur: Le dossier templates n'existe pas, installation impossible.$c_" && exit 1
cd $templates
fi
## Update system packages
apt install -y lsb-release apt-transport-https ca-certificates
apt update -y
apt install nginx mariadb-server apt-transport-https curl gnupg2 git lsb-release ssl-cert ca-certificates apt-transport-https tree locate software-properties-common dirmngr screen htop net-tools zip unzip curl ffmpeg ghostscript libfile-fcntllock-perl -y
systemctl start nginx || (echo -e "${c_red}Erreur quelque part ...$c_" && exit 1)
systemctl start mariadb || (echo -e "${c_red}Erreur quelque part ...$c_" && exit 1)
systemctl enable mariadb || (echo -e "${c_red}Erreur quelque part ...$c_" && exit 1)
systemctl enable nginx || (echo -e "${c_red}Erreur quelque part ...$c_" && exit 1)
echo -e "${c_yellow} === Installing php ... ===$c_"
apt install php php-fpm php-xml php-curl php-gd php php-cgi php-cli php-zip php-mysql php-mbstring php-intl php-json php-bz2 php-ldap php-apcu imagemagick php-imagick php-smbclient -y
export PHPVERSION=$(ps auxf | grep php-fpm | grep -v -E 'color=auto|grep' | head -n 1 | grep -oP '(?<=\().*(?=\))' | awk -F '/' '{print $4}')
echo -e "${c_yellow} === Configuring php ... ===$c_"
[[ ! -e /etc/php/$PHPVERSION/cli/php.ini.bak ]] && (bash configure_php.sh || (echo -e "${c_red}Erreur quelque part ...$c_" && exit 1)) || echo "PHP déjà configuré, skip"
echo -e "${c_yellow} === Configure MariaDB ===$c_"
configMariaManual() {
mysql_secure_installation || (echo -e "${c_red}Erreur quelque part ...$c_" && exit 1)
}
configMariaAuto() {
mysql -e "UPDATE mysql.user SET Password = PASSWORD('$db_pass_root') WHERE User = 'root'"
isLocalhostUsers=$(mysql -e "select user from mysql.user;" | grep "localhost")
isTestDB=$(mysql -e "show databases" | grep "test")
[[ -n $isLocalhostUsers ]] && mysql -e "DROP USER ''@'localhost'; DROP USER ''@'$(hostname)'"
[[ -n $isTestDB ]] && mysql -e "DROP DATABASE test"
mysql -e "FLUSH PRIVILEGES"
}
[[ $configMaria == "auto" ]] && configMariaAuto || configMariaManual
[[ ! -e /etc/mysql/my.cnf.bak ]] && (mv /etc/mysql/my.cnf /etc/mysql/my.cnf.bak && cp my.cnf /etc/mysql/ && service mysql restart) || echo "MariaDB déjà configuré, skip"
echo -e "${c_yellow} === Create and configure database... ===$c_"
isDBCreate=$(mysql -e "show databases" | grep "nextcloud")
[[ -z $isDBCreate ]] && mysql -e "CREATE DATABASE nextcloud;CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY \"$db_pass\";GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost';FLUSH PRIVILEGES;ALTER DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" || echo "La base de donnée de nextcloud est déjà créé, skip"
echo -e "${c_yellow} === Installing and configure Redis... ===$c_"
apt install redis-server php-redis -y
[[ ! -e /etc/redis/redis.conf.bak ]] && cp /etc/redis/redis.conf /etc/redis/redis.conf.bak || echo "Redis est déjà configuré, skip"
sed -i "s/port 6379/port 0/" /etc/redis/redis.conf
sed -i "s/redis.sock/redis-server.sock/" /etc/redis/redis.conf
sed -i s/\#\ unixsocket/\unixsocket/g /etc/redis/redis.conf
sed -i "s/unixsocketperm 700/unixsocketperm 770/" /etc/redis/redis.conf
sed -i "s/# maxclients 10000/maxclients 512/" /etc/redis/redis.conf
usermod -a -G redis www-data || (echo -e "${c_red}Erreur quelque part ...$c_" && exit 1)
[[ ! -e /etc/sysctl.conf.bak ]] && cp /etc/sysctl.conf /etc/sysctl.conf.bak || echo "sysctl est déjà configuré, skip"
sed -i '$avm.overcommit_memory = 1' /etc/sysctl.conf
service redis-server restart || (echo -e "${c_red}Erreur quelque part ...$c_" && exit 1)
echo -e "${c_yellow} === Installing NextCloud... ===$c_"
if [[ ! -e /var/www/nextcloud ]]; then
mkdir /var/www/nextcloud
chown www-data:www-data /var/www/nextcloud
chmod 750 /var/www/nextcloud || (echo -e "${c_red}Erreur quelque part ...$c_" && exit 1)
wget https://download.nextcloud.com/server/releases/latest.tar.bz2
tar -xjf latest.tar.bz2 -C /var/www && chown -R www-data:www-data /var/www/ && rm -f latest.tar.bz2
fi
if [[ ! -e $data_dir ]]; then
mkdir -p $data_dir
chown www-data:www-data $data_dir
chmod 750 $data_dir || (echo -e "${c_red}Erreur quelque part ...$c_" && exit 1)
fi
## Add local IP as secondary trust domain
# Prefere occ methode ...
# sed -i "/0 => '$nc_domain'.*/a \ 1 => '$ip_local:$nc_port'," /var/www/nextcloud/config/config.php
ip_local=$(/sbin/ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p')
[[ $nc_port == 80 ]] && nc_port_loc="" || nc_port_loc=":$nc_port"
[[ -e /var/www/nextcloud/config/config.php ]] && isNCConfig=$(cat /var/www/nextcloud/config/config.php | grep "'installed' => true")
[[ -z "$isNCConfig" ]] && sudo -u www-data php /var/www/nextcloud/occ maintenance:install --database "mysql" --database-name "nextcloud" --database-user "nextcloud" --database-pass "$db_pass" --admin-user "$admin_user" --admin-pass "$admin_pass" --data-dir "$data_dir"
sleep 0.2
sudo -u www-data php /var/www/nextcloud/occ config:system:set mysql.utf8mb4 --type boolean --value="true"
sudo -u www-data php /var/www/nextcloud/occ config:system:set trusted_domains 0 --value=$nc_domain
sudo -u www-data php /var/www/nextcloud/occ config:system:set trusted_domains 1 --value=$ip_local$nc_port_loc
sudo -u www-data php /var/www/nextcloud/occ config:system:set overwrite.cli.url --value=$nc_domain
isNCConfigAdd=$(cat /var/www/nextcloud/config/config.php | grep "activity_expire_days")
if [[ -z "$isNCConfigAdd" ]]; then
sudo -u www-data sed -i 's/^[ ]*//' /var/www/nextcloud/config/config.php
sudo -u www-data sed -i '/);/d' /var/www/nextcloud/config/config.php
cat config_complete.php >> /var/www/nextcloud/config/config.php
fi
sudo -u www-data sed -i "s/output_buffering=.*/output_buffering=0/" /var/www/nextcloud/.user.ini
sudo -u www-data php /var/www/nextcloud/occ app:disable survey_client
sudo -u www-data php /var/www/nextcloud/occ app:disable firstrunwizard
sudo -u www-data php /var/www/nextcloud/occ app:enable admin_audit
sudo -u www-data php /var/www/nextcloud/occ app:enable files_pdfviewer
echo -e "${c_yellow} === Configure nginx ... ===$c_"
cp nextcloud.conf /etc/nginx/conf.d/
cp *optimization.conf /etc/nginx/
sed -i "s/NC_DOMAIN/$nc_domain/" /etc/nginx/conf.d/nextcloud.conf
sed -i "s/NC_PORT/$nc_port/" /etc/nginx/conf.d/nextcloud.conf
sed -i "s/_PHPVERSION/$PHPVERSION/" /etc/nginx/conf.d/nextcloud.conf
sed -i "s/80 default_server;/81 default_server;/" /etc/nginx/sites-enabled/default
chmod u+x ../ssl.sh
if [[ $isSSL == "false" ]]; then
../ssl.sh nonssl
else
../ssl.sh certif
../ssl.sh ssl
fi
echo -e "${c_yellow} === Mise en place des scripts et crons ... ===$c_"
[[ ! -e /opt/scripts ]] && mkdir /opt/scripts
cp nc_optimize.sh /opt/scripts/
cp upgrade.sh /opt/scripts/
cp occ /opt/scripts/
echo "alias occ='/opt/scripts/occ'" >> ~/.bashrc
alias occ='/opt/scripts/occ'
[[ -z $(crontab -l | grep "/var/www/nextcloud/cron.php") ]] && (crontab -l ; echo "*/5 * * * * sudo -u www-data /usr/bin/php -f /var/www/nextcloud/cron.php > /dev/null 2>&1") | crontab -u root - || echo "cron nextcloud ever set, skip"
[[ -z $(crontab -l | grep "/opt/scripts/optimize.sh") ]] && (crontab -l ; echo "5 1 * * * /opt/scripts/optimize.sh > /dev/null 2>&1") | crontab -u root - || echo "cron optimize ever set, skip"
sudo -u www-data php /var/www/nextcloud/occ background:cron
sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices
sudo -u www-data php /var/www/nextcloud/occ db:convert-filecache-bigint
echo -e "${c_yellow} === Restarting services ... ===$c_"
service php$PHPVERSION-fpm restart && service nginx restart && service mysql restart && service redis-server restart || (echo -e "${c_red}Impossible de reloader les service$c_" && exit 1)
bash /opt/scripts/nc_optimize.sh
usermod -aG www-data $YOU
echo -e "${c_green}Nextcloud a été installé avec succès !\nOuverture...$c_"
URL="http://$nc_domain:$nc_port"
[[ -x $BROWSER ]] && su -c "exec \"$BROWSER\" \"$URL\"" $YOU > /dev/null
path=$(which xdg-open || which gnome-open) && su -c "exec \"$path\" \"$URL\"" $YOU > /dev/null
echo -e "${c_yellow}Can't find browser$c_"

View File

@ -1,69 +0,0 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Veuillez executez ce script en root"
exit 1
fi
domain=$(cat /etc/nginx/conf.d/nextcloud.conf | grep server_name | awk '{ print $2 }')
domain=$(echo ${domain::-1})
[[ ! $1 =~ ^(ssl|nonssl|certif)$ ]] && echo "Veuillez choisir ssl, nonssl ou certif pour créer un certificat ssl" && exit 1
ssl(){
sed -i "s/'overwriteprotocol' => 'http'/'overwriteprotocol' => 'https'/" /var/www/nextcloud/config/config.php
sed -i "s/http/https/" /etc/nginx/conf.d/nextcloud.conf
sed -i "s/fastcgi_param HTTPS off/fastcgi_param HTTPS on/" /etc/nginx/conf.d/nextcloud.conf
sed -i "s/listen 443;/listen 443 ssl;/" /etc/nginx/conf.d/nextcloud.conf
[[ ! -e /etc/nginx/includes ]] && mkdir /etc/nginx/includes
cp .install_templates/ssl.conf /etc/nginx/includes/
sed -i "/fastcgi_hide_header X-Powered-By;/a \ include includes/ssl.conf;\n ssl_certificate /etc/letsencrypt/live/$domain/fullchain.pem;\n ssl_certificate_key /etc/letsencrypt/live/$domain/privkey.pem;" /etc/nginx/conf.d/nextcloud.conf
}
nonssl(){
sed -i "s/'overwriteprotocol' => 'https'/'overwriteprotocol' => 'http'/" /var/www/nextcloud/config/config.php
sed -i "s/https/http/" /etc/nginx/conf.d/nextcloud.conf
sed -i "s/fastcgi_param HTTPS on/fastcgi_param HTTPS off/" /etc/nginx/conf.d/nextcloud.conf
sed -i '/ssl.conf;/d' /etc/nginx/conf.d/nextcloud.conf
sed -i '/ssl_certificate/d' /etc/nginx/conf.d/nextcloud.conf
}
install_certbot(){
sudo apt update
if [[ $(grep buster /etc/os-release) ]]; then
[[ -z $(cat /etc/apt/sources.list | grep "buster-backports main") ]] && echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
sudo apt install certbot python-certbot-nginx -t buster-backports -y
elif [[ $(grep stretch /etc/os-release) ]]; then
sudo apt install certbot python-certbot-nginx -y
elif [[ $(grep -E '16.|17.|18.|19.' /etc/os-release) ]]; then
sudo apt install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt update
sudo apt install certbot python-certbot-nginx
else
echo "OS non supporté pour certbot." && exit 1
fi
}
create_certificate() {
cd .install_templates
certbot --nginx certonly --non-interactive --agree-tos -m $USER@$domain -d $domain && echo "Le certificat de $domain a bien été déployé" || echo "Une erreur s'est produite lors de la création du certificat SSL"
## Cronification
[[ ! -e /opt/scripts ]] && mkdir /opt/scripts
cp ssl_renew.sh /opt/scripts/
[[ -z $(crontab -l | grep "/opt/scripts/ssl_renew.sh") ]] && (crontab -l ; echo "12 2 * * 1 /opt/scripts/ssl_renew.sh") | crontab -u root -
}
certif() {
[[ -z $(which certbot) ]] && install_certbot
[[ -n /etc/letsencrypt/live/$domain/fullchain.pem ]] && create_certificate
}
$@
service nginx reload
exit 0

View File

@ -1,52 +0,0 @@
'activity_expire_days' => 14,
'auth.bruteforce.protection.enabled' => true,
'blacklisted_files' =>
array (
0 => '.htaccess',
1 => 'Thumbs.db',
2 => 'thumbs.db',
),
'cron_log' => true,
'enable_previews' => true,
'enabledPreviewProviders' =>
array (
0 => 'OC\\Preview\\PNG',
1 => 'OC\\Preview\\JPEG',
2 => 'OC\\Preview\\GIF',
3 => 'OC\\Preview\\BMP',
4 => 'OC\\Preview\\XBitmap',
5 => 'OC\\Preview\\Movie',
6 => 'OC\\Preview\\PDF',
7 => 'OC\\Preview\\MP3',
8 => 'OC\\Preview\\TXT',
9 => 'OC\\Preview\\MarkDown',
),
'filesystem_check_changes' => 0,
'filelocking.enabled' => 'true',
'htaccess.RewriteBase' => '/',
'integrity.check.disabled' => false,
'knowledgebaseenabled' => false,
'logfile' => '/var/log/nextcloud.log',
'loglevel' => 2,
'logtimezone' => 'Europe/Paris',
'log_rotate_size' => 104857600,
'maintenance' => false,
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'overwriteprotocol' => 'https',
'preview_max_x' => 1024,
'preview_max_y' => 768,
'preview_max_scale_factor' => 1,
'redis' =>
array (
'host' => '/var/run/redis/redis-server.sock',
'port' => 0,
'timeout' => 0.0,
),
'quota_include_external_storage' => false,
'share_folder' => '/Shares',
'skeletondirectory' => '',
'theme' => '',
'trashbin_retention_obligation' => 'auto, 7',
'updater.release.channel' => 'stable',
);

View File

@ -1,50 +0,0 @@
cp /etc/php/$PHPVERSION/fpm/pool.d/www.conf /etc/php/$PHPVERSION/fpm/pool.d/www.conf.bak
cp /etc/php/$PHPVERSION/cli/php.ini /etc/php/$PHPVERSION/cli/php.ini.bak
cp /etc/php/$PHPVERSION/fpm/php.ini /etc/php/$PHPVERSION/fpm/php.ini.bak
cp /etc/php/$PHPVERSION/fpm/php-fpm.conf /etc/php/$PHPVERSION/fpm/php-fpm.conf.bak
sed -i "s/;env\[HOSTNAME\] = /env[HOSTNAME] = /" /etc/php/$PHPVERSION/fpm/pool.d/www.conf
sed -i "s/;env\[TMP\] = /env[TMP] = /" /etc/php/$PHPVERSION/fpm/pool.d/www.conf
sed -i "s/;env\[TMPDIR\] = /env[TMPDIR] = /" /etc/php/$PHPVERSION/fpm/pool.d/www.conf
sed -i "s/;env\[TEMP\] = /env[TEMP] = /" /etc/php/$PHPVERSION/fpm/pool.d/www.conf
sed -i "s/;env\[PATH\] = /env[PATH] = /" /etc/php/$PHPVERSION/fpm/pool.d/www.conf
sed -i "s/pm.max_children = .*/pm.max_children = 240/" /etc/php/$PHPVERSION/fpm/pool.d/www.conf
sed -i "s/pm.start_servers = .*/pm.start_servers = 20/" /etc/php/$PHPVERSION/fpm/pool.d/www.conf
sed -i "s/pm.min_spare_servers = .*/pm.min_spare_servers = 10/" /etc/php/$PHPVERSION/fpm/pool.d/www.conf
sed -i "s/pm.max_spare_servers = .*/pm.max_spare_servers = 20/" /etc/php/$PHPVERSION/fpm/pool.d/www.conf
sed -i "s/;pm.max_requests = 500/pm.max_requests = 500/" /etc/php/$PHPVERSION/fpm/pool.d/www.conf
sed -i "s/output_buffering =.*/output_buffering = 'Off'/" /etc/php/$PHPVERSION/cli/php.ini
sed -i "s/max_execution_time =.*/max_execution_time = 1800/" /etc/php/$PHPVERSION/cli/php.ini
sed -i "s/max_input_time =.*/max_input_time = 3600/" /etc/php/$PHPVERSION/cli/php.ini
sed -i "s/post_max_size =.*/post_max_size = 10240M/" /etc/php/$PHPVERSION/cli/php.ini
sed -i "s/upload_max_filesize =.*/upload_max_filesize = 10240M/" /etc/php/$PHPVERSION/cli/php.ini
sed -i "s/max_file_uploads =.*/max_file_uploads = 100/" /etc/php/$PHPVERSION/cli/php.ini
sed -i "s/;date.timezone.*/date.timezone = Europe\/\Paris/" /etc/php/$PHPVERSION/cli/php.ini
## sed -i "s/;session.cookie_secure.*/session.cookie_secure = True/" /etc/php/$PHPVERSION/cli/php.ini # Bug if not using ssl
sed -i "s/memory_limit = 128M/memory_limit = 512M/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/output_buffering =.*/output_buffering = 'Off'/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/max_execution_time =.*/max_execution_time = 1800/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/max_input_time =.*/max_input_time = 3600/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/post_max_size =.*/post_max_size = 10240M/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/upload_max_filesize =.*/upload_max_filesize = 10240M/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/max_file_uploads =.*/max_file_uploads = 100/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/;date.timezone.*/date.timezone = Europe\/\Paris/" /etc/php/$PHPVERSION/fpm/php.ini
## sed -i "s/;session.cookie_secure.*/session.cookie_secure = True/" /etc/php/$PHPVERSION/fpm/php.ini # Bug if not using ssl
sed -i "s/;opcache.enable=.*/opcache.enable=1/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/;opcache.enable_cli=.*/opcache.enable_cli=1/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/;opcache.memory_consumption=.*/opcache.memory_consumption=128/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/;opcache.interned_strings_buffer=.*/opcache.interned_strings_buffer=8/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/;opcache.max_accelerated_files=.*/opcache.max_accelerated_files=10000/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/;opcache.revalidate_freq=.*/opcache.revalidate_freq=1/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/;opcache.save_comments=.*/opcache.save_comments=1/" /etc/php/$PHPVERSION/fpm/php.ini
sed -i "s/;emergency_restart_threshold =.*/emergency_restart_threshold = 10/" /etc/php/$PHPVERSION/fpm/php-fpm.conf
sed -i "s/;emergency_restart_interval =.*/emergency_restart_interval = 1m/" /etc/php/$PHPVERSION/fpm/php-fpm.conf
sed -i "s/;process_control_timeout =.*/process_control_timeout = 10s/" /etc/php/$PHPVERSION/fpm/php-fpm.conf
sed -i "s/09,39.*/# &/" /etc/cron.d/php
(crontab -l ; echo "09,39 * * * * /usr/lib/php/sessionclean 2>&1") | crontab -u root -
cp /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml.bak
sed -i "s/rights\=\"none\" pattern\=\"PS\"/rights\=\"read\|write\" pattern\=\"PS\"/" /etc/ImageMagick-6/policy.xml
sed -i "s/rights\=\"none\" pattern\=\"EPI\"/rights\=\"read\|write\" pattern\=\"EPI\"/" /etc/ImageMagick-6/policy.xml
sed -i "s/rights\=\"none\" pattern\=\"PDF\"/rights\=\"read\|write\" pattern\=\"PDF\"/" /etc/ImageMagick-6/policy.xml
sed -i "s/rights\=\"none\" pattern\=\"XPS\"/rights\=\"read\|write\" pattern\=\"XPS\"/" /etc/ImageMagick-6/policy.xml
service php$PHPVERSION-fpm restart && service nginx restart

View File

@ -1,79 +0,0 @@
[client]
default-character-set = utf8mb4
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
log_error=/var/log/mysql/mysql_error.log
nice = 0
socket = /var/run/mysqld/mysqld.sock
[mysqld]
basedir = /usr
bind-address = 127.0.0.1
binlog_format = ROW
bulk_insert_buffer_size = 16M
character-set-server = utf8mb4
collation-server = utf8mb4_general_ci
concurrent_insert = 2
connect_timeout = 5
datadir = /var/lib/mysql
default_storage_engine = InnoDB
expire_logs_days = 10
general_log_file = /var/log/mysql/mysql.log
general_log = 0
innodb_buffer_pool_size = 1024M
innodb_buffer_pool_instances = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 32M
innodb_max_dirty_pages_pct = 90
innodb_large_prefix = on
innodb_file_format = barracuda
innodb_file_per_table = 1
innodb_open_files = 400
innodb_io_capacity = 4000
innodb_flush_method = O_DIRECT
key_buffer_size = 128M
lc_messages_dir = /usr/share/mysql
lc_messages = en_US
log_bin = /var/log/mysql/mariadb-bin
log_bin_index = /var/log/mysql/mariadb-bin.index
log_error=/var/log/mysql/mysql_error.log
log_slow_verbosity = query_plan
log_warnings = 2
long_query_time = 1
max_allowed_packet = 16M
max_binlog_size = 100M
max_connections = 200
max_heap_table_size = 64M
myisam_recover_options = BACKUP
myisam_sort_buffer_size = 512M
port = 3306
pid-file = /var/run/mysqld/mysqld.pid
query_cache_limit = 2M
query_cache_size = 64M
query_cache_type = 1
query_cache_min_res_unit = 2k
read_buffer_size = 2M
read_rnd_buffer_size = 1M
skip-external-locking
skip-name-resolve
slow_query_log_file = /var/log/mysql/mariadb-slow.log
slow-query-log = 1
socket = /var/run/mysqld/mysqld.sock
sort_buffer_size = 4M
table_open_cache = 400
thread_cache_size = 128
tmp_table_size = 64M
tmpdir = /tmp
transaction_isolation = READ-COMMITTED
user = mysql
wait_timeout = 600
[mysqldump]
max_allowed_packet = 16M
quick
quote-names
[isamchk]
key_buffer = 16M

View File

@ -1,10 +0,0 @@
#!/bin/bash
redis-cli -s /var/run/redis/redis-server.sock <<EOF
FLUSHALL
quit
EOF
sudo -u www-data php /var/www/nextcloud/occ files:scan --all
sudo -u www-data php /var/www/nextcloud/occ files:scan-app-data
exit 0

View File

@ -1,149 +0,0 @@
upstream php-handler {
server unix:/var/run/php/php_PHPVERSION-fpm.sock;
}
server {
listen NC_PORT;
listen 443;
listen [::]:443 ssl;
server_name NC_DOMAIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header Referrer-Policy no-referrer;
set_real_ip_from 192.168.9.1;
set_real_ip_from 192.168.9.6;
# Remove X-Powered-By, which is an information leak
fastcgi_hide_header X-Powered-By;
add_header X-Frame-Options "SAMEORIGIN";
# Path to the root of your installation
root /var/www/nextcloud/;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# The following 2 rules are only needed for the user_webfinger app.
# Uncomment it if you're planning to use this app.
#rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
#rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json
# last;
location = /.well-known/carddav {
return 301 https://$host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 https://$host/remote.php/dav;
}
# set max upload size
client_max_body_size 512M;
fastcgi_buffers 64 4K;
# Enable gzip but do not remove ETag headers
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
# Uncomment if your server is build with the ngx_pagespeed module
# This module is currently not supported.
#pagespeed off;
location / {
rewrite ^ /index.php;
}
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
deny all;
}
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
}
location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
try_files $fastcgi_script_name =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS on;
# Avoid sending the security headers twice
fastcgi_param modHeadersAvailable true;
# Enable pretty urls
fastcgi_param front_controller_active true;
fastcgi_pass php-handler;
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
}
location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) {
try_files $uri/ =404;
index index.php;
}
# Adding the cache control header for js and css files
# Make sure it is BELOW the PHP block
location ~ \.(?:css|js|woff2?|svg|gif)$ {
try_files $uri /index.php$request_uri;
add_header Cache-Control "public, max-age=15778463";
# Add headers to serve security related headers (It is intended to
# have those duplicated to the ones above)
# Before enabling Strict-Transport-Security headers please read into
# this topic first.
# add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
#
# WARNING: Only add the preload option once you read about
# the consequences in https://hstspreload.org/. This option
# will add the domain to a hardcoded list that is shipped
# in all major browsers and getting removed from this list
# could take several months.
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header Referrer-Policy no-referrer;
# Optional: Don't log access to assets
access_log off;
}
location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
try_files $uri /index.php$request_uri;
# Optional: Don't log access to other assets
access_log off;
}
location ^~ /apps/rainloop/app/data {
deny all;
}
location ~ \.(?:flv|mp4|mov|m4a)$ {
# mp4;
# mp4_buffer_size 100M;
# mp4_max_buffer_size 1024M;
fastcgi_split_path_info ^(.+?.php)(\/.*|)$;
include fastcgi_params;
include php_optimization.conf;
fastcgi_pass php-handler;
fastcgi_param HTTPS on;
}
location ~ ^\/nextcloud/(?:updater|oc[ms]-provider)(?:$|\/) {
try_files $uri/ =404;
index index.php;
}
}

View File

@ -1,6 +0,0 @@
#/bin/bash
sudo -u www-data php /var/www/nextcloud/occ $@
exit 0

View File

@ -1,17 +0,0 @@
fastcgi_hide_header X-Powered-By;
fastcgi_read_timeout 3600;
fastcgi_send_timeout 3600;
fastcgi_connect_timeout 3600;
fastcgi_buffers 64 64K;
fastcgi_buffer_size 256k;
fastcgi_busy_buffers_size 3840K;
fastcgi_cache_key $http_cookie$request_method$host$request_uri;
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
gzip_disable "MSIE [1-6]\.";

View File

@ -1,8 +0,0 @@
#!/bin/bash
find /var/www/ -type f -print0 | xargs -0 chmod 0640
find /var/www/ -type d -print0 | xargs -0 chmod 0750
chown -R www-data:www-data /var/www/
chown -R www-data:www-data /var/nextcloud/
chmod 0644 /var/www/nextcloud/.htaccess
chmod 0644 /var/www/nextcloud/.user.ini
exit 0

View File

@ -1,9 +0,0 @@
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true;
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
fastcgi_cache_valid 404 1m;
fastcgi_cache_valid any 1h;
fastcgi_cache_methods GET HEAD;

View File

@ -1,16 +0,0 @@
ssl_session_timeout 4h;
ssl_session_cache shared:SSL:50m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-CBC-SHA:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
ssl_prefer_server_ciphers on;
add_header Strict-Transport-Security max-age=15768000;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=86400;
resolver_timeout 10;
ssl_session_tickets on;

View File

@ -1,26 +0,0 @@
#!/bin/bash
log="/var/log/ssl_renew.log"
date=$(date +%d-%m-%Y)
renew=$(certbot renew --pre-hook "service nginx stop" --post-hook "service nginx start")
echo "####################################################################################" >> $log
echo "#################################### $date ####################################" >> $log
echo "####################################################################################" >> $log
echo "$renew" >> $log
if [[ $renew = *"No hooks were run"* ]]; then
echo "Rien n'a été fait" >> $log
else
sleep 5
/etc/init.d/nginx stop
sleep 1
killall nginx
sleep 3
/etc/init.d/nginx restart &>> $log
echo "Des certificats ont été renouvellés" >> $log
fi
exit 0

View File

@ -1,15 +0,0 @@
#!/bin/bash
/usr/sbin/service nginx stop
sudo -u www-data php /var/www/nextcloud/updater/updater.phar
sudo -u www-data php /var/www/nextcloud/occ status
sudo -u www-data php /var/www/nextcloud/occ -V
sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices
sudo -u www-data php /var/www/nextcloud/occ db:convert-filecache-bigint
sudo -u www-data sed -i "s/output_buffering=.*/output_buffering=O/" /var/www/nextcloud/.user.ini
sudo -u www-data php /var/www/nextcloud/occ update:check
sudo -u www-data php /var/www/nextcloud/occ app:update --all
/usr/sbin/service php7.3-fpm restart
/usr/sbin/service nginx restart
exit 0

View File

@ -1,130 +1,7 @@
#!/bin/bash
scuttlebutt() {
echo -e "${c_yellow}Onboarding SCUTTLEBUTT...$c_"
where_is_ssb_installed=$(which ssb-server)
where_is_oasis_installed=$(which oasis)
mkdir -p ~/.zen
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ ! $where_is_ssb_installed ]]; then
# KILL the BRUTAL WAY...
kill -9 $(ps auxf --sort=+utime | grep -w ssb-server| grep -v -E 'color=auto|grep' | tail -n 1 | awk '{print $2}')
# Install dependencies
sudo apt-get install -y socat python3-dev libtool python3-setuptools autoconf automake
# Install nvm
if [[ ! $(which nvm) ]]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
source ~/.bashrc
export NVM_DIR="$HOME/.nvm"
nvm install --lts
fi
cd ~/.ssb
### Install module
npm install -g sodium-native ssb-backlinks ssb-ws ssb-links ssb-query ssb-secret-blob ssb-private
npm install -g ssb-server
# TODO plugin activation !??
# sbot plugins.enable
### Install oasis & ssb-cli (could replace ssb-server?? TODO: try it)
npm -g install fraction/oasis#semver:
npm install -g fraction/ssb-daemon
# npm install -g ssb-cli
# INSTALL sbotc
if [[ ! $(which sbotc) ]]; then
sudo apt install libsodium-dev jq -y
git submodule add https://git.scuttlebot.io/%25133ulDgs%2FoC1DXjoK04vDFy6DgVBB%2FZok15YJmuhD5Q%3D.sha256 sbotc
cd sbotc
make
sudo make install
fi
fi
# TEST ssb-server Install
ssbSERVER=$(which ssb-server)
[[ $ssbSERVER == "" ]] && echo "Check your ssb-server install... Cannot find it !!" && exit 1
# If exists backup ~/.ssb to ~/.ssb_$USER SSB (one time only !)
[[ -d ~/.ssb_$USER ]] && echo "BACKUP already existing... ~/.ssb_$USER !!! Manual check please..." && exit 1
[[ -d ~/.ssb ]] && [[ ! -d ~/.ssb_$USER ]] && mv ~/.ssb ~/.ssb_$USER
# CREATE ~/.ssb_astroport
[[ ! -d ~/.ssb_astroport ]] && mkdir -p ~/.ssb_astroport && cd ~/.ssb_astroport
# if exists, keep ~/.ssb_$USER/secret*
[[ ! -f ~/.ssb_astroport/secret ]] && [[ -f ~/.ssb_$USER/secret ]] && cp -f ~/.ssb_$USER/secret* ~/.ssb_astroport/
# Symlink ~/.ssb -> ~/.ssb_astroport
[[ -L ~/.ssb ]] && rm ~/.ssb
[[ -d ~/.ssb_astroport ]] && ln -s ~/.ssb_astroport ~/.ssb
## #TODO get ~/.ssb/manifest.json from template
cp ./templates/ssb/manifest.json ~/.ssb/manifest.json
# Create config (TODO: adapt if public Pub or Local Node)
# TODO: Create unique hostname in swarm !! uidna
nodename=$(cat /etc/hostname)
extension=$(echo $nodename | cut -d '.' -f 2)
if [[ $extension == $nodename ]]; then
PUB="false"
nodename=$nodename.local
else
PUB="true"
fi
cat > ~/.ssb/config <<EOF
{
"connections": {
"incoming": {
"net": [
{ "scope": "public", "host": "0.0.0.0", "external": ["$nodename"], "transform": "shs", "port": 8008 }
],
"ws": [
{ "scope": ["public", "local", "device"], "host": "0.0.0.0", "port": 8989, "transform": "shs", "http": true }
]
},
"outgoing": {
"net": [{ "transform": "shs" }]
}
}
}
EOF
cat > ~/.zen/launch-oasis.sh <<EOF
#!/bin/bash
oasis --allow-host $nodename --host $nodename
EOF
echo "
_ __ __ _
_ _ .__|_o _ (_ (_ |_)
(_(_)| || |(_| __)__)|_)
_|
$nodename
"
echo '
__ _ _ _ _
(_ |_|_)\ /|_|_) o._ o_|_
__)|_| \ \/ |_| \ || || |_ ... SCUTTLEBUTT ... OK?
'
echo "Launching oasis"
oasis --allow-host $nodename --host $nodename &
echo " http://$nodename:3000 "
echo
echo "ADD ~/.zen/launch-oasis.sh TO YOUR '/etc/rc.local' !!! Or use patchwork. "
sleep $((1 + RANDOM % 5))
echo "LAUNCHING OASIS NODE MANAGER http://$nodename:3000"
echo "IF YOU ARE A PUB consider protect it behind password nginx redirect !!!"
echo "3 seconds before ssb_INIT.sh..."
sleep 3
$MY_PATH/zen/ssb_INIT.sh
echo "TODO"
}
$@

View File

@ -1,66 +0,0 @@
#!/bin/bash
###########################################
echo "NO READY TO USE. REWRITING..." && exit 1
###########################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
OS=$(head -n1 $MY_PATH/.OS)
isARM=$(cat $MY_PATH/.OS | grep YES)
unset err
# Basics
sudo apt update
echo -e "${c_yellow}Mise à jours des prérequis...$c_"
sudo apt install curl jq zip unzip htop tree ntpdate gnupg mpack imagemagick qrencode build-essential base58 bc -y
# Silkaj + Duniterpy
silkaj() {
echo -e "${c_yellow}Installation de Silkaj...$c_"
libsodium=$(sudo apt-cache search libsodium 2>/dev/null | grep -v -E "header|debug symbols" | grep "Network communication" -B1 | head -n1 | awk -F '-' '{ print $1 }')
[[ $libsodium =~ " " ]] && libsodium=$(echo $libsodium | awk '{ print $2 }')
sudo apt install libsodium-dev libssl-dev libffi-dev python3-pip python3-wheel $libsodium -y || err+="Install python3 and $libsodium"
pip3 install duniterpy || err+="Install duniterpy"
pip3 install silkaj --user || err+="Install Silkaj"
source .profile ## PATH="$HOME/.local/bin:$PATH"
}
# Install PHP + MySQL (TODO: REWRITE!!)
php() {
echo -e "${c_yellow}Installation de PHP et MySQL$c_"
if [[ $OS == "buster" ]]; then
sudo apt -y install software-properties-common nginx php php-common php-fpm php-gettext php-gd php-mysql php-curl php-imap php-mbstring php-xml php-cli mariadb-server || err+="Install PHP and MySQL"
elif [[ $OS == "stretch" ]]; then
sudo apt -y install lsb-release apt-transport-https ca-certificates || err+="Install apt-transport-https"
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg || err+="Download PHP key"
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.3.list
sudo apt update
sudo apt -y install software-properties-common dirmngr nginx php7.3 php7.3-common php7.3-gettext php7.3-fpm php7.3-gd php7.3-mysql php7.3-curl php7.3-imap php7.3-mbstring php7.3-xml php7.3-cli mariadb-server || err+="Install PHP and MySQL"
else
echo "${c_red}Votre système n'est pas pris en charge par ce script d'installation.$c_"
exit 1
fi
isLocalhostUsers=$(sudo mysql -e "select user from mysql.user;" | grep "localhost")
isTestDB=$(sudo mysql -e "show databases" | grep "test")
[[ -n $isLocalhostUsers ]] && sudo mysql -e "DROP USER ''@'localhost'; DROP USER ''@'$(hostname)'"
[[ -n $isTestDB ]] && sudo mysql -e "DROP DATABASE test"
sudo mysql -e "FLUSH PRIVILEGES"
}
# Read arguments
for i in $@; do
echo -e "${c_yellow}Installation de $c_light$i$c_"
$i
done
if [[ $err ]]; then
echo -e "${c_red}Installation des prérequis incomplète: $err$c_"
exit 1
else
echo -e "${c_green}Les prérequis ont été correctement installés$c_"
exit 0
fi

View File

@ -1,7 +0,0 @@
{
"plugins": {
"ssb-private": true,
"ssb-backlinks": true,
"patchfoo": true
}
}

View File

@ -1,65 +0,0 @@
#!/usr/bin/env bash
# shellcheck disable=SC1091
true
VERSION="TO-V0.5"
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CURRENT_DIR="$(pwd)"
# Install node.js shared module
# shellcheck source=../shared/node.js/install
source "$BASE_DIR/../shared/node.js/install"
# Make folder if service did not
mkdir -p ~/.ssb/node_modules || true
# shellcheck disable=SC2164
cd ~/.ssb/node_modules
# Install dependencies
npm install --unsafe-perm asyncmemo hashlru pull-stream pull-cat multicb hyperscript pull-paramap ssb-contact ssb-sort stream-to-pull-stream emoji-server pull-paginate ssb-mentions busboy mime-types pull-identify-filetype human-time pull-hyperscript jpeg-autorotate pull-catch diff pull-split pull-utf8-decoder ssb-web-resolver highlight.js pull-box-stream base64-url ssb-backlinks ssb-private
# Install patchfoo and enable plugin
git clone https://github.com/tomeshnet/patchfoo.git patchfoo
(
# shellcheck disable=SC2164
cd patchfoo
git checkout ${VERSION}
)
# Replace ssb-server plugins.install with a static config file
# This will prevent the installation of these modules a second time
# and compiling downlevel for a 3rd time
cp "$BASE_DIR/config" ~/.ssb
#ssb-server plugins.install ssb-private
#ssb-server plugins.install ssb-backlinks
#ssb-server plugins.enable patchfoo
# Stop ssb service to process plugin
sudo systemctl stop ssb
# Disable the git-ssb and npm-ssb prerequisite
# Comment out two lines in patchwork that create a prerequisite for git-ssb and npm-ssb
# but don't seem to serve any purpose. git-ssb and and npm-ssbis not available on npm
sed -i 's#var Git#//var Git#' patchfoo/lib/app.js patchfoo/lib/app.js
sed -i 's#this.git = new Git(this.sbot, this.config)#//this.git = new Git(this.sbot, this.config)#' patchfoo/lib/app.js
sed -i 's#var SsbNpmRegistry#//var SsbNpmRegistry#' patchfoo/lib/app.js patchfoo/lib/app.js
sed -i 's#this.serveSsbNpmRegistry = SsbNpmRegistry.respond(this.sbot, this.config)#//this.serveSsbNpmRegistry = SsbNpmRegistry.respond(this.sbot, this.config)#' patchfoo/lib/app.js
# Comment out line that breaks things
sed -i "s#h('input', {type: 'file', name: 'upload'})#//h('input', {type: 'file', name: 'upload'})#" patchfoo/lib/serve.js
# Start service again to start patchfoo
sudo systemctl start ssb
# Install nginx reverse proxy file
sudo cp "$BASE_DIR/ssb-patchfoo.conf" /etc/nginx/site-path-enabled/ssb-patchfoo.conf
# Add entry into nginx home screen
APP="<div class='app'><h2>Patch Foo</h2>Plain SSB web UI. <br/><a href='/patchfoo'>Go</a></div>"
sudo sed -i "s#<\!--APPLIST-->#$APP\n<\!--APPLIST-->#" "/var/www/html/index.html"
# shellcheck disable=SC2164
cd "$CURRENT_DIR"

View File

@ -1,9 +0,0 @@
location /patchfoo {
proxy_pass http://127.0.0.1:8027/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
sub_filter "=\"/" "=\"/patchfoo/";
sub_filter_once off;
}

View File

@ -1,74 +0,0 @@
#!/bin/bash
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
### Vars
args=$(echo $@ | tr " " "\n")
if [[ "$args" =~ "DOMAIN=" ]]; then
DOMAIN=$(echo "$args" | grep "\<DOMAIN=" | awk -F '=' '{ print $2 }')
else
echo "Veuillez sélectionner un domaine avec DOMAIN=mondommain.com"
exit 1
fi
if [[ "$args" =~ "APP=" ]]; then
APP=$(echo "$args" | grep "\<APP=" | awk -F '=' '{ print $2 }')
else
echo "Veuillez sélectionner une application avec APP=monapp"
exit 1
fi
action=$(echo "$args" | grep -v "=")
[[ ! $action =~ ^(on|off|certif)$ ]] && echo "Veuillez choisir on, off ou certif pour créer un certificat ssl" && exit 1
###
install_certbot(){
sudo apt update
if [[ $(grep -E 'stretch|buster' /etc/os-release) ]]; then
sudo apt install certbot python-certbot-nginx -y
elif [[ $(grep -E '16.|17.|18.|19.' /etc/os-release) ]]; then
sudo apt install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt update
sudo apt install certbot python-certbot-nginx
else
echo "OS non supporté pour certbot." && exit 1
fi
}
create_certificate() {
sudo certbot --nginx certonly --non-interactive --agree-tos -m $USER@$DOMAIN -d $DOMAIN && echo "Le certificat de $DOMAIN a bien été déployé" || echo "Une erreur s'est produite lors de la création du certificat SSL"
## Cronification
[[ ! -e /opt/scripts ]] && sudo mkdir /opt/scripts
sudo cp $MY_PATH/templates/rproxy/ssl_renew.sh /opt/scripts/
[[ -z $(sudo crontab -l | grep "/opt/scripts/ssl_renew.sh") ]] && (sudo crontab -l ; sudo echo "12 2 * * 1 /opt/scripts/ssl_renew.sh") | sudo crontab -u root -
}
case $action in
on)
sudo sed -i 's/ #if/ if/g' /etc/nginx/conf.d/$APP.conf
sudo sed -i 's/ #add/ add/g' /etc/nginx/conf.d/$APP.conf
sudo sed -i "s/listen 443;/listen 443 ssl;/g" /etc/nginx/conf.d/$APP.conf
[[ ! -d /etc/nginx/includes ]] && sudo mkdir /etc/nginx/includes
sudo cp $MY_PATH/templates/rproxy/ssl.conf /etc/nginx/includes/
sudo sed -i "/Content-Security-Policy/a \ include includes/ssl.conf;\n ssl_certificate /etc/letsencrypt/live/$DOMAIN/fullchain.pem;\n ssl_certificate_key /etc/letsencrypt/live/$DOMAIN/privkey.pem;" /etc/nginx/conf.d/$APP.conf
;;
off)
sudo sed -i "s/ if/ #if/g" /etc/nginx/conf.d/$APP.conf
sudo sed -i "s/ add/ #add/g" /etc/nginx/conf.d/$APP.conf
sudo sed -i "/ssl.conf;/d" /etc/nginx/conf.d/$APP.conf
sudo sed -i "/ssl_certificate/d" /etc/nginx/conf.d/$APP.conf
;;
certif)
[[ ! $(which certbot) ]] && install_certbot
if sudo test ! -f /etc/letsencrypt/live/$DOMAIN/fullchain.pem; then create_certificate; fi
;;
esac

View File

@ -1,37 +0,0 @@
#!/bin/bash
astroVars="OS ARM YOU ipfsnodeid ASTROZEN ASTRONODE myProfile"
export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
export ipfsnodeid=$(ipfs id -f='<id>\n')
export ASTROZEN="/home/$YOU/.zen"
export ASTRONODE="$ASTROZEN/ipfs/.$ipfsnodeid"
export myProfile="$ASTRONODE/profile"
[[ ! -d $ASTRONODE ]] && mkdir -p $ASTRONODE
## Check system kind
[[ $(uname -a | grep arm) ]] && export ARM=yes || unset ARM
if [[ $(grep -E '19.3|19.4' /etc/os-release) ]]; then export OS=buster;
elif [[ $(grep -E 'stretch|18.|19.' /etc/os-release) ]]; then export OS=stretch;
else export OS=buster;
fi
[[ -e $myProfile ]] && rm $myProfile
touch $myProfile
for i in $astroVars; do
[[ ! $(grep "$i=" $myProfile) && -n ${!i} ]] && echo "export $i=${!i}" >> $myProfile
done
# Export for user
[[ -n $(grep "/.zen/ipfs/" ~/.bashrc) ]] && sed -i -n '/\/.zen\/ipfs/!p' ~/.bashrc
[[ -n $(grep "# ASTROPORT " ~/.bashrc) ]] && sed -i -n '/# ASTROPORT /!p' ~/.bashrc
echo -e "# ASTROPORT ENVIRONMENT VARIABLE\n. /home/$YOU/.zen/ipfs/.$ipfsnodeid/profile" >> ~/.bashrc
# Export for root (obsolete)
#[[ -n $(sudo grep "/.zen/ipfs/" /root/.bashrc) ]] && sudo sed -i -n '/\/.zen\/ipfs/!p' /root/.bashrc
#[[ -n $(sudo grep "# ASTROPORT " /root/.bashrc) ]] && sudo sed -i -n '/# ASTROPORT /!p' /root/.bashrc
#echo -e "# ASTROPORT ENVIRONMENT VARIABLE\n. /home/$YOU/.zen/ipfs/.$ipfsnodeid/profile" | sudo tee -a /root/.bashrc
[[ $1 != "noexec" ]] && exec bash

View File

@ -1,36 +0,0 @@
music_directory "/home/_USER_/.zen/audio"
playlist_directory "/home/_USER_/.zen/playlists"
user "_USER_"
bind_to_address "localhost"
auto_update "yes"
zeroconf_enabled "yes"
zeroconf_name "Astroport CopyLaRadio Jukebox"
connection_timeout "120"
filesystem_charset "UTF-8"
id3v1_encoding "UTF-8"
log_file "syslog"
###############################
audio_output {
type "pulse"
name "My Pulse Output"
server "127.0.0.1"
}
audio_output {
type "httpd"
name "CopyLaRadio HTTP Stream"
encoder "lame"
port "8000"
quality "5.0"
# bitrate "128"
format "44100:16:1"
}
audio_output {
type "fifo"
name "my pipe"
path "/tmp/snapfifo"
format "48000:16:2"
mixer_type "software"
}

View File

@ -1,101 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: ipfs daemon
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts the ipfs daemon
# Description: Starts the ipfs daemon using the start-stop-daemon
### END INIT INFO
# Author: Dylan Powers <dylan.kyle.powers@gmail.com
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
DESC="ipfs daemon"
NAME=ipfs
DAEMON=/usr/local/bin/ipfs
DAEMON_ARGS="daemon --enable-pubsub-experiment --enable-namesys-pubsub --enable-gc"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
IPFS_PATH=/home/xbian/.ipfs
IPFS_USER=xbian
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions
#
# Function that starts the daemon/service
#
do_start() {
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test >/dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \
--background --chuid $IPFS_USER --no-close \
--exec /usr/bin/env IPFS_PATH="$IPFS_PATH" $DAEMON 2>>/var/log/ipfs.log 1>/dev/null \
-- $DAEMON_ARGS \
|| return 2
}
#
# Function that stops the daemon/service
#
do_stop() {
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Delete the pid
rm -f $PIDFILE
return "$RETVAL"
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
restart)
do_stop
do_start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2
exit 3
;;
esac

View File

@ -1,11 +0,0 @@
[Unit]
Description=IPFS daemon
After=network.target
[Service]
User=_USER
ExecStart=/usr/local/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub --routing=dhtclient --enable-gc
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@ -1,28 +0,0 @@
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location /g1billet {
proxy_pass http://127.0.0.1:9980;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /ipfs {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /ipns {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
}

View File

@ -1,14 +0,0 @@
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 100m;
client_body_buffer_size 128k;
client_header_buffer_size 64k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 16k;
proxy_buffers 32 16k;
proxy_busy_buffers_size 64k;

View File

@ -1,118 +0,0 @@
{
"auth": "async",
"address": "sync",
"manifest": "sync",
"multiserver": {
"parse": "sync",
"address": "sync"
},
"multiserverNet": {},
"get": "async",
"createFeedStream": "source",
"createLogStream": "source",
"messagesByType": "source",
"createHistoryStream": "source",
"createUserStream": "source",
"createWriteStream": "sink",
"links": "source",
"add": "async",
"publish": "async",
"getAddress": "sync",
"getLatest": "async",
"latest": "source",
"latestSequence": "async",
"whoami": "sync",
"progress": "sync",
"status": "sync",
"getVectorClock": "async",
"version": "sync",
"help": "sync",
"seq": "async",
"usage": "sync",
"clock": "async",
"plugins": {
"install": "source",
"uninstall": "source",
"enable": "async",
"disable": "async",
"help": "sync"
},
"gossip": {
"add": "sync",
"remove": "sync",
"connect": "async",
"disconnect": "async",
"changes": "source",
"reconnect": "sync",
"disable": "sync",
"enable": "sync",
"ping": "duplex",
"get": "sync",
"peers": "sync",
"help": "sync"
},
"replicate": {
"changes": "source",
"upto": "source",
"request": "sync",
"block": "sync"
},
"friends": {
"hopStream": "source",
"onEdge": "sync",
"isFollowing": "async",
"isBlocking": "async",
"hops": "async",
"help": "sync",
"get": "async",
"createFriendStream": "source",
"stream": "source"
},
"blobs": {
"get": "source",
"getSlice": "source",
"add": "sink",
"rm": "async",
"ls": "source",
"has": "async",
"size": "async",
"meta": "async",
"want": "async",
"push": "async",
"changes": "source",
"createWants": "source",
"help": "sync"
},
"backlinks": {
"read": "source"
},
"invite": {
"create": "async",
"use": "async",
"accept": "async"
},
"query": {
"read": "source",
"explain": "sync",
"help": "sync"
},
"search": {
"query": "source",
"help": "sync"
},
"links2": {
"read": "source"
},
"ws": {},
"ebt": {
"replicate": "duplex",
"request": "sync",
"block": "sync",
"peerStatus": "sync"
},
"ooo": {
"stream": "duplex",
"get": "async",
"help": "sync"
}
}

View File

@ -1,34 +0,0 @@
#!/bin/bash
########################################################################
# Author: Fred (support@qo-op.com)
# Version: 2020.12.06
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
# update_bashrc.sh
# Add $YOU $IPFSNODEID $G1PUB to ~/.bashrc
source ~/.bashrc
[[ $YOU != "" && $IPFSNODEID != "" && $G1PUB != "" ]] && er+="bashrc already updated"
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1) || er+=" ipfs daemon not running"
IPFSNODEID=$(ipfs id -f='<id>\n') || er+=" ipfs id problem"
[[ -f ~/.zen/secret.dunikey ]] && G1PUB=$(cat ~/.zen/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2) || er+=" ~/.zen/secret.dunikey missing cannot find G1PUB"
[[ $er != "" ]] && echo "$er" && exit 1
echo "### ASTROPORT IDENTITY ###" >> ~/.bashrc
echo "YOU=$YOU" >> ~/.bashrc
echo "G1PUB=$G1PUB" >> ~/.bashrc
echo "IPFSNODEID=$IPFSNODEID" >> ~/.bashrc
## Add jaklis/.env ?
# cat ~/.zen/astroport/zen/jaklis/.env >> ~/.bashrc
source ~/.bashrc
echo "UPDATE ~/.bashrc OK"
tail -n 4 ~/.bashrc
exit 0

View File

@ -1,8 +0,0 @@
#!/bin/bash
########################################################################
######## YOUTUBE-DL ##########
if [[ ! $(which youtube-dl) ]]; then
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl || exit 1
sudo chmod a+rx /usr/local/bin/youtube-dl
sudo chown $USER /usr/local/bin/youtube-dl
fi

View File

@ -1,113 +0,0 @@
#!/bin/bash
########################################################################
# Author: Fred (support@qo-op.com)
# Version: 2020.12.04
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
#
# This script is run from ~/.config/autostart/Astroport_X_config.desktop
#
########################################################################
# Create secret key files
# ~/.zen/secret.june
# ~/.zen/secret.dunikey
# ~/.zen/secret.ipfs & /tmp/config.ipfs
# ~/.zen/ipfs.sync
########################################################################
[[ $(which zenity) == "" ]] && echo "Please! sudo apt install zenity. EXIT" && exit 1
[[ -f ~/.zen/ipfs.sync ]] && echo "CONFIG ALREADY DONE" && source ~/.zen/ipfs.sync && exit 0
function cleanTMP
{
rm -f /tmp/secret.june /tmp/secret.dunikey /tmp/config.ipfs /tmp/secret.ipfs /tmp/secret.all
}
# NB: 2> >(grep -v 'GtkDialog' >&2) remove zenity console warning
zenity --question --width 300 --text "Initialiser votre station Astroport?" 2> >(grep -v 'GtkDialog' >&2)
[ $? == 1 ] && exit 1
########################################################################
# LOGIN (=SALT)
salt="$(~/.zen/astroport/zen/tools/diceware.sh 3 | xargs)"
# PASS (=PEPPER)
pepper="$(~/.zen/astroport/zen/tools/diceware.sh 3 | xargs)"
g1_profil=$(zenity --entry --width 300 --text "Nom de votre machine" --title "Astroport -- Profil" --entry-text="$(hostname)" 2> >(grep -v 'GtkDialog' >&2));
g1_salt=$(zenity --entry --width 300 --text "Identifiant gchange/cesium (sel)" --title "Astroport - Sel" --entry-text="$salt" 2> >(grep -v 'GtkDialog' >&2));
[ ${#g1_salt} -lt 8 ] && zenity --warning --width 300 --text "Identifiant doit faire plus de 8 caractères!!" 2> >(grep -v 'GtkDialog' >&2) && cleanTMP && exit 1
g1_pepper=$(zenity --entry --width 300 --text "Mot de passe gchange/cesium (poivre)" --title "Astroport - Poivre" --entry-text="$pepper" 2> >(grep -v 'GtkDialog' >&2));
echo "CREATING /tmp/secret.june"
echo "$g1_salt" > /tmp/secret.june
echo "$g1_pepper" >> /tmp/secret.june
echo "________________ https://gchange.fr ________________" > /tmp/secret.all
cat /tmp/secret.june >> /tmp/secret.all
########################################################################
echo "CREATING /tmp/secret.dunikey"
python3 ~/.zen/astroport/zen/tools/key_create_dunikey.py "$g1_salt" "$g1_pepper"
g1pub=$(cat /tmp/secret.dunikey | grep "pub" | cut -d ' ' -f 2)
g1sec=$(cat /tmp/secret.dunikey | grep "sec" | cut -d ' ' -f 2)
echo "" >> /tmp/secret.all
echo "_________________ https://cesium.app _______________" >> /tmp/secret.all
cat /tmp/secret.dunikey >> /tmp/secret.all
echo "" >> /tmp/secret.all
########################################################################
echo "CREATING /tmp/config.ipfs"
ipfs_ID=$(python3 ~/.zen/astroport/zen/tools/create_ipfsnodeid_from_tmp_secret.dunikey.py)
echo $ipfs_ID > /tmp/secret.ipfs && source /tmp/secret.ipfs
jq -r --arg PeerID "$PeerID" '.Identity.PeerID=$PeerID' ~/.ipfs/config > /tmp/config.tmp
jq -r --arg PrivKEY "$PrivKEY" '.Identity.PrivKey=$PrivKEY' /tmp/config.tmp > /tmp/config.ipfs
rm /tmp/config.tmp
echo "" >> /tmp/secret.all
echo "_____________________ IPFS ________________________" >> /tmp/secret.all
cat /tmp/secret.ipfs >> /tmp/secret.all
echo "" >> /tmp/secret.all
## Which directory to sync with IPFS
IPFS_sync_directory=$(zenity --file-selection --title="Choisissez le répertoire à partager par IPFS avec vos amis" --directory 2> >(grep -v 'GtkDialog' >&2))
[[ ! -d $IPFS_sync_directory ]] && zenity --warning --width 300 --text "Aucun répertoire... ANNULATION" 2> >(grep -v 'GtkDialog' >&2) && cleanTMP && exit 1
echo "IPFS_SYNC_DIR=$IPFS_sync_directory" >> /tmp/secret.all
########################################################################
echo "Copy new keys?"
zenity --width=971 --height=600 --title "Validation de votre configuration" --text-info --filename="/tmp/secret.all" 2> >(grep -v 'GtkDialog' >&2)
[ $? == 1 ] && cleanTMP && exit 1
[[ -f ~/.zen/secret.dunikey.old ]] && zenity --warning --width 300 --text "ANNULATION! Il existe déjà une sauvegarde d'anciennes clefs... support@qo-op.com" 2> >(grep -v 'GtkDialog' >&2) && cleanTMP && exit 1
mv ~/.zen/secret.june ~/.zen/secret.june.old
mv /tmp/secret.june ~/.zen/secret.june
mv ~/.zen/secret.dunikey ~/.zen/secret.dunikey.old
mv /tmp/secret.dunikey ~/.zen/secret.dunikey
mv ~/.zen/secret.ipfs ~/.zen/secret.ipfs.old
mv /tmp/secret.ipfs ~/.zen/secret.ipfs
mv ~/.ipfs/config ~/.ipfs/config.old
mv /tmp/config.ipfs ~/.ipfs/config
rm /tmp/secret.all
# WRITE ~/.zen/ipfs.sync CONFIG
echo "IPFS_SYNC_DIR=$IPFS_sync_directory" > ~/.zen/ipfs.sync
# CREATE gchange+ profile
# cd ~/.zen/astroport/zen/jaklis
# ./jaklis.py --key "~/.zen/secret.dunikey" --node "https://data.gchange.fr" set --name "$g1_profil" --avatar "~/.zen/astroport/logo.png"
# ERROR
echo "OK. Restart now"
zenity --warning --width 300 --text "Veuillez redémarrer l'ordinateur pour activer votre configuration..." 2> >(grep -v 'GtkDialog' >&2)
exit 0

View File

@ -3,29 +3,12 @@
If you are exhausted with the actual Feodal Internet...
If you want to join and build a P2P Digital Cyberspace, made and own by everyone. You are at the right place
[Do you want to join Swarm#0](https://git.p2p.legal/axiom-team/astroport#installation) ?
It as a swarm of Nodes spread accross Internet networks. Each loading a fat stack protocol layer made with
+ DUNITER Blockchain G1 for Libre money co-creation based on Humans
+ SCUTTLEBUTT Pubs for Machine & Human social interactions
+ IPFS Nodes for File Storage, public, private and Zen accounting
Astroport is a Framework mixing protocols as communication and messaging layers.
This release is a bunch of install install scripts.
Each one opening a new "cabin" offering different interfaces and uses with the Metaverse
- Cesium ease your life and manage all your wallets
- Gchange is a market for your local and global exchanges
- Patchwork, Oasis, Feedless, ... and more Fabulous ScuttleButt & IPFS Apps to come
[CODE](https://git.p2p.legal/axiom-team/astroport)
EXTRA DEPT:
- Nextcloud open, share and backup your cloud with your friends and family
- Minetest organise your virtual meetings, build your world on your 1km² land
- Kodi your multimedia center in a friend of friends Zen economy
| [EN](01.home/default.en.md) | [ES](01.home/default.es.md) | [FR](01.home/default.fr.md) | [DE](01.home/default.de.md) | [IT](01.home/default.it.md) | [PL](01.home/default.pl.md) | [RU](01.home/default.ru.md) | [PT](01.home/default.pt.md) | [NL](01.home/default.nl.md) |
| ------------------------- | ---------------------------- | --------------------------- | --------------------------- | --------------------------- | --------------------------- | ---------------------------- | ---------------------------- | ---------------------------- |
| [METAVERSE](02.metaverse/default.en.md) | [METAVERSO](02.metaverse/default.es.md) | [METAVERS](02.metaverse/default.fr.md) | [METAVERSUM](02.metaverse/default.de.md) | [METAVERSO](02.metaverse/default.it.md) | [METAVERSE](02.metaverse/default.pl.md) | [МУЖЧИНА](02.metaverse/default.ru.md) | [METAVERSO](02.metaverse/default.pt.md) | [METAVERSIE](02.metaverse/default.nl.md) |
@ -59,28 +42,3 @@ We are all spread thin, each community doing one cool thing in its own place, so
Let's stop protocol wars and work together to progress toward our mutual vision.
Let's join our efforts and invent protocols to make our systems able to communicate at the lowest level.
## [The Map is the Territory](https://solarpunk.cool/zines/map-is-the-territory/)
![https://solarpunk.cool/zines/map-is-the-territory/aesthetic/tmitt_dither.png]
```
[[ ! -d ~/.zen ]] && mkdir ~/.zen
cd ~/.zen/
curl -L coolguy.website/earth | grep "~~*" -A2 | tail -2 >> earth
curl -L angblev.com/water | grep "~~*" -A2 | tail -2 >> water
curl -L solarpunk.cool/magic/fire | grep "~~*" -A2 | tail -2 >> fire
curl -L apileof.rocks | grep "~~*" -A2 | tail -2 >> air
curl -L solarpunk.cool/magic/end | grep "~~*" -A2 | tail -2 >> end
cat begin earth water fire air end
### YOUR KEY IS IMPORTANT
cat ~/.zen/secret.astroport.key
# SECURITY AND FREEDOM IS IMPORTANT TO YOU ?
############################################# USE LINUX !! ####
### My favorite distribution is Linux Mint
```

View File

@ -1,207 +0,0 @@
#!/bin/bash
########################################################################
# Author: Fred (support@qo-op.com)
# Version: 2020.12.05
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
# AUTOMATIC version of interactive 1stRUNconfig.sh
# This script can run from ~/.config/autostart/Astroport_X_config.desktop
#
########################################################################
# Create secret key files
# ~/.zen/secret.june
# ~/.zen/secret.dunikey
# ~/.zen/secret.ipfs & /tmp/config.ipfs
# ~/.zen/ipfs.sync
########################################################################
# CHECK IF CONFIG ALREADY DONE !! Remove ~/.zen/ipfs ~/.zen/secret ~/.zen/ipfs.sync
if [[ -f ~/.zen/ipfs.sync ]]; then
echo "CONFIG ALREADY DONE"
source ~/.zen/ipfs.sync
# NEW BOOT! SEND ipfstryme message to my friends...
cd ~/.zen/astroport/zen/jaklis
# GET LIST of issuer(s) who likes me
for liking_me in $(./jaklis.py like | jq -r '.likes[].issuer');
do
# CHECk if I am liking him either
friend_of_mine=$(./jaklis.py like -p $liking_me | jq -r '.yours');
echo "Sending IPFSTRYME message to $liking_me"
[[ $friend_of_mine != null ]] && ./jaklis.py send -d $liking_me -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
done
cd -
exit 0
fi
# CHECK INTERNET CONNECTIVITY !!
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null && echo ok || (echo "NO INTERNET CONNEXION" && exit 1)
########################################################################
########################################################################
echo "CREATING Gchange credentials"
########################################################################
salt="$(~/.zen/astroport/zen/tools/diceware.sh 3 | xargs)"
[[ $salt == "" ]] && echo "ERROR" && exit 1
pepper="$(~/.zen/astroport/zen/tools/diceware.sh 3 | xargs)"
g1_salt="$salt"
g1_pepper="$pepper"
echo "CREATING /tmp/secret.june"
echo "$g1_salt" > /tmp/secret.june
echo "$g1_pepper" >> /tmp/secret.june
########################################################################
########################################################################
echo "CREATING /tmp/secret.dunikey"
########################################################################
python3 ~/.zen/astroport/zen/tools/key_create_dunikey.py "$g1_salt" "$g1_pepper"
g1pub=$(cat /tmp/secret.dunikey | grep "pub" | cut -d ' ' -f 2)
g1sec=$(cat /tmp/secret.dunikey | grep "sec" | cut -d ' ' -f 2)
########################################################################
########################################################################
echo "CREATING /tmp/config.ipfs"
########################################################################
ipfs_ID=$(python3 ~/.zen/astroport/zen/tools/create_ipfsnodeid_from_tmp_secret.dunikey.py)
echo $ipfs_ID > /tmp/secret.ipfs && source /tmp/secret.ipfs
[[ $PrivKEY == "" ]] && echo "ERROR" && exit 1
jq -r --arg PeerID "$PeerID" '.Identity.PeerID=$PeerID' ~/.ipfs/config > /tmp/config.tmp
jq -r --arg PrivKEY "$PrivKEY" '.Identity.PrivKey=$PrivKEY' /tmp/config.tmp > /tmp/config.ipfs
rm /tmp/config.tmp
#
IPFSNODEID=$PeerID
echo $IPFSNODEID
## Declare directory transfered in IPFS
IPFS_sync_directory="$HOME/astroport"
########################################################################
# INSTALL KEYS
########################################################################
timestamp=$(date -u +%s%N | cut -b1-13)
[[ -f ~/.zen/secret.june ]] && mv ~/.zen/secret.june ~/.zen/secret.june.old.$timestamp
mv /tmp/secret.june ~/.zen/secret.june
[[ -f ~/.zen/secret.dunikey ]] && mv ~/.zen/secret.dunikey ~/.zen/secret.dunikey.old.$timestamp
mv /tmp/secret.dunikey ~/.zen/secret.dunikey
[[ -f ~/.zen/secret.ipfs ]] && mv ~/.zen/secret.ipfs ~/.zen/secret.ipfs.old.$timestamp
mv /tmp/secret.ipfs ~/.zen/secret.ipfs
[[ -f ~/.ipfs/config ]] && mv ~/.ipfs/config ~/.ipfs/config.old.$timestamp
mv /tmp/config.ipfs ~/.ipfs/config
########################################################################
echo "INIT ~/.zen/ipfs/.${IPFSNODEID}"
########################################################################
rm -Rf ~/.zen/ipfs
mkdir -p ~/.zen/ipfs/.${IPFSNODEID}/G1SSB
########################################################################
# Give $XZUID to your (gchange friends) to add in Vstream Astroport and access your sharings
# IPNS link to "pastebin list" http://localhost:8181/ipns/$IPNSKEY/xbian/$XZUID
########################################################################
XZUID=$(~/.zen/astroport/zen/tools/diceware.sh 1 | xargs)${RANDOM:0:2}$(~/.zen/astroport/zen/tools/diceware.sh 1 | xargs)
echo "CREATE ~/.zen/ipfs/xbian/$XZUID"
mkdir -p ~/.zen/ipfs/xbian
touch ~/.zen/ipfs/xbian/$XZUID
# https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films
echo "$XZUID" > ~/.zen/ipfs/.${IPFSNODEID}/_xbian.zuid
########################################################################
########################################################################
echo "CREATE + profile"
########################################################################
cd ~/.zen/astroport/zen/jaklis
./jaklis.py -n "https://g1.data.e-is.pro" set --name "$XZUID" --avatar "$HOME/.zen/astroport/logo.png" #CESIUM+
./jaklis.py -n "https://data.gchange.fr" set --name "$XZUID" --avatar "$HOME/.zen/astroport/logo.png" #GCHANGE+
########################################################################
########################################################################
echo "BECOME FRIEND with oasis (1st bootstrap)"
########################################################################
./jaklis.py -n "https://g1.data.e-is.pro" like -p 2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS -s 5
./jaklis.py -n "https://data.gchange.fr" like -p 2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS -s 5
########################################################################
echo "RESTART ipfs"
########################################################################
sudo service ipfs restart
echo ".... WAIT for SWARM to connect ..."
sleep 10
ipfs swarm peers
########################################################################
echo 'EXTEND ~/.bashrc'
########################################################################
~/.zen/astroport/.install/update_bashrc.sh
echo "Configure .kodi/addons/plugin.video.vstream/resources/sites/astroport.py"
cp -f ~/.zen/astroport/.install/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py \
~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py
# CREATE xbian IPNSKEY used to publish ~/.zen/ipfs_swarm/xbian (contains all XZUID pastebin files)
ipfs key rm xbian
IPNSKEY=$(ipfs key gen xbian)
sed -i "s/_IPNSKEY_/$IPNSKEY/g" ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py
sed -i "s/_PROFIL_/$XZUID/g" ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py
sed -i "s/_LOGIN_/$salt/g" ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py
sed -i "s/_MDP_/$pepper/g" ~/.kodi/addons/plugin.video.vstream/resources/sites/astroport.py
~/.zen/astroport/zen/cesium_IPFS_swarm.sh
~/.zen/astroport/zen/ipfs_SWARM_refresh.sh
########################################################################
echo 'SEND "ipfstryme" message'
########################################################################
echo "" > ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr # ERASE
for tryme in $(ipfs id | jq -r .Addresses[]);
do
isLAN=$(echo $tryme | cut -f3 -d '/' | grep -E "(^127\.)|(^192\.168\.)|(^fd42\:)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^::1$)|(^[fF][cCdD])/")
[[ ! $isLAN && $tryme != "" ]] && echo "$tryme" >> ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr && echo "$tryme"
done
echo 'SEND ipfstryme to oasis' # Add your bootstrap Pub here
./jaklis.py -n "https://g1.data.le-sou.org" send -d 2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
./jaklis.py -n "https://data.gchange.fr" send -d 2jQUH4HfHxdTesjCjvMCx1VJgA5AnpuvrWRq1swfRdsS -t "ipfstryme" -f ~/.zen/ipfs/.${IPFSNODEID}/tryme.addr
########################################################################
echo 'INSTALL Astroport cron_MINUTE'
########################################################################
~/.zen/astroport/zen/cron_VRFY.sh
# Run only once: comment /etc/rc.local (su - xbian -c "~/.zen/astroport/ISOconfig.sh")
# sudo sed -i s/su/\#su/g /etc/rc.local
# BETTER NOT: Send new 'ipfstryme' message on each boot is done instead
echo "CHANGE hostname"
astrxbian=$(hostname)
sudo sed -i "s/$astrxbian/$XZUID/g" /etc/hostname
sudo sed -i "s/$astrxbian/$XZUID/g" /etc/hosts
echo "CHANGE DNS" # Avoid provider restrictions
sudo mv /etc/resolv.conf /etc/resolv.conf.old
sudo cat > /etc/resolv.conf <<EOF
domain home
search home
nameserver 80.67.169.12 80.67.169.40 94.247.43.254 2001:67c:13e4:1::37
# FFDN.org opennic.org = ns8.he.de + ns5.ru
EOF
sudo chattr +i /etc/resolv.conf
# WRITE ~/.zen/ipfs.sync CONFIG (meaning DONE)
echo "IPFS_SYNC_DIR=$IPFS_sync_directory" > ~/.zen/ipfs.sync
# RESIZING / partition
# sudo btrfs filesystem resize max /
########################################################################
echo 'REBOOT NOW...'
########################################################################
sudo reboot
exit 0

661
LICENSE
View File

@ -1,661 +0,0 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.

308
README.md
View File

@ -1,300 +1,38 @@
# NOUVELLE VERSION
Le développement
```
___ __ __
/ | _____/ /__________ ____ ____ _____/ /_
/ /| | / ___/ __/ ___/ __ \/ __ \/ __ \/ ___/ __/
/ ___ |(__ ) /_/ / / /_/ / /_/ / /_/ / / / /_
/_/ |_/____/\__/_/ \____/ .___/\____/_/ \__/ / KODI
/_/
__HyperWeb 5D - Metavers Numérique centré sur l'Humain__
```
continue sur [Astroport/KODI - astrXbian](https://git.p2p.legal/axiom-team/astrXbian)
---
title: 'EVASION NUMERIQUE'
---
> ATTENTION ce code n'est plus maintenu... nous vous invitons désormais à utilisez [Astroport/KODI](https://git.p2p.legal/axiom-team/astrXbian)
# ASTROPORT
## is Not an Astroport
# __Human Centric Telecommunication System__
===
## [is Not an Astroport](./ANA)
### **FR: Internet est cassé**
**EN: The Internet is broken |
DE: Das Internet ist kaputt |
ES: La Internet está rota |
PT: A Internet está quebrada |
IT: Internet è rotto |
NL: Het internet is kapot |
PL: Internet jest zepsuty |
RU: Интернет сломан**
The dream of an Internet without GAFAM, without Datacenter. Hosted and operated by all of us...
An asynchronous, anoptic, friend of friend (P2P) network.
## [c'est quoi?](https://astroport.frama.site/)
Le rêve d'un Internet sans GAFAM, sans Datacenter. Hébergé et opéré par nous tous...
Un réseau asynchrone, anoptique, qui fonctionne par ami d'ami (P2P).
[GROGol traduction](https://translate.google.fr/translate?sl=en&tl=fr&u=https%3A%2F%2Fgit.p2p.legal/axiom-team/astroport/src/master/README.md)
---
| FR | EN | DE | ES | PT | IT | NL | RU | PL |
| ------------------------------------------------- | ---- | ---- | --- | --- | --- | --- | --- | --- |
| [Internet est cassé](./ANA/01.home/default.fr.md) | [The Internet is broken](./ANA/01.home/default.en.md) | [Das Internet ist kaputt](./ANA/01.home/default.de.md) | [La Internet está rota](./ANA/01.home/default.es.md) | [A Internet está quebrada](./ANA/01.home/default.pt.md) | [Internet è rotto](./ANA/01.home/default.it.md) | [Het internet is kapot](./ANA/01.home/default.nl.md) | [Интернет сломан](./ANA/01.home/default.ru.md) | [Internet jest zepsuty](./ANA/01.home/default.pl.md) |
---
===
## So what is Astroport ?
Astroport is an ecosystem of several open sources applications forming a global mesh of meshes restructuring the network from Humans point of view not Machine POV.
### It is autonomous, doesn't need permanent connectivity and is Human centered ONLY. [It behaves like The "BLOB creature"](https://git.p2p.legal/axiom-team/astroport#-help-our-open-collective-with-donations)
Astroport is an ecosystem of several open sources applications forming a global mesh and complete network.
It's using:
- **ScuttleButt** as friendship, relative confidence, personnal blockchain & asynchronous, disconnect friendly, communication (SSB) layer, and 5Mb max file size storage.
- **IPFS** as distributed storage, incremental backup, media transport & file sharing layer between friends through **Zen Contracts**.
- **Duniter** First Libre currency monetary layer. Based on a sidechain strict consensus blockchain producing a Libre Money called June (Ḡ1). Actual fixed conversion rate is **1 Ḡ1 = 100 Zen**
- ScuttleButt for communication layer
- IPFS for media transport layer and swarm authentification
- Libre currency Duniter/Ḡ1 as monetary layer
### THE FLAVORS
Each hosted astroport station will be able to have different "flavors", i.e. different software interconnected with it.
The base is a crystal with three branches, this is the Lapunta key in "The Castle in the Sky": G1 + SSB + IPFS.
The Lapunta key is the **responsible numerical identity which allows to start its relativistic #Swarm0** using the Astroport engine.
We can then add 'flavors' to the base which then becomes a Metaverse
**Metaverse is the experience of each of the interconnection of its information channels**
G1sms, Nextcloud, G1Dab, G1Tx, Cesium, Gchange, Transiscope, Oasis, Feedless, Youtube, Torrent, Minetest, etc...
We will even be able to add new applications simply ! It's everyone's taste in Metavers.
These tastes are like doors that we open or close to data flows thanks to the astroport, by its Stations (x64, Rpi, VirtualBox), its keys and your friends.
The **Minetest flavor**, which is actively developped, will teleport you into the private digital worlds of your Scuttlebutt friends.
The **Nextcloud flavor** will allow you a nearly infinite storage in the IPFS.
Applications connected to Astroport are considered as modules, synchronized channels with push/pull capacities, step by step integrated
1. Scraper / Pusher
2. API : Read / Write
3. IPFS full index/data conversion.
### Rapid overview how an App can become an Astroport Module and then be a DApp
In Astroport Loveland Metaverse every Station have a relative SSB view of the whole...
So many stations are part of the unique #Swarm0 relative to each "$YOU" Station.
Each Station have some software installed on it. Once "Fat Protocol Layer" is activated. **Your Astroport PC have new Power(S)**.
IPFS layer is always adapting to Half of your avalaible HDD space (better USB3 SSD ... technology ask @attilax)
Your LOCAL Apps can benefit from backup / replication / cryptographic file sharing / teleportation features !!
Depending on App and Data structure, different operations are requested.
[Get your App transformed to DApp is easy as 1, 2, 3](https://git.p2p.legal/axiom-team/astroport/src/master/g1sms/Readme.md)?
Want to join and try Alpha stage #Swarm0 ?
## #SWARM0
## Installation
```
__ __ ____
__/ // /_______ ______ __________ ___ / __ \
/_ _ __/ ___/ | /| / / __ `/ ___/ __ `__ \/ / / /
/_ _ __(__ )| |/ |/ / /_/ / / / / / / / / /_/ /
/_//_/ /____/ |__/|__/\__,_/_/ /_/ /_/ /_/\____/
```
Activated and meshed layers, your node will create and connect to its #Swarm0
A special view and access to its network and data through friends only.
#swarm0 is the inner IPFS Metaverse structure and shape the same way our SSB friends are.
Main Task Manager is [run every minutes via cron](https://git.p2p.legal/axiom-team/astroport/src/master/cron_MINUTE.sh)
By default, shared ipfs data are encrypted (ed25519), but is not "private"...
- Just "invisible" from IPFS Not Friends Nodes.
- Discoverable within SSB by friends of your friends.
Share the same ~/.ipfs/swarm.key with your friends to "HARDEN" your shield
## Installation: Debian 10 (armv7/arm64/amd64) and Ubuntu/Mint 64bits ONLY !
**WARNING: This is an alpha stage development! Please FOLLOW INSTRUCTIONS!!! Open issues and help corrections. Thank you.**
### 0 - OPTIONAL : Create a new user "pi"
Only if you don't have "ipfs daemon" already running !!
continue the install with the user you are already using instead.
```
adduser pi
usermod -aG sudo pi
su - pi
curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/git-install.sh | bash && cd astroport
./install.sh # Can have argument to specific gate, or script ask which gate do you want interactively.
```
### 1 - Automatic install
If you are sure about the code and you don't have .ssb and .ipfs folders, you can run automatic install:
```
curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/install.sh | bash
```
:coffee:
Else you can follow steps 2,3 and 4 to check code gradually.
### 2 - IPFS - **Install and start “ipfs daemon”**
**WE ENCOURAGE YOU TO ALWAYS READ CODE YOU ARE DOWNLOADING AND EXECUTING or trust a friend only!!**
---
#### JOINING FOUNDATION TEAM !!!
**IMPORTANT !!!**
- Read the [Pure bash Bible](https://github.com/dylanaraps/pure-bash-bible)
- DO NOT RUN AUTOMATIC INSTALL BUT DO "STEP BY STEP" CODE EXECUTION
- Do make your report and follow https://pad.p2p.legal/s/astroport-landing#
- Do you know https://asciinema.org/? Record your session as a movie (join it to your issues)
> WELCOME
* Semi manual (so you can run the code step by step)
```
# to do so
curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/.install/ipfs_alone.sh -o /tmp/ipfsA.sh
geany /tmp/ipfsA.sh
# If you are happy with what you read and understood. RUN it
chmod +x /tmp/ipfsA.sh && /tmp/ipfsA.sh
```
* Full automatic (you trust this script from this git depot)
```
curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/.install/ipfs_alone.sh | bash
```
[How your SSB and IPFS swarm are kept in sync](https://git.p2p.legal/axiom-team/astroport/src/master/zen/ssb_IPFS_swarm.sh)?
### 3 - G1 SSB - **Create your “secrets” 🔑 from credentials and activate your Astroport Station 🛸**
[Look at the code generating your G1SSB Identity](https://git.p2p.legal/axiom-team/astroport/src/master/zen/tools/make_G1SSB_secret.sh).
```
# ONCE YOU READ, RUN step by step and AGREE !!! Run QUICK Install...
curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/zen/tools/make_G1SSB_secret.sh | bash
```
**Astroport #Swarm0 makes you enter a "Virtual Private IPFS Swarm" shared with Scuttlebutt friends**
All files are located in ```~/.zen``` and ```~/.ssb_astroport``` (linked to ```~/.ssb```)
Your Astroport Station is working as a "multi-channel Switch", Apps are seen as push/pull communication channels.
Every minute, it "listens" to all its connected "channels" and run small routines to make actions between them.
During alpha period, your Station will ```git pull``` fresh code from this git every 5 mn.
**Fresh code** is located in ```~/.zen/astroport```
**IMPORTANT!! BACKUP YOUR KEYS!**
```
~/.zen/secret.astroport.key # this Station $WHOAMI "LaPunta" Key, containing login/password to create your "gchange account"
~/.zen/secret.dunikey # Cesium Key, the June G1 wallet of you Key.
~/.ssb/secret ( + ".json's" for easier SSB recovery) # ScuttleButt ID + connectors
```
KEEP them safe.
This way you could recover your data from #Swarm0
### 4 - DEMONSTRATION _ LOVELand _ Metaverse Interface: https://oasis.astroport.com
**$YOU Local basic 100km Web Control for Zen p2p markets**
(+ coming [Minetest](https://minetest.net), [NextCloud](https://nextcloud.com/), [CopyLaRadio](https://www.copylaradio.com), .... **Adding your App is easy as "1 2 3"**)
```
curl -s https://git.p2p.legal/axiom-team/astroport/raw/master/.install/loveland.sh | bash
```
---
## Quick tour of Astroport Stations "flavours" (alpha):
- A 100 km local area Information System around your Cesium location
- [gchange_MONITOR!!](https://git.p2p.legal/axiom-team/astroport/src/master/zen/gchange_MONITOR.sh) Connect to [Gchange](https://gchange.fr) market
- A Nextcloud / IPFS Hub [Cloud Attilax Station](https://cloudattilax.axiom-team.fr/) [Rock64 Station](https://rock64.p2p.legal/)
- Minetest Mini Worlds (SSB in sync) [Txmn.tk Station](https://diaspora.normandie-libre.fr/posts/171127)
- **Explore ScuttleButt UNIVERSE**
- Choose your prefered ScuttleButt client to reach the Metaverse
- [Patchwork](http://dinosaur.is/patchwork-downloader/)
- [Oasis](https://github.com/fraction/oasis)
- [Feedless](https://github.com/rogeriochaves/feedless)
- [Manyverse](https://manyver.se)
- [others](https://scuttlebot.io/apps/index.html) & plenty to come !!
- **Experimentations with SSB & G1 UNIVERSE**
- Reward SSB likes with [ssb-g1-tip](https://git.p2p.legal/axiom-team/ssb-g1-tip)
- **Experimentations into IPFS Zen UNIVERSE**
- Copy [Audio](https://git.p2p.legal/axiom-team/astroport/src/master/zen/ssb_GET_zenyta.sh) and [Video](https://git.p2p.legal/axiom-team/astroport/src/master/zen/ssb_GET_zenytv.sh) from Youtube.
- Publish [contracts in ZenTag](https://git.p2p.legal/axiom-team/astroport/src/master/zen/zen_MAKE.sh)
- ZenTag counters, IPNS nano DHT to control ipfs availability of files.
![](https://pad.p2p.legal/uploads/upload_bfcde4526535bce2cfb12c2e0497587d.png)
Questions? Help needed? Post an issue...
Chat with us https://chat.axiom-team.fr/channel/astroport
---
## PARTNERS
[AXIOM-TEAM](https://axiom-team.fr/) | [Made In Zion](https://madeinzion.org) | [QWANTIC](https://qwantic.com)
```
_ ______ _
/ \\ //\ |\ || | /
\_X \/\//--\| \|| _|_\_ #HyperWeb 5D
# BUILT FROM GNU CORE BASH TECHNOLOGY
https://www.gnu.org/software/coreutils/
```
---
# [OASIS RULES, Docs and Roadmap](https://git.p2p.legal/axiom-team/astroport/src/master/g1sms/Readme.md)
Participating @attilax @poka @josselinchevalay @ben @mlsuyt @tuxmain @qo-op @manutopik @yyy @borispaing @paulart @guenoel @jeanluc @nox @pruls @cel @andrestaltz @Dan ... I have to stop... to many people...
# EXERNAL DOCUMENTATION
- [IPFS CLI commands](https://docs.ipfs.io/reference/api/cli/)
- [sbotc documentation and examples](https://pad.p2p.legal/scuttlebot#sbotc--documentation)
KEEP COOL, BE SAFE, BE FREE
```
_____
/__ / ___ ____
/ / / _ \/ __ \
/ /__/ __/ / / /
/____/\___/_/ /_/
```
### Astroport is Human centered & Nature inspired
- Similar to Organic Life Form
[![Blob creature](https://git.p2p.legal/axiom-team/astroport/raw/master/blob.gif)](https://www.youtube.com/watch?v=W_FaOWZQdz0)
[![#Swarm0 Clusters](https://git.p2p.legal/axiom-team/astroport/raw/master/doc/images/LIFE.gif)](http://www.ventrella.com/Clusters/)
- Devil/angel Game resolver :
- [SSB viewer link](https://viewer.scuttlebot.io/%25TzYboJss10k83csj3khLkGGc5km9zoR%2FAx6RG6z6yEo%3D.sha256)
- [Youtube link](https://www.youtube.com/watch?v=sxiKlOK3EJY)
- [#Swarm0 link](http://127.0.0.1:8080/ipfs/QmXs9374jUX6y8s3rSYxHb9LtkCKCxXGGwAVMbQgWBTbJa/sxiKlOK3EJY.mp4)
# [>>>>>>> Help our Open Collective with DONATIONS](https://opencollective.com/monnaie-libre)
### Web 2.0 is dangerous!! You only have window and an apple already biten.
Actual Internet is a place full of virus. But we are lucky a **Free Software Universe is lying inside of it**.
Now you must KNOW it exists, to be SAFE!
[HOW MANY PEOPLE ARE ALREADY OWNING YOUR DATA ???](https://monitor.firefox.com/) **<<< check your "digital ghost"**
> WE are building the **"HyperWeb Cyberspace"** with Base Stations and "Spacecraft(s) UX" (ZApp)
[Discover "LOVE Land" the 1st Libre Metaverse interface, a living digital space](https://oasis.astroport.com)
**WARNING: This is an early stage develepment, use it with great care!**

11147
REVE.sh

File diff suppressed because it is too large Load Diff

BIN
blob.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

136
command_received.sh Executable file
View File

@ -0,0 +1,136 @@
#!/bin/bash
########################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.3
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
# ASTROPORT COMMAND RECEIVER & DISPACHER
# Rise Up by unid@chan && Run corresponding command.sh
########################################################################
# NOT WORKING YET
# TODO! CONVERT G1SMS+ FROM PHONE TO MULTICHANNEL
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
source ./zen/functions.sh
SOURCE="$1" # id@channel
COMMAND="$2" # command received (message, comment, ...)
[[ $SOURCE == "" ]] && SOURCE="unid@channel"
[[ $COMMAND == "" ]] && COMMAND="cmd arg1 arg2 ..."
SOURCEH=$(echo -n $SOURCE | sha512sum | cut -d ' ' -f 1) # Hash SOURCE
SRC=$(echo "$SOURCE" | cut -d '@' -f 1)
CHAN=$(echo "$SOURCE" | cut -d '@' -f 2)
CMD=$(echo "$COMMAND" | awk '{print toupper($1)}') # CMD is first word
########################################################################
# ANTI SPAM
##################################################################
NOspam
##################################################################
# Handle commands CMD
##################################################################
case "$CMD" in
# RAZ MEMERUID?
RAZ)
MEMBERUID=$(echo "$COMMAND" | awk '{print $2}' | grep -E "([A-Za-z0-9\-\_]+$)")
./shell/chan_RAZ.sh "$SOURCE" "$MEMBERUID"&
;;
# HELP
HELP)
./shell/chan_HELP.sh "$SOURCE" &
;;
# NEW MEMERUID?
NEW)
MEMBERUID=$(echo "$COMMAND" | awk '{print $2}' | grep -E "([A-Za-z0-9\-\_]+$)")
./shell/chan_NEW.sh "$SOURCE" "$MEMBERUID" &
;;
# PAY DESTINATION! MONEY!
PAY)
DESTINATION=$(echo "$COMMAND" | awk '{print tolower($2)}' | grep -E "[a-z0-9._%+-]+@[a-z0-9._%+-]")
MONEY=$(echo "$COMMAND" | awk '{print $3}' | grep -E "^\-?[0-9]+$")
if [[ "$DEST" != "" && "$MONEY" != "" ]]; then
./shell/chan_PAY.sh "$SOURCE" "$DEST" "$MONEY" &
else
./shell/chan_ERROR.sh "$SOURCE" "PAY DESTINATION! MONEY!" &
fi
;;
# VIR AMOUNT! VIRDEST! PERIOD? TIME?
VIR)
AMOUNT=$(echo "$COMMAND" | awk '{print $2}' | grep -E "^\-?[0-9]+$")
VIRDEST=$(echo "$COMMAND" | awk '{print $3}' | grep -E "([A-Za-z0-9\-\_]+$)")
PERIOD=$(echo "$COMMAND" | awk '{print toupper($4)}' | grep -E "([A-Za-z0-9\-\_]+$)")
TIME=$(echo "$COMMAND" | awk '{print $5}' | grep -E "^\-?[0-9]+$")
if [[ "$VIRDEST" != "" && "$AMOUNT" != "" && "$PERIOD" != "" && "$TIME" != "" ]]; then
./shell/chan_VIR.sh "$SOURCE" "$VIRDEST" "$AMOUNT" "$PERIOD" "$TIME" &
else
./shell/chan_ERROR.sh "$SOURCE" "VIR AMOUNT! VIRDEST! PERIOD? TIME?" &
fi
;;
# BAL
BAL)
./shell/chan_COUNT.sh "$SOURCE" &
;;
# EMAIL MAIL!
EMAIL)
MAIL=$(echo "$COMMAND" | awk '{print tolower($2)}' | grep -E "[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}")
if [[ "$MAIL" != "" ]]; then
./shell/chan_EMAIL.sh "$SOURCE" "$MAIL" &
else
./shell/chan_ERROR.sh "$SOURCE" "EMAIL MAIL!" &
fi
;;
# BILL VAL!
BILL)
VAL=$(echo "$COMMAND" | awk '{print $2}' | grep -E "^\-?[0-9]+$")
if [[ "$VAL" != "" ]]; then
./shell/chan_BILLET.sh "$SOURCE" "$VAL" &
else
./shell/chan_ERROR.sh "$SOURCE" "BILL VAL!" &
fi
;;
# CHK W1! W2! W3? W4? W5? W6? W7?
CHK)
W1=$(echo "$COMMAND" | awk '{print tolower($2)}' | grep -E "^[a-z0-9]+$")
W2=$(echo "$COMMAND" | awk '{print tolower($3)}' | grep -E "^[a-z0-9]+$")
W3=$(echo "$COMMAND" | awk '{print tolower($4)}' | grep -E "^[a-z0-9]+$")
W4=$(echo "$COMMAND" | awk '{print tolower($5)}' | grep -E "^[a-z0-9]+$")
W5=$(echo "$COMMAND" | awk '{print tolower($6)}' | grep -E "^[a-z0-9]+$")
W6=$(echo "$COMMAND" | awk '{print tolower($7)}' | grep -E "^[a-z0-9]+$")
W7=$(echo "$COMMAND" | awk '{print tolower($8)}' | grep -E "^[a-z0-9]+$")
if [[ "$W1" != "" && "$W2" != "" ]]; then
./shell/chan_BILLETCHK.sh "$SOURCE" "$W1" "$W2" "$W3" "$W4" "$W5" "$W6" "$W7" &
else
./shell/chan_ERROR.sh "$SOURCE" "CHK W1! W2! W3? W4? W5? W6? W7?" &
fi
;;
CMD)
echo "==================================================="
echo "HELLO $SOURCE your ASTROPORT suit is $SOURCEH"
echo "RUN ./command_received.sh \"$SOURCE\" \"$COMMAND\""
;;
ACK|DELIVERED|PENDING|FAILED)
exit 0
;;
*)
echo "$SOURCE :: UNKNOWN $COMMAND"
exit 1
;;
esac
exit 0

View File

@ -1,196 +0,0 @@
#!/bin/bash
########################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.3
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
########################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
source $HOME/.profile
# CORRECT PATH
[[ ! $(echo $PATH | grep "/usr/local/bin") ]] && export PATH="$PATH:/usr/local/bin"
[[ ! $(echo $PATH | grep "HOME/.local/bin") ]] && export PATH="$PATH:$HOME/.local/bin"
[[ ! $(echo $PATH | grep "/usr/games") ]] && export PATH="$PATH:/usr/games"
#### INIT STATION PARAMETERS
[[ -f $MY_PATH/../secret.astroport.key ]] && source $MY_PATH/../secret.astroport.key # DEPRECATED now using ~/.bashrc
export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
source /home/$YOU/.profile
[[ $IPFSNODEID ]] && export IPFSNODEID=$IPFSNODEID || export IPFSNODEID=$(ipfs id -f='<id>\n')
########################################################################
# HELP DEVLT: Search "TODO" in code
# Write what you thing about the situation
# AND how you would like to 'fix it'...
# Then friends can read and enhance solution.
# WARNING: This script must be processing less than 1 minute, so do not charge too much this script
# _ _____ ____ _ _______ ________ ____
# | | / / | / __ \/ | / / _/ | / / ____/ / / /
# | | /| / / /| | / /_/ / |/ // // |/ / / __ / / /
# | |/ |/ / ___ |/ _, _/ /| // // /| / /_/ / /_/_/
# |__/|__/_/ |_/_/ |_/_/ |_/___/_/ |_/\____/ (_|_)
########################################################################
# NB: 'figlet' is used for labeling code trunks
########################################################################
### MODIFY WITH GREAT CARE!!! MUST BE BUG FREE !!!!!
### EVERY STATION RUN THIS SCRIPT EVERY MINUTE.
export isMinetestRunning=$(ps auxf --sort=+utime | grep -w minetest | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
export isG1smsRunning=$(ps auxf --sort=+utime | grep -w gammu | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
export isKodiRunning=$(ps auxf --sort=+utime | grep -w kodi | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
# ? isNextcloudRunning=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d ' ' -f 1)
### DETECT FLAVOURS (TODO: Publish and share into ipfs/.12D3KooW***/ )
########################################################################
cd $MY_PATH
# WHAT UNIVERSAL TIME is it ?
minute=$(date -u +%M)
heure=$(date -u +%H)
timebar="$heure:$minute"
dayoftheweek=$(date +%w)
dayofthemonth=$(date +%d)
weeknumber=$(date +%V)
echo $timebar
#
# _________
# / ____< /________ ___ _____
# / / __ / / ___/ __ `__ \/ ___/
#/ /_/ // (__ ) / / / / (__ )
#\____//_/____/_/ /_/ /_/____/
#
# $MY_PATH/g1sms/sms_ASTROPORT.sh
# TIME NTP SYNC: TODO: Problem being root (stickybit INSTALL?)
# G1Tx. G1sms. G1Dab Zen economy needs precise time sync (RpiZero !!)
# Tx rates is limited by Station time synchronisation.
# sudo ntpdate ntp.pool.org
# ____ _______ __ __
# / __ \/ ____/ | / / ____ ___ ____ ____/ /__
# / / / / __/ | | / / / __ `__ \/ __ \/ __ / _ \
# / /_/ / /___ | |/ / / / / / / / /_/ / /_/ / __/
# /_____/_____/ |___/ /_/ /_/ /_/\____/\__,_/\___/
#
#
# ACTIVATE 5 MN "git pull" update
if [[ $(($minute % 5)) == 0 ]]; then
#######################################
sleep $((1 + RANDOM % 12))
git pull
fi
# __ __ _____ ____
# __/ // /_/ ___/ ______ __________ ___ / __ \
# /_ _ __/\__ \ | /| / / __ `/ ___/ __ `__ \/ / / /
# /_ _ __/___/ / |/ |/ / /_/ / / / / / / / / /_/ /
# /_//_/ /____/|__/|__/\__,_/_/ /_/ /_/ /_/\____/
#
##################################################################
# REFRESH IPFS SWARM DATA EVERY 12 & 15 minutes
[[ $(($minute % 12)) == 0 ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/gchange_IPFS_swarm.sh &
[[ $(($minute % 15)) == 0 ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/ipfs_SWARM_refresh.sh &
# Transfert ~/astroport/films to IPFS and make Vstream/ASTROPORT indexes on IPNS
if [[ "$timebar" == "03:03" ]]; then
$MY_PATH/zen/xbian_vstream.sh &
fi
## TODO investigate could breaks "ipfs p2p" forwards ?
##################################################################
# _________ _______ __ _ __
# / ____< / /_ __/ |/ / ____ ___ ____ ____ (_) /_____ _____
# / / __ / / / / | / / __ `__ \/ __ \/ __ \/ / __/ __ \/ ___/
# / /_/ // / / / / | / / / / / / /_/ / / / / / /_/ /_/ / /
# \____//_/ /_/ /_/|_| /_/ /_/ /_/\____/_/ /_/_/\__/\____/_/
#
##################################################################
# MONITOR INPUT TX (TODO: DEBUG)
# Activate later for DAB ZenTx Machines
# [[ $(($minute % 5)) == 0 ]] && sleep $((1 + RANDOM % 10)) && $MY_PATH/zen/g1_MONITOR_zen.sh "5 minutes"
##################################################################
##################################################################
##################################################################
# MIDNIGHT:01 : ZENBOT CLEANING & UPDATE
##################################################################
##################################################################
if [[ "$timebar" == "00:01" ]]; then
echo '
# ____ ____ ____ ___
# / __ \/ __ \ _ / __ < /
# / / / / / / / (_) / / / / /
# / /_/ / /_/ / _ / /_/ / /
# \____/\____/ (_) \____/_/
#
# MAINTENANCE
'
sleep $((1 + RANDOM % 5)) ### Be careful if random sleep is not activated...
############################## That swarm could become an aggressive blob !!
### PEACE & LOVE software is processing... We are HyperWeb people here.
# DEFCON 5 quiet behaviour so Please keep cool, take care and be zen.
# GOOD BYE GOOGLE, AMAZON, FACEBOOK, APPLE, MICROSOFT. We don't need you.
##################################################################
# REFRESH & UPGRADE youtube-dl
youtube-dl --rm-cache-dir
youtube-dl -U
#### DESYNC
sleep $((1 + RANDOM % 5))
##################################################################
# ssb_INIT + LOG ROTATE EVERY SUNDAY # TODO /var/log/ + logrotate (& tempfiles in /tmp in RAMFS)
if [[ $dayoftheweek == 0 ]]; then
$MY_PATH/zen/gchange_INIT.sh &
# ACTIVATE IF CRON LOGGING
#tar cvzf ~/.zen/astroport.$weeknumber.log.tgz /tmp/astroport.log # LOG BACKUP FOR 1 YEAR !!
fi
#### DESYNC
sleep $((1 + RANDOM % 5))
##################################################################
# GIT UPDATE
./git-update.sh
git pull # UPDATE CODE git pull
##################################################################
echo '
_________ ______
____ ___ ____ /_ __/ | / ____/
/_ / / _ \/ __ \ / / / /| |/ / __
/ /_/ __/ / / / / / / ___ / /_/ /
/___/\___/_/ /_/ /_/ /_/ |_\____/
REFRESHing ZenTAG nano DHTs = Zen File ECONOMY
'
# ./zen/ipns_TAG_refresh.sh
##################################################################
if [[ $dayofthemonth == 7 ]]; then
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
diskSize="$((availableDiskSize / 2))"
ipfs config Datastore.StorageMax $diskSize
echo '
_____ __ __ ___
/ ___// /_____ _________ _____ ____ / |/ /___ __ __
\__ \/ __/ __ \/ ___/ __ `/ __ `/ _ \ / /|_/ / __ `/ |/_/
___/ / /_/ /_/ / / / /_/ / /_/ / __/ / / / / /_/ /> <
/____/\__/\____/_/ \__,_/\__, /\___/ /_/ /_/\__,_/_/|_|
/____/
# 1/2 HDD for IPFS size - dicotomic adaptation 7th EVERY MONTH
#
# TODO: Read parameters from ipfs, publish status to swarm, could be use for youtube-dl or other kind of heavy ipfs input Station election.
#
'
echo "StorageMax = $diskSize"
fi
##################################################################
fi

View File

@ -1,682 +0,0 @@
<!DOCTYPE html>
<html lang="en-US"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- Google Tag Manager -->
<script async="" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/gtm.js"></script><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push(
{'gtm.start': new Date().getTime(),event:'gtm.js'}
);var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5QBJTNC');</script>
<!-- End Google Tag Manager -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/js"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-11198485-1');
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="https://gmpg.org/xfn/11">
<link rel="apple-touch-icon" sizes="57x57" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/favicon-16x16.png">
<link rel="manifest" href="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="https://www.usv.com/wp-content/themes/unionsquareventures/frontend/static/favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<link rel="alternate" type="application/rss+xml" href="https://www.usv.com/writing/feed" title="USV Blog RSS">
<link rel="alternate" type="application/rss+xml" href="https://www.usv.com/team-posts/feed" title="USV Team Posts RSS">
<title>Fat Protocols | Union Square Ventures</title>
<!-- This site is optimized with the Yoast SEO plugin v12.5 - https://yoast.com/wordpress/plugins/seo/ -->
<meta name="description" content="Here's one way to think about the differences between the Internet and the Blockchain. The previous generation of shared protocols (TCP/IP, HTTP, SMTP,">
<meta name="robots" content="max-snippet:-1, max-image-preview:large, max-video-preview:-1">
<link rel="canonical" href="https://www.usv.com/writing/2016/08/fat-protocols/">
<meta property="og:locale" content="en_US">
<meta property="og:type" content="article">
<meta property="og:title" content="Fat Protocols | Union Square Ventures">
<meta property="og:description" content="Here's one way to think about the differences between the Internet and the Blockchain. The previous generation of shared protocols (TCP/IP, HTTP, SMTP,">
<meta property="og:url" content="https://www.usv.com/writing/2016/08/fat-protocols/">
<meta property="og:site_name" content="Union Square Ventures">
<meta property="article:section" content="USV Blog">
<meta property="article:published_time" content="2016-08-08T09:35:39-04:00">
<meta property="article:modified_time" content="2019-08-26T13:53:04-04:00">
<meta property="og:updated_time" content="2019-08-26T13:53:04-04:00">
<meta property="og:image" content="http://i.imgur.com/6uKSty0.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:description" content="Here's one way to think about the differences between the Internet and the Blockchain. The previous generation of shared protocols (TCP/IP, HTTP, SMTP,">
<meta name="twitter:title" content="Fat Protocols | Union Square Ventures">
<meta name="twitter:site" content="@usv">
<meta name="twitter:image" content="http://i.imgur.com/6uKSty0.png">
<meta name="twitter:creator" content="@usv">
<!-- / Yoast SEO plugin. -->
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net/">
<link rel="dns-prefetch" href="https://s.w.org/">
<script type="text/javascript">
window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/12.0.0-1\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/12.0.0-1\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/www.usv.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=5.3.2"}};
!function(e,a,t){var r,n,o,i,p=a.createElement("canvas"),s=p.getContext&&p.getContext("2d");function c(e,t){var a=String.fromCharCode;s.clearRect(0,0,p.width,p.height),s.fillText(a.apply(this,e),0,0);var r=p.toDataURL();return s.clearRect(0,0,p.width,p.height),s.fillText(a.apply(this,t),0,0),r===p.toDataURL()}function l(e){if(!s||!s.fillText)return!1;switch(s.textBaseline="top",s.font="600 32px Arial",e){case"flag":return!c([127987,65039,8205,9895,65039],[127987,65039,8203,9895,65039])&&(!c([55356,56826,55356,56819],[55356,56826,8203,55356,56819])&&!c([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]));case"emoji":return!c([55357,56424,55356,57342,8205,55358,56605,8205,55357,56424,55356,57340],[55357,56424,55356,57342,8203,55358,56605,8203,55357,56424,55356,57340])}return!1}function d(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(i=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},o=0;o<i.length;o++)t.supports[i[o]]=l(i[o]),t.supports.everything=t.supports.everything&&t.supports[i[o]],"flag"!==i[o]&&(t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&t.supports[i[o]]);t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady=!1,t.readyCallback=function(){t.DOMReady=!0},t.supports.everything||(n=function(){t.readyCallback()},a.addEventListener?(a.addEventListener("DOMContentLoaded",n,!1),e.addEventListener("load",n,!1)):(e.attachEvent("onload",n),a.attachEvent("onreadystatechange",function(){"complete"===a.readyState&&t.readyCallback()})),(r=t.source||{}).concatemoji?d(r.concatemoji):r.wpemoji&&r.twemoji&&(d(r.twemoji),d(r.wpemoji)))}(window,document,window._wpemojiSettings);
</script><script src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/wp-emoji-release.js" type="text/javascript" defer="defer"></script>
<style type="text/css">
img.wp-smiley,
img.emoji {
display: inline !important;
border: none !important;
box-shadow: none !important;
height: 1em !important;
width: 1em !important;
margin: 0 .07em !important;
vertical-align: -0.1em !important;
background: none !important;
padding: 0 !important;
}
</style>
<link rel="stylesheet" id="wp-block-library-css" href="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/style.css" type="text/css" media="all">
<link rel="stylesheet" id="wp-block-library-theme-css" href="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/theme.css" type="text/css" media="all">
<link rel="stylesheet" id="mpp_gutenberg-css" href="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/blocks.css" type="text/css" media="all">
<link rel="stylesheet" id="wpt-twitter-feed-css" href="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/twitter-feed.css" type="text/css" media="all">
<link rel="stylesheet" id="parent-style-css" href="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/style_002.css" type="text/css" media="all">
<link rel="stylesheet" id="custom-styles-css" href="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/main.css" type="text/css" media="all">
<link rel="stylesheet" id="twentynineteen-style-css" href="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/style_003.css" type="text/css" media="all">
<link rel="stylesheet" id="twentynineteen-print-style-css" href="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/print.css" type="text/css" media="print">
<script type="text/javascript" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/jquery_002.js"></script>
<script type="text/javascript" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/jquery-migrate.js"></script>
<link rel="https://api.w.org/" href="https://www.usv.com/wp-json/">
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://www.usv.com/xmlrpc.php?rsd">
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://www.usv.com/wp-includes/wlwmanifest.xml">
<meta name="generator" content="WordPress 5.3.2">
<link rel="shortlink" href="https://www.usv.com/?p=443">
<link rel="alternate" type="application/json+oembed" href="https://www.usv.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.usv.com%2Fwriting%2F2016%2F08%2Ffat-protocols%2F">
<link rel="alternate" type="text/xml+oembed" href="https://www.usv.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fwww.usv.com%2Fwriting%2F2016%2F08%2Ffat-protocols%2F&amp;format=xml">
<!-- This site is optimized with the Schema plugin v1.7.8 - https://schema.press -->
<script type="application/ld+json">{"@context":"http:\/\/schema.org\/","@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https:\/\/www.usv.com\/writing\/2016\/08\/fat-protocols\/"},"url":"https:\/\/www.usv.com\/writing\/2016\/08\/fat-protocols\/","headline":"Fat...","datePublished":"2016-08-08T09:35:39-04:00","dateModified":"2019-08-26T13:53:04-04:00","publisher":{"@type":"Organization","@id":"https:\/\/www.usv.com\/#organization","name":"Union Square Ventures","logo":{"@type":"ImageObject","url":"https:\/\/dev-union-square-ventures.pantheonsite.io\/wp-content\/uploads\/2019\/04\/usv_logo.jpg","width":600,"height":60}},"image":{"@type":"ImageObject","url":"http:\/\/i.imgur.com\/6uKSty0.png","width":696,"height":"515"},"articleSection":"USV Blog","description":"Here's one way to think about the differences between the Internet and the Blockchain. The previous generation of shared protocols (TCP\/IP, HTTP, SMTP, etc.) produced immeasurable amounts of value, but most of it got captured and re-aggregated on top at the applications layer, largely in the form of data","author":{"@type":"Person","name":"Joel Monegro","url":"https:\/\/www.usv.com\/people\/joel-monegro\/","description":"\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\"","image":{"@type":"ImageObject","url":"https:\/\/secure.gravatar.com\/avatar\/eca9bf219907c268f52652417960552d?s=96&d=mm&r=g","height":96,"width":96}}}</script>
<!-- Stream WordPress user activity plugin v3.4.2 -->
<link rel="icon" href="https://www.usv.com/wp-content/uploads/2019/04/cropped-usv_logo-32x32.jpg" sizes="32x32">
<link rel="icon" href="https://www.usv.com/wp-content/uploads/2019/04/cropped-usv_logo-192x192.jpg" sizes="192x192">
<link rel="apple-touch-icon-precomposed" href="https://www.usv.com/wp-content/uploads/2019/04/cropped-usv_logo-180x180.jpg">
<meta name="msapplication-TileImage" content="https://www.usv.com/wp-content/uploads/2019/04/cropped-usv_logo-270x270.jpg">
<style type="text/css" id="wp-custom-css">
.discuss-on-twitter-button {
background: #349f4e!important;
border: 2px solid #fff;
}
.discuss-on-twitter-button:hover {
background: #fff!important;
border: 2px solid #349f4e!important;
color: #349f4e !important;
} </style>
</head>
<body class="post-template-default single single-post postid-443 single-format-standard wp-custom-logo wp-embed-responsive section-writing singular image-filters-enabled">
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5QBJTNC"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<div id="page" class="site">
<a class="skip-link screen-reader-text" href="#content">Skip to content</a>
<header id="masthead" class="site-header">
<div class="site-branding-container">
<div class="site-branding">
<section class="o__header container js-header">
<div class="o__header__container">
<div class="o__header__logo">
<div class="a__logo"><a href="https://www.usv.com/" class="custom-logo-link" rel="home"><img src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/usv_logo.jpg" class="custom-logo" alt="Union Square Ventures" srcset="https://www.usv.com/wp-content/uploads/2019/04/usv_logo.jpg 190w, https://www.usv.com/wp-content/uploads/2019/04/usv_logo-150x150.jpg 150w" sizes="(max-width: 190px) 100vw, 190px" width="190" height="190"></a></div>
</div>
<div class="o__header__menu-container">
<button class="a__hamburger hamburger hamburger--slider js-hamburger " aria-label="Open menu" type="button">
<span class="hamburger-box">
<span class="hamburger-inner">
</span>
</span>
</button>
<nav class="o__header__menu-subcontainer ">
<ul id="menu-company" class="o__header__menu"><li id="menu-item-2505" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2505"><a href="https://www.usv.com/about/">About</a></li>
<li id="menu-item-1138" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1138"><a href="https://www.usv.com/people/">People</a></li>
<li id="menu-item-914" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-914"><a href="https://www.usv.com/companies">Companies</a></li>
<li id="menu-item-915" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-915"><a href="https://www.usv.com/network">Network</a></li>
<li id="menu-item-916" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-916"><a href="https://jobs.usv.com/">Jobs</a></li>
<li id="menu-item-917" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-917"><a href="https://www.usv.com/writing/">Writing</a></li>
</ul>
<a class="o__header__menu-mobilesearch" href="https://www.usv.com/?s">
<div class="a__icon a__icon--big">
<svg class="a__icons__magnifier" width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g transform="translate(-1189.000000, -82.000000)" stroke="#0D0D0D">
<g>
<g transform="translate(1133.000000, 81.000000)">
<g transform="translate(56.000000, 2.000000)">
<circle stroke-width="1.50179841" transform="translate(9.500000, 4.500000) rotate(-270.000000) translate(-9.500000, -4.500000) " cx="9.5" cy="4.5" r="4.5"></circle>
<path d="M3.25745446,7.25168545 L3.49549041,15.7416187 L4.74254554,15.7483146 L4.50450959,7.25838128 L3.25745446,7.25168545 Z" stroke-width="0.500598971" fill="#0D0D0D" transform="translate(4.000000, 11.500000) rotate(-315.000000) translate(-4.000000, -11.500000) "></path>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>
Search
</a>
<div class="o__header__menu-address">
<p><strong>Union Square Ventures</strong><br>
915 Broadway, 19th Floor<br>
New York, NY 10010</p>
</div>
</nav>
</div>
<div class="o__header__menu-social">
<a href="https://twitter.com/usv" target="_blank" aria-label="Share on Twitter">
<div class="a__icon a__icon--big">
<svg class="a__icons__twitter" width="22" height="22" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.900000036">
<g transform="translate(-76.000000, -195.000000)" fill="#0D0D0D">
<g>
<g transform="translate(76.000000, 61.000000)">
<g transform="translate(0.000000, 132.000000)">
<path d="M9.71114123,6.39666422 L9.75449454,7.11153991 L9.03193939,7.02400411 C6.40183864,6.68845022 4.10411326,5.55048483 2.15321435,3.63928657 L1.19944155,2.69098208 L0.9537728,3.39126847 C0.433533091,4.95232354 0.76590846,6.60091442 1.84974119,7.7097012 C2.42778531,8.32245179 2.29772538,8.40998759 1.30059927,8.04525509 C0.9537728,7.9285407 0.650299636,7.8410049 0.62139743,7.8847728 C0.520239709,7.98689789 0.867066182,9.31452417 1.14163714,9.83973896 C1.51736582,10.569204 2.28327428,11.2840796 3.12143825,11.7071693 L3.8295423,12.0427232 L2.99137833,12.0573125 C2.18211656,12.0573125 2.15321435,12.0719018 2.23992097,12.3782771 C2.52894303,13.3265816 3.67058017,14.3332433 4.94227724,14.7709223 L5.83824562,15.0772976 L5.05788606,15.5441552 C3.90179782,16.215263 2.54339413,16.5945848 1.18499045,16.6237634 C0.534690812,16.6383527 0,16.6967099 0,16.7404778 C0,16.8863707 1.76303457,17.7033715 2.78906288,18.0243361 C5.86714783,18.9726406 9.5232769,18.5641402 12.2689865,16.9447279 C14.2198854,15.7921733 16.1707843,13.5016532 17.0812038,11.2840796 C17.5725413,10.1023464 18.0638788,7.94312999 18.0638788,6.90728971 C18.0638788,6.23618192 18.1072321,6.14864612 18.9164939,5.34623464 C19.3933803,4.87937705 19.8413645,4.36875155 19.9280711,4.22285856 C20.0725821,3.94566186 20.058131,3.94566186 19.3211247,4.19367996 C18.092781,4.63135895 17.9193678,4.57300175 18.5263141,3.91648326 C18.9742983,3.44962567 19.5089891,2.60344628 19.5089891,2.35542819 C19.5089891,2.31166029 19.2922225,2.38460679 19.0465538,2.51591048 C18.7864339,2.66180348 18.2083898,2.88064298 17.7748567,3.01194668 L16.9944972,3.25996477 L16.2863931,2.77851788 C15.8962133,2.51591048 15.3470714,2.22412449 15.0580494,2.13658869 C14.3210431,1.93233849 13.1938571,1.96151709 12.5291063,2.19494589 C10.7227184,2.85146438 9.58108131,4.54382315 9.71114123,6.39666422 Z"></path>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>
</a>
<a href="https://www.usv.com/?s" aria-label="Go to the search page">
<div class="a__icon a__icon--big">
<svg class="a__icons__magnifier" width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g transform="translate(-1189.000000, -82.000000)" stroke="#0D0D0D">
<g>
<g transform="translate(1133.000000, 81.000000)">
<g transform="translate(56.000000, 2.000000)">
<circle stroke-width="1.50179841" transform="translate(9.500000, 4.500000) rotate(-270.000000) translate(-9.500000, -4.500000) " cx="9.5" cy="4.5" r="4.5"></circle>
<path d="M3.25745446,7.25168545 L3.49549041,15.7416187 L4.74254554,15.7483146 L4.50450959,7.25838128 L3.25745446,7.25168545 Z" stroke-width="0.500598971" fill="#0D0D0D" transform="translate(4.000000, 11.500000) rotate(-315.000000) translate(-4.000000, -11.500000) "></path>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>
</a>
</div>
</div>
</section>
</div>
</div><!-- .layout-wrap -->
</header><!-- #masthead -->
<div id="content" class="site-content">
<section class="content-area">
<div class="site-main">
<article id="post-443" class="post-443 post type-post status-publish format-standard hentry category-usv-blog Topic-blockchains-crypto Topic-open-decentralized-data Thesis-2-0 entry">
<header class="entry-header">
<h1 class="entry-title">Fat Protocols</h1>
<div class="blog-post-meta">
<div class="blog-post-meta__profile">
<img src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/eca9bf219907c268f52652417960552d.jpeg" alt="Joel Monegro">
</div>
<p>
<a class="blog-post-meta__author" href="https://www.usv.com/people/joel-monegro/">
Joel Monegro
</a>
Aug 8, 2016 </p>
</div>
</header><!-- .entry-header -->
<div class="entry-content gutenberg-blocks__common">
<p>Heres one way to think about the differences between the Internet
and the Blockchain. The previous generation of shared protocols (TCP/IP,
HTTP, SMTP, etc.) produced immeasurable amounts of value, but most of
it got captured and re-aggregated on top at the applications layer,
largely in the form of data (think Google, Facebook and so on). The
Internet stack, in terms of how value is <em>distributed,</em> is
composed of “thin” protocols and “fat” applications. As the market
developed, we learned that investing in applications produced high
returns whereas investing directly in protocol technologies generally
produced low returns.</p>
<p><img alt="Value distribution on the web" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/6uKSty0.png" width="400" height="515"></p>
<p>This relationship between protocols and applications is reversed in
the blockchain application stack. Value concentrates at the shared
protocol layer and only a fraction of that value is distributed along at
the applications layer. Its a stack with “fat” protocols and “thin”
applications.</p>
<p>We see this very clearly in the two dominant blockchain networks,
Bitcoin and Ethereum. The Bitcoin network has a $10B market cap yet the
largest companies built on top are worth a few hundred million at best,
and most are probably overvalued by “business fundamentals” standards.
Similarly, Ethereum has a $1B market cap even before the emergence of a
real breakout application on top and only a year after its public
release.</p>
<p><img alt="Value distribution on the blockchain" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/cz6Xrwn.png" width="400" height="517"></p>
<p>There are two things about most blockchain-based protocols that cause
this to happen: the first is the shared data layer, and the second is
the introduction cryptographic “access” token with some speculative
value.</p>
<p><a href="http://joel.mn/post/104755282493/the-shared-data-layer-of-the-blockchain">I wrote about the shared data layer about a year ago</a>.
Though the post has gathered some dust since, the main point remains:
by replicating and storing user data across an open and decentralized
network rather than individual applications controlling access to
disparate silos of information, we reduce the barriers to entry for new
players and create a more vibrant and competitive ecosystem of products
and services on top. As a concrete example, consider how easy it is to
switch from <a href="https://poloniex.com/">Poloniex</a> to <a href="https://gdax.com/">GDAX</a>,
or to any of the dozens of cryptocurrency exchanges out there, and
vice-versa in large part because they all have equal and free access to
the underlying data, blockchain transactions. Here you have several
competing, non-cooperating services which are interoperable with each
other by virtue of building their services on top of the same open
protocols. This forces the market to find ways to reduce costs, build
better products, and <a href="http://whaleclub.co/">invent radical new ones</a> to succeed.</p>
<p>But an open network and a shared data layer alone are not not enough
of an incentive to promote adoption. The second component, the protocol
token[1] which is used to access the service provided by the network
(transactions in the case of Bitcoin, computing power in the case of
Ethereum, file storage in the case of Sia and Storj, and so on) fills
that gap.</p>
<p><a href="http://continuations.com/">Albert</a> and <a href="http://avc.com/">Fred</a> wrote about this last week after we had a number discussions at USV about investing in blockchain-based networks. <a href="http://continuations.com/post/148098927445/crypto-tokens-and-the-coming-age-of-protocol">Albert looked at protocol tokens from the point of view of incentivizing open protocol innovation</a>,
as a way of funding research and development (via crowdsales), creating
value for shareholders (via token value appreciation), or both.</p>
<p>Alberts post will help you understand how tokens incentivize
protocol development. Here, Im going focus on how tokens incentivize
protocol adoption and how they affect value distribution via what I will
call the token feedback loop.</p>
<p><img alt="Token Feedback Loop" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/IqGC7W3.png" width="400" height="375"></p>
<p>When a token appreciates in value, it draws the attention of early
speculators, developers and entrepreneurs. They become stakeholders in
the protocol itself and are financially invested in its success. Then
some of these early adopters, perhaps financed in part by the profits of
getting in at the start, build products and services around the
protocol, recognizing that its success would further increase the value
of their tokens. Then some of these become successful and bring in new
users to the network and perhaps VCs and other kinds of investors. This
further increases the value of the tokens, which draws more attention
from more entrepreneurs, which leads to more applications, and so
on.&nbsp;</p>
<p>There are two things I want to point out about this feedback loop.
First is how much of the initial growth is driven by speculation.
Because most tokens are programmed to be scarce, as interest in the
protocol grows so does the price per token and thus the market cap of
the network. Sometimes interest grows a lot faster than the supply of
tokens and it leads to bubble-style appreciation.</p>
<p>With the exception of deliberately fraudulent schemes, this is a good
thing. Speculation is often the engine of technological adoption [2].
Both aspects of irrational speculation — the boom and the bust — can be
very beneficial to technological innovation. The boom attracts financial
capital through&nbsp;early profits, some of which are reinvested in
innovation (how many of Ethereums investors were re-investing their
Bitcoin profits, or DAO investors their Ethereum profits?), and the bust
can actually support&nbsp;the adoption long-term adoption of the new
technology as prices depress and out-of-the-money stakeholders look to
be made whole by promoting and creating value around it (just look at
how many of todays Bitcoin companies were started by early adopters
after the crash of 2013).</p>
<p>The second aspect worth pointing out is what happens towards the end
of the loop. When applications begin to emerge and show early signs of
success (whether measured by increased usage or by the attention (or
capital) paid by financial investors), two things happen in the market
for a protocols token: new users are drawn to the protocol, increasing
demand for tokens (since you need them to access the service — see
Alberts analogy of tickets in a fair), and existing investors hold onto
their tokens anticipating future price increases, further constraining
supply. The combination forces up the price (assuming sufficient
scarcity in new token creation), the newly-increased market cap of the
protocol attracts new entrepreneurs and new investors, and the loop
repeats itself.</p>
<p>Whats significant about this dynamic is the effect it has on how value is distributed along the stack: <strong>the market cap of the protocol always</strong> <strong>grows
faster than the combined value of the applications built on top, since
the success of the application layer drives further speculation at the
protocol layer</strong>. And again, increasing value at the protocol
layer attracts and incentivises competition at the application layer.
Together with a shared data layer, which dramatically lowers the
barriers to entry, the end result is a vibrant and competitive ecosystem
of applications and the bulk value distributed to a widespread pool of
shareholders. This is how tokenized protocols become “fat” and its
applications “thin”.</p>
<p>This is a big shift. The combination of shared open data with an
incentive system that prevents “winner-take-all” markets changes the
game at the application layer and creates an entire new category of
companies with fundamentally different business models at the protocol
layer. Many of the established rules about building businesses and
investing in innovation dont apply to this new model and today we
probably have more questions than answers. But were quickly learning
the ins and outs of this market through our blockchain portfolio and in
typical USV fashion were going to share that knowledge as we go along.</p>
<p>[1] Also known as <em>App Coins,</em><a href="https://startupboy.com/2014/03/09/the-bitcoin-model-for-crowdfunding/"> as coined pun intended by Naval in 2014</a></p>
<p>[2] <a href="https://www.goodreads.com/book/show/91360.Devil_Take_the_Hindmost">Edward Chancellor</a>
writes a thorough and entertaining history of financial speculation and
its place in society (youll be in awe by how similar cryptocurrency
speculation today is to prior bursts of financial exuberance!) and <a href="https://en.m.wikipedia.org/wiki/Technological_Revolutions_and_Financial_Capital">Carlota Perez</a>
describes the important role of bubbles in the development of new
technologies by attracting financial capital to research and
development.</p>
</div><!-- .entry-content -->
<div class="entry-content-footer">
<div class="" style="clear:both;">
<div class="discuss-on-twitter">
<a class="discuss-on-twitter-button reply-on-twitter" href="https://twitter.com/intent/tweet?url=https://www.usv.com/writing/2016/08/fat-protocols/&amp;text=@usv">
<span class="dashicons dashicons-twitter"></span>
Discuss on Twitter
</a>
<a class="discuss-on-twitter-button view-reactions" href="https://twitter.com/search?q=https%3A%2F%2Fwww.usv.com%2Fwriting%2F2016%2F08%2Ffat-protocols%2F" target="_twitter-443">
View Discussion
</a>
</div>
</div>
</div>
</article><!-- #post-${ID} -->
<div class="single-entry">
<div class="m__list-items m__list-items--default">
<header class="m__list-items__header">
<h4 class="a__lh_36">Recommended in Blockchains &amp; Crypto</h4>
</header>
<div class="m__list-items__list">
<div class="m__list-items__list-item">
<h6 class="m__list-items__list-item__title">
<a href="https://avc.com/2019/07/business-model-innovation/" rel="bookmark" title="Permanent Link to Business Model Innovation" class="m__list-items__list-item__title-link" target="_blank">
Business Model Innovation
<div class="a__icon-small">
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g fill="#28A055" fill-rule="nonzero">
<g>
<path d="M16.1544835,0.00747252747 L10.7957473,0.00747252747 C10.3660769,0.00747252747 10.0178571,0.355692308 10.0178571,0.785362637 C10.0178571,1.21503297 10.3660769,1.56325275 10.7957473,1.56325275 L14.3629451,1.56325275 L6.72901099,9.19718681 C6.42506593,9.50094505 6.42506593,9.99357143 6.72901099,10.2973297 C6.88089011,10.4492088 7.08003297,10.5252418 7.27898901,10.5252418 C7.47794505,10.5252418 7.67708791,10.4492088 7.82896703,10.2973297 L15.3765934,2.74951648 L15.3765934,6.14391209 C15.3765934,6.57358242 15.7248132,6.9218022 16.1544835,6.9218022 C16.5841538,6.9218022 16.9323736,6.57358242 16.9323736,6.14391209 L16.9323736,0.785362637 C16.9323736,0.355692308 16.5841538,0.00747252747 16.1544835,0.00747252747 Z"></path>
<path d="M13.4638132,7.84167033 C13.0341429,7.84167033 12.6859231,8.18989011 12.6859231,8.61956044 L12.6859231,14.7567473 C12.6859231,15.0379011 12.4484835,15.2753407 12.1673297,15.2753407 L2.24941758,15.2753407 C1.96826374,15.2753407 1.73082418,15.0379011 1.73082418,14.7567473 L1.73082418,4.83883516 C1.73082418,4.55768132 1.96826374,4.32024176 2.24941758,4.32024176 L8.40827473,4.32024176 C8.83794505,4.32024176 9.18616484,3.97202198 9.18616484,3.54235165 C9.18616484,3.11268132 8.83794505,2.76446154 8.40827473,2.76446154 L2.24941758,2.76446154 C1.10556044,2.76446154 0.175043956,3.69497802 0.175043956,4.83883516 L0.175043956,14.7567473 C0.175043956,15.9006044 1.10556044,16.8311209 2.24941758,16.8311209 L12.1673297,16.8311209 C13.3111868,16.8311209 14.2417033,15.9006044 14.2417033,14.7567473 L14.2417033,8.61956044 C14.2417033,8.19007692 13.8934835,7.84167033 13.4638132,7.84167033 Z"></path>
</g>
</g>
</g>
</svg>
</div>
</a>
</h6>
<div class="m__list-items__list-item__meta">
<div class="blog-post-meta blog-post-meta--variant2">
<p>
<a class="blog-post-meta__author" href="https://www.usv.com/people/fred-wilson/">
Fred Wilson
</a>
Jul 8, 2019
</p>
</div>
</div>
</div>
<div class="m__list-items__list-item">
<h6 class="m__list-items__list-item__title">
<a href="https://www.usv.com/writing/2019/03/arweave-project-ideas/" rel="bookmark" title="Permanent Link to Arweave Project Ideas" class="m__list-items__list-item__title-link">
Arweave Project Ideas
</a>
</h6>
<div class="m__list-items__list-item__meta">
<div class="blog-post-meta blog-post-meta--variant2">
<p>
<a class="blog-post-meta__author" href="https://www.usv.com/people/dani-grant/">
Dani Grant
</a>
Mar 5, 2019
</p>
</div>
</div>
</div>
<div class="m__list-items__list-item">
<h6 class="m__list-items__list-item__title">
<a href="https://www.usv.com/writing/2018/10/the-myth-of-the-infrastructure-phase/" rel="bookmark" title="Permanent Link to The Myth of The Infrastructure Phase" class="m__list-items__list-item__title-link">
The Myth of The Infrastructure Phase
</a>
</h6>
<div class="m__list-items__list-item__meta">
<div class="blog-post-meta blog-post-meta--variant2">
<p>
<a class="blog-post-meta__author" href="https://www.usv.com/people/dani-grant/">Dani Grant</a> and <a class="blog-post-meta__author" href="https://www.usv.com/people/nick-grossman/">Nick Grossman</a>
Oct 1, 2018
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- #main -->
</section><!-- #primary -->
</div><!-- #content -->
<footer class="o__footer">
<div class="o__footer-info">
<div class="m__footer-info3">
<p><strong>Union Square Ventures</strong><br>
915 Broadway, 19th Floor<br>
New York, NY 10010</p>
<div class="m__footerleft-socialinks">
<a class="m__footerleft-socialinks__link" rel="noreferrer" href="https://twitter.com/usv" target="_blank" aria-label="Share on twitter">
<div class="a__icon a__icon--small">
<svg class="a__icons__twitter" width="22" height="22" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.900000036">
<g transform="translate(-76.000000, -195.000000)" fill="#0D0D0D">
<g>
<g transform="translate(76.000000, 61.000000)">
<g transform="translate(0.000000, 132.000000)">
<path d="M9.71114123,6.39666422 L9.75449454,7.11153991 L9.03193939,7.02400411 C6.40183864,6.68845022 4.10411326,5.55048483 2.15321435,3.63928657 L1.19944155,2.69098208 L0.9537728,3.39126847 C0.433533091,4.95232354 0.76590846,6.60091442 1.84974119,7.7097012 C2.42778531,8.32245179 2.29772538,8.40998759 1.30059927,8.04525509 C0.9537728,7.9285407 0.650299636,7.8410049 0.62139743,7.8847728 C0.520239709,7.98689789 0.867066182,9.31452417 1.14163714,9.83973896 C1.51736582,10.569204 2.28327428,11.2840796 3.12143825,11.7071693 L3.8295423,12.0427232 L2.99137833,12.0573125 C2.18211656,12.0573125 2.15321435,12.0719018 2.23992097,12.3782771 C2.52894303,13.3265816 3.67058017,14.3332433 4.94227724,14.7709223 L5.83824562,15.0772976 L5.05788606,15.5441552 C3.90179782,16.215263 2.54339413,16.5945848 1.18499045,16.6237634 C0.534690812,16.6383527 0,16.6967099 0,16.7404778 C0,16.8863707 1.76303457,17.7033715 2.78906288,18.0243361 C5.86714783,18.9726406 9.5232769,18.5641402 12.2689865,16.9447279 C14.2198854,15.7921733 16.1707843,13.5016532 17.0812038,11.2840796 C17.5725413,10.1023464 18.0638788,7.94312999 18.0638788,6.90728971 C18.0638788,6.23618192 18.1072321,6.14864612 18.9164939,5.34623464 C19.3933803,4.87937705 19.8413645,4.36875155 19.9280711,4.22285856 C20.0725821,3.94566186 20.058131,3.94566186 19.3211247,4.19367996 C18.092781,4.63135895 17.9193678,4.57300175 18.5263141,3.91648326 C18.9742983,3.44962567 19.5089891,2.60344628 19.5089891,2.35542819 C19.5089891,2.31166029 19.2922225,2.38460679 19.0465538,2.51591048 C18.7864339,2.66180348 18.2083898,2.88064298 17.7748567,3.01194668 L16.9944972,3.25996477 L16.2863931,2.77851788 C15.8962133,2.51591048 15.3470714,2.22412449 15.0580494,2.13658869 C14.3210431,1.93233849 13.1938571,1.96151709 12.5291063,2.19494589 C10.7227184,2.85146438 9.58108131,4.54382315 9.71114123,6.39666422 Z"></path>
</g>
</g>
</g>
</g>
</g>
</svg>
</div>
</a>
<a class="m__footerleft-socialinks__link" rel="noreferrer" href="https://www.linkedin.com/company/union-square-ventures" target="_blank" aria-label="Share on linkedin">
<div class="a__icon-small a__icon__linkedin">
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.900000036">
<g transform="translate(-116.000000, -193.000000)" fill="#1A1A1A">
<g transform="translate(76.000000, 61.000000)">
<g transform="translate(40.000000, 132.000000)">
<path d="M17.0432512,17.0422222 L14.0770577,17.0422222 L14.0770577,12.4005556 C14.0770577,11.2938889 14.0581683,9.87 12.5359038,9.87 C10.991972,9.87 10.7564099,11.0761111 10.7564099,12.3216667 L10.7564099,17.0422222 L7.79354982,17.0422222 L7.79354982,7.49777778 L10.6369621,7.49777778 L10.6369621,8.80277778 L10.6780744,8.80277778 C11.0736409,8.05222222 12.0414456,7.26111111 13.4842635,7.26111111 C16.4882358,7.26111111 17.0432512,9.23722222 17.0432512,11.8077778 L17.0432512,17.0422222 Z M4.44901247,6.19388889 C3.49620823,6.19388889 2.72785355,5.42333333 2.72785355,4.47333333 C2.72785355,3.52388889 3.49620823,2.75333333 4.44901247,2.75333333 C5.39792772,2.75333333 6.16794911,3.52388889 6.16794911,4.47333333 C6.16794911,5.42333333 5.39792772,6.19388889 4.44901247,6.19388889 Z M2.96341565,17.0422222 L5.93294258,17.0422222 L5.93294258,7.49777778 L2.96341565,7.49777778 L2.96341565,17.0422222 Z M18.5205145,0 L1.47504097,0 C0.661129476,0 0,0.645555556 0,1.44222222 L0,18.5566667 C0,19.3533333 0.661129476,20 1.47504097,20 L18.5205145,20 C19.3360927,20 20,19.3533333 20,18.5566667 L20,1.44222222 C20,0.645555556 19.3360927,0 18.5205145,0 L18.5205145,0 Z"></path>
</g>
</g>
</g>
</g>
</svg>
</div>
</a>
</div>
</div>
<div class="m__footer-info3">
<p class="m__footer-info3__title">Company</p>
<nav id="site-navigation" class="main-navigation m__footerleft-menu" aria-label="Top Menu">
<div class="menu-company-container"><ul id="menu-company-1" class="menu"><li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2505"><a href="https://www.usv.com/about/">About</a></li>
<li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-1138"><a href="https://www.usv.com/people/">People</a></li>
<li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-914"><a href="https://www.usv.com/companies">Companies</a></li>
<li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-915"><a href="https://www.usv.com/network">Network</a></li>
<li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-916"><a href="https://jobs.usv.com/">Jobs</a></li>
<li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-917"><a href="https://www.usv.com/writing/">Writing</a></li>
</ul></div> </nav><!-- #site-navigation -->
</div>
<div class="m__footer-info6">
<p><strong>Contact Us</strong></p>
<p>If you would like to share your ideas, business, or feedback with us,
please email us. All business plan submissions must include a clear
description of your operations and current progress.</p>
<div class="m__footerright-contact">
<p>
Email: <a class="a__underline-link" href="mailto:info@usv.com">
info@usv.com</a>
</p>
<p>
Call: <a class="" href="tel:2129947880">
(212) 994-7880</a>
</p>
<p>
Fax: <a class="" href="tel:2129947399">
(212) 994-7399</a>
</p>
</div>
</div>
</div>
<div class="o__footer-legal">
<div class="o__footer-logo">
<div class="a__site-logo"><a href="https://www.usv.com/" class="custom-logo-link" rel="home"><img src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/usv_logo.jpg" class="custom-logo" alt="Union Square Ventures" srcset="https://www.usv.com/wp-content/uploads/2019/04/usv_logo.jpg 190w, https://www.usv.com/wp-content/uploads/2019/04/usv_logo-150x150.jpg 150w" sizes="(max-width: 190px) 100vw, 190px" width="190" height="190"></a></div>
</div>
<nav class="o__footer-legalmenu" aria-label="Footer Menu">
<div class="menu-legal-container"><ul id="menu-legal" class="menu"><li id="menu-item-2474" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2474"><a href="https://www.usv.com/policy-against-harassment/">Policy Against Harassment</a></li>
</ul></div> </nav><!-- .footer-navigation -->
</div>
</footer><!-- #colophon -->
</div><!-- #page -->
<link rel="stylesheet" id="dashicons-css" href="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/dashicons.css" type="text/css" media="all">
<link rel="stylesheet" id="discuss-on-twitter-css" href="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/styles.css" type="text/css" media="all">
<script type="text/javascript" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/mpp-frontend.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
var icons_html = {"external":"<div class=\"a__icon-small\">\n <svg width=\"20px\" height=\"20px\" viewBox=\"0 0 20 20\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g fill=\"#28A055\" fill-rule=\"nonzero\">\n <g>\n <path d=\"M16.1544835,0.00747252747 L10.7957473,0.00747252747 C10.3660769,0.00747252747 10.0178571,0.355692308 10.0178571,0.785362637 C10.0178571,1.21503297 10.3660769,1.56325275 10.7957473,1.56325275 L14.3629451,1.56325275 L6.72901099,9.19718681 C6.42506593,9.50094505 6.42506593,9.99357143 6.72901099,10.2973297 C6.88089011,10.4492088 7.08003297,10.5252418 7.27898901,10.5252418 C7.47794505,10.5252418 7.67708791,10.4492088 7.82896703,10.2973297 L15.3765934,2.74951648 L15.3765934,6.14391209 C15.3765934,6.57358242 15.7248132,6.9218022 16.1544835,6.9218022 C16.5841538,6.9218022 16.9323736,6.57358242 16.9323736,6.14391209 L16.9323736,0.785362637 C16.9323736,0.355692308 16.5841538,0.00747252747 16.1544835,0.00747252747 Z\"><\/path>\n <path d=\"M13.4638132,7.84167033 C13.0341429,7.84167033 12.6859231,8.18989011 12.6859231,8.61956044 L12.6859231,14.7567473 C12.6859231,15.0379011 12.4484835,15.2753407 12.1673297,15.2753407 L2.24941758,15.2753407 C1.96826374,15.2753407 1.73082418,15.0379011 1.73082418,14.7567473 L1.73082418,4.83883516 C1.73082418,4.55768132 1.96826374,4.32024176 2.24941758,4.32024176 L8.40827473,4.32024176 C8.83794505,4.32024176 9.18616484,3.97202198 9.18616484,3.54235165 C9.18616484,3.11268132 8.83794505,2.76446154 8.40827473,2.76446154 L2.24941758,2.76446154 C1.10556044,2.76446154 0.175043956,3.69497802 0.175043956,4.83883516 L0.175043956,14.7567473 C0.175043956,15.9006044 1.10556044,16.8311209 2.24941758,16.8311209 L12.1673297,16.8311209 C13.3111868,16.8311209 14.2417033,15.9006044 14.2417033,14.7567473 L14.2417033,8.61956044 C14.2417033,8.19007692 13.8934835,7.84167033 13.4638132,7.84167033 Z\"><\/path>\n <\/g>\n <\/g>\n <\/g>\n <\/svg>\n<\/div>\n"};
/* ]]> */
</script>
<script type="text/javascript" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/main.js"></script>
<script type="text/javascript" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/instantsearch.js"></script>
<script type="text/javascript" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/jquery.js"></script>
<script type="text/javascript" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/skip-link-focus-fix.js"></script>
<script type="text/javascript" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/priority-menu.js"></script>
<script type="text/javascript" src="Fat%20Protocols%20|%20Union%20Square%20Ventures_fichiers/widgets.js"></script>
</body></html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,9 +0,0 @@
jQuery( document ).ready( function( $ ) {
$( '.mpp-gutenberg-tab' ).on( 'click', function( e ) {
$('.mpp-author-tabs li').removeClass('active');
$(this).addClass('active');
var $tabs = $('.mpp-tab').removeClass('mpp-tab-active');
var new_tab = $(this).data('tab');
$('.' + new_tab).addClass('mpp-tab-active');
} );
} );

View File

@ -1,163 +0,0 @@
@charset "UTF-8";
/*
Theme Name: Twenty Nineteen
Adding print support. The print styles are based on the the great work of
Andreas Hecht in https://www.jotform.com/blog/css-perfect-print-stylesheet-98272/.
*/
/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# Margins
# Typography÷
# Page breaks
# Links
# Visibility
--------------------------------------------------------------*/
@media print {
/* Margins */
@page {
margin: 2cm;
}
.entry {
margin-top: 1em;
}
.entry .entry-header, .site-footer .site-info {
margin: 0;
}
/* Fonts */
body {
font: 13pt Georgia, "Times New Roman", Times, serif;
line-height: 1.3;
background: #fff !important;
color: #000;
}
h1 {
font-size: 24pt;
}
h2,
h3,
h4,
.has-regular-font-size,
.has-large-font-size,
h2.author-title,
p.author-bio,
.comments-title, h3 {
font-size: 14pt;
margin-top: 25px;
}
/* Page breaks */
a {
page-break-inside: avoid;
}
blockquote {
page-break-inside: avoid;
}
h1,
h2,
h3,
h4,
h5,
h6 {
page-break-after: avoid;
page-break-inside: avoid;
}
img {
page-break-inside: avoid;
page-break-after: avoid;
}
table, pre {
page-break-inside: avoid;
}
ul, ol, dl {
page-break-before: avoid;
}
/* Links */
a:link, a:visited, a {
background: transparent;
font-weight: bold;
text-decoration: underline;
text-align: left;
}
a {
page-break-inside: avoid;
}
a[href^=http]:after {
content: " < " attr(href) "> ";
}
a:after > img {
content: "";
}
article a[href^="#"]:after {
content: "";
}
a:not(:local-link):after {
content: " < " attr(href) "> ";
}
/* Visibility */
.main-navigation,
.site-title + .main-navigation,
.social-navigation,
.site-branding-container:before,
.entry .entry-title:before,
.entry-footer,
.author-description:before,
.post-navigation,
.widget-area,
.comment-form-flex,
.comment-reply,
.comment .comment-metadata .edit-link {
display: none;
}
.entry .entry-content .wp-block-button .wp-block-button__link,
.entry .entry-content .button {
color: #000;
background: none;
}
/* Site Header (With Featured Image) */
.site-header.featured-image {
min-height: 0;
}
.site-header.featured-image .main-navigation a,
.site-header.featured-image .main-navigation a + svg,
.site-header.featured-image .social-navigation a,
.site-header.featured-image .site-title a,
.site-header.featured-image .site-featured-image a,
.site-header.featured-image .site-branding .site-title,
.site-header.featured-image .site-branding .site-description,
.site-header.featured-image .main-navigation a:after,
.site-header.featured-image .main-navigation .main-menu > li.menu-item-has-children:after,
.site-header.featured-image .main-navigation li,
.site-header.featured-image .social-navigation li,
.site-header.featured-image .entry-meta,
.site-header.featured-image .entry-title,
.site-header.featured-image#masthead .site-title a {
color: #000;
text-shadow: none;
}
.site-header.featured-image .site-featured-image .entry-header,
.site-header.featured-image .site-branding-container {
margin-top: 0;
margin-bottom: 0;
}
.site-header.featured-image .site-featured-image .post-thumbnail img {
position: relative;
height: initial;
width: initial;
object-fit: none;
min-width: 0;
min-height: 0;
max-width: 100%;
margin-top: 1rem;
}
/* Remove image filters from featured image */
.image-filters-enabled *:after {
display: none !important;
}
.image-filters-enabled .site-header.featured-image .site-featured-image:before {
display: none;
}
.image-filters-enabled .site-header.featured-image .site-featured-image .post-thumbnail img {
filter: none;
}
}

View File

@ -1,216 +0,0 @@
(function() {
/**
* Debounce
*
* @param {Function} func
* @param {number} wait
* @param {boolean} immediate
*/
function debounce(func, wait, immediate) {
'use strict';
var timeout;
wait = (typeof wait !== 'undefined') ? wait : 20;
immediate = (typeof immediate !== 'undefined') ? immediate : true;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) {
func.apply(context, args);
}
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) {
func.apply(context, args);
}
};
}
/**
* Prepends an element to a container.
*
* @param {Element} container
* @param {Element} element
*/
function prependElement(container, element) {
if (container.firstChild.nextSibling) {
return container.insertBefore(element, container.firstChild.nextSibling);
} else {
return container.appendChild(element);
}
}
/**
* Shows an element by adding a hidden className.
*
* @param {Element} element
*/
function showButton(element) {
// classList.remove is not supported in IE11
element.className = element.className.replace('is-empty', '');
}
/**
* Hides an element by removing the hidden className.
*
* @param {Element} element
*/
function hideButton(element) {
// classList.add is not supported in IE11
if (!element.classList.contains('is-empty')) {
element.className += ' is-empty';
}
}
/**
* Returns the currently available space in the menu container.
*
* @returns {number} Available space
*/
function getAvailableSpace( button, container ) {
return container.offsetWidth - button.offsetWidth - 22;
}
/**
* Returns whether the current menu is overflowing or not.
*
* @returns {boolean} Is overflowing
*/
function isOverflowingNavivation( list, button, container ) {
return list.offsetWidth > getAvailableSpace( button, container );
}
/**
* Set menu container variable
*/
var navContainer = document.querySelector('.main-navigation');
var breaks = [];
/**
* Lets bail if we our menu doesn't exist
*/
if ( ! navContainer ) {
return;
}
/**
* Refreshes the list item from the menu depending on the menu size
*/
function updateNavigationMenu( container ) {
/**
* Lets bail if our menu is empty
*/
if ( ! container.parentNode.querySelector('.main-menu[id]') ) {
return;
}
// Adds the necessary UI to operate the menu.
var visibleList = container.parentNode.querySelector('.main-menu[id]');
var hiddenList = visibleList.parentNode.nextElementSibling.querySelector('.hidden-links');
var toggleButton = visibleList.parentNode.nextElementSibling.querySelector('.main-menu-more-toggle');
if ( isOverflowingNavivation( visibleList, toggleButton, container ) ) {
// Record the width of the list
breaks.push( visibleList.offsetWidth );
// Move last item to the hidden list
prependElement( hiddenList, ! visibleList.lastChild || null === visibleList.lastChild ? visibleList.previousElementSibling : visibleList.lastChild );
// Show the toggle button
showButton( toggleButton );
} else {
// There is space for another item in the nav
if ( getAvailableSpace( toggleButton, container ) > breaks[breaks.length - 1] ) {
// Move the item to the visible list
visibleList.appendChild( hiddenList.firstChild.nextSibling );
breaks.pop();
}
// Hide the dropdown btn if hidden list is empty
if (breaks.length < 2) {
hideButton( toggleButton );
}
}
// Recur if the visible list is still overflowing the nav
if ( isOverflowingNavivation( visibleList, toggleButton, container ) ) {
updateNavigationMenu( container );
}
}
/**
* Run our priority+ function as soon as the document is `ready`
*/
document.addEventListener( 'DOMContentLoaded', function() {
updateNavigationMenu( navContainer );
// Also, run our priority+ function on selective refresh in the customizer
var hasSelectiveRefresh = (
'undefined' !== typeof wp &&
wp.customize &&
wp.customize.selectiveRefresh &&
wp.customize.navMenusPreview.NavMenuInstancePartial
);
if ( hasSelectiveRefresh ) {
// Re-run our priority+ function on Nav Menu partial refreshes
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function ( placement ) {
var isNewNavMenu = (
placement &&
placement.partial.id.includes( 'nav_menu_instance' ) &&
'null' !== placement.container[0].parentNode &&
placement.container[0].parentNode.classList.contains( 'main-navigation' )
);
if ( isNewNavMenu ) {
updateNavigationMenu( placement.container[0].parentNode );
}
});
}
});
/**
* Run our priority+ function on load
*/
window.addEventListener( 'load', function() {
updateNavigationMenu( navContainer );
});
/**
* Run our priority+ function every time the window resizes
*/
var isResizing = false;
window.addEventListener( 'resize',
debounce( function() {
if ( isResizing ) {
return;
}
isResizing = true;
setTimeout( function() {
updateNavigationMenu( navContainer );
isResizing = false;
}, 150 );
} )
);
/**
* Run our priority+ function
*/
updateNavigationMenu( navContainer );
})();

View File

@ -1,31 +0,0 @@
/**
* File skip-link-focus-fix.js.
*
* Helps with accessibility for keyboard only users.
*
* Learn more: https://git.io/vWdr2
*/
( function() {
var isIe = /(trident|msie)/i.test( navigator.userAgent );
if ( isIe && document.getElementById && window.addEventListener ) {
window.addEventListener( 'hashchange', function() {
var id = location.hash.substring( 1 ),
element;
if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
return;
}
element = document.getElementById( id );
if ( element ) {
if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
element.tabIndex = -1;
}
element.focus();
}
}, false );
}
} )();

File diff suppressed because one or more lines are too long

View File

@ -1,19 +0,0 @@
@charset "UTF-8";
/*
Theme Name: Union Square Ventures
Description: Union Square Ventures Theme
Author: Nolte
Template: twentynineteen
Version: 1.0.1
*/
.discuss-on-twitter-button {
border-radius: 0 !important;
}
.discuss-on-twitter-button:hover {
background: #76d1ff !important;
color: #fff !important;
}
.discuss-on-twitter-button:visited {
color: #fff !important;
}

View File

@ -1,30 +0,0 @@
.discuss-on-twitter {
white-space:nowrap;
}
.discuss-on-twitter-button {
display: inline-block;
background: #1da0f1;
color: #fff;
padding: .5em 1.5em;
font-size: 1em;
margin: 10px 0 20px;
}
.discuss-on-twitter-button.reply-on-twitter {
border-radius: 12px 0 0 12px;
}
.discuss-on-twitter-button.view-reactions {
border-radius: 0 12px 12px 0;
}
.discuss-on-twitter-button.view-and-reply {
border-radius: 12px;
}
.discuss-on-twitter-button:hover {
background: #fff;
color: #1da0f1;
}
.discuss-on-twitter-button .dashicons-twitter {
line-height: 1.5em;
margin-right: 10px;
font-size: 1.1em;
display:none;
}

View File

@ -1 +0,0 @@
.wp-block-audio figcaption{color:#555d66;font-size:13px;text-align:center}.wp-block-code{font-family:Menlo,Consolas,monaco,monospace;font-size:14px;color:#23282d;padding:.8em 1em;border:1px solid #e2e4e7;border-radius:4px}.blocks-gallery-caption,.wp-block-embed figcaption,.wp-block-image figcaption{color:#555d66;font-size:13px;text-align:center}.wp-block-preformatted pre{font-family:Menlo,Consolas,monaco,monospace;color:#23282d;font-size:16px}@media (min-width:600px){.wp-block-preformatted pre{font-size:14px}}.wp-block-pullquote{border-top:4px solid #555d66;border-bottom:4px solid #555d66;margin-bottom:28px;color:#40464d}.wp-block-pullquote__citation,.wp-block-pullquote cite,.wp-block-pullquote footer{color:#40464d;text-transform:uppercase;font-size:13px;font-style:normal}.wp-block-quote{border-left:4px solid #000;margin:0 0 28px;padding-left:1em}.wp-block-quote__citation,.wp-block-quote cite,.wp-block-quote footer{color:#6c7781;font-size:13px;margin-top:1em;position:relative;font-style:normal}.wp-block-quote.has-text-align-right{border-left:none;border-right:4px solid #000;padding-left:0;padding-right:1em}.wp-block-quote.has-text-align-center{border:none;padding-left:0}.wp-block-quote.is-large,.wp-block-quote.is-style-large{border:none}.wp-block-search .wp-block-search__label{font-weight:700}.wp-block-group.has-background{padding:20px 30px;margin-top:0;margin-bottom:0}.wp-block-separator{border:none;border-bottom:2px solid #8f98a1;margin-left:auto;margin-right:auto}.wp-block-separator:not(.is-style-wide):not(.is-style-dots){max-width:100px}.wp-block-separator.has-background:not(.is-style-dots){border-bottom:none;height:1px}.wp-block-separator.has-background:not(.is-style-wide):not(.is-style-dots){height:2px}.wp-block-table{border-collapse:collapse}.wp-block-table td,.wp-block-table th{padding:.5em;border:1px solid;word-break:normal}.wp-block-video figcaption{color:#555d66;font-size:13px;text-align:center}

View File

@ -1,98 +0,0 @@
.wpt-header iframe {
float: right;
}
.wpt-left {
float: left;
margin-right: 10px;
}
.wpt-right {
float: right;
margin-left: 10px;
}
.wpt-twitter-name {
font-size: 120%;
line-height: 1;
}
.wpt-twitter-id {
display: inline-block;
margin-top: .5em;
}
.wpt-tweet-time {
font-size: 90%;
}
.wpt-latest-tweets li, .wpt-search-tweets li {
margin-bottom: .75em;
list-style-type: none;
}
.wpt-intents-border {
border-top: 1px solid;
opacity: .3;
margin: 5px 0;
}
.wpt-intents {
padding: 0 0 5px;
text-align: center;
font-size: 12px;
}
.wpt-twitter-image {
width: 100%;
height: auto;
}
.wpt-intents a span {
width: 16px;
height: 16px;
display: inline-block;
margin-right: 3px;
position: relative;
top: 2px;
}
.wpt-intents .wpt-reply span {
background: url(../images/spritev2.png) 0px;
}
.wpt-intents .wpt-retweet span {
background: url(../images/spritev2.png) -80px;
}
.wpt-intents .wpt-favorite span {
background: url(../images/spritev2.png) -32px;
}
.wpt-intents .wpt-reply:hover span, .wpt-intents .wpt-reply:focus span {
background-position: -16px;
}
.wpt-intents .wpt-retweet:hover span, .wpt-intents .wpt-retweet:focus span {
background-position: -96px;
}
.wpt-intents .wpt-favorite:hover span, .wpt-intents .wpt-favorite:focus span {
background-position: -48px;
}
.retweeted .wpt-intents .wpt-retweet span {
background-position: -112px;
}
.favorited .wpt-intents .wpt-favorite span {
background-position: -64px;
}
.wpt-intents a span.intent-text {
width: auto;
height: auto;
margin: 0;
top: 0;
background: none;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More