App aus Dateinamen entfernt
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
package XxxApp;
|
package Xxx;
|
||||||
use Mojo::Base 'Mojolicious';
|
use Mojo::Base 'Mojolicious';
|
||||||
use Time::localtime;
|
use Time::localtime;
|
||||||
|
|
||||||
@@ -8,7 +8,6 @@ sub startup {
|
|||||||
|
|
||||||
# einlesen der lokalen Config
|
# einlesen der lokalen Config
|
||||||
my $config = $self->plugin('Config');
|
my $config = $self->plugin('Config');
|
||||||
# $self->plugin('Config', 'file' => $config->{zus_config}); # hier und in der konfig zus_config aktivieren
|
|
||||||
|
|
||||||
$self->secrets([ $config->{secret}]);
|
$self->secrets([ $config->{secret}]);
|
||||||
|
|
||||||
@@ -43,7 +42,7 @@ sub startup {
|
|||||||
# $config->{test} = $self->dbxxx->{dsn} =~ m/dbs-test/gxms;
|
# $config->{test} = $self->dbxxx->{dsn} =~ m/dbs-test/gxms;
|
||||||
|
|
||||||
# Local Helpers
|
# Local Helpers
|
||||||
$self->plugin('XxxApp::Helpers' => { verbose => 1 });
|
$self->plugin('Xxx::Helpers' => { verbose => 1 });
|
||||||
|
|
||||||
# https://editor.swagger.io/?url=https://petstore.swagger.io/v2/swagger.yaml
|
# https://editor.swagger.io/?url=https://petstore.swagger.io/v2/swagger.yaml
|
||||||
$self->plugin('OpenAPI' => {
|
$self->plugin('OpenAPI' => {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package XxxApp::Controller::Api::Jstreetemplate;
|
package Xxx::Controller::Api::Jstreetemplate;
|
||||||
use Mojo::Base 'Mojolicious::Controller';
|
use Mojo::Base 'Mojolicious::Controller';
|
||||||
use Data::Printer;
|
use Data::Printer;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package XxxApp::Controller::Menu;
|
package Xxx::Controller::Menu;
|
||||||
use Mojo::Base 'Mojolicious::Controller';
|
use Mojo::Base 'Mojolicious::Controller';
|
||||||
|
|
||||||
sub jstreetemplate {
|
sub jstreetemplate {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package XxxApp::Helpers;
|
package Xxx::Helpers;
|
||||||
use Mojo::Base 'Mojolicious::Plugin';
|
use Mojo::Base 'Mojolicious::Plugin';
|
||||||
|
|
||||||
sub register {
|
sub register {
|
||||||
@@ -6,6 +6,7 @@ sub register {
|
|||||||
|
|
||||||
$app->helper('trim' => \&_trim);
|
$app->helper('trim' => \&_trim);
|
||||||
$app->helper('debuglog' => \&_debuglog);
|
$app->helper('debuglog' => \&_debuglog);
|
||||||
|
$app->helper('authenticate' => \&_authenticate);
|
||||||
|
|
||||||
$app->log->info(sprintf('REGISTERED: %s', __PACKAGE__)) if !!$args->{verbose};
|
$app->log->info(sprintf('REGISTERED: %s', __PACKAGE__)) if !!$args->{verbose};
|
||||||
return;
|
return;
|
||||||
@@ -27,4 +28,14 @@ sub _debuglog {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub _authenticate {
|
||||||
|
my ($c, $username, $password) = @_;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return 1; # or return 0 on failure
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package XxxApp::Main;
|
package Xxx::Main;
|
||||||
use Mojo::Base 'Mojolicious::Controller';
|
use Mojo::Base 'Mojolicious::Controller';
|
||||||
|
|
||||||
sub main {
|
sub main {
|
||||||
2
xxx/app/morbo.sh
Normal file → Executable file
2
xxx/app/morbo.sh
Normal file → Executable file
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
cd "${0%/*}"
|
cd "${0%/*}"
|
||||||
morbo -l http://*:hypnotoadport script/XxxApp -w templates -w lib -w *.conf -w *.json
|
morbo -l http://*:hypnotoadport script/Xxx -w templates -w lib -w *.conf -w *.json
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ BEGIN { unshift @INC, "$FindBin::Bin/../lib" }
|
|||||||
use Mojolicious::Commands;
|
use Mojolicious::Commands;
|
||||||
|
|
||||||
# Start command line interface for application
|
# Start command line interface for application
|
||||||
Mojolicious::Commands->start_app('XxxApp');
|
Mojolicious::Commands->start_app('Xxx');
|
||||||
@@ -10,18 +10,18 @@ use DBI;
|
|||||||
use Data::Printer;
|
use Data::Printer;
|
||||||
|
|
||||||
#my $dbh = DBI->connect('DBI:mysql:prod:ares', '', '') or die ('Fehler beim Verbinden mit der Datenbank');
|
#my $dbh = DBI->connect('DBI:mysql:prod:ares', '', '') or die ('Fehler beim Verbinden mit der Datenbank');
|
||||||
my $t = Test::Mojo->new('XxxApp');
|
my $t = Test::Mojo->new('Xxx');
|
||||||
|
|
||||||
$t->app->log->level('info');
|
$t->app->log->level('info');
|
||||||
$t->app->ua->max_redirects(1);
|
$t->app->ua->max_redirects(1);
|
||||||
|
|
||||||
subtest 'prod konfig test' => sub {
|
subtest 'prod konfig test' => sub {
|
||||||
my $konf = do '../deb/prod/xxx_app.conf';
|
my $konf = do '../deb/prod/xxx.conf';
|
||||||
|
|
||||||
is exists $konf->{secret}, 1, 'secret = exists';
|
is exists $konf->{secret}, 1, 'secret = exists';
|
||||||
is $konf->{htlib}, "/var/local/htlib", 'htlib = /var/local/htlib';
|
is $konf->{htlib}, "/var/local/htlib", 'htlib = /var/local/htlib';
|
||||||
|
|
||||||
is $konf->{hypnotoad}->{pid_file}, "/run/xxx.pid", 'hypnotoad->pid_file = /run/xxx.pid';
|
is $konf->{hypnotoad}->{pid_file}, "/run/steffen/xxx.pid", 'hypnotoad->pid_file = /run/steffen/xxx.pid';
|
||||||
is $konf->{hypnotoad}->{workers}, 4, 'hypnotoad->workers = 4';
|
is $konf->{hypnotoad}->{workers}, 4, 'hypnotoad->workers = 4';
|
||||||
is $konf->{hypnotoad}->{proxy}, 1, 'hypnotoad->proxy = 1';
|
is $konf->{hypnotoad}->{proxy}, 1, 'hypnotoad->proxy = 1';
|
||||||
|
|
||||||
|
|||||||
@@ -27,10 +27,7 @@
|
|||||||
|
|
||||||
<nav class="navbar navbar-expand-sm navbar-light bg-light">
|
<nav class="navbar navbar-expand-sm navbar-light bg-light">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand" href="<%= $self->config->{mlandshome} %>">
|
<a class="navbar-brand ukraine" href="<%= url_for('/') %>" style="margin-right: 0.5rem;">
|
||||||
<img src="<%= url_for('/htlib/mlands/img/mlands.svg') %>">
|
|
||||||
</a>
|
|
||||||
<a class="navbar-brand ukraine" href="/" style="margin-right: 0.5rem;">
|
|
||||||
<img src="<%= url_for('/images/xxx.svg') %>" width="40px">
|
<img src="<%= url_for('/images/xxx.svg') %>" width="40px">
|
||||||
</a>
|
</a>
|
||||||
<a class="navbar-brand" style="font-size: 1.4rem;" href="<%= url_for('/') %>">Xxx</a>
|
<a class="navbar-brand" style="font-size: 1.4rem;" href="<%= url_for('/') %>">Xxx</a>
|
||||||
@@ -85,8 +82,8 @@
|
|||||||
%= javascript '/htlib/jquery/3.7.1/jquery.min.js'
|
%= javascript '/htlib/jquery/3.7.1/jquery.min.js'
|
||||||
%= javascript '/htlib/jquery-ui/1.13.2/jquery-ui.min.js'
|
%= javascript '/htlib/jquery-ui/1.13.2/jquery-ui.min.js'
|
||||||
%= javascript '/htlib/bootstrap/5.3.3/js/bootstrap.bundle.min.js'
|
%= javascript '/htlib/bootstrap/5.3.3/js/bootstrap.bundle.min.js'
|
||||||
%= javascript '/htlib/jquery-datatables/2.1.8/js/dataTables.min.js'
|
%= javascript '/htlib/jquery-datatables/2.2.2/js/dataTables.min.js'
|
||||||
%= javascript '/htlib/jquery-datatables/2.1.8/js/dataTables.bootstrap4.min.js'
|
%= javascript '/htlib/jquery-datatables/2.2.2/js/dataTables.bootstrap4.min.js'
|
||||||
%= javascript '/htlib/jquery-datatables/extensions/Select/2.1.0/js/dataTables.select.min.js'
|
%= javascript '/htlib/jquery-datatables/extensions/Select/2.1.0/js/dataTables.select.min.js'
|
||||||
%= javascript '/htlib/jquery-datatables/extensions/Select/2.1.0/js/select.bootstrap4.min.js'
|
%= javascript '/htlib/jquery-datatables/extensions/Select/2.1.0/js/select.bootstrap4.min.js'
|
||||||
%= javascript '/htlib/jquery-datatables/extensions/Buttons/3.1.2/js/dataTables.buttons.min.js'
|
%= javascript '/htlib/jquery-datatables/extensions/Buttons/3.1.2/js/dataTables.buttons.min.js'
|
||||||
@@ -100,7 +97,7 @@
|
|||||||
%= javascript '/htlib/jquery-datatables/extensions/Scroller/2.4.3/js/scroller.bootstrap4.min.js'
|
%= javascript '/htlib/jquery-datatables/extensions/Scroller/2.4.3/js/scroller.bootstrap4.min.js'
|
||||||
%= javascript '/htlib/jquery-datatables/date-de/date-de.min.js'
|
%= javascript '/htlib/jquery-datatables/date-de/date-de.min.js'
|
||||||
|
|
||||||
%= javascript "/htlib/mlands/js/popy.min.js"
|
%= javascript "/htlib/popy/popy.min.js"
|
||||||
|
|
||||||
<%= content %>
|
<%= content %>
|
||||||
|
|
||||||
@@ -111,7 +108,7 @@
|
|||||||
% use POSIX qw(strftime);
|
% use POSIX qw(strftime);
|
||||||
% my $year = strftime('%Y', localtime);
|
% my $year = strftime('%Y', localtime);
|
||||||
<div class="container-fluid text-muted text-right">
|
<div class="container-fluid text-muted text-right">
|
||||||
<small>Xxx v<%= $self->config->{version} %> • © 2003-<%= $year %> ml&s Gmbh & Co. KG</small>
|
<small>Xxx v<%= $self->config->{version} %> • © <%= $year %> Steffen Junge</small>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
0
xxx/app/test.sh
Normal file → Executable file
0
xxx/app/test.sh
Normal file → Executable file
28
xxx/app/xxx.conf
Normal file
28
xxx/app/xxx.conf
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
htlib => '/var/local/htlib',
|
||||||
|
secret => 'mojoappsecret',
|
||||||
|
|
||||||
|
# DB Pools
|
||||||
|
db => {
|
||||||
|
xxx => {
|
||||||
|
dsn => 'DBI:mysql:test:localhost',
|
||||||
|
username => '',
|
||||||
|
password => '',
|
||||||
|
verbose => 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
privileges => {
|
||||||
|
# user => wird bei erfolgreicher Anmeldung den Privs hinzugefügt
|
||||||
|
},
|
||||||
|
|
||||||
|
logging => {
|
||||||
|
level => 'debug',
|
||||||
|
facility => 'local7',
|
||||||
|
enable => 1,
|
||||||
|
only_syslog => 0,
|
||||||
|
#access_log => 'v1', #bisher nicht änderbar
|
||||||
|
ident => 'xxx',
|
||||||
|
#color => 1, #erst ab Mojolicious 9.01
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
# zus_config => '/etc/mlands/configs/xxx.conf', # um externe konfigs mit Passwörtern zu laden
|
|
||||||
|
|
||||||
htlib => '/var/local/htlib',
|
|
||||||
mlandshome => 'http://intranet.mlands.com:9673/Z/',
|
|
||||||
komaurl => 'http://intra/koma',
|
|
||||||
smtpserver => 'mail.mlands.com',
|
|
||||||
mail => 'Xxx@mlands.com',
|
|
||||||
|
|
||||||
secret => 'mojoappsecret',
|
|
||||||
|
|
||||||
# DB Pools
|
|
||||||
# db => {
|
|
||||||
# xxx => {
|
|
||||||
# dsn => 'DBI:mysql:test:localhost',
|
|
||||||
# username => '',
|
|
||||||
# password => '',
|
|
||||||
# verbose => 0,
|
|
||||||
# },
|
|
||||||
# },
|
|
||||||
|
|
||||||
privileges => {
|
|
||||||
# user => wird bei erfolgreicher Anmeldung den Privs hinzugefügt
|
|
||||||
},
|
|
||||||
|
|
||||||
logging => {
|
|
||||||
level => 'debug',
|
|
||||||
facility => 'local7',
|
|
||||||
enable => 1,
|
|
||||||
only_syslog => 0,
|
|
||||||
#access_log => 'v1', #bisher nicht änderbar
|
|
||||||
ident => 'xxx',
|
|
||||||
#color => 1, #erst ab Mojolicious 9.01
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +1 @@
|
|||||||
/opt/xxx/app/xxx_app.conf
|
/opt/xxx/xxx.conf
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ if [ $rc -eq 0 ] ; then
|
|||||||
minor=$(date +'%m')
|
minor=$(date +'%m')
|
||||||
|
|
||||||
progpfad="opt/xxx/"
|
progpfad="opt/xxx/"
|
||||||
apppfad="app/lib/XxxApp.pm"
|
apppfad="app/lib/Xxx.pm"
|
||||||
workdir=/tmp/$USER_$(pwd | sed 's/^.*\///')
|
workdir=/tmp/$USER_$(pwd | sed 's/^.*\///')
|
||||||
rm -Rf "${workdir:?}/*"
|
rm -Rf "${workdir:?}/*"
|
||||||
mkdir -p "$workdir"
|
mkdir -p "$workdir"
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ StartLimitIntervalSec=10
|
|||||||
Type=forking
|
Type=forking
|
||||||
User=steffen-xxx
|
User=steffen-xxx
|
||||||
Group=webapps
|
Group=webapps
|
||||||
WorkingDirectory=/opt/xxx/app
|
WorkingDirectory=/opt/xxx
|
||||||
ExecStart=/usr/bin/hypnotoad ./script/XxxApp
|
ExecStart=/usr/bin/hypnotoad ./script/Xxx
|
||||||
ExecReload=/usr/bin/hypnotoad ./script/XxxApp
|
ExecReload=/usr/bin/hypnotoad ./script/Xxx
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
PIDFile=/run/xxx.pid
|
PIDFile=/run/steffen/xxx.pid
|
||||||
KillMode=process
|
KillMode=process
|
||||||
|
|
||||||
# Optional hardening to improve security
|
# Optional hardening to improve security
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
# see https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html
|
# see https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html
|
||||||
# Type Path Mode User Group Age Argument
|
# Type Path Mode User Group Age Argument
|
||||||
|
d /run/steffen 770 root webapps
|
||||||
Z /opt/xxx - steffen-xxx steffen-xxx
|
Z /opt/xxx - steffen-xxx steffen-xxx
|
||||||
|
|||||||
Reference in New Issue
Block a user