diff --git a/app.py b/app.py index 00b5fab..a44a0e1 100644 --- a/app.py +++ b/app.py @@ -25,9 +25,10 @@ class Channel(Resource): args = parser.parse_args() channel = args['channel'] # Save the new channel to file - with open("channel_url.txt", "w") as f: + with open("/var/channel_url.txt", "w") as f: f.write(channel) # Update the current channel + global current_channel current_channel = channel return jsonify({"message": "Channel updated"}) @@ -36,9 +37,10 @@ class GetNewChannel(Resource): r = requests.get("https://nixos.org/channels/nixos-21.11") channel = r.url # Save the new channel to file - with open("channel_url.txt", "w") as f: + with open("/var/channel_url.txt", "w") as f: f.write(channel) # Update the current channel + global current_channel current_channel = channel return jsonify({"message": "Channel updated", "channel": channel}) diff --git a/channel_url.txt b/channel_url.txt index 58dc96c..06d62e0 100644 --- a/channel_url.txt +++ b/channel_url.txt @@ -1 +1 @@ -https://nixos.org/channels/nixos-21.05 \ No newline at end of file +https://nixos.org/channels/nixos-21.11 \ No newline at end of file