Compare commits

..

10 Commits

Author SHA1 Message Date
d6dc6b7d61 Add Permissions-Policy response header to opt out of Google FLoC 2021-04-20 13:00:52 -04:00
963b7e74f3 Some updates
- Pull latest Perl image
- Run apt updates
- Use prefork server
- Clean up Dockerfile
2021-04-17 16:21:41 -04:00
471d77208c Fill out license details 2021-02-02 10:37:10 -05:00
Daniel Bowling
b87c39c90d Revert "Fix syntax"
This reverts commit cb72411379.
2021-01-25 20:02:35 -05:00
Daniel Bowling
14e265d872 Revert "Revert "Remove the useless autoplay attribute""
This reverts commit d220a035d7.
2021-01-25 20:01:23 -05:00
Daniel Bowling
d220a035d7 Revert "Remove the useless autoplay attribute"
This reverts commit 7f33ea003a.
2021-01-25 19:58:46 -05:00
Daniel Bowling
cb72411379 Fix syntax 2021-01-24 01:35:27 -05:00
Daniel Bowling
7f33ea003a Remove the useless autoplay attribute 2021-01-23 20:07:08 -05:00
Daniel Bowling
9fcda0a3c3 Set MOJO_REVERSE_PROXY=1 2021-01-23 19:51:11 -05:00
Daniel Bowling
aef71fdbae Clean up excess redirects 2021-01-23 19:23:22 -05:00
5 changed files with 48 additions and 8 deletions

View File

@ -1,7 +1,21 @@
FROM perl:5.22
RUN cpanm Mojolicious
FROM perl:5.32.1
# Move it
WORKDIR /opt
COPY public/ ./public/
COPY templates/ ./templates/
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"]

View File

@ -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
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
the terms of the GNU Affero General Public License as published by the Free

View File

@ -1,3 +1,25 @@
# 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

View File

@ -67,8 +67,7 @@
<!-- Soundtrack -->
<audio src="/assets/curb.mp3"
id="soundtrack"
preload="auto"
autoplay></audio>
preload="auto"></audio>
<!-- Add the background image -->
<div class="bg"></div>
</body>

View File

@ -5,13 +5,18 @@ use Mojolicious::Lite;
get '/' => sub {
my ($c) = @_;
my $hostHeader = $c->req->headers->host();
my $scheme = $c->req->url->base->scheme();
if ($hostHeader =~ /www.wethepeople.win(|:[0-9]{1,5})/) {
$c->render()
}
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';
app->start();