mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 19:14:27 +05:00
fix: add more trusted clients, cors domains, auto create a config folder if missing for whatever reason
This commit is contained in:
@@ -214,7 +214,7 @@ create_single_moonraker_conf(){
|
|||||||
HOSTNAME=$(hostname -I | cut -d" " -f1)
|
HOSTNAME=$(hostname -I | cut -d" " -f1)
|
||||||
LOCAL_NETWORK="$(hostname -I | cut -d" " -f1 | cut -d"." -f1-3).0/24"
|
LOCAL_NETWORK="$(hostname -I | cut -d" " -f1 | cut -d"." -f1-3).0/24"
|
||||||
|
|
||||||
/bin/sh -c "cat > $MOONRAKER_CONF_LOC/moonraker.conf" << MOONRAKERCONF
|
/bin/sh -c "cat > $MOONRAKER_CONF_LOC/moonraker.conf" << MOONRAKERCONF
|
||||||
[server]
|
[server]
|
||||||
host: 0.0.0.0
|
host: 0.0.0.0
|
||||||
port: $PORT
|
port: $PORT
|
||||||
@@ -228,17 +228,16 @@ api_key_file: ~/.moonraker_api_key
|
|||||||
trusted_clients:
|
trusted_clients:
|
||||||
127.0.0.1
|
127.0.0.1
|
||||||
$LOCAL_NETWORK
|
$LOCAL_NETWORK
|
||||||
|
::1/128
|
||||||
|
FE80::/10
|
||||||
cors_domains:
|
cors_domains:
|
||||||
|
http://*.*
|
||||||
http://*.local
|
http://*.local
|
||||||
http://my.mainsail.app
|
http://my.mainsail.app
|
||||||
https://my.mainsail.app
|
https://my.mainsail.app
|
||||||
http://app.fluidd.xyz
|
http://app.fluidd.xyz
|
||||||
https://app.fluidd.xyz
|
https://app.fluidd.xyz
|
||||||
http://$HOSTNAME
|
http://$HOSTNAME
|
||||||
|
|
||||||
[update_manager]
|
|
||||||
#client_repo:
|
|
||||||
#client_path:
|
|
||||||
MOONRAKERCONF
|
MOONRAKERCONF
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -246,7 +245,7 @@ create_multi_moonraker_conf(){
|
|||||||
HOSTNAME=$(hostname -I | cut -d" " -f1)
|
HOSTNAME=$(hostname -I | cut -d" " -f1)
|
||||||
LOCAL_NETWORK="$(hostname -I | cut -d" " -f1 | cut -d"." -f1-3).0/24"
|
LOCAL_NETWORK="$(hostname -I | cut -d" " -f1 | cut -d"." -f1-3).0/24"
|
||||||
|
|
||||||
/bin/sh -c "cat > $MOONRAKER_CONF_LOC/printer_$INSTANCE/moonraker.conf" << MOONRAKERCONF
|
/bin/sh -c "cat > $MOONRAKER_CONF_LOC/printer_$INSTANCE/moonraker.conf" << MOONRAKERCONF
|
||||||
[server]
|
[server]
|
||||||
host: 0.0.0.0
|
host: 0.0.0.0
|
||||||
port: $PORT
|
port: $PORT
|
||||||
@@ -260,17 +259,16 @@ api_key_file: ~/.moonraker_api_key
|
|||||||
trusted_clients:
|
trusted_clients:
|
||||||
127.0.0.1
|
127.0.0.1
|
||||||
$LOCAL_NETWORK
|
$LOCAL_NETWORK
|
||||||
|
::1/128
|
||||||
|
FE80::/10
|
||||||
cors_domains:
|
cors_domains:
|
||||||
|
http://*.*
|
||||||
http://*.local
|
http://*.local
|
||||||
http://my.mainsail.app
|
http://my.mainsail.app
|
||||||
https://my.mainsail.app
|
https://my.mainsail.app
|
||||||
http://app.fluidd.xyz
|
http://app.fluidd.xyz
|
||||||
https://app.fluidd.xyz
|
https://app.fluidd.xyz
|
||||||
http://$HOSTNAME
|
http://$HOSTNAME
|
||||||
|
|
||||||
[update_manager]
|
|
||||||
#client_repo:
|
|
||||||
#client_path:
|
|
||||||
MOONRAKERCONF
|
MOONRAKERCONF
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,6 +384,7 @@ moonraker_conf_creation(){
|
|||||||
ip_list+=("$HOSTNAME:$PORT")
|
ip_list+=("$HOSTNAME:$PORT")
|
||||||
|
|
||||||
status_msg "Creating moonraker.conf in $MOONRAKER_CONF_LOC"
|
status_msg "Creating moonraker.conf in $MOONRAKER_CONF_LOC"
|
||||||
|
[ ! -d $MOONRAKER_CONF_LOC ] && mkdir -p $MOONRAKER_CONF_LOC
|
||||||
if [ ! -f $MOONRAKER_CONF_LOC/moonraker.conf ]; then
|
if [ ! -f $MOONRAKER_CONF_LOC/moonraker.conf ]; then
|
||||||
create_single_moonraker_conf && ok_msg "moonraker.conf created!"
|
create_single_moonraker_conf && ok_msg "moonraker.conf created!"
|
||||||
else
|
else
|
||||||
@@ -404,6 +403,7 @@ moonraker_conf_creation(){
|
|||||||
|
|
||||||
### start the creation of each instance
|
### start the creation of each instance
|
||||||
status_msg "Creating moonraker.conf for instance #$INSTANCE"
|
status_msg "Creating moonraker.conf for instance #$INSTANCE"
|
||||||
|
[ ! -d $MOONRAKER_CONF_LOC/printer_$INSTANCE ] && mkdir -p $MOONRAKER_CONF_LOC/printer_$INSTANCE
|
||||||
if [ ! -f $MOONRAKER_CONF_LOC/printer_$INSTANCE/moonraker.conf ]; then
|
if [ ! -f $MOONRAKER_CONF_LOC/printer_$INSTANCE/moonraker.conf ]; then
|
||||||
create_multi_moonraker_conf && ok_msg "moonraker.conf created!"
|
create_multi_moonraker_conf && ok_msg "moonraker.conf created!"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user