Просмотр исходного кода

Merge pull request #20 from YunoHost-Apps/testing

Testing
eric_G 2 лет назад
Родитель
Сommit
d3b50c04a3
9 измененных файлов с 95 добавлено и 63 удалено
  1. 1 1
      README.md
  2. 9 10
      README_fr.md
  3. 18 0
      conf/.env
  4. 10 0
      doc/DESCRIPTION_fr.md
  5. 8 5
      manifest.toml
  6. 2 2
      scripts/change_url
  7. 20 16
      scripts/install
  8. 1 18
      scripts/restore
  9. 26 11
      scripts/upgrade

+ 1 - 1
README.md

@@ -29,7 +29,7 @@ It integrates with the services you use to display information on the homepage (
 - Very light-weight and fast.
 
 
-**Shipped version:** 0.13.4~ynh1
+**Shipped version:** 0.14.2~ynh1
 
 **Demo:** https://homarr.ajnart.fr/fr
 

+ 9 - 10
README_fr.md

@@ -16,20 +16,19 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
 
 ## Vue d’ensemble
 
-Homarr is a simple and lightweight homepage for your server, that helps you easily access all of your services in one place.
-It integrates with the services you use to display information on the homepage (E.g. Show upcoming Sonarr/Radarr releases).
+Homarr est une page d'accueil simple et légère pour votre serveur, qui vous aide à accéder facilement à tous vos services en un seul endroit.
+Il s'intègre aux services que vous utilisez pour afficher des informations sur la page d'accueil (par exemple, afficher les prochaines versions de Sonarr/Radar).
 
-### Features
+### Caractéristiques
 
-- Integrates with services you use.
-- Search the web directly from your homepage.
-- Real-time status indicator for every service.
-- Automatically finds icons while you type the name of a service.
-- Widgets that can display all types of information.
-- Very light-weight and fast.
+- S'intègre aux services que vous utilisez.
+- Recherchez sur le Web directement depuis votre page d'accueil.
+- Indicateur d'état en temps réel pour chaque service.
+- Recherche automatiquement les icônes pendant que vous tapez le nom d'un service.
+- Des widgets pouvant afficher tous types d'informations.
 
 
-**Version incluse :** 0.13.4~ynh1
+**Version incluse :** 0.14.2~ynh1
 
 **Démo :** https://homarr.ajnart.fr/fr
 

+ 18 - 0
conf/.env

@@ -0,0 +1,18 @@
+DATABASE_URL="file:./database/db.sqlite"
+
+# Next Auth
+# You can generate a new secret on the command line with:
+# openssl rand -base64 32
+# https://next-auth.js.org/configuration/options#secret
+NEXTAUTH_URL="http://127.0.0.1:__PORT__"
+
+NEXTAUTH_SECRET="__SECRET__"
+
+# Disable analytics
+NEXT_PUBLIC_DISABLE_ANALYTICS="true"
+
+DEFAULT_COLOR_SCHEME="light"
+
+DOCKER_HOST="unix:///var/run/docker.sock"
+
+TZ=__TIMEZONE__

+ 10 - 0
doc/DESCRIPTION_fr.md

@@ -0,0 +1,10 @@
+Homarr est une page d'accueil simple et légère pour votre serveur, qui vous aide à accéder facilement à tous vos services en un seul endroit.
+Il s'intègre aux services que vous utilisez pour afficher des informations sur la page d'accueil (par exemple, afficher les prochaines versions de Sonarr/Radar).
+
+### Caractéristiques
+
+- S'intègre aux services que vous utilisez.
+- Recherchez sur le Web directement depuis votre page d'accueil.
+- Indicateur d'état en temps réel pour chaque service.
+- Recherche automatiquement les icônes pendant que vous tapez le nom d'un service.
+- Des widgets pouvant afficher tous types d'informations.

+ 8 - 5
manifest.toml

@@ -5,7 +5,7 @@ name = "Homarr"
 description.en = "Customizable browser's home page to interact with your homeserver's Docker containers"
 description.fr = "Page d'accueil personnalisable pour interagir avec les conteneurs Docker de votre serveur"
 
-version = "0.13.4~ynh1"
+version = "0.14.2~ynh1"
 
 maintainers = ["eric_G"]
 
@@ -21,10 +21,13 @@ code = "https://github.com/ajnart/homarr"
 yunohost = ">= 11.2"
 architectures = "all"
 multi_instance = true
+
 ldap = false
+
 sso = false
+
 disk = "50M"
-ram.build = "50M"
+ram.build = "1500M"
 ram.runtime = "50M"
 
 [install]
@@ -37,8 +40,8 @@ ram.runtime = "50M"
 
 [resources]
         [resources.sources.main]
-        url = "https://github.com/ajnart/homarr/archive/refs/tags/v0.13.4.tar.gz"
-        sha256 = "bddeecf22f40743ff7446bc8dc8427539788425671147029a33b088aaec5967b"
+        url = "https://github.com/ajnart/homarr/archive/refs/tags/v0.14.2.tar.gz"
+        sha256 = "c8e30aaf9ccfd5c5cfa11965cbb7d0c4615c915afca73f19b0b64c8fa3abd327"
         autoupdate.strategy = "latest_github_tag"
 
     [resources.ports]
@@ -51,7 +54,7 @@ ram.runtime = "50M"
     main.url = "/"
 
     [resources.apt]
-    packages = ""
+    packages = "sqlite3"
     extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main"
     extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg"
     extras.yarn.packages = "yarn"

+ 2 - 2
scripts/change_url

@@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers
 #=================================================
 ynh_script_progression --message="Stopping a systemd service..." --weight=1
 
-ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
+ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
 
 #=================================================
 # MODIFY URL IN NGINX CONF
@@ -32,7 +32,7 @@ ynh_change_url_nginx_config
 #=================================================
 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="systemd"
 
 #=================================================
 # END OF SCRIPT

+ 20 - 16
scripts/install

@@ -9,6 +9,9 @@
 source _common.sh
 source /usr/share/yunohost/helpers
 
+secret=$(ynh_string_random --length=24)
+timezone=$(cat /etc/timezone)
+
 #=================================================
 # INSTALL DEPENDENCIES
 #=================================================
@@ -36,6 +39,22 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1
 # Create a dedicated NGINX config
 ynh_add_nginx_config
 
+env_path="$PATH"
+# Create a dedicated systemd config
+ynh_add_systemd_config
+
+yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log"
+
+#=================================================
+# ADD A CONFIGURATION
+#=================================================
+ynh_script_progression --message="Adding a configuration file..." --weight=1
+
+ynh_add_config --template=".env" --destination="$install_dir/.env"
+
+chmod 400 "$install_dir/.env"
+chown $app:$app "$install_dir/.env"
+
 #=================================================
 # INSTALL HOMARR
 #=================================================
@@ -45,24 +64,9 @@ pushd $install_dir
  	ynh_use_nodejs
 	ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install
 	ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production yarn build
+	ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH  yarn db:migrate
 popd
 
-#=================================================
-# SETUP SYSTEMD
-#=================================================
-ynh_script_progression --message="Configuring a systemd service..." --weight=1
-
-env_path="$PATH"
-# Create a dedicated systemd config
-ynh_add_systemd_config
-
-#=================================================
-# INTEGRATE SERVICE IN YUNOHOST
-#=================================================
-ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
-
-yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log"
-
 #=================================================
 # START SYSTEMD SERVICE
 #=================================================

+ 1 - 18
scripts/restore

@@ -37,19 +37,9 @@ ynh_script_progression --message="Restoring the NGINX web server configuration..
 
 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
 
-#=================================================
-# RESTORE SYSTEMD
-#=================================================
-ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
-
 ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
 systemctl enable $app.service --quiet
 
-#=================================================
-# INTEGRATE SERVICE IN YUNOHOST
-#=================================================
-ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
-
 yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log"
 
 #=================================================
@@ -57,14 +47,7 @@ yunohost service add $app --description="Customizable browser's home page" --log
 #=================================================
 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"
-
-#=================================================
-# GENERIC FINALIZATION
-#=================================================
-# RELOAD NGINX AND PHP-FPM
-#=================================================
-ynh_script_progression --message="Reloading NGINX web server..." --weight=1
+ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
 
 ynh_systemd_action --service_name=nginx --action=reload
 

+ 26 - 11
scripts/upgrade

@@ -9,6 +9,9 @@
 source _common.sh
 source /usr/share/yunohost/helpers
 
+secret=$(ynh_string_random --length=24)
+timezone=$(cat /etc/timezone)
+
 #=================================================
 # CHECK VERSION
 #=================================================
@@ -22,7 +25,7 @@ upgrade_type=$(ynh_check_app_version_changed)
 #=================================================
 ynh_script_progression --message="Stopping a systemd service..." --weight=1
 
-ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
+ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
 
 #=================================================
 # DOWNLOAD, CHECK AND UNPACK SOURCE
@@ -33,7 +36,7 @@ then
 	ynh_script_progression --message="Upgrading source files..." --weight=1
 
 	# 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" --keep=".env"
 fi
 
 chmod -R o-rwx "$install_dir"
@@ -55,28 +58,40 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
 # Create a dedicated NGINX config
 ynh_add_nginx_config
 
-#=================================================
-# SETUP SYSTEMD
-#=================================================
-ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
-
 env_path="$PATH"
 # Create a dedicated systemd config
 ynh_add_systemd_config
 
+yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log"
+
 #=================================================
-# INTEGRATE SERVICE IN YUNOHOST
+# ADD A CONFIGURATION
 #=================================================
-ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
+ynh_script_progression --message="Adding a configuration file..." --weight=1
 
-yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log"
+ynh_add_config --template=".env" --destination="$install_dir/.env"
+
+chmod 400 "$install_dir/.env"
+chown $app:$app "$install_dir/.env"
+
+#=================================================
+# INSTALL HOMARR
+#=================================================
+ynh_script_progression --message="Building the app..." --weight=20
+
+pushd $install_dir
+ 	ynh_use_nodejs
+	ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install
+	ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production yarn build
+	ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH  yarn db:migrate
+popd
 
 #=================================================
 # START SYSTEMD SERVICE
 #=================================================
 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="systemd"
 
 #=================================================
 # END OF SCRIPT