1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/garage_ynh.git synced 2024-09-03 18:36:32 +02:00

Merge pull request #1 from YunoHost-Apps/testing

Testing
This commit is contained in:
oiseauroch 2023-01-25 14:25:51 +00:00 committed by GitHub
commit ca2c127608
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 110 additions and 106 deletions

View file

@ -15,37 +15,35 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview ## Overview
Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Garage is an S3-compatible distributed object storage service designed for self-hosting at a small-to-medium scale.
Garage is designed for storage clusters composed of nodes running at different physical locations, in order to easily provide a storage service that replicates data at these different locations and stays available even when some servers are unreachable. Garage also focuses on being lightweight, easy to operate, and highly resilient to machine failures.
### Features ### Features
- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; - S3 API
- Laboris nisi ut aliquip ex ea commodo consequat ; - Standalone/self-contained
- Duis aute irure dolor in reprehenderit in voluptate ; - Flexible topology
- Velit esse cillum dolore eu fugiat nulla pariatur ; - No RAFT slowing you down
- Excepteur sint occaecat cupidatat non proident, sunt in culpa." - Several replication modes
- Web server for static websites
- Bucket names as aliases
- Cluster administration API
- Metrics and traces
- Support for changing IP addresses
- K2V API (experimental)
**Shipped version:** 0.8.0~ynh1 **Shipped version:** 0.8.0~ynh1
## Screenshots
![Screenshot of garage_ynh](./doc/screenshots/example.jpg)
## Disclaimers / important information ## Disclaimers / important information
* Any known limitations, constrains or stuff not working, such as (but not limited to): * Limitations :
* requiring a full dedicated domain ? * This application is not usable if you're not part of a cluster with minimun 3 other nodes
* architectures not supported ?
* not-working single-sign on or LDAP integration ?
* the app requires an important amount of RAM / disk / .. to install or to work properly
* etc...
* Other infos that people should be aware of, such as: * infos you should be aware of:
* any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) * This application provide a node that you can connect to a garage cluster. Few option are manageable by the config panel for the current node but IT DOESN'T offer simpler way to manage bucket and keys. You have to do it by command line or let an other node managing it.
* how to configure / administrate the application if it ain't obvious * This application consider that the weight of the node is the size reserved to garage in G
* upgrade process / specificities / things to be aware of ? * This application will try to create a virtual disk to ensure garage doesn't use more than allowed. If virtualisation is not available your responsible to check space used by garage.
* security considerations ?
## Documentation and resources ## Documentation and resources

View file

@ -15,37 +15,35 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
## Vue d'ensemble ## Vue d'ensemble
Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Garage is an S3-compatible distributed object storage service designed for self-hosting at a small-to-medium scale.
Garage is designed for storage clusters composed of nodes running at different physical locations, in order to easily provide a storage service that replicates data at these different locations and stays available even when some servers are unreachable. Garage also focuses on being lightweight, easy to operate, and highly resilient to machine failures.
### Features ### Features
- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; - S3 API
- Laboris nisi ut aliquip ex ea commodo consequat ; - Standalone/self-contained
- Duis aute irure dolor in reprehenderit in voluptate ; - Flexible topology
- Velit esse cillum dolore eu fugiat nulla pariatur ; - No RAFT slowing you down
- Excepteur sint occaecat cupidatat non proident, sunt in culpa." - Several replication modes
- Web server for static websites
- Bucket names as aliases
- Cluster administration API
- Metrics and traces
- Support for changing IP addresses
- K2V API (experimental)
**Version incluse :** 0.8.0~ynh1 **Version incluse :** 0.8.0~ynh1
## Captures d'écran
![Capture d'écran de garage_ynh](./doc/screenshots/example.jpg)
## Avertissements / informations importantes ## Avertissements / informations importantes
* Any known limitations, constrains or stuff not working, such as (but not limited to): * Limitations :
* requiring a full dedicated domain ? * This application is not usable if you're not part of a cluster with minimun 3 other nodes
* architectures not supported ?
* not-working single-sign on or LDAP integration ?
* the app requires an important amount of RAM / disk / .. to install or to work properly
* etc...
* Other infos that people should be aware of, such as: * infos you should be aware of:
* any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) * This application provide a node that you can connect to a garage cluster. Few option are manageable by the config panel for the current node but IT DOESN'T offer simpler way to manage bucket and keys. You have to do it by command line or let an other node managing it.
* how to configure / administrate the application if it ain't obvious * This application consider that the weight of the node is the size reserved to garage in G
* upgrade process / specificities / things to be aware of ? * This application will try to create a virtual disk to ensure garage doesn't use more than allowed. If virtualisation is not available your responsible to check space used by garage.
* security considerations ?
## Documentations et ressources ## Documentations et ressources

View file

@ -6,16 +6,19 @@
;; Test complet ;; Test complet
; Manifest ; Manifest
domain="domain.tld" domain="domain.tld"
path="/" rpc_secret=""
bootstrap_peers=""
weight="10"
datadir=""
; Checks ; Checks
pkg_linter=1 pkg_linter=1
setup_sub_dir=0 setup_sub_dir=0
setup_root=1 setup_root=0
setup_nourl=0 setup_nourl=1
setup_private=0 setup_private=0
setup_public=1 setup_public=0
upgrade=1 upgrade=1
upgrade=1 from_commit=CommitHash upgrade=0 from_commit=CommitHash
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
port_already_use=0 port_already_use=0
@ -26,4 +29,4 @@ Notification=none
;;; Upgrade options ;;; Upgrade options
; commit=CommitHash ; commit=CommitHash
name=Name and date of the commit. name=Name and date of the commit.
manifest_arg=domain=DOMAIN&path=PATH&is_public=1&language=fr&admin=USER&password=pass&port=666& manifest_arg=domain=DOMAIN&rpc_secret=RPC_SECRET&bootstrap_peers=BOOTSTRAP_PEERS&weight=WEIGHT&datadir=DATADIR

View file

@ -1,9 +1,17 @@
Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Garage is an S3-compatible distributed object storage service designed for self-hosting at a small-to-medium scale.
Garage is designed for storage clusters composed of nodes running at different physical locations, in order to easily provide a storage service that replicates data at these different locations and stays available even when some servers are unreachable. Garage also focuses on being lightweight, easy to operate, and highly resilient to machine failures.
### Features ### Features
- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; - S3 API
- Laboris nisi ut aliquip ex ea commodo consequat ; - Standalone/self-contained
- Duis aute irure dolor in reprehenderit in voluptate ; - Flexible topology
- Velit esse cillum dolore eu fugiat nulla pariatur ; - No RAFT slowing you down
- Excepteur sint occaecat cupidatat non proident, sunt in culpa." - Several replication modes
- Web server for static websites
- Bucket names as aliases
- Cluster administration API
- Metrics and traces
- Support for changing IP addresses
- K2V API (experimental)

View file

@ -1,12 +1,7 @@
* Any known limitations, constrains or stuff not working, such as (but not limited to): * Limitations :
* requiring a full dedicated domain ? * This application is not usable if you're not part of a cluster with minimun 3 other nodes
* architectures not supported ?
* not-working single-sign on or LDAP integration ?
* the app requires an important amount of RAM / disk / .. to install or to work properly
* etc...
* Other infos that people should be aware of, such as: * infos you should be aware of:
* any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) * This application provide a node that you can connect to a garage cluster. Few option are manageable by the config panel for the current node but IT DOESN'T offer simpler way to manage bucket and keys. You have to do it by command line or let an other node managing it.
* how to configure / administrate the application if it ain't obvious * This application consider that the weight of the node is the size reserved to garage in G
* upgrade process / specificities / things to be aware of ? * This application will try to create a virtual disk to ensure garage doesn't use more than allowed. If virtualisation is not available your responsible to check space used by garage.
* security considerations ?

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

View file

@ -36,6 +36,7 @@ port_web=$(ynh_app_setting_get --app=$app --key=port_web)
datadir=$(ynh_app_setting_get --app=$app --key=datadir) datadir=$(ynh_app_setting_get --app=$app --key=datadir)
bootstrap_peers=$(ynh_app_setting_get --app=$app --key=bootstrap_peers) bootstrap_peers=$(ynh_app_setting_get --app=$app --key=bootstrap_peers)
final_path=/opt/yunohost/$app
#================================================= #=================================================
# DECLARE DATA AND CONF FILES TO BACKUP # DECLARE DATA AND CONF FILES TO BACKUP
#================================================= #=================================================

View file

@ -33,6 +33,9 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
datadir=$(ynh_app_setting_get --app=$app --key=datadir) datadir=$(ynh_app_setting_get --app=$app --key=datadir)
virtualisation=$(ynh_app_setting_get --app=$app --key=virtualisation) virtualisation=$(ynh_app_setting_get --app=$app --key=virtualisation)
bootstrap_peers=$(ynh_app_setting_get --app=$app --key=bootstrap_peers) bootstrap_peers=$(ynh_app_setting_get --app=$app --key=bootstrap_peers)
port=$(ynh_app_setting_get --app=$app --key=port)
node_id=$(ynh_app_setting_get --app=$app --key=node_id)
weight=$(ynh_app_setting_get --app=$app --key=weight)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
@ -142,23 +145,28 @@ yunohost service add --needs_exposed_ports $port --description="s3 storage" --lo
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Starting a systemd service..." --weight=1
#recreate log folder
mkdir /var/log/$app
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"
#================================================= #=================================================
# RECREATE CONFIGURATION # RECREATE CONFIGURATION
#================================================= #=================================================
node_id=$(ynh_app_setting_get --app=$app --key=node_id)
weight=$(ynh_app_setting_get --app=$app --key=weight)
garage_command="$garage_path/garage -c $garage_path/garage.toml" sleep 2
garage_command="$final_path/garage -c $final_path/garage.toml"
# define node
$garage_command layout assign $node_id -z $domain -c $weight -t $domain
# if there is enough node, apply layout
apply_layout "$garage_command"
if [ -n "$bootstrap_peers" ] if [ -n "$bootstrap_peers" ]
then then
$garage_command id connect "$bootstrap_peers" garage_connect "$garage_command" "$bootstrap_peers"
fi fi
init_garage "$garage_command" "$node_id" "$weight" "$domain"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -23,7 +23,15 @@ port_api=$(ynh_app_setting_get --app=$app --key=port_api)
port_web=$(ynh_app_setting_get --app=$app --key=port_web) port_web=$(ynh_app_setting_get --app=$app --key=port_web)
datadir=$(ynh_app_setting_get --app=$app --key=datadir) datadir=$(ynh_app_setting_get --app=$app --key=datadir)
bootstrap_peers=$(ynh_app_setting_get --app=$app --key=bootstrap_peers) bootstrap_peers=$(ynh_app_setting_get --app=$app --key=bootstrap_peers)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
virtualisation=$(ynh_app_setting_get --app=$app --key=virtualisation)
if [ "$virtualisation" = "true" ] ;
then
virt_protection=""
else
virt_protection="#"
fi
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
@ -64,44 +72,29 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
#
# N.B. : the followings setting migrations snippets are provided as *EXAMPLES*
# of what you may want to do in some cases (e.g. a setting was not defined on
# some legacy installs and you therefore want to initiaze stuff during upgrade)
#
# If db_name doesn't exist, create it
#if [ -z "$db_name" ]; then
# db_name=$(ynh_sanitize_dbid --db_name=$app)
# ynh_app_setting_set --app=$app --key=db_name --value=$db_name
#fi
# If final_path doesn't exist, create it
#if [ -z "$final_path" ]; then
# final_path=/var/www/$app
# ynh_app_setting_set --app=$app --key=final_path --value=$final_path
#fi
### If nobody installed your app before 4.1,
### then you may safely remove these lines
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
if ! ynh_permission_exists --permission="admin"; then
# Create the required permissions
ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin
fi
# Create a permission if needed # Create a permission if needed
if ! ynh_permission_exists --permission="api"; then if ! ynh_permission_exists --permission="api"; then
ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true" ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true"
fi fi
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=1
### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package.
### Those deb packages will be installed as dependencies of this package.
### If you're not using this helper:
### - Remove the section "REMOVE DEPENDENCIES" in the remove script
### - Remove the variable "pkg_dependencies" in _common.sh
### - As well as the section "REINSTALL DEPENDENCIES" in the restore script
### - And the section "UPGRADE DEPENDENCIES" in the upgrade script
if [ "$virtualisation" = "true" ]
then
ynh_install_app_dependencies $pkg_dependencies_virtualisation
fi
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================