From b03ee7032b2ea2d4d22ab7ec1346b7c9331cfc17 Mon Sep 17 00:00:00 2001 From: Petri Hienonen Date: Wed, 29 Oct 2025 15:18:30 +0200 Subject: Initial commit --- house_scraper.service | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 house_scraper.service (limited to 'house_scraper.service') diff --git a/house_scraper.service b/house_scraper.service new file mode 100644 index 0000000..94f0799 --- /dev/null +++ b/house_scraper.service @@ -0,0 +1,42 @@ +[Unit] +Description=House Hunter Scraper Service +Documentation=https://github.com/your-username/house-hunter +Wants=network-online.target +After=network-online.target + +[Service] +Type=oneshot +User=house-scraper +Group=house-scraper +WorkingDirectory=/opt/house-scraper + +# Environment variables for configuration +Environment=COUCHDB_URL=https://couch.tammi.cc +Environment=COUCHDB_DATABASE=asunnot +Environment=S3_ENDPOINT=s3.tammi.cc +Environment=S3_BUCKET=asunnnot +Environment=SCRAPING_INTERVAL=24h +Environment=LOG_LEVEL=info + +# Security settings +NoNewPrivileges=yes +PrivateTmp=yes +ProtectSystem=strict +ProtectHome=yes +ReadWritePaths=/opt/house-scraper/logs /opt/house-scraper/tmp + +# Process settings +ExecStart=/usr/local/bin/house-scraper +ExecStartPre=/usr/bin/sleep 30 # Wait for network to be fully up + +# Credentials (store in /etc/systemd/system/house-scraper.service.d/credentials.conf) +Environment=S3_ACCESS_KEY=gQ1c5HvC4LyI9Pmt8UDW +Environment=S3_SECRET_KEY=D9iwHkQe18UoyxBzvaTc5KBeXWw2Wwu6qjo7YKzl + +# Logging +StandardOutput=journal +StandardError=journal +SyslogIdentifier=house-scraper + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3-70-g09d2