Browse Source

working on stuff

feature/startup-from-labels
Mario Alegre 5 years ago
parent
commit
ca52bfe834
  1. 1
      bin/pdm-launch
  2. 22
      install.sh
  3. 1
      src/mailsrv/Containerfile
  4. 4
      src/mailsrv/assets/bin/mkvirt
  5. 20
      src/mailsrv/assets/postfix/master.cf
  6. 9
      src/startpage/assets/data.json
  7. 34
      src/startpage/assets/thumbnails/discord.svg

1
bin/pdm-launch

@ -53,5 +53,4 @@ if [[ $FLAGS_overwrite ]]; then
fi
podman run -itd --name $name --hostname $name $deployopts $image
# --userns=keep-id
echo "Done!"

22
install.sh

@ -34,27 +34,6 @@ else
exit 1
fi
echo "Creating containers user ..."
user_id=$(id -u $myusr > /dev/null 2>&1)
user_exists=$(echo $?)
if [[ $user_exists != 0 ]]; then
sudo addgroup $myusr --gid $myuid --system
sudo adduser $myusr --ingroup $myusr --uid $myuid --disabled-password --gecos "Containers User" --shell /usr/sbin/nologin --no-create-home --home /srv/$myusr --system
elif [[ $user_id != $myuid ]]; then
echo "Error: User \"$myusr\" already exists, but does not have UID $myuid."
echo "Please delete user \"$myusr\" and then re-run the install script."
exit 2
else
echo "User \"$myusr\" is already configured. Skipping ..."
fi
echo "Configuring subuids and subgids ..."
echo "$myusr:1000000:1000000000" | sudo tee -a /etc/subuid /etc/subgid
echo "Configuring kernel parameters ..."
kernel.unprivileged_userns_clone=1
#net.ipv4.ping_group_range=0 1001000000
echo "Copying scripts to /usr/local/bin ..."
# copy bin files to /usr/local/bin
sudo cp bin/* /usr/local/bin/
@ -72,4 +51,3 @@ fi
sudo chmod +x /etc/containers/startup.sh
echo "Installed containers startup script in /etc/containers/startup.sh."
echo "Put any podman-related commands that should run on startup in that file."

1
src/mailsrv/Containerfile

@ -7,7 +7,6 @@ FROM localhost/debian
# -p (port) and -v (volume) both go host:container
LABEL deployopts="\
-p 25:25 \
-p 465:465 \
-p 587:587 \
-p 143:143 \
-p 993:993 \

4
src/mailsrv/assets/bin/mkvirt

@ -2,6 +2,10 @@
set -e
# copy users passwd-file to /etc/dovecot and set appropriate permissions
cp /vol/db/users /etc/dovecot/users
chown dovecot:dovecot /etc/dovecot/users
# make self-referential users list
# this is needed for the reject_sender_login_mismatch restriction to work,
# otherwise users cannot send emails as their own address

20
src/mailsrv/assets/postfix/master.cf

@ -18,15 +18,17 @@ submission inet n - y - - smtpd
-o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject
-o smtpd_sender_login_maps=hash:/etc/postfix/aliases
-o smtpd_sender_restrictions=reject_sender_login_mismatch
smtps inet n - y - - smtpd
-o smtpd_sasl_local_domain=$myhostname
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_security_options=noanonymous
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject
-o smtpd_sender_login_maps=hash:/etc/postfix/aliases
-o smtpd_sender_restrictions=reject_sender_login_mismatch
#smtps inet n - y - - smtpd
# -o syslog_name=postfix/smtps
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_reject_unlisted_recipient=no
# -o smtpd_client_restrictions=$mua_client_restrictions
# -o smtpd_helo_restrictions=$mua_helo_restrictions
# -o smtpd_sender_restrictions=$mua_sender_restrictions
# -o smtpd_recipient_restrictions=
# -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
# Local services
# ==========================================================================
pickup unix n - y 60 1 pickup

9
src/startpage/assets/data.json

@ -4,12 +4,12 @@
"content": {
"General" : [
{
"url": "http://medusa.casa.alemor.org/nextcloud/",
"url": "https://medusa.alemor.org/nextcloud/",
"title": "Nextcloud",
"image": "assets/thumbnails/nextcloud.svg"
},
{
"url": "http://medusa.casa.alemor.org/git/",
"url": "https://medusa.alemor.org/git/",
"title": "Gitea",
"image": "assets/thumbnails/gitea.svg"
},
@ -57,6 +57,11 @@
"url": "https://hangouts.google.com/",
"title": "Google Hangouts",
"image": "assets/thumbnails/google_hangouts.svg"
},
{
"url": "https://discord.com/app",
"title": "Discord",
"image": "assets/thumbnails/discord.svg"
}
],
"Work" : [

34
src/startpage/assets/thumbnails/discord.svg

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="875px" height="1000px" viewBox="0 0 875 1000" enable-background="new 0 0 875 1000" xml:space="preserve">
<g>
<path fill="#7289DA" d="M347.2154846,419.5360107c-28.3029785,0-51.2084961,24.7799988-51.2084961,55.338501
c0,30.5780029,22.9055176,55.3535156,51.2084961,55.3535156c28.2630615,0,51.1690063-24.7755127,51.1690063-55.3535156
C398.384491,444.3160095,375.4785461,419.5360107,347.2154846,419.5360107z"/>
<path fill="#7289DA" d="M529.4649658,419.5360107c-28.2634888,0-51.1694641,24.7799988-51.1694641,55.338501
c0,30.5780029,22.9059753,55.3535156,51.1694641,55.3535156c28.3024902,0,51.2080078-24.7755127,51.2080078-55.3535156
C580.6729736,444.3160095,557.7674561,419.5360107,529.4649658,419.5360107z"/>
<path fill="#7289DA" d="M772.661499,0h-670.322937C45.8115005,0,0,46.2019997,0,103.2105026v676.0349731
c0,57.0085449,45.8115005,103.2105103,102.3385391,103.2105103h567.1838989l-26.5249634-92.3449707l63.881958,59.407959
l60.302002,56.0574951L875,1000V779.2454834v-50.1914673V103.2105026C875,46.2019997,829.1879883,0,772.661499,0z
M579.598999,653.1359863c0,0-17.831543-21.6129761-32.7814941-40.5620117
c65.6795044-18.4214478,90.4219971-59.5254517,90.4219971-59.5254517
c-20.6690063,13.5449829-40.1365356,22.977478-57.6799927,29.6714478
c-24.9470215,10.3635254-49.25,17.3380127-72.6830139,21.6675415
c-47.8479614,8.8955078-91.9064941,6.7329712-129.6004944-0.2755127
c-28.4250183-5.3049927-53.2060242-13.3485107-73.3965149-21.510498
c-11.4719849-4.3934937-23.7844849-10.0574951-36.7369995-17.2144775
c-1.6409912-0.8915405-3.1984863-1.7390137-4.6394958-2.5615234c-0.7569885-0.4235229-1.4750061-0.8074951-2.197998-1.2509766
c-8.9179993-5.1224976-13.7924957-8.526001-13.7924957-8.526001S270.5419922,593,334.1405029,611.8104858
c-15.0719604,19.1110229-33.371521,41.3255005-33.371521,41.3255005
c-110.4604492-3.3889771-152.6779785-76.242981-152.6779785-76.242981c0-160.9234924,71.960495-291.3894958,71.960495-291.3894958
c72.0384979-54.2055054,140.2770538-52.489502,140.2770538-52.489502l5.1574402,5.8834991
c-90.2260132,25.881485-131.2805023,65.7144928-131.2805023,65.7144928s10.7545013-6.2260132,29.6945038-14.2890015
c53.6940002-23.5859985,95.989502-29.9375,113.4935608-31.6294861c2.802948-0.4015198,5.5574341-0.8275146,8.3999939-1.1914978
c30.7394409-3.8890076,64.8784485-4.9775085,101.1369324-0.9040222
c47.4915161,5.3590088,98.6655273,19.5910034,150.6705322,48.0140076c0,0-39.2970581-37.6755066-124.6050415-63.5570068
l6.9990234-8.0409851c0,0,68.2730103-1.7160034,140.2719727,52.489502c0,0,71.9995117,130.4660034,71.9995117,291.3894958
C732.2664795,576.8930054,690.0539551,649.7470093,579.598999,653.1359863z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

Loading…
Cancel
Save