mirror of
https://github.com/YunoHost-Apps/gotosocial_ynh.git
synced 2024-09-03 19:16:06 +02:00
v2
This commit is contained in:
parent
ac10b87996
commit
ef4b1659e4
18 changed files with 86 additions and 986 deletions
154
.github/workflows/updater.sh
vendored
154
.github/workflows/updater.sh
vendored
|
@ -1,154 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# PACKAGE UPDATING HELPER
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# This script is meant to be run by GitHub Actions
|
|
||||||
# The YunoHost-Apps organisation offers a template Action to run this script periodically
|
|
||||||
# Since each app is different, maintainers can adapt its contents so as to perform
|
|
||||||
# automatic actions when a new upstream release is detected.
|
|
||||||
|
|
||||||
# Remove this exit command when you are ready to run this Action
|
|
||||||
# exit 1
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# FETCHING LATEST RELEASE AND ITS ASSETS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Fetching information
|
|
||||||
current_version=$(jq -j '.version|split("~")[0]' manifest.json)
|
|
||||||
repo=$(jq -j '.upstream.code|split("https://github.com/")[1]' manifest.json)
|
|
||||||
# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions)
|
|
||||||
version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1)
|
|
||||||
assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'"$version"'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'"))
|
|
||||||
|
|
||||||
# Later down the script, we assume the version has only digits and dots
|
|
||||||
# Sometimes the release name starts with a "v", so let's filter it out.
|
|
||||||
# You may need more tweaks here if the upstream repository has different naming conventions.
|
|
||||||
if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then
|
|
||||||
version=${version:1}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Setting up the environment variables
|
|
||||||
echo "Current version: $current_version"
|
|
||||||
echo "Latest release from upstream: $version"
|
|
||||||
{ echo "VERSION=$version"; echo "REPO=$repo"; } >> "$GITHUB_ENV"
|
|
||||||
# For the time being, let's assume the script will fail
|
|
||||||
echo "PROCEED=false" >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
# Proceed only if the retrieved version is greater than the current one
|
|
||||||
if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then
|
|
||||||
echo "::warning ::No new version available"
|
|
||||||
exit 0
|
|
||||||
# Proceed only if the retrieved version is not a release candidate
|
|
||||||
elif [[ "$version" == *"rc"* ]] ; then
|
|
||||||
echo "::warning ::No new version available"
|
|
||||||
exit 0
|
|
||||||
# Proceed only if a PR for this new version does not already exist
|
|
||||||
elif git ls-remote -q --exit-code --heads https://github.com/"$GITHUB_REPOSITORY".git ci-auto-update-v"$version" ; then
|
|
||||||
echo "::warning ::A branch already exists for this update"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.)
|
|
||||||
echo "${#assets[@]} available asset(s)"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# UPDATE SOURCE FILES
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Here we use the $assets variable to get the resources published in the upstream release.
|
|
||||||
# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like.
|
|
||||||
|
|
||||||
# Create the temporary directory
|
|
||||||
tempdir="$(mktemp -d)"
|
|
||||||
|
|
||||||
# Download checksums.txt
|
|
||||||
checksum_file=https://github.com/"$repo"/releases/download/v"$version"/checksums.txt
|
|
||||||
echo "Downloading checksums file at" "$checksum_file"
|
|
||||||
curl --silent -4 -L "$checksum_file" -o "$tempdir/checksums.txt"
|
|
||||||
|
|
||||||
# Let's loop over the array of assets URLs
|
|
||||||
for asset_url in "${assets[@]}"; do
|
|
||||||
|
|
||||||
echo "Handling asset at $asset_url"
|
|
||||||
|
|
||||||
# Assign the asset to a source file in conf/ directory
|
|
||||||
# Here we base the source file name upon a unique keyword in the assets url (admin vs. update)
|
|
||||||
# Leave $src empty to ignore the asset
|
|
||||||
case $asset_url in
|
|
||||||
*"linux_386"*)
|
|
||||||
src="i386"
|
|
||||||
;;
|
|
||||||
*"linux_amd64"*)
|
|
||||||
src="x86-64"
|
|
||||||
;;
|
|
||||||
*"linux_arm64"*)
|
|
||||||
src="arm64"
|
|
||||||
;;
|
|
||||||
*"linux_armv6"*)
|
|
||||||
src="armv6"
|
|
||||||
;;
|
|
||||||
*"linux_armv7"*)
|
|
||||||
src="armv7"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
src=""
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# If $src is not empty, let's process the asset
|
|
||||||
if [ -n "$src" ]; then
|
|
||||||
|
|
||||||
# Get checksum
|
|
||||||
filename=${asset_url##*/}
|
|
||||||
checksum=$(grep "$filename" "$tempdir/checksums.txt" | awk '{print $1;}')
|
|
||||||
|
|
||||||
# Get extension
|
|
||||||
if [[ $filename == *.tar.gz ]]; then
|
|
||||||
extension=tar.gz
|
|
||||||
else
|
|
||||||
extension=${filename##*.}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Rewrite source file
|
|
||||||
cat <<EOT > "conf/$src.src"
|
|
||||||
SOURCE_URL=$asset_url
|
|
||||||
SOURCE_SUM=$checksum
|
|
||||||
SOURCE_SUM_PRG=sha256sum
|
|
||||||
SOURCE_FORMAT=$extension
|
|
||||||
SOURCE_EXTRACT=true
|
|
||||||
SOURCE_IN_SUBDIR=false
|
|
||||||
SOURCE_FILENAME=$filename
|
|
||||||
EOT
|
|
||||||
echo "... conf/$src.src updated"
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "... asset ignored"
|
|
||||||
fi
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
# Delete temporary directory
|
|
||||||
rm -rf "$tempdir"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC UPDATE STEPS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Any action on the app's source code can be done.
|
|
||||||
# The GitHub Action workflow takes care of committing all changes after this script ends.
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Replace new version in manifest
|
|
||||||
echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json
|
|
||||||
|
|
||||||
# No need to update the README, yunohost-bot takes care of it
|
|
||||||
|
|
||||||
# The Action will proceed only if the PROCEED environment variable is set to true
|
|
||||||
echo "PROCEED=true" >> "$GITHUB_ENV"
|
|
||||||
exit 0
|
|
51
.github/workflows/updater.yml
vendored
51
.github/workflows/updater.yml
vendored
|
@ -1,51 +0,0 @@
|
||||||
# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected.
|
|
||||||
# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization.
|
|
||||||
# This file should be enough by itself, but feel free to tune it to your needs.
|
|
||||||
# It calls updater.sh, which is where you should put the app-specific update steps.
|
|
||||||
name: Check for new upstream releases
|
|
||||||
on:
|
|
||||||
# Allow to manually trigger the workflow
|
|
||||||
workflow_dispatch:
|
|
||||||
# Run it every day at 6:00 UTC
|
|
||||||
schedule:
|
|
||||||
- cron: '0 6 * * *'
|
|
||||||
jobs:
|
|
||||||
updater:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Fetch the source code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
ref: 'testing'
|
|
||||||
- name: Run the updater script
|
|
||||||
id: run_updater
|
|
||||||
run: |
|
|
||||||
# Setting up Git user
|
|
||||||
git config --global user.name 'yunohost-bot'
|
|
||||||
git config --global user.email 'yunohost-bot@users.noreply.github.com'
|
|
||||||
# Run the updater script
|
|
||||||
/bin/bash .github/workflows/updater.sh
|
|
||||||
- name: Commit changes
|
|
||||||
id: commit
|
|
||||||
if: ${{ env.PROCEED == 'true' }}
|
|
||||||
run: |
|
|
||||||
git commit -am "Upgrade to v$VERSION"
|
|
||||||
- name: Create Pull Request
|
|
||||||
id: cpr
|
|
||||||
if: ${{ env.PROCEED == 'true' }}
|
|
||||||
uses: peter-evans/create-pull-request@v4
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
commit-message: Update to version ${{ env.VERSION }}
|
|
||||||
committer: 'yunohost-bot <yunohost-bot@users.noreply.github.com>'
|
|
||||||
author: 'yunohost-bot <yunohost-bot@users.noreply.github.com>'
|
|
||||||
signoff: false
|
|
||||||
base: testing
|
|
||||||
branch: ci-auto-update-v${{ env.VERSION }}
|
|
||||||
delete-branch: true
|
|
||||||
title: 'Upgrade to version ${{ env.VERSION }}'
|
|
||||||
body: |
|
|
||||||
Upgrade to v${{ env.VERSION }}
|
|
||||||
Changelog: https://github.com/${{ env.REPO }}/releases/tag/v${{ env.VERSION }}
|
|
||||||
draft: false
|
|
|
@ -24,7 +24,7 @@ location __PATH__/ {
|
||||||
# media caching stuff
|
# media caching stuff
|
||||||
# https://docs.gotosocial.org/en/latest/advanced/caching/assets-media/#nginx
|
# https://docs.gotosocial.org/en/latest/advanced/caching/assets-media/#nginx
|
||||||
location /assets/ {
|
location /assets/ {
|
||||||
alias __FINAL_PATH__/web/assets/;
|
alias __INSTALL_DIR__/web/assets/;
|
||||||
autoindex off;
|
autoindex off;
|
||||||
# 300 = 5 minutes
|
# 300 = 5 minutes
|
||||||
more_set_headers "Cache-control: public, max-age=300";
|
more_set_headers "Cache-control: public, max-age=300";
|
||||||
|
|
|
@ -22,7 +22,7 @@ help = "Config pertaining to creation and maintenance of accounts on the server,
|
||||||
[main.accounts.accounts_registration_open]
|
[main.accounts.accounts_registration_open]
|
||||||
ask.en = "Open registrations?"
|
ask.en = "Open registrations?"
|
||||||
ask.fr = "Inscriptions ouvertes ?"
|
ask.fr = "Inscriptions ouvertes ?"
|
||||||
bind = "accounts-registration-open:__FINALPATH__/config.yaml"
|
bind = "accounts-registration-open:__INSTALL_DIR__/config.yaml"
|
||||||
choices = ["true", "false"]
|
choices = ["true", "false"]
|
||||||
default = "false"
|
default = "false"
|
||||||
help.en = "Do we want people to be able to just submit sign up requests, or do we want invite only?"
|
help.en = "Do we want people to be able to just submit sign up requests, or do we want invite only?"
|
||||||
|
@ -32,7 +32,7 @@ type = "select"
|
||||||
[main.accounts.accounts_approval_required]
|
[main.accounts.accounts_approval_required]
|
||||||
ask.en = "Approval required?"
|
ask.en = "Approval required?"
|
||||||
ask.fr = "Validation requise ?"
|
ask.fr = "Validation requise ?"
|
||||||
bind = "accounts-approval-required:__FINALPATH__/config.yaml"
|
bind = "accounts-approval-required:__INSTALL_DIR__/config.yaml"
|
||||||
choices = ["true", "false"]
|
choices = ["true", "false"]
|
||||||
default = "true"
|
default = "true"
|
||||||
help.en = "Do sign up requests require approval from an admin/moderator before an account can sign in/use the server?"
|
help.en = "Do sign up requests require approval from an admin/moderator before an account can sign in/use the server?"
|
||||||
|
@ -42,7 +42,7 @@ type = "select"
|
||||||
[main.accounts.accounts_reason_required]
|
[main.accounts.accounts_reason_required]
|
||||||
ask.en = "Reason required?"
|
ask.en = "Reason required?"
|
||||||
ask.fr = "Motif requis ?"
|
ask.fr = "Motif requis ?"
|
||||||
bind = "accounts-reason-required:__FINALPATH__/config.yaml"
|
bind = "accounts-reason-required:__INSTALL_DIR__/config.yaml"
|
||||||
choices = ["true", "false"]
|
choices = ["true", "false"]
|
||||||
default = "true"
|
default = "true"
|
||||||
help.en = "Are sign up requests required to submit a reason for the request (eg., an explanation of why they want to join the instance)?"
|
help.en = "Are sign up requests required to submit a reason for the request (eg., an explanation of why they want to join the instance)?"
|
||||||
|
@ -52,7 +52,7 @@ type = "select"
|
||||||
[main.accounts.accounts_allow_custom_css]
|
[main.accounts.accounts_allow_custom_css]
|
||||||
ask.en = "Allow custom CSS?"
|
ask.en = "Allow custom CSS?"
|
||||||
ask.fr = "Autoriser le CSS personnalisé ?"
|
ask.fr = "Autoriser le CSS personnalisé ?"
|
||||||
bind = "accounts-allow-custom-css:__FINALPATH__/config.yaml"
|
bind = "accounts-allow-custom-css:__INSTALL_DIR__/config.yaml"
|
||||||
choices = ["true", "false"]
|
choices = ["true", "false"]
|
||||||
default = "false"
|
default = "false"
|
||||||
help.en = """Allow accounts on this instance to set custom CSS for their profile pages and statuses.\
|
help.en = """Allow accounts on this instance to set custom CSS for their profile pages and statuses.\
|
||||||
|
@ -68,7 +68,7 @@ type = "select"
|
||||||
[main.accounts.accounts_custom_css_length]
|
[main.accounts.accounts_custom_css_length]
|
||||||
ask.en = "Custom CSS length?"
|
ask.en = "Custom CSS length?"
|
||||||
ask.fr = "Longueur du CSS personnalisé ?"
|
ask.fr = "Longueur du CSS personnalisé ?"
|
||||||
bind = "accounts-custom-css-length:__FINALPATH__/config.yaml"
|
bind = "accounts-custom-css-length:__INSTALL_DIR__/config.yaml"
|
||||||
default = "10000"
|
default = "10000"
|
||||||
help.en = "If accounts-allow-custom-css is 'true', this is the permitted length in characters for CSS uploaded by accounts on this instance. No effect if accounts-allow-custom-css is 'false'. Default: 10000"
|
help.en = "If accounts-allow-custom-css is 'true', this is the permitted length in characters for CSS uploaded by accounts on this instance. No effect if accounts-allow-custom-css is 'false'. Default: 10000"
|
||||||
help.fr = "Si accounts-allow-custom-css est 'true', il s'agit de la longueur autorisée en caractères pour les feuilles de style CSS qui sont fournies par les comptes sur cette instance. Aucun effet si accounts-allow-custom-css est 'false'. Valeur par défaut : 10000"
|
help.fr = "Si accounts-allow-custom-css est 'true', il s'agit de la longueur autorisée en caractères pour les feuilles de style CSS qui sont fournies par les comptes sur cette instance. Aucun effet si accounts-allow-custom-css est 'false'. Valeur par défaut : 10000"
|
||||||
|
@ -86,7 +86,7 @@ help = "Config pertaining to user media uploads (videos, image, image descriptio
|
||||||
[main.media.media_image_max_size]
|
[main.media.media_image_max_size]
|
||||||
ask.en = "Maximum allowed image upload size in bytes."
|
ask.en = "Maximum allowed image upload size in bytes."
|
||||||
ask.fr = "Taille maximale autorisée pour le téléchargement d'images, en octets."
|
ask.fr = "Taille maximale autorisée pour le téléchargement d'images, en octets."
|
||||||
bind = "media-image-max-size:__FINALPATH__/config.yaml"
|
bind = "media-image-max-size:__INSTALL_DIR__/config.yaml"
|
||||||
default = "2097152"
|
default = "2097152"
|
||||||
help.en = "Default: 2097152 -- aka 2MB"
|
help.en = "Default: 2097152 -- aka 2MB"
|
||||||
help.fr = "Valeur par défaut : 2097152 (soit 2 Mo)"
|
help.fr = "Valeur par défaut : 2097152 (soit 2 Mo)"
|
||||||
|
@ -95,7 +95,7 @@ type = "number"
|
||||||
[main.media.media_video_max_size]
|
[main.media.media_video_max_size]
|
||||||
ask.en = "Maximum allowed video upload size in bytes."
|
ask.en = "Maximum allowed video upload size in bytes."
|
||||||
ask.fr = "Taille maximale autorisée pour le téléchargement de vidéos, en octets."
|
ask.fr = "Taille maximale autorisée pour le téléchargement de vidéos, en octets."
|
||||||
bind = "media-video-max-size:__FINALPATH__/config.yaml"
|
bind = "media-video-max-size:__INSTALL_DIR__/config.yaml"
|
||||||
default = "10485760"
|
default = "10485760"
|
||||||
help.en = "Default: 10485760 -- aka 10MB"
|
help.en = "Default: 10485760 -- aka 10MB"
|
||||||
help.fr = "Valeur par défaut : 10485760 (soit 10 Mo)"
|
help.fr = "Valeur par défaut : 10485760 (soit 10 Mo)"
|
||||||
|
@ -104,7 +104,7 @@ type = "number"
|
||||||
[main.media.media_description_min_chars]
|
[main.media.media_description_min_chars]
|
||||||
ask.en = "Minimum amount of characters required as an image or video description."
|
ask.en = "Minimum amount of characters required as an image or video description."
|
||||||
ask.fr = "Nombre minimum de caractères requis pour la description d'une image ou d'une vidéo."
|
ask.fr = "Nombre minimum de caractères requis pour la description d'une image ou d'une vidéo."
|
||||||
bind = "media-description-min-chars:__FINALPATH__/config.yaml"
|
bind = "media-description-min-chars:__INSTALL_DIR__/config.yaml"
|
||||||
default = "0"
|
default = "0"
|
||||||
help.en = "Default: 0 (not required)"
|
help.en = "Default: 0 (not required)"
|
||||||
help.fr = "Valeur par défaut : 0 (non obligatoire)"
|
help.fr = "Valeur par défaut : 0 (non obligatoire)"
|
||||||
|
@ -113,7 +113,7 @@ type = "number"
|
||||||
[main.media.media_description_max_chars]
|
[main.media.media_description_max_chars]
|
||||||
ask.en = "Maximum amount of characters permitted in an image or video description."
|
ask.en = "Maximum amount of characters permitted in an image or video description."
|
||||||
ask.fr = "Nombre maximum de caractères requis pour la description d'une image ou d'une vidéo."
|
ask.fr = "Nombre maximum de caractères requis pour la description d'une image ou d'une vidéo."
|
||||||
bind = "media-description-max-chars:__FINALPATH__/config.yaml"
|
bind = "media-description-max-chars:__INSTALL_DIR__/config.yaml"
|
||||||
default = "500"
|
default = "500"
|
||||||
help.en = "Default: 500"
|
help.en = "Default: 500"
|
||||||
help.fr = "Valeur par défaut : 500"
|
help.fr = "Valeur par défaut : 500"
|
||||||
|
@ -122,7 +122,7 @@ type = "number"
|
||||||
[main.media.media_remote_cache_days]
|
[main.media.media_remote_cache_days]
|
||||||
ask.en = "Number of days to cache media from remote instances before they are removed from the cache."
|
ask.en = "Number of days to cache media from remote instances before they are removed from the cache."
|
||||||
ask.fr = "Nombre de jours de mise en cache des médias des instances distantes avant qu'ils ne soient retirés du cache."
|
ask.fr = "Nombre de jours de mise en cache des médias des instances distantes avant qu'ils ne soient retirés du cache."
|
||||||
bind = "media-remote-cache-days:__FINALPATH__/config.yaml"
|
bind = "media-remote-cache-days:__INSTALL_DIR__/config.yaml"
|
||||||
default = "30"
|
default = "30"
|
||||||
help.en = """Default: 30\
|
help.en = """Default: 30\
|
||||||
A job will run every day at midnight to clean up any remote media older than the given amount of days. \
|
A job will run every day at midnight to clean up any remote media older than the given amount of days. \
|
||||||
|
@ -139,7 +139,7 @@ type = "number"
|
||||||
[main.media.media_emoji_local_max_size]
|
[main.media.media_emoji_local_max_size]
|
||||||
ask.en = "Max size in bytes of emojis uploaded to this instance via the admin API."
|
ask.en = "Max size in bytes of emojis uploaded to this instance via the admin API."
|
||||||
ask.fr = "Taille maximale en octets des emojis téléchargés vers cette instance via l'API d'administration."
|
ask.fr = "Taille maximale en octets des emojis téléchargés vers cette instance via l'API d'administration."
|
||||||
bind = "media-emoji-local-max-size:__FINALPATH__/config.yaml"
|
bind = "media-emoji-local-max-size:__INSTALL_DIR__/config.yaml"
|
||||||
default = "51200"
|
default = "51200"
|
||||||
help.en = """Default: 51200\
|
help.en = """Default: 51200\
|
||||||
The default is the same as the Mastodon size limit for emojis (50kb), which allows for good interoperability.\
|
The default is the same as the Mastodon size limit for emojis (50kb), which allows for good interoperability.\
|
||||||
|
@ -152,7 +152,7 @@ type = "number"
|
||||||
[main.media.media_emoji_remote_max_size]
|
[main.media.media_emoji_remote_max_size]
|
||||||
ask.en = "Max size in bytes of emojis to download from other instances."
|
ask.en = "Max size in bytes of emojis to download from other instances."
|
||||||
ask.fr = "Taille maximale en octets des emojis téléchargeables à partir d'autres instances."
|
ask.fr = "Taille maximale en octets des emojis téléchargeables à partir d'autres instances."
|
||||||
bind = "media-emoji-remote-max-size:__FINALPATH__/config.yaml"
|
bind = "media-emoji-remote-max-size:__INSTALL_DIR__/config.yaml"
|
||||||
default = "102400"
|
default = "102400"
|
||||||
help.en = """Default: 102400\
|
help.en = """Default: 102400\
|
||||||
By default this is 100kb, or twice the size of the default for media-emoji-local-max-size.\
|
By default this is 100kb, or twice the size of the default for media-emoji-local-max-size.\
|
||||||
|
@ -174,7 +174,7 @@ help = "Config pertaining to the creation of statuses/posts, and permitted limit
|
||||||
[main.statuses.statuses_max_chars]
|
[main.statuses.statuses_max_chars]
|
||||||
ask.en = "Maximum amount of characters permitted for a new status."
|
ask.en = "Maximum amount of characters permitted for a new status."
|
||||||
ask.fr = "Nombre maximal de caractères autorisés pour un nouveau statut."
|
ask.fr = "Nombre maximal de caractères autorisés pour un nouveau statut."
|
||||||
bind = "statuses-max-chars:__FINALPATH__/config.yaml"
|
bind = "statuses-max-chars:__INSTALL_DIR__/config.yaml"
|
||||||
default = "5000"
|
default = "5000"
|
||||||
help.en = "Default: 5000. Note that going way higher than the default might break federation."
|
help.en = "Default: 5000. Note that going way higher than the default might break federation."
|
||||||
help.fr = "Valeur par défaut : 5000. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
|
help.fr = "Valeur par défaut : 5000. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
|
||||||
|
@ -183,7 +183,7 @@ type = "number"
|
||||||
[main.statuses.statuses_cw_max_chars]
|
[main.statuses.statuses_cw_max_chars]
|
||||||
ask.en = "Maximum amount of characters allowed in the CW/subject header of a status."
|
ask.en = "Maximum amount of characters allowed in the CW/subject header of a status."
|
||||||
ask.fr = "Nombre maximum de caractères autorisés dans l'en-tête CW/sujet d'un statut."
|
ask.fr = "Nombre maximum de caractères autorisés dans l'en-tête CW/sujet d'un statut."
|
||||||
bind = "statuses-cw-max-chars:__FINALPATH__/config.yaml"
|
bind = "statuses-cw-max-chars:__INSTALL_DIR__/config.yaml"
|
||||||
default = "100"
|
default = "100"
|
||||||
help.en = "Default: 100. Note that going way higher than the default might break federation."
|
help.en = "Default: 100. Note that going way higher than the default might break federation."
|
||||||
help.fr = "Valeur par défaut : 100. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
|
help.fr = "Valeur par défaut : 100. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
|
||||||
|
@ -192,7 +192,7 @@ type = "number"
|
||||||
[main.statuses.statuses_poll_max_options]
|
[main.statuses.statuses_poll_max_options]
|
||||||
ask.en = "Maximum amount of options to permit when creating a new poll."
|
ask.en = "Maximum amount of options to permit when creating a new poll."
|
||||||
ask.fr = "Nombre maximum d'options autorisées lors de la création d'un nouveau sondage."
|
ask.fr = "Nombre maximum d'options autorisées lors de la création d'un nouveau sondage."
|
||||||
bind = "statuses-poll-max-options:__FINALPATH__/config.yaml"
|
bind = "statuses-poll-max-options:__INSTALL_DIR__/config.yaml"
|
||||||
default = "6"
|
default = "6"
|
||||||
help.en = "Default: 6. Note that going way higher than the default might break federation."
|
help.en = "Default: 6. Note that going way higher than the default might break federation."
|
||||||
help.fr = "Valeur par défaut : 6. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
|
help.fr = "Valeur par défaut : 6. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
|
||||||
|
@ -201,7 +201,7 @@ type = "number"
|
||||||
[main.statuses.statuses_poll_option_max_chars]
|
[main.statuses.statuses_poll_option_max_chars]
|
||||||
ask.en = "Maximum amount of characters to permit per poll option when creating a new poll."
|
ask.en = "Maximum amount of characters to permit per poll option when creating a new poll."
|
||||||
ask.fr = "Nombre maximal de caractères autorisés par option de sondage lors de la création d'un nouveau sondage."
|
ask.fr = "Nombre maximal de caractères autorisés par option de sondage lors de la création d'un nouveau sondage."
|
||||||
bind = "statuses-poll-option-max-chars:__FINALPATH__/config.yaml"
|
bind = "statuses-poll-option-max-chars:__INSTALL_DIR__/config.yaml"
|
||||||
default = "50"
|
default = "50"
|
||||||
help.en = "Default: 50. Note that going way higher than the default might break federation."
|
help.en = "Default: 50. Note that going way higher than the default might break federation."
|
||||||
help.fr = "Valeur par défaut : 50. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
|
help.fr = "Valeur par défaut : 50. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
|
||||||
|
@ -210,7 +210,7 @@ type = "number"
|
||||||
[main.statuses.statuses_media_max_files]
|
[main.statuses.statuses_media_max_files]
|
||||||
ask.en = "Maximum amount of media files that can be attached to a new status."
|
ask.en = "Maximum amount of media files that can be attached to a new status."
|
||||||
ask.fr = "Quantité maximale de fichiers multimédias qui peuvent être joints à un nouveau statut."
|
ask.fr = "Quantité maximale de fichiers multimédias qui peuvent être joints à un nouveau statut."
|
||||||
bind = "statuses-media-max-files:__FINALPATH__/config.yaml"
|
bind = "statuses-media-max-files:__INSTALL_DIR__/config.yaml"
|
||||||
default = "6"
|
default = "6"
|
||||||
help.en = "Default: 6. Note that going way higher than the default might break federation."
|
help.en = "Default: 6. Note that going way higher than the default might break federation."
|
||||||
help.fr = "Valeur par défaut : 6. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
|
help.fr = "Valeur par défaut : 6. Notez que si vous dépassez la valeur par défaut, vous risquez de compromettre la fédération."
|
||||||
|
@ -229,7 +229,7 @@ help = "Config pertaining to instance federation settings, pages to hide/expose,
|
||||||
[main.instance.landing_page_user]
|
[main.instance.landing_page_user]
|
||||||
ask.en = "Landing page user"
|
ask.en = "Landing page user"
|
||||||
ask.fr = "Utilisateurice en tant que page d'accueil"
|
ask.fr = "Utilisateurice en tant que page d'accueil"
|
||||||
bind = "landing-page-user:__FINALPATH__/config.yaml"
|
bind = "landing-page-user:__INSTALL_DIR__/config.yaml"
|
||||||
help.en = "The user that will be shown instead of the landing page. if no user is set, the landing page will be shown."
|
help.en = "The user that will be shown instead of the landing page. if no user is set, the landing page will be shown."
|
||||||
help.fr = "L'utilisateurice qui sera affiché-e à la place de la page d'accueil. Si le champ est laissé vide, la page d'accueil normale sera affichée."
|
help.fr = "L'utilisateurice qui sera affiché-e à la place de la page d'accueil. Si le champ est laissé vide, la page d'accueil normale sera affichée."
|
||||||
type = "string"
|
type = "string"
|
||||||
|
@ -237,7 +237,7 @@ type = "string"
|
||||||
[main.instance.instance_expose_peers]
|
[main.instance.instance_expose_peers]
|
||||||
ask.en = "API: Expose peers?"
|
ask.en = "API: Expose peers?"
|
||||||
ask.fr = "API : Exposer les pairs ?"
|
ask.fr = "API : Exposer les pairs ?"
|
||||||
bind = "instance-expose-peers:__FINALPATH__/config.yaml"
|
bind = "instance-expose-peers:__INSTALL_DIR__/config.yaml"
|
||||||
choices = ["true", "false"]
|
choices = ["true", "false"]
|
||||||
default = "false"
|
default = "false"
|
||||||
help.en = "Allow unauthenticated users to make queries to /api/v1/instance/peers?filter=open in order to see a list of instances that this instance 'peers' with. Even if set to 'false', then authenticated users (members of the instance) will still be able to query the endpoint."
|
help.en = "Allow unauthenticated users to make queries to /api/v1/instance/peers?filter=open in order to see a list of instances that this instance 'peers' with. Even if set to 'false', then authenticated users (members of the instance) will still be able to query the endpoint."
|
||||||
|
@ -247,7 +247,7 @@ type = "select"
|
||||||
[main.instance.instance_expose_suspended]
|
[main.instance.instance_expose_suspended]
|
||||||
ask.en = "API: Expose suspended?"
|
ask.en = "API: Expose suspended?"
|
||||||
ask.fr = "API : Exposer les instances bloquées ?"
|
ask.fr = "API : Exposer les instances bloquées ?"
|
||||||
bind = "instance-expose-suspended:__FINALPATH__/config.yaml"
|
bind = "instance-expose-suspended:__INSTALL_DIR__/config.yaml"
|
||||||
choices = ["true", "false"]
|
choices = ["true", "false"]
|
||||||
default = "false"
|
default = "false"
|
||||||
help.en = "Allow unauthenticated users to make queries to /api/v1/instance/peers?filter=suspended in order to see a list of instances that this instance blocks/suspends. This will also allow unauthenticated users to see the list through the web UI. Even if set to 'false', then authenticated users (members of the instance) will still be able to query the endpoint."
|
help.en = "Allow unauthenticated users to make queries to /api/v1/instance/peers?filter=suspended in order to see a list of instances that this instance blocks/suspends. This will also allow unauthenticated users to see the list through the web UI. Even if set to 'false', then authenticated users (members of the instance) will still be able to query the endpoint."
|
||||||
|
@ -257,7 +257,7 @@ type = "select"
|
||||||
[main.instance.instance_expose_suspended_web]
|
[main.instance.instance_expose_suspended_web]
|
||||||
ask.en = "API: Expose suspended on Web (/about/suspended)?"
|
ask.en = "API: Expose suspended on Web (/about/suspended)?"
|
||||||
ask.fr = "API : Exposer les instances bloquées sur le Web (/about/suspended) ?"
|
ask.fr = "API : Exposer les instances bloquées sur le Web (/about/suspended) ?"
|
||||||
bind = "instance-expose-suspended-web:__FINALPATH__/config.yaml"
|
bind = "instance-expose-suspended-web:__INSTALL_DIR__/config.yaml"
|
||||||
choices = ["true", "false"]
|
choices = ["true", "false"]
|
||||||
default = "false"
|
default = "false"
|
||||||
help.en = "Allow unauthenticated users to view /about/suspended, showing the HTML rendered list of instances that this instance blocks/suspends."
|
help.en = "Allow unauthenticated users to view /about/suspended, showing the HTML rendered list of instances that this instance blocks/suspends."
|
||||||
|
@ -267,7 +267,7 @@ type = "select"
|
||||||
[main.instance.instance_expose_public_timeline]
|
[main.instance.instance_expose_public_timeline]
|
||||||
ask.en = "API: Expose public timeline?"
|
ask.en = "API: Expose public timeline?"
|
||||||
ask.fr = "API : Exposer la timeline publique ?"
|
ask.fr = "API : Exposer la timeline publique ?"
|
||||||
bind = "instance-expose-public-timeline:__FINALPATH__/config.yaml"
|
bind = "instance-expose-public-timeline:__INSTALL_DIR__/config.yaml"
|
||||||
choices = ["true", "false"]
|
choices = ["true", "false"]
|
||||||
default = "false"
|
default = "false"
|
||||||
help.en = "Allow unauthenticated users to make queries to /api/v1/timelines/public in order to see a list of public posts on this server. Even if set to 'false', then authenticated users (members of the instance) will still be able to query the endpoint."
|
help.en = "Allow unauthenticated users to make queries to /api/v1/timelines/public in order to see a list of public posts on this server. Even if set to 'false', then authenticated users (members of the instance) will still be able to query the endpoint."
|
||||||
|
@ -277,7 +277,7 @@ type = "select"
|
||||||
[main.instance.instance_deliver_to_shared_inboxes]
|
[main.instance.instance_deliver_to_shared_inboxes]
|
||||||
ask.en = "Deliver to shared inboxes?"
|
ask.en = "Deliver to shared inboxes?"
|
||||||
ask.fr = "Envoi en boites partagées ?"
|
ask.fr = "Envoi en boites partagées ?"
|
||||||
bind = "instance-deliver-to-shared-inboxes:__FINALPATH__/config.yaml"
|
bind = "instance-deliver-to-shared-inboxes:__INSTALL_DIR__/config.yaml"
|
||||||
choices = ["true", "false"]
|
choices = ["true", "false"]
|
||||||
default = "true"
|
default = "true"
|
||||||
help.en = """This flag tweaks whether GoToSocial will deliver ActivityPub messages to the shared inbox of a recipient, if one is available, instead of delivering each message to each actor who should receive a message individually.\
|
help.en = """This flag tweaks whether GoToSocial will deliver ActivityPub messages to the shared inbox of a recipient, if one is available, instead of delivering each message to each actor who should receive a message individually.\
|
||||||
|
@ -291,7 +291,7 @@ type = "select"
|
||||||
[main.instance.instance_inject_mastodon_version]
|
[main.instance.instance_inject_mastodon_version]
|
||||||
ask.en = "Inject Mastodon version?"
|
ask.en = "Inject Mastodon version?"
|
||||||
ask.fr = "Injecter une version Mastodon ?"
|
ask.fr = "Injecter une version Mastodon ?"
|
||||||
bind = "instance-inject-mastodon-version:__FINALPATH__/config.yaml"
|
bind = "instance-inject-mastodon-version:__INSTALL_DIR__/config.yaml"
|
||||||
choices = ["true", "false"]
|
choices = ["true", "false"]
|
||||||
default = "false"
|
default = "false"
|
||||||
help.en = """This flag will inject a Mastodon version into the version field that is included in /api/v1/instance.\
|
help.en = """This flag will inject a Mastodon version into the version field that is included in /api/v1/instance.\
|
||||||
|
@ -317,7 +317,7 @@ help = "Config for sending emails via an smtp server."
|
||||||
[main.smtp.smtp_host]
|
[main.smtp.smtp_host]
|
||||||
ask.en = "SMTP Server Hostname"
|
ask.en = "SMTP Server Hostname"
|
||||||
ask.fr = "Nom d'hôte du serveur SMTP"
|
ask.fr = "Nom d'hôte du serveur SMTP"
|
||||||
bind = "smtp-host:__FINALPATH__/config.yaml"
|
bind = "smtp-host:__INSTALL_DIR__/config.yaml"
|
||||||
default = "localhost"
|
default = "localhost"
|
||||||
help.en = "The hostname of the SMTP server you want to use. Examples: mail.example.org, localhost"
|
help.en = "The hostname of the SMTP server you want to use. Examples: mail.example.org, localhost"
|
||||||
help.fr = "Le nom d'hôte du serveur SMTP que vous souhaitez utiliser. Exemples: mail.example.org, localhost"
|
help.fr = "Le nom d'hôte du serveur SMTP que vous souhaitez utiliser. Exemples: mail.example.org, localhost"
|
||||||
|
@ -326,7 +326,7 @@ type = "string"
|
||||||
[main.smtp.smtp_port]
|
[main.smtp.smtp_port]
|
||||||
ask.en = "SMTP Port"
|
ask.en = "SMTP Port"
|
||||||
ask.fr = "Port SMTP"
|
ask.fr = "Port SMTP"
|
||||||
bind = "smtp-port:__FINALPATH__/config.yaml"
|
bind = "smtp-port:__INSTALL_DIR__/config.yaml"
|
||||||
default = "25"
|
default = "25"
|
||||||
help.en = "Port to use to connect to the SMTP server"
|
help.en = "Port to use to connect to the SMTP server"
|
||||||
help.fr = "Port à utiliser pour se connecter au serveur SMTP"
|
help.fr = "Port à utiliser pour se connecter au serveur SMTP"
|
||||||
|
@ -335,7 +335,7 @@ type = "number"
|
||||||
[main.smtp.smtp_username]
|
[main.smtp.smtp_username]
|
||||||
ask.en = "SMTP Username"
|
ask.en = "SMTP Username"
|
||||||
ask.fr = "Nom d'utilisateur SMTP"
|
ask.fr = "Nom d'utilisateur SMTP"
|
||||||
bind = "smtp-username:__FINALPATH__/config.yaml"
|
bind = "smtp-username:__INSTALL_DIR__/config.yaml"
|
||||||
default = ""
|
default = ""
|
||||||
help.en = "Username to use when authenticating with the SMTP server"
|
help.en = "Username to use when authenticating with the SMTP server"
|
||||||
help.fr = "Nom d'utilisateur à utiliser lors de l'authentification avec le serveur SMTP"
|
help.fr = "Nom d'utilisateur à utiliser lors de l'authentification avec le serveur SMTP"
|
||||||
|
@ -344,7 +344,7 @@ type = "string"
|
||||||
[main.smtp.smtp_password]
|
[main.smtp.smtp_password]
|
||||||
ask.en = "SMTP Password"
|
ask.en = "SMTP Password"
|
||||||
ask.fr = "Mot de passe SMTP"
|
ask.fr = "Mot de passe SMTP"
|
||||||
bind = "smtp-password:__FINALPATH__/config.yaml"
|
bind = "smtp-password:__INSTALL_DIR__/config.yaml"
|
||||||
default = ""
|
default = ""
|
||||||
help.en = "Password to use when authenticating with the SMTP server"
|
help.en = "Password to use when authenticating with the SMTP server"
|
||||||
help.fr = "Mot de passe à utiliser lors de l'authentification avec le serveur SMTP"
|
help.fr = "Mot de passe à utiliser lors de l'authentification avec le serveur SMTP"
|
||||||
|
@ -353,7 +353,7 @@ type = "password"
|
||||||
[main.smtp.smtp_from]
|
[main.smtp.smtp_from]
|
||||||
ask.en = "SMTP From Address"
|
ask.en = "SMTP From Address"
|
||||||
ask.fr = "Adresse d'expédition SMTP"
|
ask.fr = "Adresse d'expédition SMTP"
|
||||||
bind = "smtp-from:__FINALPATH__/config.yaml"
|
bind = "smtp-from:__INSTALL_DIR__/config.yaml"
|
||||||
default = "GoToSocial@__DOMAIN__"
|
default = "GoToSocial@__DOMAIN__"
|
||||||
help.en = "From address for sent emails"
|
help.en = "From address for sent emails"
|
||||||
help.fr = "L'adresse utilisée pour les e-mails envoyés"
|
help.fr = "L'adresse utilisée pour les e-mails envoyés"
|
||||||
|
@ -362,7 +362,7 @@ type = "email"
|
||||||
[main.smtp.smtp_disclose_recipients]
|
[main.smtp.smtp_disclose_recipients]
|
||||||
ask.en = "SMTP Disclose Recipients"
|
ask.en = "SMTP Disclose Recipients"
|
||||||
ask.fr = "SMTP Divulguer les destinataires"
|
ask.fr = "SMTP Divulguer les destinataires"
|
||||||
bind = "smtp-disclose-recipients:__FINALPATH__/config.yaml"
|
bind = "smtp-disclose-recipients:__INSTALL_DIR__/config.yaml"
|
||||||
choices = ["true", "false"]
|
choices = ["true", "false"]
|
||||||
default = "false"
|
default = "false"
|
||||||
help.en = """true: Disclose all recipients in the To field\
|
help.en = """true: Disclose all recipients in the To field\
|
||||||
|
@ -384,7 +384,7 @@ help = "Settings pertaining to... the cache"
|
||||||
[main.cache.cache_memory_target]
|
[main.cache.cache_memory_target]
|
||||||
ask.en = "Value of the cache target"
|
ask.en = "Value of the cache target"
|
||||||
ask.fr = "Valeur du niveau de cache"
|
ask.fr = "Valeur du niveau de cache"
|
||||||
bind = "memory-target:__FINALPATH__/config.yaml"
|
bind = "memory-target:__INSTALL_DIR__/config.yaml"
|
||||||
default = "100MiB"
|
default = "100MiB"
|
||||||
help.en = """Sets a target limit that the application will try to keep it's caches within.\
|
help.en = """Sets a target limit that the application will try to keep it's caches within.\
|
||||||
This is based on estimated sizes of in-memory objects, and so NOT AT ALL EXACT.
|
This is based on estimated sizes of in-memory objects, and so NOT AT ALL EXACT.
|
||||||
|
@ -407,7 +407,7 @@ help = "Settings pertaining to http timeouts, security, cookies, and more. ⚠
|
||||||
[main.advanced.advanced_cookies_samesite]
|
[main.advanced.advanced_cookies_samesite]
|
||||||
ask.en = "Value of the SameSite attribute of cookies set by GoToSocial."
|
ask.en = "Value of the SameSite attribute of cookies set by GoToSocial."
|
||||||
ask.fr = "Valeur de l'attribut SameSite des cookies définis par GoToSocial."
|
ask.fr = "Valeur de l'attribut SameSite des cookies définis par GoToSocial."
|
||||||
bind = "advanced-cookies-samesite:__FINALPATH__/config.yaml"
|
bind = "advanced-cookies-samesite:__INSTALL_DIR__/config.yaml"
|
||||||
choices = ["lax", "strict"]
|
choices = ["lax", "strict"]
|
||||||
default = "lax"
|
default = "lax"
|
||||||
help.en = """Defaults to 'lax' to ensure that the OIDC flow does not break, which is fine in most cases.\
|
help.en = """Defaults to 'lax' to ensure that the OIDC flow does not break, which is fine in most cases.\
|
||||||
|
@ -420,7 +420,7 @@ type = "select"
|
||||||
[main.advanced.advanced_rate_limit_requests]
|
[main.advanced.advanced_rate_limit_requests]
|
||||||
ask.en = "Amount of requests to permit from a single IP address within a span of 5 minutes."
|
ask.en = "Amount of requests to permit from a single IP address within a span of 5 minutes."
|
||||||
ask.fr = "Nombre de requêtes autorisées à partir d'une seule adresse IP dans un délai de 5 minutes."
|
ask.fr = "Nombre de requêtes autorisées à partir d'une seule adresse IP dans un délai de 5 minutes."
|
||||||
bind = "advanced-rate-limit-requests:__FINALPATH__/config.yaml"
|
bind = "advanced-rate-limit-requests:__INSTALL_DIR__/config.yaml"
|
||||||
default = "300"
|
default = "300"
|
||||||
help.en = """Default: 300\
|
help.en = """Default: 300\
|
||||||
If this amount is exceeded, a 429 HTTP error code will be returned.\
|
If this amount is exceeded, a 429 HTTP error code will be returned.\
|
||||||
|
|
|
@ -1,7 +1 @@
|
||||||
GoToSocial is an [ActivityPub](https://activitypub.rocks/) social network server, written in Golang.
|
GoToSocial is an [ActivityPub](https://activitypub.rocks/) social network server, written in Golang. With GoToSocial, you can keep in touch with your friends, post, read, and share images and articles. All without being tracked or advertised to!
|
||||||
|
|
||||||
With GoToSocial, you can keep in touch with your friends, post, read, and share images and articles. All without being tracked or advertised to!
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Documentation is at [docs.gotosocial.org](https://docs.gotosocial.org).
|
|
|
@ -1,7 +1 @@
|
||||||
Un serveur de réseau social basé sur [ActivityPub](https://activitypub.rocks/) écrit en Golang.
|
Un serveur de réseau social basé sur [ActivityPub](https://activitypub.rocks/) écrit en Golang. Avec GoToSocial, vous pouvez rester en contact avec vos amis, publier, lire et partager des images et des articles. Tout cela sans être pisté ni subir de publicité !
|
||||||
|
|
||||||
Avec GoToSocial, vous pouvez rester en contact avec vos amis, publier, lire et partager des images et des articles. Tout cela sans être pisté ni subir de publicité !
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Vous pouvez consulter la documentation à l'adresse : [docs.gotosocial.org](https://docs.gotosocial.org).
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 35 KiB |
109
manifest.json
109
manifest.json
|
@ -1,109 +0,0 @@
|
||||||
{
|
|
||||||
"name": "GoToSocial",
|
|
||||||
"id": "gotosocial",
|
|
||||||
"packaging_format": 1,
|
|
||||||
"description": {
|
|
||||||
"en": "ActivityPub social network server",
|
|
||||||
"fr": "Serveur de réseau social basé sur ActivityPub"
|
|
||||||
},
|
|
||||||
"version": "0.11.1~ynh4",
|
|
||||||
"url": "https://github.com/superseriousbusiness/gotosocial",
|
|
||||||
"upstream": {
|
|
||||||
"license": "AGPL-3.0-only",
|
|
||||||
"website": "https://gotosocial.org/",
|
|
||||||
"demo": "",
|
|
||||||
"admindoc": "https://docs.gotosocial.org/en/latest/",
|
|
||||||
"userdoc": "https://docs.gotosocial.org/en/latest/",
|
|
||||||
"code": "https://github.com/superseriousbusiness/gotosocial"
|
|
||||||
},
|
|
||||||
"license": "AGPL-3.0-only",
|
|
||||||
"maintainer": {
|
|
||||||
"name": "OniriCorpe",
|
|
||||||
"email": ""
|
|
||||||
},
|
|
||||||
"requirements": {
|
|
||||||
"yunohost": ">= 11.0.6"
|
|
||||||
},
|
|
||||||
"multi_instance": true,
|
|
||||||
"services": [
|
|
||||||
"nginx",
|
|
||||||
"postgresql"
|
|
||||||
],
|
|
||||||
"arguments": {
|
|
||||||
"install": [
|
|
||||||
{
|
|
||||||
"name": "domain",
|
|
||||||
"type": "domain"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "admin",
|
|
||||||
"type": "string",
|
|
||||||
"ask": {
|
|
||||||
"en": "The username of your admin account.",
|
|
||||||
"fr": "Le nom d'utilisateur de votre compte admin."
|
|
||||||
},
|
|
||||||
"help": {
|
|
||||||
"en": "Must be in lower case and without special characters.",
|
|
||||||
"fr": "Doit être en minuscule et sans caractère special."
|
|
||||||
},
|
|
||||||
"example": "johndoe"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "email",
|
|
||||||
"type": "string",
|
|
||||||
"ask": {
|
|
||||||
"en": "The email adress of your admin account.",
|
|
||||||
"fr": "L'adresse e-mail de votre compte admin."
|
|
||||||
},
|
|
||||||
"example": "johndoe@example.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "password",
|
|
||||||
"type": "password",
|
|
||||||
"help": {
|
|
||||||
"en": "Must contain: upper case, lower case, number and special character.",
|
|
||||||
"fr": "Il doit contenir : majuscule, minuscule, chiffre et caractère spécial."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "accounts_registration_open",
|
|
||||||
"type": "boolean",
|
|
||||||
"ask": {
|
|
||||||
"en": "Open registration?",
|
|
||||||
"fr": "Inscriptions ouvertes ?"
|
|
||||||
},
|
|
||||||
"help": {
|
|
||||||
"en": "Do you want people to be able to just submit sign up requests (true), or do you want invite only (false)?",
|
|
||||||
"fr": "Voulez-vous que les gens puissent envoyer des demandes d'inscription (true) ou voulez-vous que les inscriptions soient uniquement sur invitation (false) ?"
|
|
||||||
},
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "accounts_approval_required",
|
|
||||||
"type": "boolean",
|
|
||||||
"ask": {
|
|
||||||
"en": "Registration approval?",
|
|
||||||
"fr": "Vérification manuelle des inscriptions ?"
|
|
||||||
},
|
|
||||||
"help": {
|
|
||||||
"en": "Do sign up requests require approval from an admin/moderator before an account can sign in/use the server?",
|
|
||||||
"fr": "Les demandes d'inscription doivent-elles être approuvées par un-e administrateur-ice/modérateur-ice avant qu'un compte puisse se connecter et utiliser le serveur ?"
|
|
||||||
},
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "accounts_reason_required",
|
|
||||||
"type": "boolean",
|
|
||||||
"ask": {
|
|
||||||
"en": "Request registration reason?",
|
|
||||||
"fr": "Demande de motif pour les inscriptions ?"
|
|
||||||
},
|
|
||||||
"help": {
|
|
||||||
"en": "Are sign up requests required to submit a reason for the request (eg., an explanation of why they want to join the instance)?",
|
|
||||||
"fr": "Les demandes d'inscription doivent-elles être accompagnée d'un motif (par exemple, une explication de la raison pour laquelle la personne veut rejoindre l'instance) ?"
|
|
||||||
},
|
|
||||||
"default": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -16,40 +16,25 @@ demo = ""
|
||||||
admindoc = "https://docs.gotosocial.org/en/latest/"
|
admindoc = "https://docs.gotosocial.org/en/latest/"
|
||||||
userdoc = "https://docs.gotosocial.org/en/latest/"
|
userdoc = "https://docs.gotosocial.org/en/latest/"
|
||||||
code = "https://github.com/superseriousbusiness/gotosocial"
|
code = "https://github.com/superseriousbusiness/gotosocial"
|
||||||
cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number)
|
|
||||||
fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin.
|
|
||||||
|
|
||||||
[integration]
|
[integration]
|
||||||
yunohost = ">= 11.0.6"
|
yunohost = ">= 11.2"
|
||||||
architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"]
|
architectures = "all"
|
||||||
multi_instance = true
|
multi_instance = true
|
||||||
ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials.
|
ldap = false
|
||||||
sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal.
|
sso = false
|
||||||
disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ...
|
disk = "50M"
|
||||||
ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
|
ram.build = "50M"
|
||||||
ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
|
ram.runtime = "50M"
|
||||||
|
|
||||||
[install]
|
[install]
|
||||||
[install.domain]
|
[install.domain]
|
||||||
# this is a generic question - ask strings are automatically handled by Yunohost's core
|
|
||||||
type = "domain"
|
type = "domain"
|
||||||
full_domain = true
|
|
||||||
|
|
||||||
[install.admin]
|
[install.admin]
|
||||||
# this is a generic question - ask strings are automatically handled by Yunohost's core
|
type = "user"
|
||||||
help.en = "Must be in lower case and without special characters."
|
|
||||||
help.fr = "Doit être en minuscule et sans caractère special."
|
|
||||||
type = "string"
|
|
||||||
example = "johndoe"
|
|
||||||
|
|
||||||
[install.email]
|
|
||||||
ask.en = "The email adress of your admin account."
|
|
||||||
ask.fr = "L'adresse e-mail de votre compte admin."
|
|
||||||
type = "string"
|
|
||||||
example = "johndoe@example.com"
|
|
||||||
|
|
||||||
[install.password]
|
[install.password]
|
||||||
# this is a generic question - ask strings are automatically handled by Yunohost's core
|
|
||||||
help.en = "Must contain: upper case, lower case, number and special character."
|
help.en = "Must contain: upper case, lower case, number and special character."
|
||||||
help.fr = "Il doit contenir : majuscule, minuscule, chiffre et caractère spécial."
|
help.fr = "Il doit contenir : majuscule, minuscule, chiffre et caractère spécial."
|
||||||
type = "password"
|
type = "password"
|
||||||
|
@ -92,9 +77,10 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen
|
||||||
amd64.url = "https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.1/gotosocial_0.11.1_linux_amd64.tar.gz"
|
amd64.url = "https://github.com/superseriousbusiness/gotosocial/releases/download/v0.11.1/gotosocial_0.11.1_linux_amd64.tar.gz"
|
||||||
amd64.sha256 = "4e44a5cb4044a523c51b5d178dfd06efb077a17dac22a9a170d6204cb7aed407"
|
amd64.sha256 = "4e44a5cb4044a523c51b5d178dfd06efb077a17dac22a9a170d6204cb7aed407"
|
||||||
|
|
||||||
|
|
||||||
[resources.system_user]
|
[resources.system_user]
|
||||||
|
|
||||||
|
[resources.ports]
|
||||||
|
|
||||||
[resources.install_dir]
|
[resources.install_dir]
|
||||||
|
|
||||||
[resources.data_dir]
|
[resources.data_dir]
|
||||||
|
@ -102,5 +88,8 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen
|
||||||
[resources.permissions]
|
[resources.permissions]
|
||||||
main.url = "/"
|
main.url = "/"
|
||||||
|
|
||||||
|
[resources.apt]
|
||||||
|
packages = "postgresql, postgresql-contrib"
|
||||||
|
|
||||||
[resources.database]
|
[resources.database]
|
||||||
type = "postgresql"
|
type = "postgresql"
|
||||||
|
|
|
@ -4,32 +4,10 @@
|
||||||
# COMMON VARIABLES
|
# COMMON VARIABLES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# dependencies used by the app
|
|
||||||
#REMOVEME? pkg_dependencies="postgresql postgresql-contrib"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# custom function to detect armv6 and armv7
|
|
||||||
# ($YNH_ARCH returns armhf for both...)
|
|
||||||
detect_arch(){
|
|
||||||
local architecture
|
|
||||||
if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then
|
|
||||||
architecture="arm64"
|
|
||||||
elif [ -n "$(uname -m | grep 64)" ]; then
|
|
||||||
architecture="x86-64"
|
|
||||||
elif [ -n "$(uname -m | grep 86)" ]; then
|
|
||||||
architecture="i386"
|
|
||||||
elif [ -n "$(uname -m | grep armv6)" ]; then
|
|
||||||
architecture="armv6"
|
|
||||||
elif [ -n "$(uname -m | grep armv7)" ]; then
|
|
||||||
architecture="armv7"
|
|
||||||
else
|
|
||||||
architecture="unknown"
|
|
||||||
fi
|
|
||||||
echo $architecture
|
|
||||||
}
|
|
||||||
|
|
||||||
# custom function to change bash bool 0/1 to false/true
|
# custom function to change bash bool 0/1 to false/true
|
||||||
convert_bool(){
|
convert_bool(){
|
||||||
|
|
|
@ -10,42 +10,11 @@
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MANAGE SCRIPT FAILURE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#REMOVEME? ynh_clean_setup () {
|
|
||||||
### Remove this function if there's nothing to clean before calling the remove script.
|
|
||||||
true
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
#REMOVEME? ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_print_info --message="Loading installation settings..."
|
|
||||||
|
|
||||||
#REMOVEME? app="$YNH_APP_INSTANCE_NAME"
|
|
||||||
|
|
||||||
#REMOVEME? domain=$(ynh_app_setting_get --app="$app" --key=domain)
|
|
||||||
|
|
||||||
#REMOVEME? db_name=$(ynh_app_setting_get --app="$app" --key=db_name)
|
|
||||||
|
|
||||||
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir)
|
|
||||||
|
|
||||||
#REMOVEME? data_dir=$(ynh_app_setting_get --app="$app" --key=data_dir)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Declaring files to be backed up..."
|
ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs
|
|
||||||
### to be backuped and not an actual copy of any file. The actual backup that
|
|
||||||
### creates and fill the archive with the files happens in the core after this
|
|
||||||
### script is called. Hence ynh_backups calls takes basically 0 seconds to run.
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
183
scripts/install
183
scripts/install
|
@ -9,41 +9,22 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MANAGE SCRIPT FAILURE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#REMOVEME? ynh_clean_setup () {
|
|
||||||
### Remove this function if there's nothing to clean before calling the remove script.
|
|
||||||
true
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
#REMOVEME? ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
#REMOVEME? app="$YNH_APP_INSTANCE_NAME"
|
|
||||||
|
|
||||||
landing_page_user=""
|
landing_page_user=""
|
||||||
|
|
||||||
#REMOVEME? domain="$YNH_APP_ARG_DOMAIN"
|
|
||||||
path="/"
|
|
||||||
|
|
||||||
client_max_body_size="100M"
|
client_max_body_size="100M"
|
||||||
|
|
||||||
#REMOVEME? admin="$YNH_APP_ARG_ADMIN"
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
#REMOVEME? email="$YNH_APP_ARG_EMAIL"
|
|
||||||
#REMOVEME? password="$YNH_APP_ARG_PASSWORD"
|
|
||||||
|
|
||||||
# Config stuff:
|
# Config stuff:
|
||||||
|
|
||||||
cache_memory_target="100MiB"
|
cache_memory_target="100MiB"
|
||||||
|
|
||||||
#REMOVEME? accounts_registration_open=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REGISTRATION_OPEN")
|
accounts_registration_open=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REGISTRATION_OPEN")
|
||||||
#REMOVEME? accounts_approval_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_APPROVAL_REQUIRED")
|
accounts_approval_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_APPROVAL_REQUIRED")
|
||||||
#REMOVEME? accounts_reason_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REASON_REQUIRED")
|
accounts_reason_required=$(convert_bool "$YNH_APP_ARG_ACCOUNTS_REASON_REQUIRED")
|
||||||
accounts_allow_custom_css="false"
|
accounts_allow_custom_css="false"
|
||||||
accounts_custom_css_length="10000"
|
accounts_custom_css_length="10000"
|
||||||
|
|
||||||
|
@ -85,34 +66,15 @@ smtp_disclose_recipients="false"
|
||||||
advanced_cookies_samesite="lax"
|
advanced_cookies_samesite="lax"
|
||||||
advanced_rate_limit_requests="300"
|
advanced_rate_limit_requests="300"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1
|
|
||||||
|
|
||||||
#REMOVEME? install_dir="/var/www/$app"
|
|
||||||
#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder"
|
|
||||||
|
|
||||||
#REMOVEME? ynh_webpath_register --app="$app" --domain="$domain" --path="$path"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE SETTINGS FROM MANIFEST
|
# STORE SETTINGS FROM MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1
|
ynh_script_progression --message="Storing installation settings..." --weight=1
|
||||||
|
|
||||||
#REMOVEME? ynh_app_setting_set --app="$app" --key=install_dir --value="$install_dir"
|
|
||||||
|
|
||||||
ynh_app_setting_set --app="$app" --key=landing_page_user --value="$landing_page_user"
|
ynh_app_setting_set --app="$app" --key=landing_page_user --value="$landing_page_user"
|
||||||
|
|
||||||
#REMOVEME? ynh_app_setting_set --app="$app" --key=domain --value="$domain"
|
|
||||||
#REMOVEME? ynh_app_setting_set --app="$app" --key=path --value="$path"
|
|
||||||
|
|
||||||
ynh_app_setting_set --app="$app" --key=client_max_body_size --value="$client_max_body_size"
|
ynh_app_setting_set --app="$app" --key=client_max_body_size --value="$client_max_body_size"
|
||||||
|
|
||||||
#REMOVEME? ynh_app_setting_set --app="$app" --key=admin --value="$admin"
|
|
||||||
ynh_app_setting_set --app="$app" --key=email --value="$email"
|
ynh_app_setting_set --app="$app" --key=email --value="$email"
|
||||||
#REMOVEME? ynh_app_setting_set --app="$app" --key=password --value="$password"
|
|
||||||
|
|
||||||
ynh_app_setting_set --app="$app" --key=cache_memory_target --value="$cache_memory_target"
|
ynh_app_setting_set --app="$app" --key=cache_memory_target --value="$cache_memory_target"
|
||||||
|
|
||||||
|
@ -151,77 +113,23 @@ ynh_app_setting_set --app="$app" --key=statuses_poll_option_max_chars --value="$
|
||||||
ynh_app_setting_set --app="$app" --key=statuses_media_max_files --value="$statuses_media_max_files"
|
ynh_app_setting_set --app="$app" --key=statuses_media_max_files --value="$statuses_media_max_files"
|
||||||
|
|
||||||
ynh_app_setting_set --app="$app" --key=smtp_host --value="$smtp_host"
|
ynh_app_setting_set --app="$app" --key=smtp_host --value="$smtp_host"
|
||||||
#REMOVEME? ynh_app_setting_set --app="$app" --key=smtp_port --value="$smtp_port"
|
REMOVEME? ynh_app_setting_set --app="$app" --key=smtp_port --value="$smtp_port"
|
||||||
ynh_app_setting_set --app="$app" --key=smtp_username --value="$smtp_username"
|
ynh_app_setting_set --app="$app" --key=smtp_username --value="$smtp_username"
|
||||||
#REMOVEME? ynh_app_setting_set --app="$app" --key=smtp_password --value="$smtp_password"
|
REMOVEME? ynh_app_setting_set --app="$app" --key=smtp_password --value="$smtp_password"
|
||||||
ynh_app_setting_set --app="$app" --key=smtp_from --value="$smtp_from"
|
ynh_app_setting_set --app="$app" --key=smtp_from --value="$smtp_from"
|
||||||
ynh_app_setting_set --app="$app" --key=smtp_disclose_recipients --value="$smtp_disclose_recipients"
|
ynh_app_setting_set --app="$app" --key=smtp_disclose_recipients --value="$smtp_disclose_recipients"
|
||||||
|
|
||||||
ynh_app_setting_set --app="$app" --key=advanced_cookies_samesite --value="$advanced_cookies_samesite"
|
ynh_app_setting_set --app="$app" --key=advanced_cookies_samesite --value="$advanced_cookies_samesite"
|
||||||
ynh_app_setting_set --app="$app" --key=advanced_rate_limit_requests --value="$advanced_rate_limit_requests"
|
ynh_app_setting_set --app="$app" --key=advanced_rate_limit_requests --value="$advanced_rate_limit_requests"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD MODIFICATIONS
|
|
||||||
#=================================================
|
|
||||||
# FIND AND OPEN A PORT
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1
|
|
||||||
|
|
||||||
# Find an available port
|
|
||||||
#REMOVEME? port=$(ynh_find_port --port=8095)
|
|
||||||
#REMOVEME? ynh_app_setting_set --app="$app" --key=port --value="$port"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# INSTALL DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=5
|
|
||||||
|
|
||||||
#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CREATE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1
|
|
||||||
|
|
||||||
# Create a system user
|
|
||||||
#REMOVEME? ynh_system_user_create --username="$app" --home_dir="$install_dir"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CREATE A POSTGRESQL DATABASE
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Creating a PostgreSQL database..." --weight=5
|
|
||||||
|
|
||||||
#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name="$app")
|
|
||||||
#REMOVEME? db_user="$db_name"
|
|
||||||
#REMOVEME? db_pwd=$(ynh_string_random --length=30)
|
|
||||||
#REMOVEME? ynh_app_setting_set --app="$app" --key=db_name --value="$db_name"
|
|
||||||
#REMOVEME? ynh_app_setting_set --app="$app" --key=db_user --value="$db_user"
|
|
||||||
#REMOVEME? ynh_app_setting_set --app="$app" --key=db_pwd --value="$db_pwd"
|
|
||||||
#REMOVEME? ynh_psql_test_if_first_run
|
|
||||||
#REMOVEME? ynh_psql_setup_db --db_user="$db_user" --db_name="$db_name" --db_pwd="$db_pwd"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up source files..." --weight=1
|
ynh_script_progression --message="Setting up source files..." --weight=1
|
||||||
|
|
||||||
### `ynh_setup_source` is used to install an app from a zip or tar.gz file,
|
|
||||||
### downloaded from an upstream source, like a git repository.
|
|
||||||
### `ynh_setup_source` use the file conf/app.src
|
|
||||||
|
|
||||||
# detect_arch comes from _common.sh / personnal helpers
|
|
||||||
architecture=$(detect_arch)
|
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$install_dir"
|
ynh_setup_source --dest_dir="$install_dir"
|
||||||
|
|
||||||
# FIXME: this should be managed by the core in the future
|
|
||||||
# Here, as a packager, you may have to tweak the ownerhsip/permissions
|
|
||||||
# such that the appropriate users (e.g. maybe www-data) can access
|
|
||||||
# files in some cases.
|
|
||||||
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder _
|
|
||||||
# this will be treated as a security issue.
|
|
||||||
chmod 750 "$install_dir"
|
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R "$app:www-data" "$install_dir"
|
chown -R "$app:www-data" "$install_dir"
|
||||||
|
|
||||||
|
@ -233,68 +141,28 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1
|
||||||
# Create a dedicated NGINX config for the main domain
|
# Create a dedicated NGINX config for the main domain
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CREATE DATA DIRECTORY
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Creating a data directory..." --weight=1
|
|
||||||
|
|
||||||
#REMOVEME? data_dir=/home/yunohost.app/$app
|
|
||||||
#REMOVEME? ynh_app_setting_set --app="$app" --key=data_dir --value="$data_dir"
|
|
||||||
|
|
||||||
mkdir -p "$data_dir"
|
|
||||||
|
|
||||||
# FIXME: this should be managed by the core in the future
|
|
||||||
# Here, as a packager, you may have to tweak the ownerhsip/permissions
|
|
||||||
# such that the appropriate users (e.g. maybe www-data) can access
|
|
||||||
# files in some cases.
|
|
||||||
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
|
|
||||||
# this will be treated as a security issue.
|
|
||||||
chmod 750 "$data_dir"
|
|
||||||
chmod -R o-rwx "$data_dir"
|
|
||||||
chown -R "$app:www-data" "$data_dir"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# ADD A CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
|
||||||
|
|
||||||
ynh_add_config --template="config.yaml" --destination="$install_dir/config.yaml"
|
|
||||||
|
|
||||||
# FIXME: this should be handled by the core in the future
|
|
||||||
# You may need to use chmod 600 instead of 400,
|
|
||||||
# for example if the app is expected to be able to modify its own config
|
|
||||||
chmod 400 "$install_dir/config.yaml"
|
|
||||||
chown "$app:$app" "$install_dir/config.yaml"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP SYSTEMD
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
# SETUP LOGROTATE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring log rotation..." --weight=1
|
|
||||||
|
|
||||||
# Use logrotate to manage application logfile(s)
|
# Use logrotate to manage application logfile(s)
|
||||||
ynh_use_logrotate
|
ynh_use_logrotate
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP FAIL2BAN
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring fail2ban..." --weight=1
|
|
||||||
|
|
||||||
# Create the logfile, required before configuring fail2ban
|
# Create the logfile, required before configuring fail2ban
|
||||||
touch "/var/log/${app}/${app}.log"
|
touch "/var/log/${app}/${app}.log"
|
||||||
|
|
||||||
# Create a dedicated Fail2Ban config
|
# Create a dedicated Fail2Ban config
|
||||||
ynh_add_fail2ban_config --logpath="/var/log/${app}/${app}.log" --failregex="statusCode=401 path=/auth/sign_in clientIP=<HOST> .* msg=\"Unauthorized:" --max_retry=5
|
ynh_add_fail2ban_config --logpath="/var/log/${app}/${app}.log" --failregex="statusCode=401 path=/auth/sign_in clientIP=<HOST> .* msg=\"Unauthorized:" --max_retry=5
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# ADD A CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||||
|
|
||||||
|
ynh_add_config --template="../conf/config.yaml" --destination="$install_dir/config.yaml"
|
||||||
|
|
||||||
|
chmod 400 "$install_dir/config.yaml"
|
||||||
|
chown "$app:$app" "$install_dir/config.yaml"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -320,22 +188,7 @@ ynh_exec_warn_less /var/www/"$app"/gotosocial --config-path "$install_dir/config
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
# Start a systemd service
|
# Start a systemd service
|
||||||
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
|
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP SSOWAT
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1
|
|
||||||
|
|
||||||
# Everyone can access the app.
|
|
||||||
#REMOVEME? ynh_permission_update --permission="main" --add="visitors"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RELOAD NGINX
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
|
||||||
|
|
||||||
#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -9,20 +9,6 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1
|
|
||||||
|
|
||||||
#REMOVEME? app="$YNH_APP_INSTANCE_NAME"
|
|
||||||
|
|
||||||
#REMOVEME? domain=$(ynh_app_setting_get --app="$app" --key=domain)
|
|
||||||
#REMOVEME? port=$(ynh_app_setting_get --app="$app" --key=port)
|
|
||||||
#REMOVEME? db_name=$(ynh_app_setting_get --app="$app" --key=db_name)
|
|
||||||
#REMOVEME? db_user=$(ynh_app_setting_get --app="$app" --key=db_user)
|
|
||||||
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir)
|
|
||||||
#REMOVEME? data_dir=$(ynh_app_setting_get --app="$app" --key=data_dir)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -36,100 +22,20 @@ then
|
||||||
yunohost service remove "$app"
|
yunohost service remove "$app"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STOP AND REMOVE SERVICE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
|
|
||||||
|
|
||||||
# Remove the dedicated systemd config
|
# Remove the dedicated systemd config
|
||||||
ynh_remove_systemd_config
|
ynh_remove_systemd_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE THE POSTGRESQL DATABASE
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Removing the PostgreSQL database..." --weight=5
|
|
||||||
|
|
||||||
# Remove a database if it exists, along with the associated user
|
|
||||||
#REMOVEME? ynh_psql_remove_db --db_user="$db_user" --db_name="$db_name"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=5
|
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
|
||||||
#REMOVEME? ynh_remove_app_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE APP MAIN DIR
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1
|
|
||||||
|
|
||||||
# Remove the app directory securely
|
|
||||||
#REMOVEME? ynh_secure_remove --file="$install_dir"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE APP DATA DIR
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing app data directory..." --weight=1
|
|
||||||
|
|
||||||
# Remove the app directory securely
|
|
||||||
#REMOVEME? ynh_secure_remove --file="$data_dir"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
|
|
||||||
|
|
||||||
# Remove the dedicated NGINX config of the main domain
|
# Remove the dedicated NGINX config of the main domain
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE LOGROTATE CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
|
|
||||||
|
|
||||||
# Remove the app-specific logrotate config
|
# Remove the app-specific logrotate config
|
||||||
ynh_remove_logrotate
|
ynh_remove_logrotate
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE FAIL2BAN CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_script_progression --message="Removing fail2ban configuration..." --weight=1
|
|
||||||
|
|
||||||
ynh_remove_fail2ban_config
|
ynh_remove_fail2ban_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CLOSE A PORT
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
if yunohost firewall list | grep -q "\- $port$"
|
|
||||||
then
|
|
||||||
ynh_script_progression --message="Closing port $port..." --weight=1
|
|
||||||
ynh_exec_warn_less yunohost firewall disallow TCP "$port"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC REMOVE
|
|
||||||
#=================================================
|
|
||||||
# REMOVE VARIOUS FILES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing various files..." --weight=1
|
|
||||||
|
|
||||||
# Remove the log files
|
# Remove the log files
|
||||||
ynh_secure_remove --file="/var/log/$app"
|
ynh_secure_remove --file="/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
# REMOVE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1
|
|
||||||
|
|
||||||
# Delete a system user
|
|
||||||
#REMOVEME? ynh_system_user_delete --username="$app"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
209
scripts/restore
209
scripts/restore
|
@ -10,111 +10,6 @@
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# MANAGE SCRIPT FAILURE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#REMOVEME? ynh_clean_setup () {
|
|
||||||
#### Remove this function if there's nothing to clean before calling the remove script.
|
|
||||||
true
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
#REMOVEME? ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1
|
|
||||||
|
|
||||||
#REMOVEME? app="$YNH_APP_INSTANCE_NAME"
|
|
||||||
|
|
||||||
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir)
|
|
||||||
|
|
||||||
#REMOVEME? landing_page_user=$(ynh_app_setting_get --app="$app" --key=landing_page_user)
|
|
||||||
|
|
||||||
#REMOVEME? domain=$(ynh_app_setting_get --app="$app" --key=domain)
|
|
||||||
#REMOVEME? port=$(ynh_app_setting_get --app="$app" --key=port)
|
|
||||||
#REMOVEME? path=$(ynh_app_setting_get --app="$app" --key=path)
|
|
||||||
|
|
||||||
#REMOVEME? client_max_body_size=$(ynh_app_setting_get --app="$app" --key=client_max_body_size)
|
|
||||||
|
|
||||||
#REMOVEME? db_name=$(ynh_app_setting_get --app="$app" --key=db_name)
|
|
||||||
#REMOVEME? db_user=$(ynh_app_setting_get --app="$app" --key=db_user)
|
|
||||||
#REMOVEME? db_pwd=$(ynh_app_setting_get --app="$app" --key=db_pwd)
|
|
||||||
|
|
||||||
#REMOVEME? data_dir=$(ynh_app_setting_get --app="$app" --key=data_dir)
|
|
||||||
|
|
||||||
#REMOVEME? cache_memory_target=$(ynh_app_setting_get --app="$app" --key=cache_memory_target)
|
|
||||||
|
|
||||||
#REMOVEME? instance_expose_peers=$(ynh_app_setting_get --app="$app" --key=instance_expose_peers)
|
|
||||||
#REMOVEME? instance_expose_suspended=$(ynh_app_setting_get --app="$app" --key=instance_expose_suspended)
|
|
||||||
#REMOVEME? instance_expose_suspended_web=$(ynh_app_setting_get --app="$app" --key=instance_expose_suspended_web)
|
|
||||||
#REMOVEME? instance_expose_public_timeline=$(ynh_app_setting_get --app="$app" --key=instance_expose_public_timeline)
|
|
||||||
#REMOVEME? instance_deliver_to_shared_inboxes=$(ynh_app_setting_get --app="$app" --key=instance_deliver_to_shared_inboxes)
|
|
||||||
#REMOVEME? instance_inject_mastodon_version=$(ynh_app_setting_get --app="$app" --key=instance_inject_mastodon_version)
|
|
||||||
|
|
||||||
#REMOVEME? accounts_registration_open=$(ynh_app_setting_get --app="$app" --key=accounts_registration_open)
|
|
||||||
#REMOVEME? accounts_approval_required=$(ynh_app_setting_get --app="$app" --key=accounts_approval_required)
|
|
||||||
#REMOVEME? accounts_reason_required=$(ynh_app_setting_get --app="$app" --key=accounts_reason_required)
|
|
||||||
#REMOVEME? accounts_allow_custom_css=$(ynh_app_setting_get --app="$app" --key=accounts_allow_custom_css)
|
|
||||||
#REMOVEME? accounts_custom_css_length=$(ynh_app_setting_get --app="$app" --key=accounts_custom_css_length)
|
|
||||||
|
|
||||||
#REMOVEME? media_image_max_size=$(ynh_app_setting_get --app="$app" --key=media_image_max_size)
|
|
||||||
#REMOVEME? media_video_max_size=$(ynh_app_setting_get --app="$app" --key=media_video_max_size)
|
|
||||||
#REMOVEME? media_description_min_chars=$(ynh_app_setting_get --app="$app" --key=media_description_min_chars)
|
|
||||||
#REMOVEME? media_description_max_chars=$(ynh_app_setting_get --app="$app" --key=media_description_max_chars)
|
|
||||||
#REMOVEME? media_remote_cache_days=$(ynh_app_setting_get --app="$app" --key=media_remote_cache_days)
|
|
||||||
#REMOVEME? media_emoji_local_max_size=$(ynh_app_setting_get --app="$app" --key=media_emoji_local_max_size)
|
|
||||||
#REMOVEME? media_emoji_remote_max_size=$(ynh_app_setting_get --app="$app" --key=media_emoji_remote_max_size)
|
|
||||||
|
|
||||||
#REMOVEME? storage_backend=$(ynh_app_setting_get --app="$app" --key=storage_backend)
|
|
||||||
#REMOVEME? storage_s3_endpoint=$(ynh_app_setting_get --app="$app" --key=storage_s3_endpoint)
|
|
||||||
#REMOVEME? storage_s3_proxy=$(ynh_app_setting_get --app="$app" --key=storage_s3_proxy)
|
|
||||||
#REMOVEME? storage_s3_access_key=$(ynh_app_setting_get --app="$app" --key=storage_s3_access_key)
|
|
||||||
#REMOVEME? storage_s3_secret_key=$(ynh_app_setting_get --app="$app" --key=storage_s3_secret_key)
|
|
||||||
#REMOVEME? storage_s3_bucket=$(ynh_app_setting_get --app="$app" --key=storage_s3_bucket)
|
|
||||||
|
|
||||||
#REMOVEME? statuses_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_max_chars)
|
|
||||||
#REMOVEME? statuses_cw_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_cw_max_chars)
|
|
||||||
#REMOVEME? statuses_poll_max_options=$(ynh_app_setting_get --app="$app" --key=statuses_poll_max_options)
|
|
||||||
#REMOVEME? statuses_poll_option_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_poll_option_max_chars)
|
|
||||||
#REMOVEME? statuses_media_max_files=$(ynh_app_setting_get --app="$app" --key=statuses_media_max_files)
|
|
||||||
|
|
||||||
#REMOVEME? smtp_host=$(ynh_app_setting_get --app="$app" --key=smtp_host)
|
|
||||||
#REMOVEME? smtp_port=$(ynh_app_setting_get --app="$app" --key=smtp_port)
|
|
||||||
#REMOVEME? smtp_username=$(ynh_app_setting_get --app="$app" --key=smtp_username)
|
|
||||||
#REMOVEME? smtp_password=$(ynh_app_setting_get --app="$app" --key=smtp_password)
|
|
||||||
#REMOVEME? smtp_from=$(ynh_app_setting_get --app="$app" --key=smtp_from)
|
|
||||||
#REMOVEME? smtp_disclose_recipients=$(ynh_app_setting_get --app="$app" --key=smtp_disclose_recipients)
|
|
||||||
|
|
||||||
#REMOVEME? advanced_cookies_samesite=$(ynh_app_setting_get --app="$app" --key=advanced_cookies_samesite)
|
|
||||||
#REMOVEME? advanced_rate_limit_requests=$(ynh_app_setting_get --app="$app" --key=advanced_rate_limit_requests)
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
|
||||||
|
|
||||||
#REMOVEME? test ! -d "$install_dir" \
|
|
||||||
|| ynh_die --message="There is already a directory: $install_dir "
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD RESTORATION STEPS
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RECREATE THE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
|
||||||
#REMOVEME? ynh_system_user_create --username="$app" --home_dir="$install_dir"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -122,13 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$install_dir"
|
ynh_restore_file --origin_path="$install_dir"
|
||||||
|
|
||||||
# FIXME: this should be managed by the core in the future
|
|
||||||
# Here, as a packager, you may have to tweak the ownerhsip/permissions
|
|
||||||
# such that the appropriate users (e.g. maybe www-data) can access
|
|
||||||
# files in some cases.
|
|
||||||
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
|
|
||||||
# this will be treated as a security issue.
|
|
||||||
chmod 750 "$install_dir"
|
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R "$app:www-data" "$install_dir"
|
chown -R "$app:www-data" "$install_dir"
|
||||||
|
|
||||||
|
@ -139,91 +27,36 @@ ynh_script_progression --message="Restoring the data directory..." --weight=5
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$data_dir" --not_mandatory
|
ynh_restore_file --origin_path="$data_dir" --not_mandatory
|
||||||
|
|
||||||
mkdir -p "$data_dir"
|
|
||||||
|
|
||||||
# FIXME: this should be managed by the core in the future
|
|
||||||
# Here, as a packager, you may have to tweak the ownerhsip/permissions
|
|
||||||
# such that the appropriate users (e.g. maybe www-data) can access
|
|
||||||
# files in some cases.
|
|
||||||
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
|
|
||||||
# this will be treated as a security issue.
|
|
||||||
chmod 750 "$data_dir"
|
|
||||||
chmod -R o-rwx "$data_dir"
|
|
||||||
chown -R "$app:www-data" "$data_dir"
|
chown -R "$app:www-data" "$data_dir"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC RESTORATION
|
|
||||||
#=================================================
|
|
||||||
# REINSTALL DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=5
|
|
||||||
|
|
||||||
# Define and install dependencies
|
|
||||||
#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies "$pkg_dependencies"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE POSTGRESQL DATABASE
|
# RESTORE THE POSTGRESQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
#REMOVEME? ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=5
|
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=5
|
||||||
|
|
||||||
#REMOVEME? ynh_psql_test_if_first_run
|
|
||||||
#REMOVEME? ynh_psql_setup_db --db_user="$db_user" --db_name="$db_name" --db_pwd="$db_pwd"
|
|
||||||
ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS unaccent;" --database="$db_name"
|
ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS unaccent;" --database="$db_name"
|
||||||
ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database="$db_name"
|
ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database="$db_name"
|
||||||
ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS citext;" --database="$db_name"
|
ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS citext;" --database="$db_name"
|
||||||
ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" --database="$db_name"
|
ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" --database="$db_name"
|
||||||
ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name"
|
ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Setting up source files..." --weight=1
|
|
||||||
|
|
||||||
### `ynh_setup_source` is used to install an app from a zip or tar.gz file,
|
|
||||||
### downloaded from an upstream source, like a git repository.
|
|
||||||
### `ynh_setup_source` use the file conf/app.src
|
|
||||||
|
|
||||||
# detect_arch comes from _common.sh / personnal helpers
|
|
||||||
architecture="$(detect_arch)"
|
|
||||||
|
|
||||||
# compare if the system arch is different from the binary arch
|
|
||||||
# if so, download the correct binary
|
|
||||||
if [ "$architecture" != "$(file "$install_dir"/gotosocial | cut -d ',' -f 2 | tr -d ' ')" ]
|
|
||||||
then
|
|
||||||
ynh_script_progression --message="Migrating binary architecture..."
|
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
|
||||||
ynh_setup_source --dest_dir="$install_dir" --keep="config.yaml"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# FIXME: this should be managed by the core in the future
|
|
||||||
# Here, as a packager, you may have to tweak the ownerhsip/permissions
|
|
||||||
# such that the appropriate users (e.g. maybe www-data) can access
|
|
||||||
# files in some cases.
|
|
||||||
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder _
|
|
||||||
# this will be treated as a security issue.
|
|
||||||
chmod 750 "$install_dir"
|
|
||||||
chmod -R o-rwx "$install_dir"
|
|
||||||
chown -R "$app:www-data" "$install_dir"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE VARIOUS FILES
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
mkdir -p "/var/log/$app"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEMD
|
# RESTORE SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
|
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||||
systemctl enable "$app.service" --quiet
|
systemctl enable "$app.service" --quiet
|
||||||
|
|
||||||
#=================================================
|
mkdir -p "/var/log/$app"
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
|
||||||
#=================================================
|
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
|
||||||
|
ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
|
||||||
|
ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
|
||||||
|
ynh_systemd_action --action=restart --service_name=fail2ban
|
||||||
|
|
||||||
yunohost service add "$app" --description="Gotosocial server" --log="/var/log/$app/$app.log"
|
yunohost service add "$app" --description="Gotosocial server" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
|
@ -234,28 +67,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
|
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE LOGROTATE CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE FAIL2BAN CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
|
|
||||||
ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
|
|
||||||
ynh_systemd_action --action=restart --service_name=fail2ban
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
# RELOAD NGINX
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -9,101 +9,12 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# LOAD SETTINGS
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Loading installation settings..."
|
|
||||||
|
|
||||||
#REMOVEME? app="$YNH_APP_INSTANCE_NAME"
|
|
||||||
|
|
||||||
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir)
|
|
||||||
|
|
||||||
#REMOVEME? landing_page_user=$(ynh_app_setting_get --app="$app" --key=landing_page_user)
|
|
||||||
|
|
||||||
#REMOVEME? domain=$(ynh_app_setting_get --app="$app" --key=domain)
|
|
||||||
#REMOVEME? port=$(ynh_app_setting_get --app="$app" --key=port)
|
|
||||||
#REMOVEME? path=$(ynh_app_setting_get --app="$app" --key=path)
|
|
||||||
|
|
||||||
#REMOVEME? client_max_body_size=$(ynh_app_setting_get --app="$app" --key=client_max_body_size)
|
|
||||||
|
|
||||||
#REMOVEME? db_name=$(ynh_app_setting_get --app="$app" --key=db_name)
|
|
||||||
#REMOVEME? db_user=$(ynh_app_setting_get --app="$app" --key=db_user)
|
|
||||||
#REMOVEME? db_pwd=$(ynh_app_setting_get --app="$app" --key=db_pwd)
|
|
||||||
|
|
||||||
#REMOVEME? data_dir=$(ynh_app_setting_get --app="$app" --key=data_dir)
|
|
||||||
|
|
||||||
#REMOVEME? cache_memory_target=$(ynh_app_setting_get --app="$app" --key=cache_memory_target)
|
|
||||||
|
|
||||||
#REMOVEME? instance_expose_peers=$(ynh_app_setting_get --app="$app" --key=instance_expose_peers)
|
|
||||||
#REMOVEME? instance_expose_suspended=$(ynh_app_setting_get --app="$app" --key=instance_expose_suspended)
|
|
||||||
#REMOVEME? instance_expose_suspended_web=$(ynh_app_setting_get --app="$app" --key=instance_expose_suspended_web)
|
|
||||||
#REMOVEME? instance_expose_public_timeline=$(ynh_app_setting_get --app="$app" --key=instance_expose_public_timeline)
|
|
||||||
#REMOVEME? instance_deliver_to_shared_inboxes=$(ynh_app_setting_get --app="$app" --key=instance_deliver_to_shared_inboxes)
|
|
||||||
#REMOVEME? instance_inject_mastodon_version=$(ynh_app_setting_get --app="$app" --key=instance_inject_mastodon_version)
|
|
||||||
|
|
||||||
#REMOVEME? accounts_registration_open=$(ynh_app_setting_get --app="$app" --key=accounts_registration_open)
|
|
||||||
#REMOVEME? accounts_approval_required=$(ynh_app_setting_get --app="$app" --key=accounts_approval_required)
|
|
||||||
#REMOVEME? accounts_reason_required=$(ynh_app_setting_get --app="$app" --key=accounts_reason_required)
|
|
||||||
#REMOVEME? accounts_allow_custom_css=$(ynh_app_setting_get --app="$app" --key=accounts_allow_custom_css)
|
|
||||||
#REMOVEME? accounts_custom_css_length=$(ynh_app_setting_get --app="$app" --key=accounts_custom_css_length)
|
|
||||||
|
|
||||||
#REMOVEME? media_image_max_size=$(ynh_app_setting_get --app="$app" --key=media_image_max_size)
|
|
||||||
#REMOVEME? media_video_max_size=$(ynh_app_setting_get --app="$app" --key=media_video_max_size)
|
|
||||||
#REMOVEME? media_description_min_chars=$(ynh_app_setting_get --app="$app" --key=media_description_min_chars)
|
|
||||||
#REMOVEME? media_description_max_chars=$(ynh_app_setting_get --app="$app" --key=media_description_max_chars)
|
|
||||||
#REMOVEME? media_remote_cache_days=$(ynh_app_setting_get --app="$app" --key=media_remote_cache_days)
|
|
||||||
#REMOVEME? media_emoji_local_max_size=$(ynh_app_setting_get --app="$app" --key=media_emoji_local_max_size)
|
|
||||||
#REMOVEME? media_emoji_remote_max_size=$(ynh_app_setting_get --app="$app" --key=media_emoji_remote_max_size)
|
|
||||||
|
|
||||||
#REMOVEME? storage_backend=$(ynh_app_setting_get --app="$app" --key=storage_backend)
|
|
||||||
#REMOVEME? storage_s3_endpoint=$(ynh_app_setting_get --app="$app" --key=storage_s3_endpoint)
|
|
||||||
#REMOVEME? storage_s3_proxy=$(ynh_app_setting_get --app="$app" --key=storage_s3_proxy)
|
|
||||||
#REMOVEME? storage_s3_access_key=$(ynh_app_setting_get --app="$app" --key=storage_s3_access_key)
|
|
||||||
#REMOVEME? storage_s3_secret_key=$(ynh_app_setting_get --app="$app" --key=storage_s3_secret_key)
|
|
||||||
#REMOVEME? storage_s3_bucket=$(ynh_app_setting_get --app="$app" --key=storage_s3_bucket)
|
|
||||||
|
|
||||||
#REMOVEME? statuses_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_max_chars)
|
|
||||||
#REMOVEME? statuses_cw_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_cw_max_chars)
|
|
||||||
#REMOVEME? statuses_poll_max_options=$(ynh_app_setting_get --app="$app" --key=statuses_poll_max_options)
|
|
||||||
#REMOVEME? statuses_poll_option_max_chars=$(ynh_app_setting_get --app="$app" --key=statuses_poll_option_max_chars)
|
|
||||||
#REMOVEME? statuses_media_max_files=$(ynh_app_setting_get --app="$app" --key=statuses_media_max_files)
|
|
||||||
|
|
||||||
#REMOVEME? smtp_host=$(ynh_app_setting_get --app="$app" --key=smtp_host)
|
|
||||||
#REMOVEME? smtp_port=$(ynh_app_setting_get --app="$app" --key=smtp_port)
|
|
||||||
#REMOVEME? smtp_username=$(ynh_app_setting_get --app="$app" --key=smtp_username)
|
|
||||||
#REMOVEME? smtp_password=$(ynh_app_setting_get --app="$app" --key=smtp_password)
|
|
||||||
#REMOVEME? smtp_from=$(ynh_app_setting_get --app="$app" --key=smtp_from)
|
|
||||||
#REMOVEME? smtp_disclose_recipients=$(ynh_app_setting_get --app="$app" --key=smtp_disclose_recipients)
|
|
||||||
|
|
||||||
#REMOVEME? advanced_cookies_samesite=$(ynh_app_setting_get --app="$app" --key=advanced_cookies_samesite)
|
|
||||||
#REMOVEME? advanced_rate_limit_requests=$(ynh_app_setting_get --app="$app" --key=advanced_rate_limit_requests)
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
### This helper will compare the version of the currently installed app and the version of the upstream package.
|
|
||||||
### $upgrade_type can have 2 different values
|
|
||||||
### - UPGRADE_APP if the upstream app version has changed
|
|
||||||
### - UPGRADE_PACKAGE if only the YunoHost package has changed
|
|
||||||
### ynh_check_app_version_changed will stop the upgrade if the app is up to date.
|
|
||||||
### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do.
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
|
||||||
#=================================================
|
|
||||||
#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
|
|
||||||
|
|
||||||
# Backup the current version of the app
|
|
||||||
#REMOVEME? ynh_backup_before_upgrade
|
|
||||||
#REMOVEME? ynh_clean_setup () {
|
|
||||||
# Restore it if the upgrade fails
|
|
||||||
#REMOVEME? ynh_restore_upgradebackup
|
|
||||||
}
|
|
||||||
# Exit if an error occurs during the execution of the script
|
|
||||||
#REMOVEME? ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
9
tests.toml
Normal file
9
tests.toml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
test_format = 1.0
|
||||||
|
|
||||||
|
[default]
|
||||||
|
|
||||||
|
# -------------------------------
|
||||||
|
# Commits to test upgrade from
|
||||||
|
# -------------------------------
|
||||||
|
|
||||||
|
test_upgrade_from.9a6d018337c7d83193282830ff9d9e9b0ae3a733.name = "Upgrade from 0.6.0~ynh1"
|
Loading…
Add table
Reference in a new issue