1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/samba_ynh.git synced 2024-09-03 20:16:27 +02:00

Merge pull request #7 from YunoHost-Apps/testing

Apply example_ynh
This commit is contained in:
yalh76 2022-08-15 01:06:49 +02:00 committed by GitHub
commit 8b55b914f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 157 additions and 70 deletions

55
.github/ISSUE_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,55 @@
---
name: Bug report
about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently.
---
**How to post a meaningful bug report**
1. *Read this whole template first.*
2. *Determine if you are on the right place:*
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
- *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
- *When in doubt, post here and we will figure it out together.*
3. *Delete the italic comments as you write over them below, and remove this guide.*
---
### Describe the bug
*A clear and concise description of what the bug is.*
### Context
- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
- YunoHost version: x.x.x
- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...*
- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
- If yes, please explain:
- Using, or trying to install package version/branch:
- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
### Steps to reproduce
- *If you performed a command from the CLI, the command itself is enough. For example:*
```sh
sudo yunohost app install the_app
```
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
- *If the error occurs in your browser, explain what you did:*
1. *Go to '...'*
2. *Click on '...'*
3. *Scroll down to '...'*
4. *See error*
### Expected behavior
*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.*
### Logs
*When an operation fails, YunoHost provides a simple way to share the logs.*
- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.*
- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.*
*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)*
*If applicable and useful, add screenshots to help explain your problem.*

16
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,16 @@
## Problem
- *Description of why you made this PR*
## Solution
- *And how do you fix that problem*
## PR Status
- [ ] Code finished and ready to be reviewed/tested
- [ ] The fix/enhancement were manually tested (if applicable)
## Automatic tests
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# Samba for YunoHost
[![Integration level](https://dash.yunohost.org/integration/samba.svg)](https://dash.yunohost.org/appci/app/samba) ![](https://ci-apps.yunohost.org/ci/badges/samba.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/samba.maintain.svg)
[![Integration level](https://dash.yunohost.org/integration/samba.svg)](https://dash.yunohost.org/appci/app/samba) ![Working status](https://ci-apps.yunohost.org/ci/badges/samba.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/samba.maintain.svg)
[![Install Samba with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=samba)
*[Lire ce readme en français.](./README_fr.md)*
@ -24,32 +24,26 @@ This package allows you to create directories reachable on a private network.
- Define readonly directories
**Shipped version:** 4.9.5~ynh2
## Screenshots
![](./doc/screenshots/example.jpg)
**Shipped version:** 4.9.5~ynh3
## Documentation and resources
* Official app website: https://www.samba.org/
* Official user documentation: https://yunohost.org/app_samba
* Official admin documentation: https://www.samba.org/samba/docs/
* Upstream app code repository: https://git.samba.org/?p=samba.git;a=summary
* YunoHost documentation for this app: https://yunohost.org/app_samba
* Report a bug: https://github.com/YunoHost-Apps/samba_ynh/issues
* Official app website: <https://www.samba.org/>
* Official user documentation: <https://yunohost.org/app_samba>
* Official admin documentation: <https://www.samba.org/samba/docs/>
* Upstream app code repository: <https://git.samba.org/?p=samba.git;a=summary>
* YunoHost documentation for this app: <https://yunohost.org/app_samba>
* Report a bug: <https://github.com/YunoHost-Apps/samba_ynh/issues>
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/samba_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/samba_ynh/tree/testing --debug
or
sudo yunohost app upgrade samba -u https://github.com/YunoHost-Apps/samba_ynh/tree/testing --debug
```
**More info regarding app packaging:** https://yunohost.org/packaging_apps
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,10 +1,14 @@
<!--
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.
-->
# Samba pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/samba.svg)](https://dash.yunohost.org/appci/app/samba) ![](https://ci-apps.yunohost.org/ci/badges/samba.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/samba.maintain.svg)
[![Niveau d'intégration](https://dash.yunohost.org/integration/samba.svg)](https://dash.yunohost.org/appci/app/samba) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/samba.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/samba.maintain.svg)
[![Installer Samba avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=samba)
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer Samba 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.*
@ -20,32 +24,26 @@ This package allows you to create directories reachable on a private network.
- Define readonly directories
**Version incluse :** 4.9.5~ynh2
## Captures d'écran
![](./doc/screenshots/example.jpg)
**Version incluse :** 4.9.5~ynh3
## Documentations et ressources
* Site officiel de l'app : https://www.samba.org/
* Documentation officielle utilisateur : https://yunohost.org/app_samba
* Documentation officielle de l'admin : https://www.samba.org/samba/docs/
* Dépôt de code officiel de l'app : https://git.samba.org/?p=samba.git;a=summary
* Documentation YunoHost pour cette app : https://yunohost.org/app_samba
* Signaler un bug : https://github.com/YunoHost-Apps/samba_ynh/issues
* Site officiel de l'app : <https://www.samba.org/>
* Documentation officielle utilisateur : <https://yunohost.org/app_samba>
* Documentation officielle de l'admin : <https://www.samba.org/samba/docs/>
* Dépôt de code officiel de l'app : <https://git.samba.org/?p=samba.git;a=summary>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_samba>
* Signaler un bug : <https://github.com/YunoHost-Apps/samba_ynh/issues>
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/samba_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/samba_ynh/tree/testing --debug
ou
sudo yunohost app upgrade samba -u https://github.com/YunoHost-Apps/samba_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>

View file

@ -9,7 +9,8 @@
setup_private=0
setup_public=0
upgrade=1
#upgrade=1 from_commit=CommitHash
# 4.9.5~ynh2
upgrade=1 from_commit=2e86319103d3b6031c78d51245b06dd47327e0c4
backup_restore=1
multi_instance=0
port_already_use=0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

View file

@ -6,7 +6,7 @@
"en": "App to share directories on your private network thanks to SMB protocol",
"fr": "Apllication pour partage des dossiers sur un reseaux privé via le protocole SMB"
},
"version": "4.9.5~ynh2",
"version": "4.9.5~ynh3",
"url": "https://www.samba.org/",
"upstream": {
"license": "GPL-3.0-only",
@ -26,11 +26,11 @@
"multi_instance": false,
"services": [],
"arguments": {
"install" : [
"install": [
{
"name": "warning",
"type": "boolean",
"help": {
"type": "display_text",
"ask": {
"en": "I understand this app is only for private network purpose and i should not install it on a server with a public IP or open the 445 port on my home router.",
"fr": "Je comprends que cette application est uniquement à des fins de réseau privé et je ne dois pas l'installer sur un serveur avec une adresse IP publique ou ouvrir le port 445 sur mon routeur."
}

View file

@ -22,18 +22,12 @@ ynh_abort_if_errors
app=$YNH_APP_INSTANCE_NAME
warning=$YNH_APP_ARG_WARNING
final_path="/etc/samba"
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
test $warning = "1" || ynh_die --message="You should validate the warning"
ynh_script_progression --message="Validating installation parameters..."
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_script_progression --message="Storing installation settings..." --weight=1
final_path="/etc/samba"
#=================================================
# STORE SETTINGS FROM MANIFEST
@ -46,13 +40,15 @@ ynh_app_setting_set --app=$app --key=readonly_dir --value=''
ynh_app_setting_set --app=$app --key=unbrowseable --value=''
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# FIND AND OPEN A PORT
#=================================================
ynh_script_progression --message="Configuring firewall..."
ynh_exec_warn_less yunohost firewall allow Both 445 --no-upnp
#=================================================
# INSTALL DEPENDENCIES
#=================================================
@ -61,11 +57,15 @@ ynh_script_progression --message="Installing dependencies..." --weight=10
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# SETUP SSOWAT
# SPECIFIC SETUP
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring permissions..."
# We define the permission in advance to be able to use the group
# in unix permission
ynh_permission_create --permission="share" --allowed=all_users
#=================================================
# CREATE DATA DIRECTORY
#=================================================
@ -99,12 +99,14 @@ ynh_add_config --template="share-smb.conf" --destination="$final_path/smb.conf.d
EOF
cat $final_path/smb.conf.d/*.conf >> $final_path/smb.conf
#================================================
#=================================================
# GENERIC FINALIZATION
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#================================================
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add smbd --description="Samba service" --log="/var/log/smbd/smbd.log"
yunohost service add smbd --description="Samba service" --log="/var/log/smbd/smbd.log" --needs_exposed_ports 445
#=================================================
# START SYSTEMD SERVICE

View file

@ -16,8 +16,8 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#=================================================
# STANDARD REMOVE

View file

@ -14,6 +14,9 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
@ -37,12 +40,17 @@ unbrowseable=$(ynh_app_setting_get --app=$app --key=unbrowseable)
ynh_script_progression --message="Validating restoration parameters..." --weight=1
#=================================================
# FIND AND OPEN A PORT
# STANDARD RESTORATION STEPS
#=================================================
ynh_script_progression --message="Open 445 port..." --weight=1
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..."
ynh_exec_warn_less yunohost firewall allow Both 445 --no-upnp
ynh_restore_file --origin_path="$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R root:root "$final_path"
#=================================================
# RESTORE THE DATA DIRECTORY
@ -57,8 +65,6 @@ chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R root:root "$datadir"
ynh_restore_file --origin_path="$final_path" --not_mandatory
#=================================================
# SPECIFIC RESTORATION
#=================================================
@ -69,12 +75,21 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=1
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
#================================================
#=================================================
# FIND AND OPEN A PORT
#=================================================
ynh_script_progression --message="Open 445 port..." --weight=1
ynh_exec_warn_less yunohost firewall allow Both 445 --no-upnp
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#================================================
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add smbd --description="Samba service" --log="/var/log/smbd/smbd.log"
# Don't add --needs_exposed_ports 445 , we don't want a remote diagnosis here
yunohost service add smbd --description="Samba service" --log="/var/log/smbd/smbd.log" --needs_exposed_ports 445
#=================================================
# START SYSTEMD SERVICE

View file

@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
#=================================================
# CHECK VERSION
#=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed)
@ -30,6 +31,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
@ -45,6 +47,11 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=4
ynh_systemd_action --service_name=smbd --action="stop"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
@ -52,12 +59,15 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=12
ynh_install_app_dependencies $pkg_dependencies
#================================================
#=================================================
# GENERIC FINALIZATION
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#================================================
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add smbd --description="Samba service" --log="/var/log/smbd/smbd.log"
# Don't add --needs_exposed_ports 445 , we don't want a remote diagnosis here
yunohost service add smbd --description="Samba service" --log="/var/log/smbd/smbd.log" --needs_exposed_ports 445
#=================================================
# START SYSTEMD SERVICE

View file

@ -1,2 +0,0 @@
*~
*.sw[op]

View file

@ -1,2 +0,0 @@
*~
*.sw[op]