fork naming scheme
This commit is contained in:
+4
-5
@@ -2,15 +2,14 @@ version: "3"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
gts-federation:
|
gts-federation:
|
||||||
image: domoel/gts-federation:latest
|
image: domoel/gts-federator:latest
|
||||||
container_name: gts-federation
|
container_name: gts-federator
|
||||||
user: 1026:100
|
#user: 1026:100 # "If you run into permission issues with the 'data' folder, make sure to set the correct UID/GID for your system."
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
- ./gts_holmirdas.py:/app/gts_holmirdas.py:ro
|
|
||||||
- ./rss_feeds.txt:/app/rss_feeds.txt:ro
|
- ./rss_feeds.txt:/app/rss_feeds.txt:ro
|
||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Berlin
|
- TZ=Europe/Berlin # Change to your local timezone
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
restart: always
|
restart: always
|
||||||
|
|||||||
+5
-5
@@ -8,7 +8,7 @@ import requests
|
|||||||
import feedparser
|
import feedparser
|
||||||
from datetime import timedelta, datetime
|
from datetime import timedelta, datetime
|
||||||
|
|
||||||
class GTSHolMirDas:
|
class GTSFederator:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.config = {
|
self.config = {
|
||||||
"server_url": os.getenv("GTS_SERVER_URL", "").rstrip('/'),
|
"server_url": os.getenv("GTS_SERVER_URL", "").rstrip('/'),
|
||||||
@@ -18,7 +18,7 @@ class GTSHolMirDas:
|
|||||||
"fetch_interval": os.getenv("FETCH_INTERVAL", "30m"),
|
"fetch_interval": os.getenv("FETCH_INTERVAL", "30m"),
|
||||||
"log_level": os.getenv("LOG_LEVEL", "INFO"),
|
"log_level": os.getenv("LOG_LEVEL", "INFO"),
|
||||||
"rss_urls_file": os.getenv("RSS_URLS_FILE", "/app/rss_feeds.txt"),
|
"rss_urls_file": os.getenv("RSS_URLS_FILE", "/app/rss_feeds.txt"),
|
||||||
"user_agent": os.getenv("USER_AGENT", "GTS-Federation-Bot/1.0 (+https://social.ztfr.eu)")
|
"user_agent": os.getenv("USER_AGENT", "GTS-Federator/1.0 (+https://social.ztfr.eu)")
|
||||||
}
|
}
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
@@ -64,7 +64,7 @@ class GTSHolMirDas:
|
|||||||
self.logger.error(f"Save error: {e}")
|
self.logger.error(f"Save error: {e}")
|
||||||
|
|
||||||
def process_feeds(self):
|
def process_feeds(self):
|
||||||
self.logger.info(f"📂 Start Fetching. Database: {self.db_path}")
|
self.logger.info(f"📂 Starting fetch run. Database: {self.db_path}")
|
||||||
|
|
||||||
if not os.path.exists(self.config["rss_urls_file"]):
|
if not os.path.exists(self.config["rss_urls_file"]):
|
||||||
self.logger.error("RSS_URLS_FILE missing!")
|
self.logger.error("RSS_URLS_FILE missing!")
|
||||||
@@ -124,7 +124,7 @@ class GTSHolMirDas:
|
|||||||
|
|
||||||
def run_forever(self):
|
def run_forever(self):
|
||||||
wait_seconds = self.parse_interval(self.config["fetch_interval"])
|
wait_seconds = self.parse_interval(self.config["fetch_interval"])
|
||||||
self.logger.info(f"GTS-Federator Active. Interval: {self.config['fetch_interval']}")
|
self.logger.info(f"GTS-Federator active. Interval: {self.config['fetch_interval']}")
|
||||||
while True:
|
while True:
|
||||||
self.process_feeds()
|
self.process_feeds()
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ class GTSHolMirDas:
|
|||||||
time.sleep(wait_seconds)
|
time.sleep(wait_seconds)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
bot = GTSHolMirDas()
|
bot = GTSFederator()
|
||||||
if not bot.config["access_token"]:
|
if not bot.config["access_token"]:
|
||||||
sys.exit("Error: GTS_ACCESS_TOKEN missing!")
|
sys.exit("Error: GTS_ACCESS_TOKEN missing!")
|
||||||
bot.run_forever()
|
bot.run_forever()
|
||||||
Reference in New Issue
Block a user