You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(config): add REMOTE_CONFIG_ENABLED opt-in gate for remote config sync (#86)
The apl-feed config sync CLI now refuses to contact the website unless the feeder owner has explicitly opted in via REMOTE_CONFIG_ENABLED=true in feed.env. New apl-feed config enable / config disable subcommands flip the toggle through the canonical apply path. Default is off — a feeder that has not consented stays silent.
echo"ERROR: could not acquire feed.env lock: $APL_APPLY_ERROR_MESSAGE">&2
794
+
return 1
795
+
;;
796
+
filesystem_error)
797
+
echo"ERROR: $APL_APPLY_ERROR_MESSAGE">&2
798
+
return 1
799
+
;;
800
+
*)
801
+
echo"ERROR: ${APL_APPLY_ERROR_MESSAGE:-apply failed with status ${APL_APPLY_STATUS:-<unset>}}">&2
802
+
return 1
803
+
;;
804
+
esac
805
+
}
806
+
807
+
apl_feed_config_enable() {
808
+
local opt_rc
809
+
while [[ $#-gt 0 ]];do
810
+
if parse_common_option "$@";then opt_rc=0;else opt_rc=$?;fi
811
+
case"$opt_rc"in
812
+
1) shift ;;
813
+
2) shift 2 ;;
814
+
0) die "unknown flag for config enable: $1" ;;
815
+
esac
816
+
done
817
+
818
+
_config_toggle_apply REMOTE_CONFIG_ENABLED=true
819
+
_config_toggle_emit_result "REMOTE_CONFIG_ENABLED set to true (remote config sync enabled; next tick within ~60s will contact the website)"
820
+
}
821
+
822
+
apl_feed_config_disable() {
823
+
local opt_rc
824
+
while [[ $#-gt 0 ]];do
825
+
if parse_common_option "$@";then opt_rc=0;else opt_rc=$?;fi
826
+
case"$opt_rc"in
827
+
1) shift ;;
828
+
2) shift 2 ;;
829
+
0) die "unknown flag for config disable: $1" ;;
830
+
esac
831
+
done
832
+
833
+
_config_toggle_apply REMOTE_CONFIG_ENABLED=false
834
+
_config_toggle_emit_result "REMOTE_CONFIG_ENABLED set to false (remote config sync disabled; the timer stays armed but the sync CLI exits silently each tick)"
835
+
}
836
+
708
837
dispatch_config() {
709
838
local sub="${1:-}"
710
-
[[ -n"$sub" ]] || die "config requires a subcommand (sync)"
839
+
[[ -n"$sub" ]] || die "config requires a subcommand (enable|disable|sync)"
0 commit comments