It is currently Tue Mar 09, 2021 4:07 pm
All times are UTC + 8 hours

[APKG Script-Server] change console scripts to WebUI

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

[APKG Script-Server] change console scripts to WebUI

Postby father.mande » Tue Jan 19, 2021 1:28 am

Hi,

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.16.0.1 (script-server 1.16 + all committed change ... 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 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 ... if delay is too long, I will add a link her.
For people not wanting to wait ... the same version as AppCentral proposal is here :

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.
NB question about script-server are welcome.
Last edited by father.mande on Tue Jan 26, 2021 6:17 pm, edited 2 times in total.
AS5202T /AS5002T / AS202TE / AS1002T
My Blog specific to my APKG : https://blog.father-mande.ovh/
User avatar
father.mande
 
Posts: 1108
Joined: Sat Sep 12, 2015 2:55 am

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

Postby father.mande » Thu Jan 21, 2021 11:50 pm

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.
AS5202T /AS5002T / AS202TE / AS1002T
My Blog specific to my APKG : https://blog.father-mande.ovh/
User avatar
father.mande
 
Posts: 1108
Joined: Sat Sep 12, 2015 2:55 am

Return to Developer's Corner

  • You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot post attachments in this forum
  • Who is online

    Users browsing this forum: No registered users and 1 guest