Compare commits

..

No commits in common. "master" and "master" have entirely different histories.

9 changed files with 0 additions and 249 deletions

View File

@ -1,21 +0,0 @@
FROM alpine:latest
EXPOSE 80
COPY install.sh /install.sh
COPY entrypoint.sh /entrypoint.sh
RUN mkdir -p /srv/cfg
RUN apk add bash
RUN apk add git
RUN apk add thttpd
RUN apk add python3
RUN apk add py-pip
# tutta questa merda per compilare delle dipendenze pip di caldav, ma io dico
RUN apk add gcc py3-wheel libxml2-dev libxslt-dev libc-dev python3-dev
COPY thttpd.conf /srv/thttpd.conf
RUN bash install.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@ -1,11 +0,0 @@
# cgi-python
## Istruzioni per aggiungere una nuova applicazione CGI Python
1. Assicurarsi che siano rispettate le seguenti convenzioni:
* script CGI nominato come `main.py`;
* eventuale presenza di un `requirements.txt` con la lista di dipendenze pip;
* eventuale presenza di una cartella `conf` dove lo script CGI deve caricare la configurazione da un file `conf.custom.ini`;
1. Procurarsi l'URL del repository git su cui è versionato il progetto
1. Inserire l'URL in `install.sh` accondandolo nell'array di repository.
1. Committare, pushare e chiedere al capofficina di aggiornare il container.

View File

@ -1,2 +0,0 @@
#!/bin/bash
thttpd -D -C /srv/thttpd.conf

View File

@ -1,45 +0,0 @@
#!/bin/bash
function die {
echo -e "Qualcosa è andato storto"
exit -1
}
DEPLOY_DIR="/srv/cgi"
CFG_DIR="/srv/cfg"
mkdir -p $DEPLOY_DIR
mkdir -p $CFG_DIR
# Lista dei repository CGI
REPO[0]="https://git.golem.linux.it/golem/zerocalcare.git"
REPO[1]="https://git.golem.linux.it/golem/tpdf.git"
# ... aggiungi qui altri repository, basta che rispettino le specifiche
# descritte nel readme
cd $DEPLOY_DIR
# Che bello il bash e la sua sintassi creativa, no?
for url in ${REPO[*]}; do
PRJ_DIR=$(basename "$url" .git)
git clone $url
test $? -eq 0 || die
pushd $PRJ_DIR
# Linka la configurazione nel sottovolume
if [ -d conf ]; then
ln -s $CFG_DIR/$PRJ_DIR.conf.ini conf/conf.custom.ini
test $? -eq 0 || die
fi
if [ -f requirements.txt ]; then
pip install -r requirements.txt
test $? -eq 0 || die
fi
popd
done
exit 0

View File

@ -1,5 +0,0 @@
dir=/srv/cgi
port=80
charset=utf-8
cgipat=**/main.py
user=root

View File

@ -1,13 +0,0 @@
FROM alpine:latest
COPY entrypoint.sh /entrypoint.sh
COPY sshd_config /etc/ssh/
RUN apk add thttpd
RUN apk add openssh-server
RUN apk add openssh-sftp-server
RUN rm -rf /etc/ssh/ssh_host_*_key
ENTRYPOINT ["/entrypoint.sh"]

View File

@ -1,15 +0,0 @@
#!/bin/sh
# On first startup, generate new ssh key
if [[ $(ls -1 /etc/ssh/ssh_host_*_key | wc -l) -eq 0 ]]; then
ssh-keygen -A
fi
# Change ssh user password if required
if [[ ! -z "${THTTPD_SSH_USER}" && ! -z "${THTTPD_SSH_PASSWORD}" ]]; then
echo "${THTTPD_SSH_USER}:${THTTPD_SSH_PASSWORD}" | chpasswd
fi
/usr/sbin/sshd -f /etc/ssh/sshd_config
thttpd -D -d /html

View File

@ -1,118 +0,0 @@
# $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key
# Ciphers and keying
#RekeyLimit default none
# Logging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#PubkeyAuthentication yes
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
#AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedPrincipalsFile none
#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
# UsePAM yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
#PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# no default banner path
#Banner none
# override default of no subsystems
Subsystem sftp /usr/lib/ssh/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server

View File

@ -1,19 +0,0 @@
FROM wordpress:5.7
RUN apt update && apt upgrade -y
RUN apt install -y sendmail
# Idea from https://hub.docker.com/r/gwee/wordpress-sendmail-docker/dockerfile/
# Create script to use as new entrypoint, which
# 1. Creates a localhost entry for container hostname in /etc/hosts
# 2. Restarts sendmail to discover this entry
# 3. Calls original docker-entrypoint.sh
RUN echo '#!/bin/bash' >> /usr/local/bin/docker-entrypoint-wrapper.sh \
&& echo 'set -euo pipefail' >> /usr/local/bin/docker-entrypoint-wrapper.sh \
&& echo 'echo "127.0.0.1 $(hostname) localhost localhost.localdomain" >> /etc/hosts' >> /usr/local/bin/docker-entrypoint-wrapper.sh \
&& echo 'service sendmail restart' >> /usr/local/bin/docker-entrypoint-wrapper.sh \
&& echo 'exec docker-entrypoint.sh "$@"' >> /usr/local/bin/docker-entrypoint-wrapper.sh \
&& chmod +x /usr/local/bin/docker-entrypoint-wrapper.sh
CMD ["docker-entrypoint-wrapper.sh", "apache2-foreground"]