diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..153614c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/perl5local.xml b/.idea/perl5local.xml new file mode 100644 index 0000000..a90b3be --- /dev/null +++ b/.idea/perl5local.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/perl5shared.xml b/.idea/perl5shared.xml new file mode 100644 index 0000000..01e36b5 --- /dev/null +++ b/.idea/perl5shared.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/.idea/unix.dog.iml b/.idea/unix.dog.iml new file mode 100644 index 0000000..0c8867d --- /dev/null +++ b/.idea/unix.dog.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/lib/unix_dog.pm b/lib/unix_dog.pm new file mode 100644 index 0000000..31bd7bc --- /dev/null +++ b/lib/unix_dog.pm @@ -0,0 +1,24 @@ +package unix_dog; +use Mojo::Base 'Mojolicious', -signatures; + +# This method will run once at server start +sub startup ($self) { + + # Load configuration from config file + my $config = $self->plugin('NotYAMLConfig'); + + # Configure the application + $self->secrets($config->{secrets}); + + $self->defaults(title => 'UNIX.dog'); + + # Router + my $r = $self->routes; + + # Normal route to controller + $r->get('/')->to('Main#index'); + $r->get('/index.xhtml')->to('Main#index'); + $r->get('/rules')->to('Main#rules'); +} + +1; diff --git a/lib/unix_dog/Controller/Example.pm b/lib/unix_dog/Controller/Example.pm new file mode 100644 index 0000000..f23c710 --- /dev/null +++ b/lib/unix_dog/Controller/Example.pm @@ -0,0 +1,11 @@ +package unix_dog::Controller::Example; +use Mojo::Base 'Mojolicious::Controller', -signatures; + +# This action will render a template +sub welcome ($self) { + + # Render template "example/welcome.html.ep" with message + $self->render(msg => 'Welcome to the Mojolicious real-time web framework!'); +} + +1; diff --git a/lib/unix_dog/Controller/Main.pm b/lib/unix_dog/Controller/Main.pm new file mode 100644 index 0000000..61e07a5 --- /dev/null +++ b/lib/unix_dog/Controller/Main.pm @@ -0,0 +1,12 @@ +package unix_dog::Controller::Main; +use Mojo::Base 'Mojolicious::Controller', -signatures; + +sub index ($self) { + $self->render(); +} + +sub rules ($self) { + $self->render(); +} + +1; diff --git a/mojo.pl b/mojo.pl new file mode 100644 index 0000000..0c9c598 --- /dev/null +++ b/mojo.pl @@ -0,0 +1,12 @@ +use strict; +use warnings FATAL => 'all'; +use Mojolicious::Lite -signatures; + +app->start; +__DATA__ + +@@ magic.html.ep + + + + diff --git a/public/css/main.css b/public/css/main.css new file mode 100644 index 0000000..cb1a25c --- /dev/null +++ b/public/css/main.css @@ -0,0 +1,114 @@ +body { + font-family: monospace; + margin: 0; + background: #080e08; + color: #f6f6f6; + + display: flex; + flex-direction: column; + min-height: 100vh; +} + +h1, h2 { + color: #4af626; +} + +footer { + padding: 10px; + max-width: 800px; + width: 100%; + background: #3a7920; + color: #f6f6f6; + + margin: auto auto 0; + box-sizing: border-box; +} + +a:link { + color: #2cacb0; +} + +a:visited { + color: #b4778f; +} +@media (prefers-color-scheme: light) { + body { + background: #fcfffc; + color: #211c1b; + } + + h1, h2 { + color: #4c982a; + } + + a:link { + color: #1f7b7e; + } + + a:visited { + color: #7c5263; + } +} + +header { + background: linear-gradient( + 90deg, + rgba(255, 0, 0, 1) 0%, + rgba(255, 154, 0, 1) 10%, + rgba(208, 222, 33, 1) 20%, + rgba(79, 220, 74, 1) 30%, + rgba(63, 218, 216, 1) 40%, + rgba(47, 201, 226, 1) 50%, + rgba(28, 127, 238, 1) 60%, + rgba(95, 21, 242, 1) 70%, + rgba(186, 12, 248, 1) 80%, + rgba(251, 7, 217, 1) 90%, + rgba(255, 0, 0, 1) 100% + ); + min-height: 50px; + display: flex; + color: black; + box-sizing: border-box; +} + +#header-content { + max-width: 800px; + margin: auto; + width: 100%; + align-content: center; + flex-direction: row; + display: flex; + padding: 10px; +} +#header-content h1 { + color: black; + margin: auto auto auto 1rem; +} + +#header-content img { + display: inline; +} + +main { + max-width: 800px; + margin: 0 auto; + padding: 10px; + width: 100%; + box-sizing: border-box; +} + + +span.copyleft { + display: inline-block; + transform: rotate(180deg); +} + +footer a:link, footer a:visited { + text-decoration: none; + font-weight: bold; + color: white; +} + +footer a:hover { + text-decoration: underline; +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..46eafce Binary files /dev/null and b/public/favicon.ico differ diff --git a/script/unix_dog b/script/unix_dog new file mode 100755 index 0000000..ebc040a --- /dev/null +++ b/script/unix_dog @@ -0,0 +1,11 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +use Mojo::File qw(curfile); +use lib curfile->dirname->sibling('lib')->to_string; +use Mojolicious::Commands; + +# Start command line interface for application +Mojolicious::Commands->start_app('unix_dog'); diff --git a/t/basic.t b/t/basic.t new file mode 100644 index 0000000..19504f6 --- /dev/null +++ b/t/basic.t @@ -0,0 +1,9 @@ +use Mojo::Base -strict; + +use Test::More; +use Test::Mojo; + +my $t = Test::Mojo->new('unix_dog'); +$t->get_ok('/')->status_is(200)->content_like(qr/Mojolicious/i); + +done_testing(); diff --git a/templates/example/welcome.html.ep b/templates/example/welcome.html.ep new file mode 100644 index 0000000..0a67219 --- /dev/null +++ b/templates/example/welcome.html.ep @@ -0,0 +1,9 @@ +% layout 'default'; +% title 'Welcome'; +

<%= $msg %>

+

+ This page was generated from the template "templates/example/welcome.html.ep" + and the layout "templates/layouts/default.html.ep", + <%= link_to 'click here' => url_for %> to reload the page or + <%= link_to 'here' => '/index.html' %> to move forward to a static page. +

diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep new file mode 100644 index 0000000..2496207 --- /dev/null +++ b/templates/layouts/default.html.ep @@ -0,0 +1,33 @@ + + + + + <%= title %> + + + + + + + + + + + +
+
+ UNIX.dog +

UNIX.dog

+
+
+
+ <%= content %> +
+ + + + diff --git a/templates/main/index.html.ep b/templates/main/index.html.ep new file mode 100644 index 0000000..b552e8c --- /dev/null +++ b/templates/main/index.html.ep @@ -0,0 +1,59 @@ +% layout 'default'; +
+

Welcome to UNIX.dog!

+

+ UNIX.dog is a public UNIX server for dogs and by dogs. + We aim to provide a welcoming space for furries, + queer folks, and their allies to hang out, create, and communicate! + + Registration will open soon! +

+ +
+

Pubnix

+

+ We provide a public server running Gentoo Linux for use by our members. + You get a webpage under unix.dog you can fully customize, and a working + email you can send and receive from. + Server specifications: +

+ +

+ Of course, all resources are shared between users. + Be courteous and respectful of everyone's experience :) +

+
+
+

Services

+

+ UNIX.dog provides many useful services to promote a healthy + federated sphere. XMPP, EMail, and Akkoma are provided to all + registered users. If you have a suggestion for a service, please + email alpha at this domain; we're interesting in hosting more + useful services for everyone! +

+
+
+

More

+

+ UNIX.dog is created by Kayden (nullobsi) with help from ~keith. + We're funded entirely out of pocket, but if you like these services, + pay it forward! Donate to your favorite charity and support the causes + you believe in. +

+

+ Made with love <3 (and fur) by +
+ Kayden Tebau (nullobsi) +
+ ~keith +

+
+ +
diff --git a/templates/main/rules.html.ep b/templates/main/rules.html.ep new file mode 100644 index 0000000..907a505 --- /dev/null +++ b/templates/main/rules.html.ep @@ -0,0 +1,97 @@ +% layout 'default'; +
+

UNIX.dog Rules

+

+ To provide a welcoming space, UNIX.dog needs some rules. (tl;dr don't be an asshole). +

+

+ Please keep in mind that final intepretation of these rules are up to UNIX.dog admins. + As the server is hosted in Nuremberg, Germany, by Contabo, all use of UNIX.dog services + must follow federal law of Germany and the + Contabo terms of service. +

+ +
+

Network Conduct

+
    +
  1. + Do not impersonate or otherwise deceptively claim yourself as a UNIX.dog admin. + All official communications will be from alpha at unix dot dog or this website. +
  2. +
  3. Do not collect UNIX.dog user data without express permission.
  4. +
  5. Do not use UNIX.dog services for commercial reasons.
  6. +
  7. Do not attack, compromise, or disrupt UNIX.dog services with malicious intent.
  8. +
  9. Be courteous of the shared resources provided, and be mindful of your time using them.
  10. +
+
+
+

Personal Conduct

+
    +
  1. Treat every individual with respect and kindness.
  2. +
  3. + Do not use profanity, slurs, or offensive language + in a way directed maliciously at an individual. +
  4. +
  5. + Do not discriminate against individuals because of race, religion, nationality, + membership in a particular social group, or political opinion. +
  6. +
  7. + Do not bully, harass, or otherwise intimidate or cause emotional harm to + any individual with malicious intent. +
  8. +
+
+
+

Content Rules

+
    +
  1. When uploading NSFW, please tag it accordingly.
  2. +
  3. Do not upload content that is illegal in Germany.
  4. +
  5. Sexual depictions of children, including artistic depictions, are not allowed.
  6. +
+
+
+

Moderation Conduct

+

+ Please note that this should apply to both UNIX.dog admins + and moderators along with moderators of user-created MUCs + or other groups on UNIX.dog services. +

+
    +
  1. You must not give cruel, unusual, or vindictive punishments to users.
  2. +
  3. + You must give an explicit, unambiguous warning to users before performing + a privileged action on them, unless it is reasonably determined that they + are automated. +
  4. +
  5. + You must also provide an explicit, unambiguous reason and duration + to the privileged action. +
  6. +
  7. + You must provide a banned user, after a reasonable cool-down period, + the ability to exchange external contacts with their peers. +
  8. +
  9. + No "ex post facto" judgements. +
  10. +
  11. + Burden of proof is laid on the accuser, not the accusee. Please keep this in mind + when submitting reports. +
  12. +
+
+
+

Legal Disclaimer

+

+ THESE SERVICES ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + ADMINISTRATORS OR COPYRIGHT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THESE SERVICES OR THE USE OR OTHER DEALINGS IN THESE + SERVICES. +

+
+ +
diff --git a/unix_dog.yml b/unix_dog.yml new file mode 100644 index 0000000..fc4126a --- /dev/null +++ b/unix_dog.yml @@ -0,0 +1,3 @@ +--- +secrets: + - 888a581283ecac6c1ca08a476f559726da1c0e83