Compare commits
7 Commits
master
...
Cospend_Mo
Author | SHA1 | Date |
---|---|---|
Fede.- | 4577697b85 | |
Fede.- | e9075c29fa | |
Fede.- | abcbd2d186 | |
Fede.- | e1882c5db8 | |
Fede.- | 850f0f016a | |
Fede.- | a4ec708257 | |
Fede.- | 1043b25eaf |
|
@ -0,0 +1,191 @@
|
|||
---
|
||||
title: Web interface
|
||||
published: true
|
||||
visible: false
|
||||
indexed: true
|
||||
updated:
|
||||
last_modified: "February 2021"
|
||||
app: Cospend
|
||||
app_version: 1.2.7
|
||||
taxonomy:
|
||||
category:
|
||||
- docs
|
||||
tags:
|
||||
- cloud
|
||||
- apps
|
||||
- cospend
|
||||
page-toc:
|
||||
active: true
|
||||
---
|
||||
|
||||
# Cospend App
|
||||
|
||||
We will see now the basics of **Cospend** in the **Disroot Cloud**.
|
||||
|
||||
# Create a New Project
|
||||
|
||||
After log in, select the **Cospend App**
|
||||
|
||||
![](en/cospend_app.png)
|
||||
|
||||
The first time you use it, it will be empty (of course).
|
||||
|
||||
![](en/main_screen.png)
|
||||
|
||||
To create a new project just click on the **+ New project** box and type its name.
|
||||
|
||||
![](en/new_project.gif)
|
||||
|
||||
Now at the right of the project's name you have two shortcuts to the **Panel** and a menu.
|
||||
|
||||
![](en/project_shortcuts.png)
|
||||
|
||||
- The first one is the **Sharing** shortcut. Click on it to open the **Panel** and manage different sharing options (we will look at them in more detail below).
|
||||
|
||||
![](en/project_sharing.png)
|
||||
|
||||
- The second one opens the project **Settings** tab in the **Panel** from where you can manage members and a couple of other options (again, we will look at them in more detail below).
|
||||
|
||||
![](en/project_settings.png)
|
||||
|
||||
- The "three dot" icon opens a menu from where you can add members, see statistics of the project, settle it (this option will show you a possible way to settle the bills and put everyone's balance back to 0) and delete it.
|
||||
|
||||
![](en/project_menu.png)
|
||||
|
||||
## Add a member
|
||||
|
||||
To add a member just click on the "three dots" icon and select **Add member**. The right panel will open and you will be able to add a new member from the **Member list** option in the **Settings** tab. You can also add a **Nextcloud** user from the same instance, assign a color, rename and set the weight of the member.
|
||||
|
||||
![](en/cospend_add_member.mp4?resize=1024,576&autoplay&loop=1)
|
||||
|
||||
You can also associate a member with a **Nextcloud** user.
|
||||
|
||||
![](en/associate_user.gif)
|
||||
|
||||
To "disassociate" them, just rename the member's name.
|
||||
|
||||
|
||||
## Add a bill
|
||||
|
||||
To add a new bill click on **+ New bill**...
|
||||
|
||||
![](en/add_bill_01.png)
|
||||
|
||||
... and a right panel with bill options will be opened.
|
||||
|
||||
![](en/add_bill_02.png)
|
||||
|
||||
These options are:
|
||||
|
||||
![](en/add_bill_options_01.png)
|
||||
|
||||
- **What?**: here you can type a sort of title that describes what the bill is about.
|
||||
- **How much?**: the amount of the bill or the expense made. You can type an amount or simple maths operations and press Enter to get the value (for example, if you write `10+15` and Enter the value will be `25`).
|
||||
- **How payed?**: select the member who payed the bill.
|
||||
- **When?**: select the date of the bill.
|
||||
- **Payment mode**: select how the payment was made.
|
||||
- **Category**: select a category for the bill.
|
||||
- **Comment**: here you can add more information or a simple comment about the bill for other members.
|
||||
- **Repeat**: select if it is a recurrent expense and how often it has to be repeated.<br> *The bill repetition process runs once a day. If your bills are not automatically repeated, you should contact us so we can check if there is an issue with it*.
|
||||
|
||||
Then you have the **Bill type** options.
|
||||
|
||||
![](en/add_bill_options_02.png)
|
||||
|
||||
They are four:
|
||||
|
||||
1. **Classic, even split**: by selecting this mode the bill is split equitably between members.<br>_For example: **Andrew** pays a grocery bill and **Brenda & Carla** and **David** agree to share the cost equally._
|
||||
|
||||
2. **Even split with optional personal parts**: this mode is similar to the previous one but you can also add an amount related to "personal" expenses from other members.<br>_For example: a collective shop is made at the supermarket but **David** added some personal items that should not be paid by **Andrew** and **Brenda & Carla**._
|
||||
|
||||
3. **Custom owed ammount per member**: the bill amount is ignored and you have to select a payer and enter a custom owed amount for each member. Then click on "**Create the bills**" and multiple bills will be created.<br>_For example: **David** pays the dinner bill at the restaurant but there are quite a price differences between what **Brenda & Carla** and **Andrew** ate._
|
||||
|
||||
4. **Custom share per member**: this mode is similar to the previous one. The difference is that instead of amounts you set shares.<br>_For example: **Brenda & Carla** pay an hotel bill for a month but **Andrew** was not there the whole month but two weeks. **Andrew** should then pay half a share (0.5) while **Brenda & Carla** and **David** pay a full share (1)._
|
||||
|
||||
## Statistics
|
||||
This option does not require much explanations. Click on it to access a set of statistics that can help you manage your project.
|
||||
|
||||
![](en/menu_statistics.png)
|
||||
|
||||
![](en/statistics.png)
|
||||
|
||||
## Settle a project
|
||||
If for some reason you need to settle the bills in such a way that everyone's balance back to zero, you can use the **Settlement project** option.
|
||||
|
||||
![](en/menu_settlement.png)
|
||||
|
||||
You can choose wether to focus the settlement on one particular member and a maximum date after which the bills are not taken into account for it.
|
||||
|
||||
![](en/settlement.png)
|
||||
|
||||
|
||||
# Options and settings
|
||||
|
||||
![](en/panel.png)
|
||||
|
||||
## Sharing a project
|
||||
|
||||
In the **Sharing** tab you can:
|
||||
|
||||
![](en/sharing_01.png)
|
||||
|
||||
1. Share the project with another **Nextcloud** users, a group or a circle. Just type the usernames you want to share with and select them.
|
||||
2. Set access privileges per member:
|
||||
- Viewer
|
||||
- Participant
|
||||
- Maintainer
|
||||
- Admin
|
||||
- Remove the access to the project
|
||||
3. Set a password protected access link
|
||||
|
||||
![](en/cospend_sharing.mp4?resize=512;780&autoplay&loop)
|
||||
|
||||
4. Or generate a QR code to access the project from the [**MoneyBuster** app](https://f-droid.org/en/packages/net.eneiluj.moneybuster/).
|
||||
|
||||
![](en/sharing_02.png)
|
||||
|
||||
## Project settings
|
||||
|
||||
In the **Settings** tab you can:
|
||||
|
||||
![](en/settings.png)
|
||||
|
||||
- Rename a project
|
||||
- Set automatic export
|
||||
- Add new members and
|
||||
- assign them a color
|
||||
- change a member name
|
||||
- set the member weight
|
||||
- or remove a member
|
||||
|
||||
![](en/settings.gif)
|
||||
|
||||
4. Associate a project member with a **Nextcloud** user. To do so, just choose a project member and then a **Nextcloud** user to associate with.
|
||||
|
||||
## Categories
|
||||
|
||||
![](en/categories.png)
|
||||
|
||||
To get more organized, you can use the **Categories** tab options. Here you can add, edit, create and manage categories for your projects.
|
||||
|
||||
![](en/categories_02.png)
|
||||
|
||||
|
||||
## Currencies
|
||||
|
||||
![](en/currencies.png)
|
||||
|
||||
Here you can select a main currency, add a new one or set exchange rates.
|
||||
|
||||
|
||||
# Other settings
|
||||
|
||||
Finally, from the **Settings** option on the bottom left, you can:
|
||||
|
||||
- Export / Import projects
|
||||
- Generate a **Guess access link** to a project for those who do not have a **Nextcloud** user.
|
||||
- Change the directory where the projects will be saved.
|
||||
- Sort the projects by name or date.
|
||||
- And set the **Maximum precision** value to display more precise balances.
|
||||
|
||||
![](en/settings_02.png)
|
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 71 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 426 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 80 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 119 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 180 KiB |
After Width: | Height: | Size: 76 KiB |
|
@ -0,0 +1,81 @@
|
|||
---
|
||||
title: MoneyBuster
|
||||
published: true
|
||||
visible: false
|
||||
indexed: true
|
||||
updated:
|
||||
last_modified: "February 2021"
|
||||
app: MoneyBuster on Android
|
||||
app_version: 0.1.8
|
||||
taxonomy:
|
||||
category:
|
||||
- docs
|
||||
tags:
|
||||
- mobile
|
||||
- apps
|
||||
- cospend
|
||||
- moneybuster
|
||||
page-toc:
|
||||
active: true
|
||||
---
|
||||
|
||||
# MoneyBuster: A Cospend mobile client
|
||||
|
||||
**MoneyBuster** is a shared budget manager app that you can sync with **Nextcloud Cospend**. With this app you can choose to keep your project local or make it synchronize with your **Disroot Cloud**.
|
||||
|
||||
# How to get it?
|
||||
|
||||
You can download it from the [**F-Droid FOSS App Store**](https://f-droid.org/en/packages/net.eneiluj.moneybuster/).
|
||||
|
||||
# How to use it with your Disroot account
|
||||
|
||||
## Setup it up
|
||||
The first time you run **MoneyBuster** a setup wizard will guide you.
|
||||
|
||||
![](en/screen_mb_config_01.png)
|
||||
|
||||
1. Select **Configure Nextcloud account**.
|
||||
|
||||
![](en/screen_mb_config_02.png)
|
||||
|
||||
2. If you already have installed the **Nextcloud** mobile client, here you can choose to use the same account it is set up with or enter the **Disroot Cloud** server address ```https://cloud.disroot.org``` and tap **CONNECT**.
|
||||
|
||||
![](en/screen_mb_config_03.png)
|
||||
|
||||
3. Now the app will ask you to grant it access.
|
||||
|
||||
![](en/screen_mb_config_04.png)
|
||||
|
||||
4. Enter your **Disroot** credentials and tap **Log in**.
|
||||
|
||||
![](en/screen_mb_config_05.png)
|
||||
|
||||
5. Grant access to the app. Now we can start to use it.
|
||||
|
||||
## Using the App
|
||||
|
||||
If you already have any **Cospend** project in the **Cloud** it will appear in the app screen and you can add a new bill by tapping on the **+$** button.
|
||||
|
||||
![](en/screen_main.png)
|
||||
|
||||
If not, then you will need to create a project first. To do so open the menu by clicking on the menu icon or swiping it from the left side of the screen.
|
||||
|
||||
![](en/screen_menu.png)
|
||||
|
||||
To create a new project, tap on the **+** icon.
|
||||
|
||||
![](en/screen_new_project.png)
|
||||
|
||||
The **Add project** screen will open.
|
||||
|
||||
![](en/screen_add_new_project.png)
|
||||
|
||||
1. Select **CREATE**
|
||||
2. Select **COSPEND**
|
||||
3. The **Disroot** server address will appear by default as you have already configured the app with your account. You can modify it enetering the address of any **Nextcloud** instance where you have the **Cospend** project.
|
||||
4. Add an ID or a name for the project
|
||||
5. Set a password if you want to
|
||||
6. Add a title for the project
|
||||
7. Add a contact email
|
||||
|
||||
The process of creating a project or a bill is very similar to the web.
|
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 208 KiB |
After Width: | Height: | Size: 157 KiB |
After Width: | Height: | Size: 188 KiB |
After Width: | Height: | Size: 169 KiB |
After Width: | Height: | Size: 657 KiB |
After Width: | Height: | Size: 526 KiB |
After Width: | Height: | Size: 599 KiB |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 188 KiB |
|
@ -3,10 +3,6 @@ title: Cospend
|
|||
published: true
|
||||
visible: false
|
||||
indexed: true
|
||||
updated:
|
||||
last_modified: " 2021"
|
||||
app: Cospend
|
||||
app_version: 1.2.7
|
||||
taxonomy:
|
||||
category:
|
||||
- docs
|
||||
|
@ -14,11 +10,32 @@ taxonomy:
|
|||
- cloud
|
||||
- apps
|
||||
- cospend
|
||||
visible: true
|
||||
page-toc:
|
||||
active: false
|
||||
---
|
||||
|
||||
# Cospend (coming soon)
|
||||
# What is Cospend?
|
||||
**Cospend** is a group/shared budget manager app. You can use it when you share a house, when you go on vacation with friends or whenever you share money with others.
|
||||
|
||||
**Cospend** app is a group/shared budget manager. You can use it when you share a house, when you go on vacation with friends or whenever you share money with others.
|
||||
# How it works?
|
||||
With **Cospend** you can create a **Project** which is a way of managing expenses and bills of a group of people. A project contains **Members** (any person or sub-group of persons that participates in the project and that has an initial weight of 1) and **Bills** (any expense made by one member that involves one or more members of the same project).
|
||||
|
||||
A basic practical example to understand how it works might be the following:
|
||||
|
||||
**Andrew**, **Brenda**, **Carla** and **David** want to organize and share the costs of a vacation trip. But since **Brenda** and **Carla** are a couple they want to be added as **one member** (**Brenda & Carla**) with a weight of 2.
|
||||
|
||||
- **Andrew** (a member with a weight of 1) pays a 40 euros bill. The balance of **Andrew** will increase to 40.
|
||||
- This bill involves himself, "**Brenda & Carla**" (a member with a weight of 2) and **David** (a member with a weight of 1). So far the sum of the members weight is 4, which means they have to split the bill in 4 shares:
|
||||
- **Andrew** will owe 1 share (10 euros)
|
||||
- "**Brenda & Carla**" will owe 2 shares (20 euros) and
|
||||
- **David** will owe 1 share also (10 euros)
|
||||
|
||||
This example is pretty simple and intuitive but in a scenario with a larger budget and a bigger number of people, things can get complicated. That is when **Cospend** becomes more useful and interesting.
|
||||
|
||||
---
|
||||
|
||||
# [Cospend app](web)
|
||||
- Web interface, Basics
|
||||
|
||||
# [Cospend mobile clients](mobile)
|
||||
- MoneyBuster app
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
---
|
||||
title: 'Chat Transports: IRC'
|
||||
published: true
|
||||
visible: true
|
||||
indexed: true
|
||||
updated:
|
||||
app: Biboumi
|
||||
app_version: 9.0
|
||||
taxonomy:
|
||||
category:
|
||||
- docs
|
||||
tags:
|
||||
- chat
|
||||
- xmpp
|
||||
page-toc:
|
||||
active: true
|
||||
---
|
||||
|
||||
# XMPP <-> IRC
|
||||
|
||||
Disroot Chat provides [Biboumi](https://biboumi.louiz.org/), an IRC transport for XMPP, at irc.disroot.org.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
The syntax for connecting to IRC channel is:
|
||||
|
||||
`#channel%irc.network.tld@irc.disroot.org`
|
||||
|
||||
The syntax for connecting to IRC user is:
|
||||
|
||||
`nick%irc.network.tld@irc.disroot.org`
|
||||
|
||||
## SETTINGS
|
||||
|
||||
Settings can be configured at three different levels, by executing ad-hoc commands on respective items:
|
||||
|
||||
1. IRC-Transport Level: `irc.disroot.org`
|
||||
2. IRC-Network Level: `irc.network.tld@irc.disroot.org`
|
||||
3. IRC-Channel Level: `#channel%irc.network.tld@irc.disroot.org`
|
||||
|
||||
If there are common options across all the levels, priority or over-ride of those settings happens in the order of [3] > [2] > [1].
|
||||
|
||||
## STEPS
|
||||
|
||||
### For short-term/one-shot
|
||||
|
||||
1. Join chat `#channel%irc.network.tld@irc.disroot.org`, with a chosen nick.
|
||||
2. You'll get messages from `irc.network.tld@irc.disroot.org`. If your nick is registered, send message `NickServ IDENTIFY password`.
|
||||
3. Start chatting in `#channel`.
|
||||
|
||||
Repeat 1 and 3, for different channel on same network.
|
||||
|
||||
Repeat 1 to 3, for different channel on different network.
|
||||
|
||||
### For long-term/recurring
|
||||
|
||||
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 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.
|
||||
7. Start chatting in `#channel`.
|
||||
|
||||
Repeat 5 to 7, if joining different channel on same network.
|
||||
|
||||
Repeat 3 to 7, if joining different channel on different network.
|
||||
|
||||
## CLIENTS
|
||||
|
||||
Any client can be used, although only following clients are known to support ad-hoc commands.
|
||||
|
||||
### Gajim
|
||||
|
||||
1. Right-click on the roster element.
|
||||
2. Click 'Execute Command'.
|
||||
3. Follow the options.
|
|
@ -1,23 +0,0 @@
|
|||
---
|
||||
title: 'Chat: Transports'
|
||||
published: true
|
||||
visible: true
|
||||
indexed: true
|
||||
updated:
|
||||
taxonomy:
|
||||
category:
|
||||
- docs
|
||||
tags:
|
||||
- chat
|
||||
- xmpp
|
||||
page-toc:
|
||||
active: true
|
||||
---
|
||||
|
||||
# XMPP Transports
|
||||
|
||||
In XMPP realm, transports are the means to connect to different protocols.
|
||||
|
||||
Currently, Disroot Chat provides following transports:
|
||||
|
||||
1. [IRC](https://howto.disroot.org/en/tutorials/chat/transports/irc)
|
|
@ -1,5 +1,5 @@
|
|||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{{ page.content|raw }}
|
||||
{{ page.content }}
|
||||
{% endblock %}
|
||||
|
|
|
@ -35,14 +35,14 @@
|
|||
{% include 'partials/docmeta.html.twig' %}
|
||||
|
||||
<section class="index content narrow">
|
||||
{{ page.content|raw }}
|
||||
{{ page.content }}
|
||||
<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|raw }}
|
||||
{{ p.media.images|first.html }}
|
||||
{% endif %}
|
||||
<h6>{{ p.title }}</h6>
|
||||
</a>
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
{% block content %}
|
||||
<div class="lead text-center">
|
||||
<h1>Error!</h1>
|
||||
{{ page.content|raw }}
|
||||
{{ page.content }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
{% set colsize = ['seven', 'five'] %}
|
||||
<section id="{{ page.header.section_id }}" class="row columns">
|
||||
<div class="{{ colsize[0] }} columns">
|
||||
{{ page.content|raw }}
|
||||
{{ page.content }}
|
||||
</div>
|
||||
<div class="{{ colsize[1] }} columns topic-list">
|
||||
{% for p in page.collection %}
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
{% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %}
|
||||
|
||||
{% block content %}
|
||||
{{ page.content|raw }}
|
||||
{{ page.content }}
|
||||
<div id="content">
|
||||
{% for module in page.collection() %}
|
||||
{{ module.content|raw }}
|
||||
{{ module.content }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
{% do assets.addCss('theme://css/style.css') %}
|
||||
{% do assets.addCss('theme://css/media-queries.css') %}
|
||||
{% endblock %}
|
||||
{{ assets.css()|raw }}
|
||||
{{ assets.css() }}
|
||||
|
||||
{% block javascripts %}
|
||||
{% block javascripts %}
|
||||
{% do assets.addJs('jquery', 100) %}
|
||||
{% do assets.addJs('theme://js/howto.js', { group:'bottom' }) %}
|
||||
{% endblock %}
|
||||
{{ assets.js()|raw }}
|
||||
{{ assets.js() }}
|
||||
|
||||
{% endblock head%}
|
||||
</head>
|
||||
|
|
|
@ -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/debian10"
|
||||
howto_disroot_lan.vm.box="generic/debian9"
|
||||
howto_disroot_lan.vm.hostname = 'howto.disroot.lan'
|
||||
howto_disroot_lan.vm.box_url = "generic/debian10"
|
||||
howto_disroot_lan.vm.box_url = "generic/debian9"
|
||||
|
||||
howto_disroot_lan.vm.synced_folder "provision/", "/vagrant/provision/"
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ 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
|
||||
|
||||
|
@ -13,14 +12,11 @@ GRAV_VERSION="1.6.18"
|
|||
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 PHP7.4
|
||||
echo "set grub-pc/install_devices /dev/sda" | debconf-communicate # Fix grub error
|
||||
# Add sury repository to sources.list for PHP
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y dist-upgrade
|
||||
sudo apt-get -y upgrade
|
||||
sudo apt-get -y install ca-certificates apt-transport-https
|
||||
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
|
||||
echo "deb https://packages.sury.org/php/ stretch main" | sudo tee -a /etc/apt/sources.list.d/php.list
|
||||
|
||||
# Sury Key for PHP7.4
|
||||
wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
|
||||
|
@ -36,61 +32,30 @@ 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/
|
||||
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 ln -s /etc/nginx/sites-available/"${WEB_NAME}".conf /etc/nginx/sites-enabled/"${WEB_NAME}".conf
|
||||
sudo rm /etc/nginx/sites-enabled/default
|
||||
sudo service nginx restart
|
||||
|
||||
# Install GRAV in webroot
|
||||
echo "Installing GRAV..."
|
||||
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}"
|
||||
|
||||
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"
|
||||
echo "enter git"
|
||||
cd "${WEB_ROOT}""${WEB_NAME}"
|
||||
|
||||
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
|
||||
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}" sed -i 's/quark/grav-theme-howto/g' "${YAML}"
|
||||
|
||||
# Add Grav config
|
||||
|
@ -113,7 +78,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 # sed is missing, but creates an error anyway as "markdown: extra: true" gives an error
|
||||
sudo -u "${WWW_USER}" -i 's/false/true/g' "${WEB_ROOT}""${WEB_NAME}"/user/plugins/language-selector/language-selector.yaml
|
||||
|
||||
# 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
|
||||
|
|