1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ffsync_ynh.git synced 2024-09-03 18:26:38 +02:00

Merge branch 'testing' into fix_nginx_issue

This commit is contained in:
Josue-T 2023-01-25 07:55:02 +01:00 committed by GitHub
commit ecf0900fe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 134 additions and 86 deletions

View file

@ -1,11 +1,17 @@
# Mozillas Sync Server for YunoHost <!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
[![Integration level](https://dash.yunohost.org/integration/ffsync.svg)](https://dash.yunohost.org/appci/app/ffsync) ![](https://ci-apps.yunohost.org/ci/badges/ffsync.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/ffsync.maintain.svg) # Firefox Sync Server for YunoHost
[![Install ffsync with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ffsync)
[![Integration level](https://dash.yunohost.org/integration/ffsync.svg)](https://dash.yunohost.org/appci/app/ffsync) ![Working status](https://ci-apps.yunohost.org/ci/badges/ffsync.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/ffsync.maintain.svg)
[![Install Firefox Sync Server with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ffsync)
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
> *This package allow you to install ffsync quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* > *This package allows you to install Firefox Sync Server quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## Overview ## Overview
@ -13,35 +19,13 @@ The Sync Server provides a replacement for Firefoxs default server (hosted at
By default, a server set up will defer authentication to the Mozilla-hosted accounts server at [https://accounts.firefox.com](https://accounts.firefox.com). So you will still have to authenticate at Mozilla, but _the storage of your information will be done on your host_. By default, a server set up will defer authentication to the Mozilla-hosted accounts server at [https://accounts.firefox.com](https://accounts.firefox.com). So you will still have to authenticate at Mozilla, but _the storage of your information will be done on your host_.
**Shipped version:** 1.9.1 **Shipped version:** 1.9.1~ynh3
## Disclaimers / important information
## Documentation
* Official documentation: https://mozilla-services.readthedocs.io/en/latest/howtos/run-sync-1.5.html
* YunoHost documentation: https://yunohost.org/#/app_ffsync
## Configuration ## Configuration
Once installed, reaching `http://domain.tld/path` should show a page explaining how to configure it. Once installed, reaching `http://domain.tld/path` should show a page explaining how to configure it.
## Links
* Report a bug about this package: https://github.com/YunoHost-Apps/ffsync_ynh/issues
* Upstream app repository: https://github.com/mozilla-services/syncserver
* YunoHost website: https://yunohost.org/
---
## Developers info
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/ffsync_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
sudo yunohost app install https://github.com/YunoHost-Apps/ffsync_ynh/tree/testing --debug
or
sudo yunohost app upgrade ffsync -u https://github.com/YunoHost-Apps/ffsync_ynh/tree/testing --debug
```
### Solving problems with Android ### Solving problems with Android
The sure-fire way to know what Sync on Android is really doing is to observe the Android device log using adb logcat. Youll want to bump your log-level: The sure-fire way to know what Sync on Android is really doing is to observe the Android device log using adb logcat. Youll want to bump your log-level:
@ -61,3 +45,28 @@ D FxAccounts(...) fennec :: BaseResource :: HTTP GET https://token.stage.mozaws.
... ...
D FxAccounts(...) fennec :: BaseResource :: HTTP GET https://sync-4-us-east-1.stage.mozaws.net/ D FxAccounts(...) fennec :: BaseResource :: HTTP GET https://sync-4-us-east-1.stage.mozaws.net/
``` ```
## :red_circle: Antifeatures
- **Upstream not maintained**: This software is not maintained anymore. Expect it to break down over time, be exposed to unfixed security breaches, etc.
## Documentation and resources
* Official admin documentation: <https://mozilla-services.readthedocs.io/en/latest/howtos/run-sync-1.5.html>
* Upstream app code repository: <https://github.com/mozilla-services/syncserver>
* YunoHost documentation for this app: <https://yunohost.org/app_ffsync>
* Report a bug: <https://github.com/YunoHost-Apps/ffsync_ynh/issues>
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/ffsync_ynh/tree/testing).
To try the testing branch, please proceed like that.
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/ffsync_ynh/tree/testing --debug
or
sudo yunohost app upgrade ffsync -u https://github.com/YunoHost-Apps/ffsync_ynh/tree/testing --debug
```
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,48 +1,51 @@
# Serveur de synchronisation de Firefox pour YunoHost <!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
[![Integration level](https://dash.yunohost.org/integration/ffsync.svg)](https://dash.yunohost.org/appci/app/ffsync) ![](https://ci-apps.yunohost.org/ci/badges/ffsync.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/ffsync.maintain.svg) # Firefox Sync Server pour YunoHost
[![Install ffsync with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ffsync)
[![Niveau dintégration](https://dash.yunohost.org/integration/ffsync.svg)](https://dash.yunohost.org/appci/app/ffsync) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/ffsync.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/ffsync.maintain.svg)
[![Installer Firefox Sync Server avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ffsync)
*[Read this readme in english.](./README.md)* *[Read this readme in english.](./README.md)*
> *Ce package vous permet d'installer ffsync rapidement et simplement sur un serveur Yunohost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
## Vue d'ensemble > *Ce package vous permet dinstaller Firefox Sync Server rapidement et simplement sur un serveur YunoHost.
Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment linstaller et en profiter.*
## Vue densemble
Le serveur de synchronisation permet un remplacement du serveur par défaut de Firefox (hébergé par Mozilla). Le serveur de synchronisation permet un remplacement du serveur par défaut de Firefox (hébergé par Mozilla).
Par défaut, le serveur reporte l'authentification aux serveurs de comptes de Mozilla à https://accounts.firefox.com. vous vous authentifierez donc sur les serveurs de Mozilla, mais _le stockage de vos informations se fera sur votre serveur_. Par défaut, le serveur reporte l'authentification aux serveurs de comptes de Mozilla à https://accounts.firefox.com. vous vous authentifierez donc sur les serveurs de Mozilla, mais _le stockage de vos informations se fera sur votre serveur_.
**Version incluse :** 1.9.1 **Version incluse :** 1.9.1~ynh3
## Avertissements / informations importantes
## Documentation
* Documentation officialle : https://mozilla-services.readthedocs.io/en/latest/howtos/run-sync-1.5.html
* Documentation YunoHost : https://yunohost.org/#/app_ffsync
## Configuration ## Configuration
Une fois installé, la page `http://domain.tld/path` vous explique comment l'utiliser. Une fois installé, la page `http://domain.tld/path` vous explique comment l'utiliser.
## :red_circle: Fonctions indésirables
#### Architectures supportées - **Upstream not maintained**: This software is not maintained anymore. Expect it to break down over time, be exposed to unfixed security breaches, etc.
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/ffsync%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/ffsync/) ## Documentations et ressources
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/ffsync%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/ffsync/)
## Liens * Documentation officielle de ladmin : <https://mozilla-services.readthedocs.io/en/latest/howtos/run-sync-1.5.html>
* Dépôt de code officiel de lapp : <https://github.com/mozilla-services/syncserver>
* Rapporter un bug : https://github.com/YunoHost-Apps/ffsync_ynh/issues * Documentation YunoHost pour cette app : <https://yunohost.org/app_ffsync>
* Dépôt de Sync Server : https://github.com/mozilla-services/syncserver * Signaler un bug : <https://github.com/YunoHost-Apps/ffsync_ynh/issues>
* Site de YunoHost : https://yunohost.org/
---
## Informations pour les développeurs ## Informations pour les développeurs
Merci de faire votre « pull request » sur la [branche testing](https://github.com/YunoHost-Apps/ffsync_ynh/tree/testing). Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/ffsync_ynh/tree/testing).
Pour tester la branche testing, faites comme ceci.
``` Pour essayer la branche testing, procédez comme suit.
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/ffsync_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/ffsync_ynh/tree/testing --debug
ou ou
sudo yunohost app upgrade ffsync -u https://github.com/YunoHost-Apps/ffsync_ynh/tree/testing --debug sudo yunohost app upgrade ffsync -u https://github.com/YunoHost-Apps/ffsync_ynh/tree/testing --debug
``` ```
**Plus dinfos sur le packaging dapplications :** <https://yunohost.org/packaging_apps>

View file

@ -1,7 +1,7 @@
;; Test name ;; Test name
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld"
path="/path" (PATH) path="/path"
; Checks ; Checks
pkg_linter=1 pkg_linter=1
setup_sub_dir=1 setup_sub_dir=1

3
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1,3 @@
The Sync Server provides a replacement for Firefoxs default server (hosted at Mozilla).
By default, a server set up will defer authentication to the Mozilla-hosted accounts server at [https://accounts.firefox.com](https://accounts.firefox.com). So you will still have to authenticate at Mozilla, but _the storage of your information will be done on your host_.

3
doc/DESCRIPTION_fr.md Normal file
View file

@ -0,0 +1,3 @@
Le serveur de synchronisation permet un remplacement du serveur par défaut de Firefox (hébergé par Mozilla).
Par défaut, le serveur reporte l'authentification aux serveurs de comptes de Mozilla à https://accounts.firefox.com. vous vous authentifierez donc sur les serveurs de Mozilla, mais _le stockage de vos informations se fera sur votre serveur_.

23
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,23 @@
## Configuration
Once installed, reaching `http://domain.tld/path` should show a page explaining how to configure it.
### Solving problems with Android
The sure-fire way to know what Sync on Android is really doing is to observe the Android device log using adb logcat. Youll want to bump your log-level:
```
adb shell setprop log.tag.FxAccounts VERBOSE
```
Then, you can observe the log using:
```
adb logcat | grep FxAccounts
```
Its best to observe the log while you force a sync from the Android Settings App. You should see output like:
```
D FxAccounts(...) fennec :: BaseResource :: HTTP GET https://token.stage.mozaws.net/1.0/sync/1.5
...
D FxAccounts(...) fennec :: BaseResource :: HTTP GET https://sync-4-us-east-1.stage.mozaws.net/
```

3
doc/DISCLAIMER_fr.md Normal file
View file

@ -0,0 +1,3 @@
## Configuration
Une fois installé, la page `http://domain.tld/path` vous explique comment l'utiliser.

View file

@ -4,10 +4,15 @@
"packaging_format": 1, "packaging_format": 1,
"description": { "description": {
"en": "Mozillas Sync-Server to host your Firefox account data", "en": "Mozillas Sync-Server to host your Firefox account data",
"fr": "Le serveur de synchronisation de Mozilla, pour héberger vos données Firefox" "fr": "Serveur de synchronisation de Mozilla, pour héberger vos données Firefox"
}, },
"version": "1.9.1~ynh4", "version": "1.9.1~ynh4",
"url": "https://github.com/mozilla-services/syncserver", "url": "https://github.com/mozilla-services/syncserver",
"upstream": {
"license": "MPL-2.0",
"admindoc": "https://mozilla-services.readthedocs.io/en/latest/howtos/run-sync-1.5.html",
"code": "https://github.com/mozilla-services/syncserver"
},
"license": "MPL-2.0", "license": "MPL-2.0",
"maintainer": { "maintainer": {
"name": "Josué Tille", "name": "Josué Tille",
@ -31,8 +36,7 @@
"install" : [ "install" : [
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain"
"example": "domain.org"
}, },
{ {
"name": "path", "name": "path",

View file

@ -32,29 +32,28 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_print_info --message="Backing up the main app directory..."
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Backing up nginx web server configuration..."
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
# BACKUP THE MYSQL DATABASE
#=================================================
ynh_print_info --message="Backing up the MySQL database..."
ynh_mysql_dump_db --database="$db_name" > db.sql
#================================================= #=================================================
# SPECIFIC BACKUP # SPECIFIC BACKUP
#================================================= #=================================================
# BACKUP THE systemd FILES
ynh_print_info --message="Backing up systemd..."
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP THE MYSQL DATABASE
#=================================================
ynh_print_info --message="Backing up the MySQL database..."
ynh_mysql_dump_db --database="$db_name" > db.sql
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -49,12 +49,11 @@ ynh_app_setting_set --app $app --key web_port --value $port
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
#=================================================
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --weight=7 ynh_script_progression --message="Installing dependencies..." --weight=7
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
@ -72,7 +71,6 @@ ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
#================================================= #=================================================
ynh_script_progression --message="Installing sources files..." --weight=10 ynh_script_progression --message="Installing sources files..." --weight=10
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
install_sources install_sources
@ -83,7 +81,8 @@ install_sources
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring nginx" ynh_script_progression --message="Configuring NGINX"
if [ "$path_url" == "/" ] if [ "$path_url" == "/" ]
then then
# $finalnginxconf comes from ynh_add_nginx_config # $finalnginxconf comes from ynh_add_nginx_config
@ -98,15 +97,16 @@ ynh_add_nginx_config 'is_subpath'
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Configuring system user..." ynh_script_progression --message="Configuring system user..."
# Create a system user # Create a system user
ynh_system_user_create --username=$app --home_dir=$final_path ynh_system_user_create --username=$app --home_dir=$final_path
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
ynh_script_progression --message="Configuring application..."
# create config file syncserver.ini # create config file syncserver.ini
ynh_script_progression --message="Configuring application..."
ynh_add_config --template="syncserver.ini" --destination="$final_path/syncserver.ini" ynh_add_config --template="syncserver.ini" --destination="$final_path/syncserver.ini"
# Configure init script # Configure init script
@ -135,14 +135,15 @@ set_permissions
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring permissions" ynh_script_progression --message="Configuring permissions"
# accessible by everyone (authentification is done by firefox accounts)
# accessible by everyone (authentification is done by firefox accounts)
ynh_permission_update --permission=main --add=visitors --protected=true --show_tile=true ynh_permission_update --permission=main --add=visitors --protected=true --show_tile=true
#================================================= #=================================================
# RELOAD Services # RELOAD Services
#================================================= #=================================================
ynh_script_progression --message="Restart services..." ynh_script_progression --message="Restart services..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
ynh_script_progression --message="Starting $app services..." --weight=3 ynh_script_progression --message="Starting $app services..." --weight=3

View file

@ -30,21 +30,23 @@ db_user=$db_name
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
#================================================= #=================================================
test ! -d $final_path \ test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path " || ynh_die --message="There is already a directory: $final_path "
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
#================================================= #=================================================
ynh_script_progression --message="Restoring files..." --weight=5
# Restore all config and data # Restore all config and data
ynh_script_progression --message="Restoring files..." --weight=5
ynh_restore ynh_restore
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Recreating the dedicated system user..." ynh_script_progression --message="Recreating the dedicated system user..."
ynh_system_user_create --username="$app" ynh_system_user_create --username="$app"
usermod --append --groups www-data "$app" usermod --append --groups www-data "$app"
@ -77,8 +79,8 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_script_progression --message="Reloading services..." --weight=3 ynh_script_progression --message="Reloading services..." --weight=3
systemctl daemon-reload systemctl daemon-reload
systemctl enable --quiet $app.service systemctl enable --quiet $app.service
yunohost service add "$app" yunohost service add "$app"
@ -88,8 +90,8 @@ yunohost service add "$app"
#================================================= #=================================================
# RELOAD NGINX AND UWSGI # RELOAD NGINX AND UWSGI
#================================================= #=================================================
ynh_script_progression --message="Starting pgadmin services..." --weight=3 ynh_script_progression --message="Starting pgadmin services..." --weight=3
ynh_systemd_action --service_name "$app.service" \ ynh_systemd_action --service_name "$app.service" \
--line_match "Booting worker with pid" --log_path "systemd" --line_match "Booting worker with pid" --log_path "systemd"
ynh_systemd_action --service_name=nginx --action=reload -t 20 ynh_systemd_action --service_name=nginx --action=reload -t 20

View file

@ -28,7 +28,6 @@ db_user=$app
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
ynh_print_info --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
@ -113,21 +112,19 @@ fi
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#=================================================
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." ynh_script_progression --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." --weight=6
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_script_progression --message="Upgrading source files..." --weight=6
if [ -e $final_path/syncserver.ini ]; then if [ -e $final_path/syncserver.ini ]; then
config_backup="$(cat $final_path/syncserver.ini)" config_backup="$(cat $final_path/syncserver.ini)"
install_sources install_sources
@ -139,7 +136,8 @@ fi
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring nginx" ynh_script_progression --message="Configuring NGINX"
if [ "$path_url" == "/" ] if [ "$path_url" == "/" ]
then then
# $finalnginxconf comes from ynh_add_nginx_config # $finalnginxconf comes from ynh_add_nginx_config
@ -159,9 +157,9 @@ ynh_system_user_create --username="$app"
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================
# SETUP UWSGI
ynh_script_progression --message="Configuring application..." ynh_script_progression --message="Configuring application..."
# SETUP UWSGI
# create config file syncserver.ini # create config file syncserver.ini
ynh_script_progression --message="Configuring application..." ynh_script_progression --message="Configuring application..."
ynh_add_config --template="syncserver.ini" --destination="$final_path/syncserver.ini" ynh_add_config --template="syncserver.ini" --destination="$final_path/syncserver.ini"
@ -187,8 +185,8 @@ set_permissions
#================================================= #=================================================
# Migrate legacy permissions to new system # Migrate legacy permissions to new system
#================================================= #=================================================
ynh_script_progression --message="Set permissions..." ynh_script_progression --message="Set permissions..."
if ynh_legacy_permissions_exists if ynh_legacy_permissions_exists
then then
ynh_legacy_permissions_delete_all ynh_legacy_permissions_delete_all