Merge branch 'language-plugin' of Disroot/Website into master

This commit is contained in:
antilopa 2020-01-03 09:39:44 +00:00 committed by Gitea
commit f48fd4ebc1
3 changed files with 37 additions and 10 deletions

View File

@ -46,25 +46,38 @@
## Installation
1. Clone disroot-website repo to disroot-website project folder
1. Create a Disroot folder, in which you'll clone three repositories:
```
git clone https://git.fosscommunity.in/disroot/disroot-website.git ~/disroot-website
mkdir ~/Disroot
```
2. Add the local domain name for the hub to your host machine's `/etc/hosts` file.
2. Clone disroot-website repo to Disroot folder
```
git clone https://git.fosscommunity.in/disroot/disroot-website.git ~/Disroot
```
2. Clone grav-theme-disroot repo to Disroot folder
```
git clone https://git.disroot.org/Disroot/grav-theme-disroot.git ~/Disroot
```
3. Clone grav-plugin-language-selector repo to Disroot folder
```
git clone https://git.disroot.org/Disroot/grav-plugin-language-selector.git ~/Disroot
```
4. Add the local domain name for the hub to your host machine's `/etc/hosts` file.
```
echo "192.168.33.12 disroot.lan" >> /etc/hosts
```
3. Launch Vagrant to build the virtual machine (VM). This will take several minutes.
5. Launch Vagrant to build the virtual machine (VM). This will take several minutes.
```
cd ~/disroot-website/vagrant
cd ~/Disroot/disroot-website/vagrant
vagrant up disroot_lan
```
Congratulations, you should now have a fully functioning apache+GRAV server running locally in a Virtualbox-hosted VM managed by Vagrant. Next time you want to run vagrant simply run command
```
cd ~/disroot-website/vagrant
cd ~/Disroot/disroot-website/vagrant
vagrant up disroot_lan
vagrant provision
```
### Enable SSH access

3
vagrant/Vagrantfile vendored
View File

@ -18,7 +18,8 @@ Vagrant.configure("2") do |config|
disroot_lan.vm.provision :shell, path: "bootstrap.sh"
disroot_lan.vm.synced_folder "../pages/", "/var/www/pages", owner: "www-data", group: "www-data"
disroot_lan.vm.synced_folder "../../grav-theme-disroot", "/var/www/grav-theme-disroot", owner: "www-data", group: "www-data"
disroot_lan.vm.synced_folder "../../grav-theme-disroot", "/var/www/grav-theme-disroot", owner: "www-data", group: "www-data"
disroot_lan.vm.synced_folder "../../grav-plugin-language-selector", "/var/www/grav-plugin-language-selector", owner: "www-data", group: "www-data"
end
end

View File

@ -48,7 +48,7 @@ sudo chown -R ${WWW_USER}:${WWW_USER} "${WEB_ROOT}"
sudo chmod 775 -R bin/
sudo -u "${WWW_USER}" bin/grav install
#sudo -u www-data bin/gpm install disroot
sudo -u "${WWW_USER}" bin/gpm install language-selector
#sudo -u "${WWW_USER}" bin/gpm install language-selector
sudo -u "${WWW_USER}" bin/gpm install form
sudo -u "${WWW_USER}" sed -i 's/quark/disroot/g' "${YAML}"
@ -67,7 +67,14 @@ languages:
- fr
- it
- de
- ru" >> "${YAML}"
- ru
include_default_lang: true
pages_fallback_only: false
translations: true
translations_fallback: true
session_store_active: true
http_accept_language: true
override_locale: false" >> "${YAML}"
fi
sudo -u "${WWW_USER}" ex -s -c "4i| alias: '/home'" -c x "${YAML}"
@ -86,5 +93,11 @@ sudo sed -i "s/127.0.0.1\tlocalhost/127.0.0.1\tlocalhost $WEB_NAME/" /etc/hosts
#Add website pages in GRAV
sudo mount -o bind /var/www/pages "${WEB_ROOT}""${WEB_NAME}"/user/pages
chown "${WWW_USER}":"${WWW_USER}" -R "${WEB_ROOT}""${WEB_NAME}"/user/pages
sudo -u www-data ln -s /var/www/grav-theme-disroot "${WEB_ROOT}""${WEB_NAME}"/user/themes/disroot
#Add Disroot theme in GRAV
sudo -u "${WWW_USER}" ln -s "${WEB_ROOT}"/grav-theme-disroot "${WEB_ROOT}""${WEB_NAME}"/user/themes/disroot
#Add language-selector in GRAV
sudo -u "${WWW_USER}" ln -s "${WEB_ROOT}"/grav-plugin-language-selector "${WEB_ROOT}""${WEB_NAME}"/user/plugins/language-selector
exit 0