25 Commits 804db41102 ... 2d79cccd17

Autor SHA1 Mensaje Fecha
  Fayaaz 2d79cccd17 Add docker and uv package manager hace 1 mes
  deadtom 66e3399f4f Forgot to put a newline in for formatting hace 1 mes
  deadtom 13113d6f12 Updated version numbers hace 1 mes
  deadtom bdb64e9fc7 Updated road map hace 1 mes
  deadtom ec0b5dd671 Added overlay instructions hace 1 mes
  deadtom 3924061300 More formatting changes hace 1 mes
  Fayaaz 804db41102 Add docker and uv package manager hace 1 mes
  deadtom d3f03fbbc1 Made gunicorn logging standard. Removed option to change it. hace 1 mes
  deadtom 9059dd58f9 ocb_url added to settings menu hace 1 mes
  deadtom 4b7798c3f8 save_config updated to save OCB_URL hace 1 mes
  deadtom d9968fb54c Added OCB_URL to default config hace 1 mes
  deadtom d5408b68b6 OCB_URL is now stored in config.py. This will be useful later hace 1 mes
  deadtom e8b8820c9e Added instructions for to-do list browser source hace 1 mes
  DeadTOm 5a1efeba1b Updated version number hace 1 mes
  deadtom 7780eab344 Removed ampersand. Caused problems. hace 1 mes
  DeadTOm 427c48301d Added ampersand to background scripts run by specials hace 1 mes
  deadtom 2a59f577ff Updated version number hace 1 mes
  deadtom 6e906a8fec Wondrwmn insisted on a better screenshot hace 1 mes
  deadtom b7b21071ad Removed line about adding to category to activate, when creating a category hace 1 mes
  deadtom 4d50844b4c Now prompts for OCB URL, and defaults port number to 8081 hace 1 mes
  deadtom ef614565e0 Added some suggestions from ozone's test install hace 1 mes
  deadtom ce63a694d3 Added requirements section hace 1 mes
  deadtom a11611a90b Added making a change to the rewards queue hace 1 mes
  deadtom 87aba09d81 Removed exclamation from the end of the fulfilled notification. It looked weird. hace 1 mes
  deadtom 783d69c34a Moved Roadmap section hace 1 mes

+ 19 - 6
README.md

@@ -6,7 +6,7 @@ A feature rich chatbot for Owncast.
 ## Table of Contents
 - [Features](#features)
 - [Screenshots](#screenshots)
-- [Roadmap](#roadmap)
+- [Requirements](#requirements)
 - [Installation](#installation)
 - [Upgrading](#upgrading)
 - [Running OwnchatBot](#running-ownchatbot)
@@ -16,6 +16,7 @@ A feature rich chatbot for Owncast.
 - [To-do List](#to-do-list)
 - [Alerts](#alerts)
 - [Chat Commands](#chat-commands)
+- [Roadmap](#roadmap)
 - [Support](#support)
 - [Contributing](#contributing)
 - [License](#license)
@@ -45,7 +46,7 @@ A feature rich chatbot for Owncast.
  * Also has an overlay to display the list on your stream.
 
 ## Screenshots
-#### Overlays
+#### Vote, goal, and to-do list overlays
 <a href=https://git.deadtom.me/deadtom/OwnchatBot/src/master/screenshots/overlays.png><img src=https://git.deadtom.me/deadtom/OwnchatBot/raw/master/screenshots/overlays.png width=100></a>
 
 #### Viewer Panel
@@ -61,8 +62,15 @@ A feature rich chatbot for Owncast.
 <a href=https://git.deadtom.me/deadtom/OwnchatBot/src/master/screenshots/mgmtpanel06.png><img src=https://git.deadtom.me/deadtom/OwnchatBot/raw/master/screenshots/mgmtpanel06.png width=100></a>&nbsp;&nbsp;
 <a href=https://git.deadtom.me/deadtom/OwnchatBot/src/master/screenshots/mgmtpanel07.png><img src=https://git.deadtom.me/deadtom/OwnchatBot/raw/master/screenshots/mgmtpanel07.png width=100></a>&nbsp;&nbsp;
 
+## Requirements
+* Git
+* A recent version of Python.
+  * If using Debian, make sure python3-venv is installed.
+* Your Owncast instance must be running in https for IndieAuth authentication to function correctly.
+* It is HIGHLY recommended to run OwnchatBot behind a reverse proxy.
+ * If your Owncast instance has a reverse proxy, you'll need a separate reverse-proxy for OwnchatBot.
+
 ## Installation
-#### These instructions assume that you have git, and a recent version of python installed.
 1. You can simply download the zip/tar file from the git repo, and decompress it, but I recommend cloning the repo instead. It will make upgrading to future versions much easier.
     ```bash
     git clone https://git.deadtom.me/deadtom/OwnchatBot.git
@@ -110,7 +118,8 @@ env/bin/python -m gunicorn --error-logfile ownchatbot.log -b 0.0.0.0:8081 -w 1 '
 **A caveat here:** Some features are managed by a module called apscheduler. I chose this for its simplicity, however, it doesn't play well when trying to run the app with more than one worker. The "-w 1" option in the gunicorn command specifies just one worker. If you run it with more, it will multiply the jobs that apscheduler manages. For example, "-w 4" will start four workers, and every job apscheduler performs will get run four times. OCB will continue to function fine, but you'll see fun things like announcements getting repeated four times, and viewers getting awarded four times your configured points awards. OCB isn't yet so huge that it really needs more than one worker, but at some point I might try to move away from apscheduler.
 
 ## Final configuration
-Once OwnchatBot is running, you can start setting up your rewards and other options via the Management Panel at the URL provided by the install script. Authentication is handled using your Owncast server as an IndieAuth server. Your login credentials are the same credentials you use to log into your Owncast Admin page.
+Once OwnchatBot is running, you can start setting up your rewards and other options ```/mgmt```.
+Authentication is handled using your Owncast server as an IndieAuth server, so your login credentials are the same credentials you use to log into your Owncast Admin page.
 
 The first thing you'll want to visit is the settings page. Each option is explained in detail. Then you'll need to get it talking to your Owncast instance, and Kofi if you'll be using it, both covered below.
 
@@ -251,9 +260,13 @@ All command and rewards are preceeded with a prefix configured in the management
 
 
 ## Roadmap
+*In this order*
+* Vision impaired accessibility changes.
+* GiveButter integration.
+
 *Not necessarily in this order*
-* Streak tracker, to track how many consecutive streams a viewer has watched, and reward accordingly
-* Get emojis in OwnchatBot panels working correctly, because Wonderwmn insists on it
+* Streak tracker, to track how many consecutive streams a viewer has watched, and reward accordingly.
+* Get emojis in OwnchatBot panels working correctly, because Wonderwmn insists on it.
 * Option to only allow authenticated users, or Kofi subscribers to redeem certain rewards.
 * !Timer - Set a timer that will sound an audible alarm. A command only available to the streamer or mods.
 * A "watch" function that watches chat for certain words or phrases, and responds with preset messages.

+ 3 - 1
TODO.md

@@ -1 +1,3 @@
-* Short video tutorials on configuring OwnchatBot
+* Color blind friendly
+* GiveButter integration
+* Short video tutorials on configuring OwnchatBot.

+ 1 - 1
docker-compose.yaml

@@ -7,4 +7,4 @@ services:
     volumes:
       - ./:/app
     ports:
-      - 8082:8081
+      - 8081:8081

+ 14 - 4
install.sh

@@ -7,7 +7,7 @@ check_venv() {  # Check if the venv module is available
     if python3 -c "import venv" &> /dev/null; then
         return 0
     else
-        echo "The 'venv' module is not available. Please ensure you are using Python 3.3 or later."
+        echo "The 'venv' module is not available. If using Debian, be sure to install python3-venv."
         return 1
     fi
 }
@@ -77,7 +77,16 @@ update_config() {  # Generate key for SECRET_KEY
         echo "Set OWNCAST_URL successfully."
         rm "$bak_file"  # Remove the .bak file if the update was successful
     else
-        echo "Failed to set ACCESS_ID."
+        echo "Failed to set OWNCAST_URL."
+        exit 1  # Exit the script with a non-zero status
+    fi
+
+    read -p "Enter the external URL your OwnchatBot will be using, with \"https://\": " OCB_URL
+    if sed -i.bak "s|OCB_URL = ''|OCB_URL = '$OCB_URL'|" "instance/config.py"; then
+        echo "Set OCB_URL successfully."
+        rm "$bak_file"  # Remove the .bak file if the update was successful
+    else
+        echo "Failed to set OCB_URL."
         exit 1  # Exit the script with a non-zero status
     fi
 }
@@ -106,7 +115,8 @@ mkdir instance/assets  # Create upload folder for alert images
 SECRET_KEY=$(generate_key)
 update_config "SECRET_KEY" "$SECRET_KEY"
 
-read -p "Please enter the port number you would like OwnchatBot to listen on: " OCB_PORT
+read -p "Please enter the port number you would like OwnchatBot to listen on (default: 8081): " OCB_PORT
+OCB_PORT=${OCB_PORT:-8081}
 
 echo "
 You're ready to start OwnchatBot! Run:
@@ -115,7 +125,7 @@ env/bin/python -m gunicorn --error-logfile ownchatbot.log -b 0.0.0.0:$OCB_PORT -
 
 To configure your bot, go to:
 
-http://localhost:$OCB_PORT/mgmt
+$OCB_URL:$OCB_PORT/mgmt
 
 Login to using your owncast admin name and password.
 "

+ 3 - 4
ownchatbot/__init__.py

@@ -37,10 +37,9 @@ def create_app(test_config=None):
     app.config.from_pyfile('alerts.py', silent=True)
     app.config['ASSETS_FOLDER'] = os.path.join(app.instance_path, 'assets')
 
-    if app.config['GUNICORN']:  # Gunicorn logging integration
-        gunicorn_logger = logging.getLogger('gunicorn.error')
-        app.logger.handlers = gunicorn_logger.handlers
-        app.logger.setLevel(gunicorn_logger.level)
+    gunicorn_logger = logging.getLogger('gunicorn.error')
+    app.logger.handlers = gunicorn_logger.handlers
+    app.logger.setLevel(gunicorn_logger.level)
 
     from . import webhooks  # Set up blueprints
     from . import web_panels

+ 1 - 1
ownchatbot/defaults/config.py

@@ -4,10 +4,10 @@ ACCESS_ID = ''  # The name of your access token
 OWNCAST_URL = ''  # Either your external Owncast URL, or your local Owncast URL with the proper port number. (Example: http://localhost:8080)
 
 # OwnchatBot Configuration
+OCB_URL = ''
 POINTS_INTERVAL = 5  # How long, in minutes, between points awards
 POINTS_AWARD = 5  # How many points awarded each interval?
 SECRET_KEY = ''  # Needed for internal flask stuff. Generated during setup. DO NOT CHANGE
 PREFIX = '!'  # Preceeds commands, so OwnchatBot knows what is a command
-GUNICORN = True    # Integrate OwnchatBot logging into Gunicorn
 KOFI_TOKEN = ''  # Needed to validate Ko-fi with OCB webhook. Get from Ko-fi Settings -> More -> API -> Webhooks -> Advanced - Verification Token.
 KOFI_INTEGRATION = False  # Integrate OwnchatBot with Ko-fi

+ 1 - 1
ownchatbot/reward_handlers.py

@@ -380,10 +380,10 @@ ACCESS_TOKEN = '{config_dict['ACCESS_TOKEN']}'\n\
 OWNCAST_URL = '{config_dict['OWNCAST_URL']}'\n\
 \n\
 # OwnchatBot Configuration \n\
+OCB_URL = '{config_dict['OCB_URL']}'\n\
 SECRET_KEY = '{secret_key}'  # Needed for internal Flask stuff. DO NOT DELETE.\n\
 POINTS_INTERVAL = {config_dict['POINTS_INTERVAL']}  # How long, in seconds, between points awards\n\
 POINTS_AWARD = {config_dict['POINTS_AWARD']}  # How many points awarded each interval?\n\
-GUNICORN = {config_dict['GUNICORN']}  # Integrate OwnchatBot logging into Gunicorn\n\
 PREFIX = '{config_dict['PREFIX']}'  # Preceeds commands, so OwnchatBot knows what is a command\n\
 KOFI_TOKEN = '{config_dict['KOFI_TOKEN']}'  # Needed to validate Ko-fi with OCB webhook. Get from Ko-fi Settings -> More -> API -> Webhooks -> Advanced - Verification Token.\n\
 KOFI_INTEGRATION = {config_dict['KOFI_INTEGRATION']}  # Integrate OwnchatBot with Ko-fi"

+ 2 - 1
ownchatbot/templates/add.html

@@ -140,9 +140,10 @@
                     </tr>
                 {% endif %}  
             </table>
-            <br>Your {{ reward_type }} will be <span style="color: red;">inactive</span>, until you add it to an active category.
             {% if reward_type == "category" %}
                 <br>By default, new categories are <span style="color: red;">inactive</span>.<br>
+            {% else %}
+                <br>Your {{ reward_type }} will be <span style="color: red;">inactive</span>, until you add it to an active category.
             {% endif %}
             <br><button class="button button2" type="submit">Create {{ reward_type }}</button><br>
         </form>

+ 72 - 26
ownchatbot/templates/mgmt.html

@@ -34,10 +34,16 @@
             <li><u>Redeems</u> are standard stream point rewards. They get added to the queue for the streamer to fulfill.</li>
             <li><u>Specials</u> are redeems, but they run system commands and scripts. This enables you to integrate a lot of other fun things, such as letting your viewers control lighting, activate devices, trigger webhooks, etc. Specials do not go into the queue, because they happen automagically.</li>
               <ul>
-                <li>Be careful with this one. It does require some more advanced scripting/command line knowledge. Make sure you test your specials before letting viewers use them.</li>
+                <li>Be careful with this one. It does require some more advanced scripting/command line knowledge, and it can be dangerous. Make sure you test your specials thoroughly before letting viewers use them.</li>
               </ul>
             <li><u>Votes</u> are just that, votes. Your viewers can vote on them.</li>
+              <ul>
+                <li>See the "Overlays" section of the readme, for instructions on using the votes overlay in your stream.</li>
+              </ul>
             <li><u>Goals</u> are rewards that everyone in chat can contribute to. The streamer fulfills the reward when the goal is reached.</li>
+              <ul>
+                <li>See the "Overlays" section of the readme, for instructions on using the goals overlay in your stream.</li>
+              </ul>
             <li>Add rewards to categories to enable and disable groups of rewards.</li>
             <li>Rewards with no categories are inactive.</li>
         </ul>
@@ -274,16 +280,16 @@
                     </thead>
                     <tr>
                         <td> <label for="announce_enable">Enable:</label> </td>
-                        {% if settings_info[9] %}
-                        <td> <input type="checkbox" name="announce_enable" value="{{ settings_info[9] }}" checked> </td>
+                        {% if settings_info[8] %}
+                        <td> <input type="checkbox" name="announce_enable" value="{{ settings_info[8] }}" checked> </td>
                         {% else %}
-                        <td> <input type="checkbox" name="announce_enable" value="{{ settings_info[9] }}"> </td>
+                        <td> <input type="checkbox" name="announce_enable" value="{{ settings_info[8] }}"> </td>
                         {% endif %}
                         <td>Enable periodic announcements</td>
                     </tr>
                     <tr>
                         <td> <label for="announce_interval">Interval:</label> </td>
-                        <td> <input type="number" name="announce_interval" value="{{ settings_info[10] }}" size="2" required> minutes</td>
+                        <td> <input type="number" name="announce_interval" value="{{ settings_info[9] }}" size="2" required> minutes</td>
                         <td>How long between each announcement?</td>
                     </tr>
                     <tr>
@@ -323,19 +329,16 @@
                         <td>How many points do you want to award them?</td>
                     </tr>
                     <tr>
-                        <td> <label for="gunicorn_logging">Gunicorn Logging:</label> </td>
-                        {% if settings_info[3] %}
-                        <td> <input type="checkbox" name="gunicorn_logging" value="{{ settings_info[3] }}" checked> </td>
-                        {% else %}
-                        <td> <input type="checkbox" name="gunicorn_logging" value="{{ settings_info[3] }}"> </td>
-                        {% endif %}
-                        <td>Enable Gunicorn logging integration.</td>
+                        <td> <label for="prefix">Chat Command Prefix:</label> </td>
+                        <td> <input type="text" name="prefix" maxlength="1" size="1" value="{{ settings_info[3] }}" required> </td>
+                        <td>Character that preceeds chat commands, so OwnchatBot knows what to look for.<br>Example: "{{ settings_info[3] }}points"</td>
                     </tr>
                     <tr>
-                        <td> <label for="prefix">Chat Command Prefix:</label> </td>
-                        <td> <input type="text" name="prefix" maxlength="1" size="1" value="{{ settings_info[4] }}" required> </td>
-                        <td>Character that preceeds chat commands, so OwnchatBot knows what to look for.<br>Example: "{{ settings_info[4] }}points"</td>
+                        <td> <label for=ocb_url>External URL:</label> </td>
+                        <td> <input type="text" name="ocb_url" size="40" value="{{ settings_info[10] }}" required> </td>
+                        <td>What is the external URL of your OwnchatBot?</td>
                     </tr>
+                        
                 </table>
                 
                 <h3>Owncast Integration</h3>
@@ -354,12 +357,12 @@
                     </tr>
                     <tr>
                         <td> <label for="access_token">Access Token:</label> </td>
-                        <td style="padding: 5px;"> <input type="password" name="access_token" value="{{ settings_info[5] }}" size="40"> </td>
+                        <td style="padding: 5px;"> <input type="password" name="access_token" value="{{ settings_info[4] }}" size="40"> </td>
                         <td>The token you created above.</td>
                     </tr>
                     <tr>
                         <td> <label for="owncast_url">Your Owncast URL:</label> </td>
-                        <td> <input type="text" name="owncast_url" value="{{ settings_info[6] }}" size="40"> </td>
+                        <td> <input type="text" name="owncast_url" value="{{ settings_info[5] }}" size="40"> </td>
                         <td>The external URL of your Owncast instance, with "http://" or "https://".</td>
                     </tr>
                 </table>
@@ -375,17 +378,17 @@
                     </thead>
                     <tr>
                         <td> <label for="kofi_integration">Enable:</label> </td>
-                        {% if settings_info[8] %}
-                        <td> <input type="checkbox" name="kofi_integration" value="{{ settings_info[8] }}" checked> </td>
+                        {% if settings_info[7] %}
+                        <td> <input type="checkbox" name="kofi_integration" value="{{ settings_info[7] }}" checked> </td>
                         <td>Enable Ko-fi integration.</td>
                         {% else %}
-                        <td> <input type="checkbox" name="kofi_integration" value="{{ settings_info[8] }}"> </td>
+                        <td> <input type="checkbox" name="kofi_integration" value="{{ settings_info[7] }}"> </td>
                         <td>Enable Ko-fi integration. ("Kofi Settings" button will appear in the navigation bar when enabled.)</td>
                         {% endif %}
                     </tr>
                     <tr>
                         <td> <label for="kofi_token">Verification Token:</label> </td>
-                        <td style="padding: 5px;"> <input type="password" name="kofi_token" value="{{ settings_info[7] }}" size="40"> </td>
+                        <td style="padding: 5px;"> <input type="password" name="kofi_token" value="{{ settings_info[6] }}" size="40"> </td>
                         <td>Get from Kofi -> More -> API -> Webhooks -> Advanced -> Verification Token.</td>
                     </tr>
                 </table>
@@ -489,6 +492,33 @@
         <form action="/mgmt/clearlist" method="get" style="display: inline;">
             <button class="button button2" type="submit" class="button">Clear List</button>
         </form>
+        <hr>
+        <h3>Stream Overlay</h3>
+        To place the to-do list overlay in your stream, create a browser source in your streaming software<br>using the following URL: {{ settings_info[10] }}/todo<br>
+        &emsp;Recommended width: 420<br>
+        &emsp;Recommended height: 500<br>
+        &emsp;In OBS, check "Refresh browser source when scene becomes active"
+        <br><br>
+        You can spruce up your list with fonts and colors by inserting custom CSS into the browser source.<br>
+        <h5>Example CSS:</h5>
+        &emsp;h4 {<br>
+        &emsp;&emsp;font-size: 32px;<br>
+        &emsp;&emsp;text-decoration: underline;<br>
+        &emsp;&emsp;text-align: center;<br>
+        &emsp;&emsp;margin-bottom: 0;<br>
+        &emsp;&emsp;padding-bottom: 0;<br>
+        &emsp;}<br><br>
+
+        &emsp;ul {<br>
+        &emsp;&emsp;margin-top: 0;<br>
+        &emsp;&emsp;padding-top: 0;<br>
+        &emsp;}<br><br>
+
+        &emsp;li {<br>
+        &emsp;&emsp;font-size: 30px;<br>
+        &emsp;}<br><br>
+        If you want to use a custom font, place the font file in your "instance/assets/" folder, and reference the following location in your CSS:<br>
+        &emsp;&emsp;/assets/yourfont.ttf
         <br><br>
     </div>
     
@@ -502,7 +532,7 @@
                     <th style="width: 20%;">Image</th>
                     <th></th>
                     <th style="width: 15%;"></th>
-                    <th style="width: 25%;">Browser Source</th>
+                    <th style="width: 45%;">URL</th>
                 </tr>
             </thead>
                 <tr>
@@ -522,7 +552,7 @@
                     <td><button id="nf_upload" class="button button2" type="submit">Upload</button>
                     </form>&nbsp
                         <a href="{{ url_for('web_panels.del_alert', alert_type='FOLLOWER_ALERT') }}"><button class="button button2" onclick="openTab(event, 'alerts')"><span style="color: red;">Clear</span></button></a></td>
-                    <td>/alert/follower</td>
+                    <td>{{ settings_info[10] }}/alert/follower</td>
                 </tr>
                 <tr>
                     <form id="nms_upload" action="/mgmt/alertupload/MILESTONE_ALERT" method="post" enctype="multipart/form-data">
@@ -540,7 +570,7 @@
                     <td><input type="file" name="MILESTONE_ALERT" accept=".gif, .jpg, .jpeg, .png, .webm" required></td>
                     <td><button id="nms_upload" class="button button2" type="submit">Upload</button></form>&nbsp
                         <a href="{{ url_for('web_panels.del_alert', alert_type='MILESTONE_ALERT') }}"><button class="button button2" onclick="openTab(event, 'alerts')"><span style="color: red;">Clear</span></button></a></td>
-                    <td>/alert/milestone</td>
+                    <td>{{ settings_info[10] }}/alert/milestone</td>
                 </tr>
                 <tr>
                     <form id="ng_upload" action="/mgmt/alertupload/GOAL_ALERT" method="post" enctype="multipart/form-data">
@@ -558,10 +588,26 @@
                     <td><input type="file" name="GOAL_ALERT" accept=".gif, .jpg, .jpeg, .png, .webm" required></td>
                     <td><button id="ng_upload" class="button button2" type="submit">Upload</button></form>&nbsp
                         <a href="{{ url_for('web_panels.del_alert', alert_type='GOAL_ALERT') }}"><button class="button button2" onclick="openTab(event, 'alerts')"><span style="color: red;">Clear</span></button></a></td>
-                    <td>/alert/goal</td>
+                    <td>{{ settings_info[10] }}/alert/goal</td>
                 </tr>
         </table>
+        <h3>Stream Overlays</h3>
+        To use these alerts, create a browser source in your streaming software, using the URLs specified above.<br>
+        &emsp;Recommended width: 200<br>
+        &emsp;Recommended height: 200<br>
+        &emsp;In OBS, check "Refresh browser source when scene becomes active"
+        <br><br>
+        Each alert will display the name of the viewer that triggered the alert. You can customize the position of the name, as well as fonts and colors by inserting custom CSS into the browser source.<br>
+        <h5>Example CSS:</h5>
+        &emsp;#nameBox {<br>
+        &emsp;&emsp;top: 50%; /* Vertical position */<br>
+        &emsp;&emsp;left: 50%; /* Horizontal position */<br>
+        &emsp;&emsp;font-size: 20px; /* Adjust as needed */<br>
+        &emsp;&emsp;font-weight: bold; /* Adjust as needed */<br>
+        &emsp;}<br><br>
+        If you want to use a custom font, place the font file in your "instance/assets/" folder, and reference the following location in your CSS:<br>
+        &emsp;&emsp;/assets/yourfont.ttf
         </body>
+        <br><br>
     </div>
-    <br><br>
 </html>

+ 6 - 6
ownchatbot/web_panels.py

@@ -98,7 +98,6 @@ def mgmt():
     all_cats = current_app.config['ALL_CAT']
     points_interval = current_app.config['POINTS_INTERVAL']
     points_award = current_app.config['POINTS_AWARD']
-    gunicorn_logging = current_app.config['GUNICORN']
     prefix = current_app.config['PREFIX']
     access_id = current_app.config['ACCESS_ID']
     access_token = current_app.config['ACCESS_TOKEN']
@@ -110,18 +109,19 @@ def mgmt():
     todolist_items = current_app.config['LIST']
     active_tab = request.args.get('activeTab')
     alerts_dict = current_app.config['ALERTS']
+    ocb_url = current_app.config['OCB_URL']
     settings_info = [
         access_id,
         points_interval,
         points_award,
-        gunicorn_logging,
         prefix,
         access_token,
         owncast_url,
         kofi_token,
         kofi_integration,
         announce_enable,
-        announce_interval
+        announce_interval,
+        ocb_url
         ]
 
     return render_template('mgmt.html',
@@ -206,7 +206,7 @@ def fulfilled():
     reward_name = request.args.get('reward_name')
     try:
         if fulfill_reward(db, reward_id):
-            send_chat(f'{prefix}{reward_name} fulfilled for {username}!')
+            send_chat(f'{prefix}{reward_name} fulfilled for {username}.')
     except Exception as rrerror:
         current_app.logger.error(f'General exception, when trying to send fulfill chat notification: {fferror}')
     return redirect(url_for('web_panels.mgmtqueue'))
@@ -336,18 +336,18 @@ def settings():
     todolist_items = current_app.config['LIST']
     points_interval = int(request.form['points_interval'])
     points_award = int(request.form['points_award'])
-    gunicorn_logging = 'gunicorn_logging' in request.form
     prefix = request.form['prefix']
     access_id = request.form['access_id']
     access_token = request.form['access_token']
     owncast_url = request.form['owncast_url']
+    ocb_url = request.form['ocb_url']
     kofi_integration = 'kofi_integration' in request.form
     kofi_token = request.form['kofi_token']
     config_dict = {
         'POINTS_INTERVAL': points_interval,
         'POINTS_AWARD': points_award,
-        'GUNICORN': gunicorn_logging,
         'PREFIX': prefix,
+        'OCB_URL': ocb_url,
         'ACCESS_ID': access_id,
         'ACCESS_TOKEN': access_token,
         'OWNCAST_URL': owncast_url,

+ 1 - 1
pyproject.toml

@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
 
 [project]
 name = "ownchatbot"
-version = "1.1.6"
+version = "1.1.8"
 authors = [
     {name = "DeadTOm", email = "deadtom@deadtom.me"},
 ]

BIN
screenshots/overlays.png


+ 1 - 1
setup.py

@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
 
 setup(
     name='ownchatbot',
-    version='1.1.6',
+    version='1.1.8',
     packages=find_packages(),
     include_package_data=True,
     install_requires=[

+ 21 - 5
upgrade.sh

@@ -7,15 +7,31 @@ activate_venv() {
     source env/bin/activate || { echo "Failed to activate virtual environment"; exit 1; }
 }
 
-install_module() {
+update_modules() {
     pip install --upgrade pip || { echo "Failed to upgrade pip"; exit 1; }  # Upgrade pip
     pip install -e . || { echo "Failed to install/upgrade module"; exit 1; }  # Install/upgrade modules
 }
 
-mv instance/alerts instance/assets
+update_config() {
+    local bak_file="instance/config.py.bak"
 
-activate_venv
-install_module
-deactivate
+    read -p "Enter the external URL your OwnchatBot uses, with \"https://\": " OCB_URL
+    
+    if [[ -n "$OCB_URL" ]]; then  # Check if OCB_URL is not empty
+        echo "" >> instance/config.py  # Append an empty line so it formats correctly
+        echo "OCB_URL = '$OCB_URL'" >> instance/config.py  # Append the new line
+        echo "Set OCB_URL successfully."
+        cp instance/config.py "$bak_file"
+        rm "$bak_file"  # Remove the .bak file if the update was successful
+    else
+        echo "Failed to set OCB_URL. Please provide a valid URL."
+        exit 1  # Exit the script with a non-zero status
+    fi
+}
+
+# activate_venv
+# update_modules
+update_config
+# deactivate
 
 echo -e "Your OwnchatBot configuration has been upgraded. Happy streaming!"