Compare commits
10 Commits
a588be82b4
...
d6dc6b7d61
Author | SHA1 | Date | |
---|---|---|---|
d6dc6b7d61 | |||
963b7e74f3 | |||
471d77208c | |||
|
b87c39c90d | ||
|
14e265d872 | ||
|
d220a035d7 | ||
|
cb72411379 | ||
|
7f33ea003a | ||
|
9fcda0a3c3 | ||
|
aef71fdbae |
20
Dockerfile
20
Dockerfile
|
@ -1,7 +1,21 @@
|
||||||
FROM perl:5.22
|
FROM perl:5.32.1
|
||||||
RUN cpanm Mojolicious
|
|
||||||
|
# Move it
|
||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
COPY public/ ./public/
|
COPY public/ ./public/
|
||||||
COPY templates/ ./templates/
|
COPY templates/ ./templates/
|
||||||
COPY wethepeople.pl .
|
COPY wethepeople.pl .
|
||||||
CMD ["perl", "wethepeople.pl", "daemon", "-m", "production"]
|
|
||||||
|
# Upgrade
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get -y upgrade
|
||||||
|
|
||||||
|
# Install Mojo
|
||||||
|
RUN cpanm Mojolicious
|
||||||
|
|
||||||
|
# Set up environment
|
||||||
|
ENV MOJO_REVERSE_PROXY=1
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
# Send it
|
||||||
|
CMD ["perl", "wethepeople.pl", "prefork", "-m", "production"]
|
||||||
|
|
4
LICENSE
4
LICENSE
|
@ -582,9 +582,9 @@ them to the start of each source file to most effectively state the exclusion
|
||||||
of warranty; and each file should have at least the "copyright" line and a
|
of warranty; and each file should have at least the "copyright" line and a
|
||||||
pointer to where the full notice is found.
|
pointer to where the full notice is found.
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
Source code for http://wethepeople.win
|
||||||
|
|
||||||
Copyright (C) <year> <name of author>
|
Copyright (C) 2021 Daniel Bowling
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it under
|
This program is free software: you can redistribute it and/or modify it under
|
||||||
the terms of the GNU Affero General Public License as published by the Free
|
the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
|
22
README.md
22
README.md
|
@ -1,3 +1,25 @@
|
||||||
# wethepeople.win
|
# wethepeople.win
|
||||||
|
|
||||||
Source code for http://wethepeople.win
|
Source code for http://wethepeople.win
|
||||||
|
|
||||||
|
## Building/Testing
|
||||||
|
|
||||||
|
### Build the container locally
|
||||||
|
|
||||||
|
docker build -t wethepeople.pl .
|
||||||
|
|
||||||
|
### Run it locally
|
||||||
|
|
||||||
|
docker run -p 3000:3000 wethepeople.pl:latest
|
||||||
|
|
||||||
|
Pull up [http://localhost:3000](http://localhost:3000) and poke around
|
||||||
|
|
||||||
|
## Tagging/Pushing
|
||||||
|
|
||||||
|
### Tag the image
|
||||||
|
|
||||||
|
docker tag wethepeople.pl gcr.io/www-swagg/wethepeople.pl
|
||||||
|
|
||||||
|
### Send it
|
||||||
|
|
||||||
|
docker push gcr.io/www-swagg/wethepeople.pl
|
||||||
|
|
|
@ -67,8 +67,7 @@
|
||||||
<!-- Soundtrack -->
|
<!-- Soundtrack -->
|
||||||
<audio src="/assets/curb.mp3"
|
<audio src="/assets/curb.mp3"
|
||||||
id="soundtrack"
|
id="soundtrack"
|
||||||
preload="auto"
|
preload="auto"></audio>
|
||||||
autoplay></audio>
|
|
||||||
<!-- Add the background image -->
|
<!-- Add the background image -->
|
||||||
<div class="bg"></div>
|
<div class="bg"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -5,13 +5,18 @@ use Mojolicious::Lite;
|
||||||
get '/' => sub {
|
get '/' => sub {
|
||||||
my ($c) = @_;
|
my ($c) = @_;
|
||||||
my $hostHeader = $c->req->headers->host();
|
my $hostHeader = $c->req->headers->host();
|
||||||
|
my $scheme = $c->req->url->base->scheme();
|
||||||
|
|
||||||
if ($hostHeader =~ /www.wethepeople.win(|:[0-9]{1,5})/) {
|
if ($hostHeader =~ /www.wethepeople.win(|:[0-9]{1,5})/) {
|
||||||
$c->render()
|
$c->render()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$c->redirect_to('http://www.wethepeople.win')
|
$c->redirect_to("$scheme://www.wethepeople.win")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Opt out of Google FLoC
|
||||||
|
# https://paramdeo.com/blog/opting-your-website-out-of-googles-floc-network
|
||||||
|
$c->res->headers->header('Permissions-Policy', 'interest-cohort=()');
|
||||||
} => 'index';
|
} => 'index';
|
||||||
|
|
||||||
app->start();
|
app->start();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user