Skip to content
Snippets Groups Projects
Commit 3bccb951 authored by ale's avatar ale
Browse files

Merge branch 'bozze' into 'master'

Bozze

See merge request ai/website!7
parents 08ece6e1 a7c63f51
Branches
No related tags found
No related merge requests found
...@@ -11,12 +11,10 @@ It is **very important** you set your answer before losing the password! (we sug ...@@ -11,12 +11,10 @@ It is **very important** you set your answer before losing the password! (we sug
How to recover your password How to recover your password
---------------------------- ----------------------------
### Step 1 - Click on "Have you forgotten your password?" in the login form ### Step 1 - Click on "Forgot your password?" in the login form
Go to the [login](https://accounts.autistici.org) page, insert your username and a Go to the [login](https://accounts.autistici.org) page and click on
password (that will be wrong, because you don't remember it), and try to log in. "Forgot your password?" under the login form.
A message with "Have you forgotten your password?" will appear in the login
page, just under the form. Click on it to go to the recovery question.
### Step 2 - Answer your recover question ### Step 2 - Answer your recover question
......
...@@ -10,7 +10,7 @@ Dato che la domanda di default riguarda gli animali domestici il servizio si chi ...@@ -10,7 +10,7 @@ Dato che la domanda di default riguarda gli animali domestici il servizio si chi
Ovviamente è <u>importantissimo</u> impostare la propria risposta prima di perdere la password! Ovviamente è <u>importantissimo</u> impostare la propria risposta prima di perdere la password!
Si imposta attraverso il [pannello utente](https://accounts.autistici.org) Si imposta attraverso il [pannello utente](/pannello/)
- - - - - -
......
...@@ -205,19 +205,41 @@ If you're using a Gitlab instance to manage the sources of your static ...@@ -205,19 +205,41 @@ If you're using a Gitlab instance to manage the sources of your static
website, you might find it convenient to automatically upload new website, you might find it convenient to automatically upload new
versions of the site on every change. You can use the versions of the site on every change. You can use the
[webdav-upload](https://git.autistici.org/ai3/tools/webdav-upload) [webdav-upload](https://git.autistici.org/ai3/tools/webdav-upload)
tool to upload your website, or the result of your site rendering tool to upload your website through Gitlab's continuous integration.
process, with a `.gitlab-ci.yml` file such as the following:
```yaml To do so, you will need to add the following lines to your `.gitlab-ci.yml` file:
1. You will need pip3 to be installed in your runner, so if python3-pip doesn't come installed by default in the Docker image you're using in your `.gitlab-ci.yml` script, you will need to install it first thing. Assuming you're using a Debian image, this would be the first command in your script:
- apt-get update -y && apt-get install -yq python3-pip
1. Install webdav_upload in your runner with the following command:
pip3 install git+https://git.autistici.org/ai3/tools/webdav-upload#egg=webdav_upload
2. Upload your website with the following command:
webdav-upload --user="$WEBDAV_USER" --password="$WEBDAV_PASSWORD" --url "https://www.autistici.org/dav/$WEBDAV_USER/" output-folder html-yourwebsite
In the above command, replace the following:
- `output-folder` should be the name of the folder where your website is generated within the Gitlab runner.
- `html-yourwebsite` should be replaced by the name of the folder in your webspace, so if your website is inventati.org/foo, your folder name will be `html-foo`.
- You can store your user name and password as variables in your Gitlab CI / CD settings. In the above command, the variables are called WEBDAV_USER and WEBDAV_PASSWORD.
**We strongly recommend you use this method, rather than adding the user name and password to your script, especially if your repository is publicly accessible!**
What follows is an example of a full script:
```
production: production:
stage: deploy stage: deploy
script: script:
- ./build-website.sh - apt-get update -y && apt-get install -yq python3-pip
- pip3 install git+https://git.autistici.org/ai3/tools/webdav-upload#egg=webdav_upload - pip3 install git+https://git.autistici.org/ai3/tools/webdav-upload#egg=webdav_upload
- webdav-upload --user="$WEBDAV_USER" --password="$WEBDAV_PASSWORD" --url "https://www.autistici.org/dav/$WEBDAV_USER/" output html-mywebsite - jekyll build -d output-folder
# we assume you are building your website with jekyll and the
# output is stored in a folder called `output-folder` - but you can use
# whatever system you prefer to build your website
- webdav-upload --user="$WEBDAV_USER" --password="$WEBDAV_PASSWORD" --url "https://www.autistici.org/dav/$WEBDAV_USER/" output-folder html-yourwebsite
``` ```
\ No newline at end of file
In the above example the site is built with the hypothetical
*build-website.sh* script, then the contents of the *output* directory
are uploaded to the *html-mywebsite* directory on the server, in the
WebDAV space belonging to WEBDAV_USER.
...@@ -200,3 +200,49 @@ Potete collegarvi usando la App **"WebDAV Nav"** (gratuita ed a pagamento) che t ...@@ -200,3 +200,49 @@ Potete collegarvi usando la App **"WebDAV Nav"** (gratuita ed a pagamento) che t
4. Cliccate sul pulsante "Salva". 4. Cliccate sul pulsante "Salva".
5. Nella finestra adesso vi compare il nome che avete scelto, cliccateci sopra e se vi compare una schermata con delle cartelle azzurre 5. Nella finestra adesso vi compare il nome che avete scelto, cliccateci sopra e se vi compare una schermata con delle cartelle azzurre
significa che vi siete collegati. significa che vi siete collegati.
Gitlab CI
---
Se usate un'istanza Gitlab per generare un sito statico, probabilmente
vi conviene aggiornare automaticamente il sito ogni volta che modificate
la vostra repository. Per farlo, potete usare [webdav-upload](https://git.autistici.org/ai3/tools/webdav-upload), che vi permette di caricare
i file nel vostro spazio web attraverso la continuous integration di Gitlab.
Per farlo, dovrete aggiungere i seguenti comandi al vostro file `.gitlab-ci.yml`:
1. Per installare webdav-upload avrete bisogno di pip3, quindi se python3-pip non è installato di default nell'immagine Docker che usate nel vostro script `.gitlab-ci.yml`, per prima cosa dovrete installare questo pacchetto. Se per esempio state usando un'immagine Debian, il primo comando del vostro script dovrà essere:
- apt-get update -y && apt-get install -yq python3-pip
1. A questo punto potete installare webdav_upload con il comando:
pip3 install git+https://git.autistici.org/ai3/tools/webdav-upload#egg=webdav_upload
2. Infine, caricate i file del vostro sito statico nel vostro spazio web con il seguente comando:
webdav-upload --user="$WEBDAV_USER" --password="$WEBDAV_PASSWORD" --url "https://www.autistici.org/dav/$WEBDAV_USER/" output-folder html-yourwebsite
In questo comando, dovrete sostituire alcuni elementi:
- `output-folder` va sostituito con il nome del folder in cui viene generato il sito nel Gitlab runner.
- `html-yourwebsite` va sostituito con il nome della cartella nel vostro spazio web. Per esempio, se il vostro sito si trova all'indirizzo inventati.org/foo, il nome della cartella sarà `html-foo`.
- Potete salvare il vostro nome utente e la vostra password come variabili nei setting della vostra CI (Settings -> CI/CD -> Variables). Nel comando riportato sopra, il nome delle due variabili è WEBDAV_USER per il nome utente e WEBDAV_PASSWORD per la password.
**È importante usare questo metodo per il nome utente e la password, che non dovrebbero essere incluse nello script, soprattutto se la vostra repository è pubblica!**
Di seguito, uno script di esempio:
```
production:
stage: deploy
script:
- apt-get update -y && apt-get install -yq python3-pip
- pip3 install git+https://git.autistici.org/ai3/tools/webdav-upload#egg=webdav_upload
- jekyll build -d output-folder
# qui stiamo immaginando che usiate jekyll per generare il vostro sito e
# che salviate i file generati in una cartella chiamata `output-folder`,
# ma potete generare il sito con qualunque sistema per generare siti statici
- webdav-upload --user="$WEBDAV_USER" --password="$WEBDAV_PASSWORD" --url "https://www.autistici.org/dav/$WEBDAV_USER/" output-folder html-yourwebsite
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment