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

Merge pull request #40 from YunoHost-Apps/Add-config-panel

Add config panel
This commit is contained in:
Éric Gaspar 2022-09-16 08:25:36 +02:00 committed by GitHub
commit 69d0f1859a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 47 additions and 8 deletions

View file

@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
Focalboard is a project management tool that helps define, organize, track and manage work across teams, using a familiar kanban board view.
**Shipped version:** 7.1.0~ynh1
**Shipped version:** 7.1.0~ynh2
## Screenshots

View file

@ -18,7 +18,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
Focalboard est un outil de gestion de projet qui aide à définir, organiser, suivre et gérer le travail entre les équipes, à l'aide d'une vue de tableau kanban familière.
**Version incluse :** 7.1.0~ynh1
**Version incluse :** 7.1.0~ynh2
## Captures d'écran

View file

@ -2,7 +2,7 @@
"serverRoot": "http://127.0.0.1:__PORT__",
"port": __PORT__,
"dbtype": "postgres",
"dbconfig": "postgres://__DB_NAME__:__DB_PWD__@localhost/__DB_NAME__?sslmode=disable&connect_timeout=10",
"dbconfig": "postgres://__DB_USER__:__DB_PWD__@localhost/__DB_NAME__?sslmode=disable&connect_timeout=10",
"postgres_dbconfig": "dbname=__APP__ sslmode=disable",
"useSSL": false,
"webpath": "./pack",
@ -11,5 +11,6 @@
"telemetry": false,
"session_expire_time": 2592000,
"session_refresh_time": 18000,
"enablePublicSharedBoards": __ENABLE_PUBLIC_BOARDS__,
"localOnly": false
}

16
config_panel.toml Normal file
View file

@ -0,0 +1,16 @@
version = "1.0"
[main]
name = "Focalboard configuration"
services = ["__APP__"]
[main.config]
name = "Configuration Options"
[main.config.enable_public_boards]
ask = "Enable public boards"
type = "boolean"
yes = "true"
no = "false"
help = "Enable publishing boards for public access"
bind = "enablePublicSharedBoards:__FINALPATH__/config.json"

View file

@ -6,7 +6,7 @@
"en": "Self-hosted alternative to Trello, Notion, and Asana",
"fr": "Alternative auto-hébergée à Trello, Notion et Asana"
},
"version": "7.1.0~ynh1",
"version": "7.1.0~ynh2",
"url": "https://www.focalboard.com/",
"upstream": {
"license": "MIT",

View file

@ -30,6 +30,8 @@ is_public=$YNH_APP_ARG_IS_PUBLIC
app=$YNH_APP_INSTANCE_NAME
enable_public_boards="false"
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
@ -50,6 +52,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=5
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=enable_public_boards --value=$enable_public_boards
#=================================================
# STANDARD MODIFICATIONS
@ -83,9 +86,10 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_name --db_name=$db_name
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE

View file

@ -41,7 +41,8 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
#=================================================
ynh_script_progression --message="Validating restoration parameters..." --weight=1
test ! -d $final_path || ynh_die --message="There is already a directory: $final_path "
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
#=================================================
# STANDARD RESTORATION STEPS
@ -77,7 +78,7 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1
ynh_restore_file --origin_path="$files_path" --not_mandatory
mkdir -p files_path
mkdir -p $files_path/files
chmod 755 "$files_path"
chmod -R o-rwx "$files_path"

View file

@ -20,9 +20,13 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
port=$(ynh_app_setting_get --app=$app --key=port)
files_path=$(ynh_app_setting_get --app=$app --key=files_path)
enable_public_boards=$(ynh_app_setting_get --app=$app --key=enable_public_boards)
#=================================================
# CHECK VERSION
#=================================================
@ -34,6 +38,11 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
if [ -z "$enable_public_boards" ]; then
enable_public_boards="false"
ynh_app_setting_set --app=$app --key=enable_public_boards --value=$enable_public_boards
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
@ -95,7 +104,7 @@ then
ynh_secure_remove --file="$final_path"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" #--keep="$final_path/config.json"
ynh_setup_source --dest_dir="$final_path" #--keep="config.json"
# Copy the admin saved settings from tmp directory to final path
cp -a "$tmpdir/config.json" "$final_path/config.json"
@ -115,6 +124,14 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression --message="Modifying a config file..."
ynh_add_config --template="../conf/config.json" --destination="$final_path/config.json"
chmod 600 $final_path/config.json
#=================================================
# UPGRADE DEPENDENCIES
#=================================================