Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NoCloud-Auto-Installer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NoCloud
NoCloud-Auto-Installer
Commits
69a60e8a
Commit
69a60e8a
authored
4 months ago
by
Elian Loraux
Browse files
Options
Downloads
Patches
Plain Diff
add ingore domain for fail2ban in .env
parent
29243588
Branches
Branches containing commit
No related tags found
1 merge request
!21
Services desk 81 redistributivite securimag
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
main.env.sample
+5
-0
5 additions, 0 deletions
main.env.sample
utils/configure_base_tools.sh
+25
-2
25 additions, 2 deletions
utils/configure_base_tools.sh
utils/getIgnoreIp.sh
+26
-0
26 additions, 0 deletions
utils/getIgnoreIp.sh
with
56 additions
and
2 deletions
main.env.sample
+
5
−
0
View file @
69a60e8a
...
...
@@ -13,6 +13,11 @@ export DOMAIN="dev.tetras-libre.fr"
export SERVER_ADMIN="sysadmin@tetras-libre.fr"
export IGNORE_DOMAINES=(
"tetrix.tetras-libre.fr"
"piculus.tetras-libre.fr"
)
# can be set to nginx
export WEB_SERVER="apache2"
# You can define here some services that are badly detected by checkrestart
...
...
This diff is collapsed.
Click to expand it.
utils/configure_base_tools.sh
+
25
−
2
View file @
69a60e8a
#!/bin/bash
set
-o
nounset
# Treat unset variables as an error
echo
"RUN
$(
basename
"
$0
"
)
==="
DIR
=
$(
realpath
$(
dirname
$0
)
/..
)
if
[
!
-e
$DIR
/main.env
]
then
echo
"Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it"
exit
1
else
echo
"Environment file loaded"
fi
.
$DIR
/main.env
if
[
-z
"
$(
grep
'^alias ls='
/root/.bashrc
)
"
]
then
...
...
@@ -35,10 +47,21 @@ syntax on
filetype plugin indent on
EOF
ignoreips
=()
for
domaine
in
"
${
IGNORE_DOMAINES
[@]
}
"
;
do
# Utilise dig pour obtenir l'adresse IP
ip
=
$(
dig +short
"
$domaine
"
)
ignoreips
=(
"
${
ignoreips
[@]
}
"
$ip
)
# Affiche le nom de domaine et l'adresse IP
echo
"
$domaine
:
$ip
"
done
cat
<<
EOF
> /etc/fail2ban/jail.local
[DEFAULT]
# Ignore Tetras Libre IPs
ignoreip = 127.0.0.1/8 ::1
$(
dig +short servermon.tetras-libre.fr |
tail
-n
1
)
$(
dig +short tetrix.tetras-libre.fr |
tail
-n
1
)
$(
docker network inspect traefik |
awk
'/Subnet/{print $2}'
|
sed
-e
's/"//g'
-e
's/,$//'
)
ignoreip = 127.0.0.1/8 ::1
${
ignoreips
[@]
}
$(
docker network inspect traefik |
awk
'/Subnet/{print $2}'
|
sed
-e
's/"//g'
-e
's/,$//'
)
EOF
fail2ban-client reload
This diff is collapsed.
Click to expand it.
utils/getIgnoreIp.sh
0 → 100644
+
26
−
0
View file @
69a60e8a
#!/usr/bin/env bash
set
-o
nounset
# Treat unset variables as an error
echo
"RUN
$(
basename
"
$0
"
)
==="
DIR
=
$(
realpath
$(
dirname
$0
)
/..
)
if
[
!
-e
$DIR
/main.env
]
then
echo
"Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it"
exit
1
else
echo
"Environment file loaded"
fi
.
$DIR
/main.env
ignoreips
=()
for
domaine
in
"
${
IGNORE_DOMAINES
[@]
}
"
;
do
# Utilise dig pour obtenir l'adresse IP
ip
=
$(
dig +short
"
$domaine
"
)
ignoreips
=(
"
${
ignoreips
[@]
}
"
$ip
)
# Affiche le nom de domaine et l'adresse IP
echo
"
$domaine
:
$ip
"
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment