From 6204fead92565b955512cc23a767976bc72f3da9 Mon Sep 17 00:00:00 2001 From: Erin Power Date: Sun, 17 Mar 2024 22:21:07 +0100 Subject: [PATCH] Remove old infra scripts --- initdb.sql | 24 ------------------------ nginx.conf | 24 ------------------------ setup | 18 ------------------ tokei_rs.service | 14 -------------- 4 files changed, 80 deletions(-) delete mode 100644 initdb.sql delete mode 100644 nginx.conf delete mode 100755 setup delete mode 100644 tokei_rs.service diff --git a/initdb.sql b/initdb.sql deleted file mode 100644 index ba6d31d..0000000 --- a/initdb.sql +++ /dev/null @@ -1,24 +0,0 @@ -DROP TABLE IF EXISTS repo; -DROP TABLE IF EXISTS stats; - -CREATE TABLE repo ( - hash VARCHAR PRIMARY KEY, - blanks BIGINT NOT NULL, - code BIGINT NOT NULL, - comments BIGINT NOT NULL, - lines BIGINT NOT NULL -); - -CREATE TABLE stats ( - hash VARCHAR NOT NULL, - blanks BIGINT NOT NULL, - code BIGINT NOT NULL, - comments BIGINT NOT NULL, - lines BIGINT NOT NULL, - name VARCHAR NOT NULL -); - -DROP USER IF EXISTS tokei_rs; -CREATE USER tokei_rs; -GRANT ALL PRIVILEGES ON TABLE repo TO tokei_rs; -GRANT ALL PRIVILEGES ON TABLE stats TO tokei_rs; diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index f96a3ec..0000000 --- a/nginx.conf +++ /dev/null @@ -1,24 +0,0 @@ -events { worker_connections 1024; } - -http { - - upstream app_servers { # Create an upstream for the web servers - server badge:8000; # the first server - } - - server { - listen 80; - - location / { - proxy_pass http://app_servers; # load balance the traffic - } - } - - server { - listen 443; - - location / { - proxy_pass http://app_servers; # load balance the traffic - } - } -} diff --git a/setup b/setup deleted file mode 100755 index f3a945b..0000000 --- a/setup +++ /dev/null @@ -1,18 +0,0 @@ -# Setup script to run the Tokei.rs service on a server. -#!/usr/bin/env bash -set -e - -echo 'Enter password to enable sudo' -sudo echo 'sudo enabled' -cargo build --release - -sudo /bin/cp ./initdb.sql /tmp/initdb.sql -sudo /bin/cp ./tokei_rs.service /etc/systemd/system/tokei_rs.service - -psql -f /tmp/initdb.sql -U tokei_rs - -sudo systemctl stop tokei_rs.service -sudo mkdir -p /opt/tokei/ -sudo /bin/cp ./target/release/tokei_rs /opt/tokei/tokei_rs -sudo systemctl daemon-reload -sudo systemctl start tokei_rs.service diff --git a/tokei_rs.service b/tokei_rs.service deleted file mode 100644 index ccebcc9..0000000 --- a/tokei_rs.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=tokei.rs server - -[Service] -ExecStart=/opt/tokei/tokei_rs -WorkingDirectory=/opt/tokei -Restart=always -RestartSec=10 # Restart service after 10 seconds if node service crashes -StandardOutput=syslog # Output to syslog -StandardError=syslog # Output to syslog -SyslogIdentifier=tokei_rs - -[Install] -WantedBy=multi-user.target