aboutsummaryrefslogtreecommitdiffstats
path: root/house_scraper.service
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2025-10-29 15:18:30 +0200
committerPetri Hienonen <petri.hienonen@gmail.com>2025-11-03 10:54:48 +0200
commitb03ee7032b2ea2d4d22ab7ec1346b7c9331cfc17 (patch)
treeefc0ce6823ab8611d9c6a0bf27ecdbd124638b73 /house_scraper.service
downloadhousing-b03ee7032b2ea2d4d22ab7ec1346b7c9331cfc17.tar.zst
Initial commit
Diffstat (limited to 'house_scraper.service')
-rw-r--r--house_scraper.service42
1 files changed, 42 insertions, 0 deletions
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