[APKG Script-Server 1.18.0.1] change terminal scripts to WebUI

Who doesn't love third-party apps? Get together and talk about them here.

Moderator: Lillian.W@AST

User avatar
father.mande
Posts: 1794
youtube meble na wymiar Warszawa
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

[APKG Script-Server 1.18.0.1] change terminal scripts to WebUI

Post by father.mande »

Hi,
==== PLEASE USE AppCentral to get scriptserver (and update) NOW.
==== IF you want last version immediately it's hereafter
==== Last 1.17.5 here : https://www.father-mande.ovh/A/apkg/scr ... .5_any.apk (read changelog)
After a long unavailability (heath problem even not Covid) :(

I am please to announce the availability for ALL architecture (x86_64, x86, armhf, arm64) of APKG script-server (link to a Youtube video here after) :D
[Name]
scriptserver (dev. Bugy : https://github.com/bugy/script-server ALL CREDITS TO BUGY ; APKG integrator : Father_Mande)
Information :
... viewtopic.php?f=42&t=11684 script_admin USAGE and architecture of server

[Version]
APKG 1.17.5 (script-server 1.17 + all committed change 10/17/2022 ... so based on Dev version)

[Require]
Python 3 (Asustor APKG)

[Object]
Script-server is a Web UI for scripts.
As an administrator, you add your existing scripts into Script server and other users would be able to execute them via a web interface. The UI is very straightforward and can be used by non-tech people.
No script modifications are needed - you configure each script in Script server and it creates the corresponding UI with parameters and takes care of validation, execution, etc.

[Features]
Different types of script parameters (text, flag, dropdown, file upload, etc.)
Real-time script output
Users can send input during script execution
Auth (optional): LDAP, Google OAuth, htpasswd file
Access control
Alerts
Logging and auditing
Formatted output support (colors, styles, cursor positioning, clearing)
Download of script output files
Execution history
Admin page for script configuration

[APKG features]
DEFAULT user / password for admin WebUI : script_admin / asusfr1 (change it after first connection)
Integrated scripts to manage APKG and script-server configuration.
use private .htpassword (generated by htpasswd command from Apache)
user have own set of scripts (so you don't have a lot of scripts but separate by user ... multiple users (or all) can share a script.
To install your own script ... a simple file is enough with easy rules ... samples are provided SC_for_test.tgz
Advanced features :
... Beta ... change Script-server Web port and change Icon launcher in A.D.M.
... Beta ... change to SSL (and reverse) if you provide a file with the require certificate (example used Asustor certificate)
... .... ... change are also reported to icon launcher in A.D.M.

[Wiki]
https://github.com/bugy/script-server/wiki
Take care ... not all is documented ... search also information in "issue" https://github.com/bugy/script-server/issues (closed)

[APKG Command : script_server_mngt ]
EVEN large part are in script-server WebUI itself (but targeting APKG)

Code: Select all

 # script_server_mngt
Usage : (RED is for "dangerous")
script_server_mngt start|stop|restart|clean_and_restart
script_server_mngt status
script_server_mngt  rebuild_venv ... in case of update of python (today in case of update yo 3.10+ BUT NOT REQUIRE after APKG update ... it's for future
script_server_mngt relink_admin_json ... relink admin json files
script_server_mngt integrate_apkg_folder [PATH_to_tgz_file] ...
                ADD script-server script for a specific folder or APKG (read Doc for detail)
=====
script_server_mngt webui_port_used ... by web script_server server
script_server_mngt change_webui_port_used PORT ...
                Change in AppCentral (icon) and in script-server server config file THEN RESTART
script_server_mngt change_to_https ...
                Change to use HTTPS (if http is used) DO or require a modification in server json file (read the doc) THEN RESTART
script_server_mngt change_to_http ...
                Change to use HTTP (if https is used) DO or require a modification in server json file (read the doc) THEN RESTART
=====
script_server_mngt save_settings ... save conf folder in /share/Public
script_server_mngt save_all_logs ... save logs folder in /share/Public
script_server_mngt remove_history_logs [Script-Server_USER_NAME] ...
                   remove history of shell executed for ALL or for a specific USER only
=====
script_server_mngt list_users_defined ... list users define to access WebUI
script_server_mngt verif_user_password EXISTING_USER_NAME [Current_Password] ...
               verify the actual password for the user ... providing password in command is less secure
script_server_mngt add_new_user_password NEW_USER_NAME [Password Confirm_Password] ...
               add WebUI access user/password ... providing password in command is less secure
script_server_mngt change_user_password EXISTING_USER_NAME [Password Confirm_Password] ...
               change WebUI password for existing user ... providing password in command is less secure
script_server_mngt supress_user_password EXISTING_USER_NAME ...
               suppress existing user from accessing WebUI
=====
script_server_mngt list_folder_defined ...
               list APKG/FOLDER with script-server interface defined
script_server_mngt create_new_folder FOLDER_NAME FOLDER_PATH USER_NAME [PASSWORD CONFIRM_PASSWORD] ...
               create a new folder with script NO password we use asusfr1
script_server_mngt create_folder_link [FOLDER_TARGET] ...
               create script link for an APKG/FOLDER on specific script-server user
script_server_mngt delete_folder FOLDER_NAME ...
               suppress json link & folder in folder.conf NOT original json & script
=====
DANGEROUS COMMANDS
... change_to_http ; change_to_https ; change_webui_port_used ... made change in script-server server configuration (json) BUT also made change in AppCentral config to reflect change for what icon launch.

[Video]
https://youtu.be/_B_95HTa3tY



[How to install test user & scripts]
Prerequisite for one script : having Bash (ex. using Entware APKG yhen use opkg to install bash)
... copy the file /usr/local/AppCentral/scriptserver/my_data/samples/SC_for_test.tgz to a share in the NAS (using a terminal)
... connect you in Script-Server using script_admin / asusfr1 (or your password)
... select SC_Admin_Folder group
... select Create_new_FOLDER_from_tar_gz_file
... use folder to walk through NAS to your tgz file
... execute

[Download]
Put in APKG dev. corner for official diffusion ... wait
Version 1.17.5 is at top of this post

Tar Gzipped for install in script-server of scripts for APKG (use SC_Admin WebUI or command line to install : Create_new_FOLDER_from_tar_gz_file )

Philippe.
NB question about script-server are welcome.
Last edited by father.mande on Thu May 04, 2023 6:34 pm, edited 8 times in total.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
User avatar
father.mande
Posts: 1794
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

Re: [APKG Script-Server] change console scripts to WebUI

Post by father.mande »

Hi,

Download information :
[Download]

AFTER some wait ... my APKG is always in "Processing" mode in AppCentral validation ... so I provide a link of the SAME version (so without the last change ... not fundamental)
[EDIT] ... APKG validation : I have forgot to push button for review ... so delay is my fault ... [EDIT]

ONLY for ADVENTURER 1.16.0.1 : https://www.father-mande.ovh/A/apkg/scr ... .1_any.apk

Tar Gzipped for install in script-server of scripts for APKG (use SC_Admin WebUI or command line to install : Create_new_FOLDER_from_tar_gz_file )

For domoticz APKG 1.0 : https://www.father-mande.ovh/A/other/SC ... moticz.tgz (ALL domoticz supported platform ... x86_64, Armhf, Arm64, x86)

Philippe.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
2fa642@mailbox.org
Posts: 3
Joined: Tue Feb 23, 2021 7:13 am

Re: [APKG Script-Server] change console scripts to WebUI

Post by 2fa642@mailbox.org »

Awesome! :D
User avatar
father.mande
Posts: 1794
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

Re: [APKG Script-Server] change console scripts to WebUI

Post by father.mande »

Hi,

Please update scriptserver for ADM 4.x due to change in PATH of some tools (htpasswd for ex.)

A this time in the developer center ... Asustor have validated the update 1.17.0.1 ... but this is not yet proposed.

In case use this download link : https://www.father-mande.ovh/A/apkg/scr ... .1_any.apk

Philippe.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
n0madCro
Posts: 2
Joined: Tue Jan 18, 2022 5:15 pm

Re: [APKG Script-Server] change console scripts to WebUI

Post by n0madCro »

Hi, I'm trying to setup a bash script but I'm getting this error:
Calling the script...

--- ERRORS ---
No such file or directory: '/volume1/.@plugins/AppCentral/scriptserver/script-server/conf/scripts/a.sh'
this is my script:

Code: Select all

#!/bin/bash
echo hello world
Any ideas how to resolve this issue?
User avatar
father.mande
Posts: 1794
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

Re: [APKG Script-Server] change console scripts to WebUI

Post by father.mande »

Hi n0madCro,

If the path exist (to a.sh) and a.sh is executable (x access right), this certainly due to the shebang (#!/bin/bash), because bash don't exist in A.D.M.
... change it to /bin/sh (seem like ash) or install bash from Entware APKG and change /bin/bash by /opt/bin/bash .

Evidently for your test using /bin/sh is enough but to use some complex samples (available on github script-server repository) ... bash is require for some function and syntax.

Philippe.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
agadoc
Posts: 13
Joined: Sun Jan 07, 2018 1:56 am

Re: [APKG Script-Server] change console scripts to WebUI

Post by agadoc »

Hi Philippe,

i'm trying to install the domoticz package from tar gz file but i have this error:

Code: Select all

sh: (2):: unknown operand
sh: (2):: unknown operand
sh: (2):: unknown operand
sh: (2):: unknown operand
ADD new user with name provide using default password asusfr1
setting new password to user Errno (2): No such file!
/usr/builtin/bin/htpasswd: username contains illegal character ':'
User and interactive or batch password created
Done
ADD definition in folder.conf
Create link in script_server
Done
ALL is now done ... now cleaning temp files]
and nothing is working.

Do you know what is the problem ?

You can answer in english and in french if you want, i will understand better ^^

Thx :)
User avatar
father.mande
Posts: 1794
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

Re: [APKG Script-Server] change console scripts to WebUI

Post by father.mande »

Hi,

Please can you specify :
Model (and / or architecture) & ADM version
complete name of the APKG you try to install (.apk file)
complete trace of the installation

you write in script-server topic but speak about domoticz ?
domoticz is not to be installed using private delivery(from the forum for ex.), but using AppCentral.
script-server is used for web interface in complement of command line but is not mandatory and not a requirement ...

Philippe.
NB due to internal update in domoticz ... I don't redo an installation from a long time.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
agadoc
Posts: 13
Joined: Sun Jan 07, 2018 1:56 am

Re: [APKG Script-Server] change console scripts to WebUI

Post by agadoc »

AS6102T, last ADM Version 4.0.4 RR23

i try to install the file you had linked in your first post :
Tar Gzipped for install in script-server of scripts for APKG (use SC_Admin WebUI or command line to install : Create_new_FOLDER_from_tar_gz_file )

For domoticz APKG 1.0 : https://www.father-mande.ovh/A/other/SC ... moticz.tgz (ALL domoticz supported platform ... x86_64, Armhf, Arm64, x86)
Domoticz is already installed from AppCentral, and it's your version, not the Patrick version.

Use script server to save my domoticz.db is interesting for me

Complete trace of the installation ? i don't understand

thx
User avatar
father.mande
Posts: 1794
Joined: Sat Sep 12, 2015 2:55 am
Location: La Rochelle (France)

Re: [APKG Script-Server] change console scripts to WebUI

Post by father.mande »

Hi,

You have put in your message a part of text output

Code: Select all

sh: (2):: unknown operand
sh: (2):: unknown operand
sh: (2):: unknown operand
sh: (2):: unknown operand
ADD new user with name provide using default password asusfr1
setting new password to user Errno (2): No such file!
/usr/builtin/bin/htpasswd: username contains illegal character ':'
User and interactive or batch password created
Done
ADD definition in folder.conf
Create link in script_server
Done
ALL is now done ... now cleaning temp files]
I want the complete output.
Be sure to have last script-server APKG because Apache server from Asustor have changed ...

NB if Patrick generate it's own Domoticz, I suppose mine have no more interest ... I think it's better to use the more supported APKG coming from Patrick.
I am an alone user, not with the same professional approach than Patrick. It's not a good idea to have two provider for the same application with same name.
my problem is : I can't suppress my version from AppCentraL.
Philippe.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
Post Reply

Return to “Developer's Corner”