diff --git a/README.md b/README.md index b848da5..c6e4174 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,12 @@ You might want to change the hostname in docker-compose.yml to something you lik You can change the './socat/data/socat.sh' and ips/ports you want to passtthrough. AND DONT FORGET TO DO THAT TOO IN THE DOCKER-COMPOSE.YML!! +## Network setup +You can set up the network with this: +```bash +sudo docker network create --ipam-driver default --subnet 192.168.12.0/24 netvm +``` + ## Building the images We first need to build the images to do this: ```bash diff --git a/data/pve/pve_manager/pve-replication-state.json b/data/pve/pve_manager/pve-replication-state.json deleted file mode 100644 index 9e26dfe..0000000 --- a/data/pve/pve_manager/pve-replication-state.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/data/pve/pve_manager/pve-replication-state.lck b/data/pve/pve_manager/pve-replication-state.lck deleted file mode 100644 index e69de29..0000000 diff --git a/docker-compose.yml b/docker-compose.yml index 6e4c609..6077fdc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,10 +4,10 @@ networks: name: netvm services: - pve-server2: - image: pve-custom2 + pve-server: + image: pve-custom build: ./pve - container_name: pve-server2 + container_name: pve-server privileged: true hostname: pve-owo networks: diff --git a/pve/Dockerfile b/pve/Dockerfile index 4538721..93eb87d 100644 --- a/pve/Dockerfile +++ b/pve/Dockerfile @@ -14,7 +14,7 @@ RUN apt-get update && \ RUN \ echo "**** install runtime packages ****" && \ - apt update && apt install -y isc-dhcp-server kitty-terminfo btop logrotate neovim netcat-openbsd sudo openssh-server wget systemctl curl gnupg ca-certificates rsyslog net-tools iputils-ping && \ + apt-get update && apt-get install -y isc-dhcp-server kitty-terminfo btop logrotate neovim netcat-openbsd openssh-server wget systemctl curl gnupg ca-certificates rsyslog net-tools iputils-ping && \ echo "**** setup openssh environment ****" && \ useradd -m rander && \ usermod --shell /bin/bash rander && \ @@ -82,7 +82,7 @@ RUN echo "root:root"|chpasswd RUN systemctl enable pvenetcommit.service pve-firewall isc-dhcp-server -RUN mkdir -p /var/lib/dhcp && apt update && apt install ifupdown2 -y || true +RUN mkdir -p /var/lib/dhcp && apt-get update && apt-get install ifupdown2 -y || true # add local files EXPOSE 2222 diff --git a/pve/entrypoint.sh b/pve/entrypoint.sh index 4a3fbcc..91f3792 100644 --- a/pve/entrypoint.sh +++ b/pve/entrypoint.sh @@ -2,6 +2,7 @@ set -eo pipefail shopt -s nullglob ADMIN_PASSWORD="nyaowo" +USER_PASSWORD="nyaowo" # logging functions pve_log() { @@ -21,8 +22,8 @@ pve_error() { # Verify that the minimally required password settings are set for new databases. docker_verify_minimum_env() { - if [ -z "$ADMIN_PASSWORD" ]; then - pve_error $'Password option is not specified\n\tYou need to specify an ADMIN_PASSWORD' + if [ -z "$ADMIN_PASSWORD" ] && [ "$USER_PASSWORD" ]; then + pve_error $'Password option is not specified\n\tYou need to specify an ADMIN/USER_PASSWORD' fi } @@ -33,21 +34,21 @@ systemctl start networking && systemctl start isc-dhcp-server & docker_setup_pve() { - #Set pve user + #Set root user echo "root:$ADMIN_PASSWORD"|chpasswd + #Set user + echo "pve:$USER_PASSWORD"|chpasswd } -systemctl start networking && systemctl start isc-dhcp-server & RELAY_HOST=${RELAY_HOST:-ext.home.local} sed -i "s/RELAY_HOST/$RELAY_HOST/" /etc/postfix/main.cf PVE_ENTERPRISE=${PVE_ENTERPRISE:-no} rm -f /etc/apt/sources.list.d/pve-enterprise.list +# functions docker_verify_minimum_env - -echo 'rander:12345' | chpasswd - docker_setup_pve +sleep 10 && networking_misc & if [ ! -d /var/log/pveproxy ]; then mkdir -p /var/log/pveproxy @@ -58,13 +59,10 @@ if [ -n "$ENABLE_PVE_FIREWALL" -a "$ENABLE_PVE_FIREWALL" == "no" ]; then systemctl mask pve-firewall.service fi -sleep 10 && networking_misc & echo "Running PVE..." exec "$@" while true; do # Your commands or checks here - sleep 60 # Adjust the sleep interval as needed + sleep 1m # Adjust the sleep interval as needed done - -#exec gosu backup /usr/lib/x86_64-linux-gnu/proxmox-backup/proxmox-backup-proxy "$@" diff --git a/socat/sc/Dockerfile b/socat/sc/Dockerfile index 7600f84..a5c8129 100644 --- a/socat/sc/Dockerfile +++ b/socat/sc/Dockerfile @@ -16,7 +16,6 @@ RUN apt-get update && \ RUN \ echo "**** install runtime packages ****" && \ apt update && apt install -y socat logrotate btop kitty-terminfo neovim netcat-openbsd sudo wget systemctl curl gnupg ca-certificates rsyslog net-tools iputils-ping && \ - echo "**** setup openssh environment ****" && \ rm -rf \ /tmp/* \ $HOME/.cache @@ -24,16 +23,10 @@ RUN \ #set (temporary) password for root RUN echo "root:root"|chpasswd -# add local files -EXPOSE 2222 -EXPOSE 8006 - COPY entrypoint.sh / RUN chmod +x /entrypoint.sh -#use setup.sh to start proxmox service STOPSIGNAL SIGINT ENTRYPOINT [ "/entrypoint.sh" ] -VOLUME /config #CMD [ "/lib/systemd/systemd", "log-level=info", "unit=sysinit.target"] diff --git a/socat/sc/entrypoint.sh b/socat/sc/entrypoint.sh index 1c4c94a..665bc42 100644 --- a/socat/sc/entrypoint.sh +++ b/socat/sc/entrypoint.sh @@ -5,10 +5,8 @@ ADMIN_PASSWORD="nyaowo" # Verify that the minimally required password settings are set for new databases. echo "root:$ADMIN_PASSWORD"|chpasswd -mkdir -p /var/lib/dhcp /bin/bash /root/socat.sh & - echo "Running SOCAT..." exec "$@"