[APKG Script-Server] script_admin USAGE and architecture

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

Moderator: Lillian.W@AST

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

[APKG Script-Server] script_admin USAGE and architecture

Post by father.mande »

Hi,

[APKG architecture for Script-server]
WHERE ARE THE FILES (under /usr/local/AppCentral)
script-server original folder is in /usr/local/AppCentral/scriptserver/script-server/
... server config is in /usr/local/AppCentral/scriptserver/script-server/conf folder (script-server.json the server config file; logging.json for logs (you can inside deactivate script logging))
... json script definition are in /usr/local/AppCentral/scriptserver/script-server/conf/runners/ (APKG use symlink)
... logs under /usr/local/AppCentral/scriptserver/script-server/logs folder, scripts logs in logs/processes/
APKG specific files
... are in /usr/local/AppCentral/scriptserver/my_data
... folder.conf (all folder and associated user defined)
... .htpassword for access to the Web server (take care to authorize only root to change this file)
... runners folder with inside ALL admin_script json (script interface) files ... linked in /usr/local/AppCentral/scriptserver/script-server/conf/runners folder
... example of new_folder.conf for TGZ file loading script ; of adding SSL to /usr/local/AppCentral/scriptserver/script-server/conf/script-server.json (use the Asustor keys) for this SSL use the command line is better.
... some json samples
... some shell script use by json interface (extract_username.sh) DON'T MOVE IT for the moment or for updating modules for Python3

APKG is configured to use "script-server users" (not A.D.M. not user executing command (it's root the launcher of script-server))
... attach a script to a SC user is done in each script config file (json)

Code: Select all

"allowed_users": [
    "script_admin"
  ],
... you can have one or multiple users or nothing to offer the script to ALL (ex. change_current_user_password is available to ALL users)

... as you can see on screen, commands can be grouped ... it's same if you want to have a group of command under a certain name use in script :

Code: Select all

"group": "SC_Admin_FOLDER",
... ... here a group is automatically created, so script under are visible only if you select the group

IF you create a specific user for a specific APKG or set of command ... login is enough to have ONLY the scripts allowed and not all
ex. user domoticz (remember it's ONLY for script-server) can manage domoticz APKG

BUT you are free to follow this or do what you want ...

In APKG script are NOT directly in /usr/local/AppCentral/scriptserver/conf/runners because this folder is erased during update ... so
APKG use link in this folder recreated at any time (after boot or under your choice)

[script_admin Usage]
default password is : asusfr1 (change it)
ALL this scripts need to be optimized and reduce (duplicate function) ... in next release.
... Menu
... ... change_current_user_password ... change the password for the user connected
... ... SC_Admin_FOLDER group for folder management (most important are Create_new_FOLDER_from_tar_gz_file ; Delete_FOLDER and list_FOLDER_defined)
... ... ... Create_link_for_FOLDER ... create or recreate link in /usr/local/AppCentral/scriptserver/script-server/conf/runners for a specific user scripts or for ALL (NO FOLDER_name provide)
... ... ... Create_new_FOLDER ... create a new Folder definition in folder.conf ... walk through NAS file system (based on /) to select the folder ... if user_name already exist (password field are ignored) and folder is associated to the existing user ... if no password provide ... asusfr1 is used ... folder must contains a script_server folder with json and scripts.
... ... ... Create_new_FOLDER_for_APKG ... SAME but folder walk through is based on /usr/local/APPCentral/
... ... ... Create_new_FOLDER_from_tar_gz_file ... create folder from tar gzipped file (structure here after in the post)
... ... ... Delete_FOLDER ... suppress link and change folder.conf DON'T destroy the folder itself
... ... ... list_FOLDER_defined ... list folder defined in folder.conf
... ... SC_Admin_save_and_logs
... ... ... print_last_N_lines_server_log ... self explain ... useful to debug json not loaded for ex.
... ... ... Remove_History_logs ... logs of script are large, you can remove some of them (based of user running it) or ALL
... ... ... Save_logs ... save ALL logs in /share/Public/.scriptserver/script_server_logs_DATE_TIME_FROM_SYSTEM
... ... ... Save_settings ... save ALL configuration server files ... same as save logs : /share/Public/.scriptserver/script_server_DATE_TIME_FROM_SYSTEM
... ... SC_Admin_User_Mngt (user management useless if you manage folder using Create_new_FOLDER_from_tar_gz_file except for list)
... ... ... add_new_user_password ... create a new user with personal password (require NO default)
... ... ... change_user_password ... auto explain
... ... ... list_users_defined ... auto explain
... .. ... Suppress_WebUI_user ... delete a defined user


Philippe.
AS6602T / AS5202T /AS5002T / AS1002T / FS6706T
Post Reply

Return to “Developer's Corner”