Merge branch 'master' into NC_Cospend

This commit is contained in:
meaz 2021-03-31 06:33:43 +00:00
commit db4811209a
9 changed files with 71 additions and 36 deletions

View File

@ -54,9 +54,9 @@ Repeat 1 to 3, for different channel on different network.
### For long-term/recurring
1. Add `irc.disroot.org` to your roaster.
1. Add `irc.disroot.org` to your roster.
2. Execute ad-hoc command on it, then enable history and persistence.
3. Add `irc.network.tld@irc.disroot.org` to your roaster.
3. Add `irc.network.tld@irc.disroot.org` to your roster.
4. Execute ad-hoc command on it, then add your username (nick) and password (nick password).
5. Add `#channel%irc.network.tld@irc.disroot.org` to bookmarks and then join.
6. Execute ad-hoc command on it, then enable history and persistence.
@ -72,6 +72,6 @@ Any client can be used, although only following clients are known to support ad-
### Gajim
1. Right-click on the roaster element.
1. Right-click on the roster element.
2. Click 'Execute Command'.
3. Follow the options.

View File

@ -1,5 +1,5 @@
{% extends 'partials/base.html.twig' %}
{% block content %}
{{ page.content }}
{{ page.content|raw }}
{% endblock %}

View File

@ -35,14 +35,14 @@
{% include 'partials/docmeta.html.twig' %}
<section class="index content narrow">
{{ page.content }}
{{ page.content|raw }}
<div class="row">
{% for p in page.children %}
<div class="three columns">
{%if p.header.indexed %}
<a href="{{ p.link }}">
{%if p.media %}
{{ p.media.images|first.html }}
{{ p.media.images|first.html|raw }}
{% endif %}
<h6>{{ p.title }}</h6>
</a>

View File

@ -3,6 +3,6 @@
{% block content %}
<div class="lead text-center">
<h1>Error!</h1>
{{ page.content }}
{{ page.content|raw }}
</div>
{% endblock %}

View File

@ -10,7 +10,7 @@
{% set colsize = ['seven', 'five'] %}
<section id="{{ page.header.section_id }}" class="row columns">
<div class="{{ colsize[0] }} columns">
{{ page.content }}
{{ page.content|raw }}
</div>
<div class="{{ colsize[1] }} columns topic-list">
{% for p in page.collection %}

View File

@ -4,10 +4,10 @@
{% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %}
{% block content %}
{{ page.content }}
{{ page.content|raw }}
<div id="content">
{% for module in page.collection() %}
{{ module.content }}
{{ module.content|raw }}
{% endfor %}
</div>
{% endblock %}

View File

@ -17,13 +17,13 @@
{% do assets.addCss('theme://css/style.css') %}
{% do assets.addCss('theme://css/media-queries.css') %}
{% endblock %}
{{ assets.css() }}
{{ assets.css()|raw }}
{% block javascripts %}
{% block javascripts %}
{% do assets.addJs('jquery', 100) %}
{% do assets.addJs('theme://js/howto.js', { group:'bottom' }) %}
{% endblock %}
{{ assets.js() }}
{{ assets.js()|raw }}
{% endblock head%}
</head>

4
vagrant/Vagrantfile vendored
View File

@ -7,9 +7,9 @@
# you're doing.
Vagrant.configure("2") do |config|
config.vm.define "howto_disroot_lan" do |howto_disroot_lan|
howto_disroot_lan.vm.box="generic/debian9"
howto_disroot_lan.vm.box="generic/debian10"
howto_disroot_lan.vm.hostname = 'howto.disroot.lan'
howto_disroot_lan.vm.box_url = "generic/debian9"
howto_disroot_lan.vm.box_url = "generic/debian10"
howto_disroot_lan.vm.synced_folder "provision/", "/vagrant/provision/"

View File

@ -5,6 +5,7 @@ WEB_NAME="howto.disroot.lan"
WEB_ROOT="/var/www/"
WWW_USER="www-data"
YAML="/var/www/howto.disroot.lan/user/config/system.yaml"
GRAV_VERSION="1.6.18"
# Provisioning actions
@ -12,11 +13,14 @@ YAML="/var/www/howto.disroot.lan/user/config/system.yaml"
sudo debconf-set-selections <<< "postfix postfix/main_mailer_type select No configuration"
sudo debconf-set-selections <<< "postfix postfix/mailname string ${WEB_NAME}"
# Add sury repository to sources.list for PHP
# Add sury repository to sources.list for PHP7.4
echo "set grub-pc/install_devices /dev/sda" | debconf-communicate # Fix grub error
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y install ca-certificates apt-transport-https
echo "deb https://packages.sury.org/php/ stretch main" | sudo tee -a /etc/apt/sources.list.d/php.list
if ! grep -q "^deb .*sury" /etc/apt/sources.list /etc/apt/sources.list.d/*; then
sudo sh -c 'echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/php.list'
fi
# Sury Key for PHP7.4
wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
@ -32,30 +36,61 @@ echo "Installing php7..."
sudo apt-get install -y php7.4-zip php7.4-cli php7.4-curl php7.4-gd php7.4-mbstring php7.4-xml php7.4-fpm
# Create the Nginx config files and restart webserver
echo "Installing Nginx config files..."
sudo rsync -cr /vagrant/provision/etc/nginx/sites-available /etc/nginx/
sudo ln -s /etc/nginx/sites-available/"${WEB_NAME}".conf /etc/nginx/sites-enabled/"${WEB_NAME}".conf
sudo rm /etc/nginx/sites-enabled/default
if [ ! -f /etc/nginx/sites-enabled/"${WEB_NAME}".conf ]; then
sudo ln -s /etc/nginx/sites-available/"${WEB_NAME}".conf /etc/nginx/sites-enabled/"${WEB_NAME}".conf
fi
if [ -f /etc/nginx/sites-enabled/default ]; then
sudo rm /etc/nginx/sites-enabled/default
fi
sudo service nginx restart
# Install GRAV in webroot
sudo chown -R ${WWW_USER}:${WWW_USER} /var/www
sudo wget https://getcomposer.org/download/1.9.1/composer.phar -O /usr/local/bin/composer && sudo chmod 755 /usr/local/bin/composer
echo "Git"
git clone -b master https://github.com/getgrav/grav.git "${WEB_ROOT}""${WEB_NAME}"
echo "Installing GRAV..."
sudo chown -R ${WWW_USER}:${WWW_USER} "${WEB_ROOT}"
echo "enter git"
if [ ! -f "${WEB_ROOT}""${WEB_NAME}" ]; then
sudo -u "${WWW_USER}" mkdir "${WEB_ROOT}""${WEB_NAME}"
fi
## Specific version
FILE="${WEB_ROOT}"grav-v"${GRAV_VERSION}".zip
if [ ! -f "$FILE" ]; then
echo "Downloading grav-v"${GRAV_VERSION}".zip"
sudo -u "${WWW_USER}" wget https://github.com/getgrav/grav/releases/download/"${GRAV_VERSION}"/grav-v"${GRAV_VERSION}".zip -P "${WEB_ROOT}"
sudo -u "${WWW_USER}" unzip -o "${WEB_ROOT}"grav-v"${GRAV_VERSION}".zip -d "${WEB_ROOT}"
sudo -u "${WWW_USER}" cp -r "${WEB_ROOT}"grav/* "${WEB_ROOT}""${WEB_NAME}"
else
echo "grav-v"${GRAV_VERSION}".zip already exists"
fi
# Directly from Master
# if [ ! -f /usr/local/bin/composer ]; then
# sudo wget https://getcomposer.org/download/1.9.1/composer.phar -O /usr/local/bin/composer && sudo chmod 755 /usr/local/bin/composer
# fi
# sudo chown -R ${WWW_USER}:${WWW_USER} /var/www
# sudo wget https://getcomposer.org/download/1.9.1/composer.phar -O /usr/local/bin/composer && sudo chmod 755 /usr/local/bin/composer
# echo "Git"
# git clone -b master https://github.com/getgrav/grav.git "${WEB_ROOT}""${WEB_NAME}"
# sudo chown -R ${WWW_USER}:${WWW_USER} "${WEB_ROOT}"
#
# echo "enter git"
# cd "${WEB_ROOT}""${WEB_NAME}"
# echo "composer"
# sudo -u "${WWW_USER}" composer install --no-dev -o
# sudo chown -R ${WWW_USER}:${WWW_USER} "${WEB_ROOT}"
# sudo chmod 775 -R bin/
# sudo -u "${WWW_USER}" bin/grav install
echo "Enter git"
cd "${WEB_ROOT}""${WEB_NAME}"
echo "composer"
sudo -u "${WWW_USER}" composer install --no-dev -o
sudo chown -R ${WWW_USER}:${WWW_USER} "${WEB_ROOT}"
sudo chmod 775 -R bin/
sudo -u "${WWW_USER}" bin/grav install
sudo -u "${WWW_USER}" bin/gpm install form
sudo -u "${WWW_USER}" bin/gpm install simplesearch
sudo -u "${WWW_USER}" bin/gpm install relatedpages
sudo -u "${WWW_USER}" bin/gpm install breadcrumbs
sudo -u "${WWW_USER}" bin/gpm install page-toc
sudo -u "${WWW_USER}" php7.4 bin/gpm install form
sudo -u "${WWW_USER}" php7.4 bin/gpm install simplesearch
sudo -u "${WWW_USER}" php7.4 bin/gpm install relatedpages
sudo -u "${WWW_USER}" php7.4 bin/gpm install breadcrumbs
sudo -u "${WWW_USER}" php7.4 bin/gpm install page-toc
sudo -u "${WWW_USER}" sed -i 's/quark/grav-theme-howto/g' "${YAML}"
# Add Grav config
@ -78,7 +113,7 @@ fi
sudo -u "${WWW_USER}" ex -s -c "4i| alias: '/home'" -c x "${YAML}"
sudo -u "${WWW_USER}" sed -i '4d' "${YAML}"
sudo -u "${WWW_USER}" -i 's/false/true/g' "${WEB_ROOT}""${WEB_NAME}"/user/plugins/language-selector/language-selector.yaml
sudo -u "${WWW_USER}" -i 's/false/true/g' "${WEB_ROOT}""${WEB_NAME}"/user/plugins/language-selector/language-selector.yaml # sed is missing, but creates an error anyway as "markdown: extra: true" gives an error
# Add website domain to local /etc/hosts file
sudo sed -i "s/127.0.0.1\tlocalhost/127.0.0.1\tlocalhost ${WEB_NAME}/" /etc/hosts