ご主人様
not manx 4 years ago
parent a479b49b3f
commit 0adbfeed83
Signed by: C-xC-c
GPG Key ID: F52ED472284EF2F4

@ -0,0 +1,16 @@
[Unit]
Description=bantflags serb
[Service]
# Set to the location of the application
WorkingDirectory=/var/www/bantflags/src/
ExecStart=/usr/bin/env sbcl --load init.el
Restart=always
# restarts 10 seconds after it goes bang
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=bantflags
User=nginx
[Install]
WantedBy=multi-user.target

36
env/database.sql vendored

@ -0,0 +1,36 @@
DROP DATABASE IF EXISTS `bantflags`;
CREATE DATABASE `bantflags`;
CREATE USER IF NOT EXISTS flags@localhost IDENTIFIED BY 'default';
GRANT ALL PRIVILEGES ON bantflags.* TO flags@localhost;
FLUSH PRIVILEGES;
USE `bantflags`;
CREATE TABLE `flags` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`flag` varchar(100) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `flag` (`flag`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
CREATE TABLE `posts` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`post_nr` int(10) NOT NULL DEFAULT '0',
`board` varchar(10) NOT NULL DEFAULT 'bant',
PRIMARY KEY (`id`),
UNIQUE KEY `post_nr_board` (`post_nr`,`board`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
CREATE TABLE `postflags` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`post_nr` int(10) NOT NULL DEFAULT '0',
`flag` int(10) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `flag` (`flag`),
KEY `post_nr` (`post_nr`),
CONSTRAINT `flag` FOREIGN KEY (`flag`) REFERENCES `flags` (`id`) ON DELETE CASCADE,
CONSTRAINT `post_nr` FOREIGN KEY (`post_nr`) REFERENCES `posts` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
INSERT INTO `flags` (`flag`) VALUES ('empty, or there were errors. Re-set your flags.');

36
env/nginx.conf vendored

@ -0,0 +1,36 @@
events {
worker_connections 768;
}
http {
types {
text/html html htm shtm;
text/css css;
image/gif gif;
image/jpeg jpg jpeg;
image/png png;
}
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
charset utf-8;
index index.html;
server {
root /var/www/flags;
server_name flags.plum.moe;
listen 80;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_cache_bypass $http_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
}
}
}

@ -0,0 +1,9 @@
;; This needs to be run with a lisp started in the same directory as
;; bantflags
(push (truename ".") ql:*local-project-directories*)
(ql:register-local-projects)
(ql:quickload :bantflags)
(bantflags:main)
(hunchentoot:start bantflags:*serb*)
(loop (sleep 43200) (gc :full t))
Loading…
Cancel
Save