diff --git a/glpi/.env b/glpi/.env index ffb57f13..62a2dfa4 100644 --- a/glpi/.env +++ b/glpi/.env @@ -1,6 +1,6 @@ TZ: Europe/Berlin GLPI_LANG: de_DE -MARIADB_HOST: mariadb-glpi +MARIADB_HOST: glpi-db MARIADB_PORT: 3306 MARIADB_DATABASE: glpi MARIADB_USER: glpi-user diff --git a/glpi/docker-compose.yml b/glpi/docker-compose.yml index 93a7da9a..8b0f937d 100644 --- a/glpi/docker-compose.yml +++ b/glpi/docker-compose.yml @@ -1,6 +1,6 @@ version: "3.5" services: - mariadb-glpi: + mariadb: image: fametec/glpi:mariadb container_name: glpi-db restart: unless-stopped @@ -24,12 +24,12 @@ services: - ./volumes/glpi-files:/var/www/html/files:rw - ./volumes/glpi-plugins:/var/www/html/plugins:rw environment: - GLPI_LANG: ${GLPI_LANG} - MARIADB_HOST: glpi-db + MARIADB_HOST: ${MARIADB_HOST} MARIADB_PORT: ${MARIADB_PORT} MARIADB_DATABASE: ${MARIADB_DATABASE} MARIADB_USER: ${MARIADB_USER} MARIADB_PASSWORD: ${MARIADB_PASSWORD} + GLPI_LANG: ${GLPI_LANG} VERSION: "9.5.6" PLUGINS: "all" TIMEZONE: ${TZ} @@ -37,7 +37,7 @@ services: ADMINEMAIL: ${ADMINEMAIL} ORGANIZATION: ${ORGANIZATION} depends_on: - - mariadb-glpi + - mariadb ports: - 8075:80 networks: @@ -55,7 +55,7 @@ services: - ./volumes/glpi-files:/var/www/html/files:rw - ./volumes/glpi-plugins:/var/www/html/plugins:rw depends_on: - - mariadb-glpi + - mariadb environment: MARIADB_HOST: ${MARIADB_HOST} MARIADB_PORT: ${MARIADB_PORT} diff --git a/ipam/.env b/ipam/.env index e69de29b..fa08300e 100644 --- a/ipam/.env +++ b/ipam/.env @@ -0,0 +1,6 @@ +TZ=Europe/Berlin +IPAM_DATABASE_WEBHOST=% +SCAN_INTERVAL=1h +MARIADB_HOST=ipam_db +MARIADB_ROOT_PASSWORD=IPAMrootpwd + diff --git a/ipam/Dockerfile b/ipam/Dockerfile new file mode 100644 index 00000000..847d4b08 --- /dev/null +++ b/ipam/Dockerfile @@ -0,0 +1,76 @@ +FROM php:7.2-apache +MAINTAINER Pierre Cheynier + +ENV PHPIPAM_SOURCE https://github.com/phpipam/phpipam/ +ARG PHPIPAM_VERSION=1.5.1 +ENV PHPMAILER_SOURCE https://github.com/PHPMailer/PHPMailer/ +ARG PHPMAILER_VERSION=6.7.1 +ENV PHPSAML_SOURCE https://github.com/onelogin/php-saml/ +ARG PHPSAML_VERSION=3.4.1 +ENV WEB_REPO /var/www/html + +# Install required deb packages +RUN sed -i /etc/apt/sources.list -e 's/$/ non-free'/ && \ + apt-get update && apt-get -y upgrade && \ + rm /etc/apt/preferences.d/no-debian-php && \ + apt-get install -y libcurl4-gnutls-dev libgmp-dev libmcrypt-dev libfreetype6-dev libjpeg-dev libpng-dev libldap2-dev libsnmp-dev snmp-mibs-downloader iputils-ping && \ + rm -rf /var/lib/apt/lists/* + +# Install required packages and files required for snmp +RUN mkdir -p /var/lib/mibs/ietf && \ + curl -sL https://github.com/cisco/cisco-mibs/raw/main/v2/CISCO-SMI.my -o /var/lib/mibs/ietf/CISCO-SMI.txt && \ + curl -sL https://github.com/cisco/cisco-mibs/raw/main/v2/CISCO-TC.my -o /var/lib/mibs/ietf/CISCO-TC.txt && \ + curl -sL https://github.com/cisco/cisco-mibs/raw/main/v2/CISCO-VTP-MIB.my -o /var/lib/mibs/ietf/CISCO-VTP-MIB.txt && \ + curl -sL https://github.com/cisco/cisco-mibs/raw/main/v2/MPLS-VPN-MIB.my -o /var/lib/mibs/ietf/MPLS-VPN-MIB.txt + +# Configure apache and required PHP modules +RUN docker-php-ext-configure mysqli --with-mysqli=mysqlnd && \ + docker-php-ext-install mysqli && \ + docker-php-ext-configure gd --with-freetype-dir=/usr/include/freetype2 --with-png-dir=/usr/include --with-jpeg-dir=/usr/include && \ + docker-php-ext-install gd && \ + docker-php-ext-install curl && \ + docker-php-ext-install json && \ + docker-php-ext-install snmp && \ + docker-php-ext-install sockets && \ + docker-php-ext-install pdo_mysql && \ + docker-php-ext-install gettext && \ + ln -s /usr/include/$(uname -m)-linux-gnu/gmp.h /usr/include/gmp.h && \ + docker-php-ext-configure gmp --with-gmp=/usr/include/$(uname -m)-linux-gnu && \ + docker-php-ext-install gmp && \ + docker-php-ext-install pcntl && \ + docker-php-ext-configure ldap --with-libdir=lib/$(uname -m)-linux-gnu && \ + docker-php-ext-install ldap && \ + pecl install mcrypt-1.0.1 && \ + docker-php-ext-enable mcrypt && \ + echo ". /etc/environment" >> /etc/apache2/envvars && \ + a2enmod rewrite + +COPY php.ini /usr/local/etc/php/ + +# Copy phpipam sources to web dir +ADD ${PHPIPAM_SOURCE}/archive/v${PHPIPAM_VERSION}.tar.gz /tmp/ +RUN tar -xzf /tmp/v${PHPIPAM_VERSION}.tar.gz -C ${WEB_REPO}/ --strip-components=1 +# Copy referenced submodules into the right directory +ADD ${PHPMAILER_SOURCE}/archive/v${PHPMAILER_VERSION}.tar.gz /tmp/ +RUN tar -xzf /tmp/v${PHPMAILER_VERSION}.tar.gz -C ${WEB_REPO}/functions/PHPMailer/ --strip-components=1 +ADD ${PHPSAML_SOURCE}/archive/refs/tags/${PHPSAML_VERSION}.tar.gz /tmp/ +RUN tar -xzf /tmp/${PHPSAML_VERSION}.tar.gz -C ${WEB_REPO}/functions/php-saml/ --strip-components=1 + +# Use system environment variables into config.php +ENV PHPIPAM_BASE / +RUN cp ${WEB_REPO}/config.dist.php ${WEB_REPO}/config.php && \ + chown www-data /var/www/html/app/admin/import-export/upload && \ + chown www-data /var/www/html/app/subnets/import-subnet/upload && \ + chown www-data /var/www/html/css/images/logo && \ + echo "\$db['webhost'] = '%';" >> ${WEB_REPO}/config.php && \ + sed -i -e "s/\['host'\] = '127.0.0.1'/\['host'\] = getenv(\"MYSQL_ENV_MYSQL_HOST\") ?: \"mysql\"/" \ + -e "s/\['user'\] = 'phpipam'/\['user'\] = getenv(\"MYSQL_ENV_MYSQL_USER\") ?: \"root\"/" \ + -e "s/\['name'\] = 'phpipam'/\['name'\] = getenv(\"MYSQL_ENV_MYSQL_DB\") ?: \"phpipam\"/" \ + -e "s/\['pass'\] = 'phpipamadmin'/\['pass'\] = getenv(\"MYSQL_ENV_MYSQL_ROOT_PASSWORD\")/" \ + -e "s/\['port'\] = 3306;/\['port'\] = 3306;\n\n\$password_file = getenv(\"MYSQL_ENV_MYSQL_PASSWORD_FILE\");\nif(file_exists(\$password_file))\n\$db\['pass'\] = preg_replace(\"\/\\\\s+\/\", \"\", file_get_contents(\$password_file));/" \ + -e "s/define('BASE', \"\/\")/define('BASE', getenv(\"PHPIPAM_BASE\"))/" \ + -e "s/\$gmaps_api_key.*/\$gmaps_api_key = getenv(\"GMAPS_API_KEY\") ?: \"\";/" \ + -e "s/\$gmaps_api_geocode_key.*/\$gmaps_api_geocode_key = getenv(\"GMAPS_API_GEOCODE_KEY\") ?: \"\";/" \ + ${WEB_REPO}/config.php + +EXPOSE 80 diff --git a/ipam/INSTALL.md b/ipam/INSTALL.md new file mode 100644 index 00000000..47773aad --- /dev/null +++ b/ipam/INSTALL.md @@ -0,0 +1,130 @@ +# docker-phpipam + +phpIPAM is an open-source web IP address management application. Its goal is to provide light and simple IP address management application. + +phpIPAM is developed and maintained by Miha Petkovsek, released under the GPL v3 license, project source is [here](https://github.com/phpipam/phpipam). + +Learn more on [phpIPAM homepage](http://phpipam.net). + +![phpIPAM logo](http://phpipam.net/wp-content/uploads/2014/12/phpipam_logo_small.png) + +## How to use this Docker image + +### Mysql + +Run a MySQL database, dedicated to phpipam. + +```bash +$ docker run --name phpipam-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -v /my_dir/phpipam:/var/lib/mysql -d mysql:5.6 +``` + +Here, we store data on the host system under `/my_dir/phpipam` and use a specific root password. + +### Phpipam + +```bash +$ docker run -ti -d -p 80:80 -e MYSQL_ENV_MYSQL_ROOT_PASSWORD=my-secret-pw --name ipam --link phpipam-mysql:mysql pierrecdn/phpipam +``` + +We are linking the two containers and exposing the HTTP port. + +### First install scenario + +* Browse to `http://[:]/install/` +* Step 1 : Choose 'Automatic database installation' + +![step1](https://cloud.githubusercontent.com/assets/4225738/8746785/01758b9e-2c8d-11e5-8643-7f5862c75efe.png) + +* Step 2 : Re-Enter connection information + +![step2](https://cloud.githubusercontent.com/assets/4225738/8746789/0ad367e2-2c8d-11e5-80bb-f5093801e139.png) + +* Note that these two first steps could be swapped by patching phpipam (see https://github.com/phpipam/phpipam/issues/25) +* Step 3 : Configure the admin user password + +![step3](https://cloud.githubusercontent.com/assets/4225738/8746790/0c434bf6-2c8d-11e5-9ae7-b7d1021b7aa0.png) + +* You're done ! + +![done](https://cloud.githubusercontent.com/assets/4225738/8746792/0d6fa34e-2c8d-11e5-8002-3793361ae34d.png) + +### Docker compose + +You can also create an all-in-one YAML deployment descriptor with Docker compose, like this: + +```yaml +version: '2' + +services: + mysql: + image: mysql:5.6 + environment: + - MYSQL_ROOT_PASSWORD=my-secret-pw + restart: always + volumes: + - db_data:/var/lib/mysql + ipam: + depends_on: + - mysql + image: pierrecdn/phpipam + environment: + - MYSQL_ENV_MYSQL_USER=root + - MYSQL_ENV_MYSQL_ROOT_PASSWORD=my-secret-pw + - MYSQL_ENV_MYSQL_HOST=mysql + ports: + - "80:80" +volumes: + db_data: +``` + +And next : + +```bash +$ docker-compose up -d +``` + +You can also point the `MYSQL_ENV_PASSWORD_FILE` environment variable to a file, +in which case the contents of this file will be used as the password. +This makes it possible to use docker secrets for instance: + +```yaml +version: '3' + +services: + ipam: + environment: + - MYSQL_ENV_MYSQL_PASSWORD_FILE=/run/secrets/phpipam_mysql_root_password + secrets: + - phpipam_mysql_root_password +``` + +The secret can be created by running `echo my-secret-pw | docker secret create phpipam_mysql_root_password -` + +### Advanced Configuration + +Here is the list of the available environment variables in the phpipam container, pass them to docker using `-e`. +None of them are actually needed to run the container, this is only to tweak the behavior. + +| Environment variable | Default value | Description | +| ------------------------------ |:-------------:| --------------------------------------------------------------------------------------------------------:| +| MYSQL_ENV_MYSQL_HOST | mysql | The host used to reach the MySQL instance | +| MYSQL_ENV_MYSQL_USER | root | The user to connect the MySQL instance | +| MYSQL_ENV_MYSQL_ROOT_PASSWORD | (empty) | The MySQL password. Can be set using the Web UI during the first install | +| MYSQL_ENV_MYSQL_DB | phpipam | The name of the MySQL DB to connect to | +| MYSQL_ENV_MYSQL_PASSWORD_FILE | (empty) | A file containing the password (if not using MYSQL_ROOT_PASSWORD) this allows to leverage docker secrets | +| PHPIPAM_BASE | / | The base URI under which phpipam runs. Useful when performing rewrites with a reverse-proxy | +| GMAPS_API_KEY | (empty) | Google Maps API Key, used to display maps of your devices | +| GMAPS_API_GEOCODE_KEY | (empty) | Google Maps Geocode API Key, used to find coordinates from an address/ a location of your device | + +### Specific integration (HTTPS, multi-host containers, etc.) + +Regarding your requirements and docker setup, you've to expose resources. + +For HTTPS, run a reverse-proxy in front of your phpipam container and link it to. + +For multi-host containers, expose ports, run etcd or consul to make service discovery works etc. + +### Notes + +phpIPAM is under heavy development by the amazing Miha. +To upgrade the release version, just change the `PHPIPAM_VERSION` environment variable to the target release (see [here](https://github.com/phpipam/phpipam/releases)). diff --git a/ipam/docker-compose.yml b/ipam/docker-compose.yml index 1166ce12..2a543f7a 100644 --- a/ipam/docker-compose.yml +++ b/ipam/docker-compose.yml @@ -2,45 +2,43 @@ version: '3' services: - phpipam-web: + web: image: phpipam/phpipam-www:latest - container_name: phpipam_www + container_name: ipam_www ports: - "8080:80" environment: - - TZ=Europe/Berlin - - IPAM_DATABASE_HOST=phpipam-mariadb - - IPAM_DATABASE_PASS=IPAMpass + - TZ=${TZ} + - IPAM_DATABASE_HOST=${MARIADB_HOST} + - IPAM_DATABASE_PASS=${MARIADB_ROOT_PASSWORD} - IPAM_DATABASE_WEBHOST=% restart: unless-stopped volumes: - - phpipam-logo:/phpipam/css/images/logo + - ./volumes/logo:/phpipam/css/images/logo depends_on: - - phpipam-mariadb + - mariadb - phpipam-cron: + cron: image: phpipam/phpipam-cron:latest - container_name: phpipam_cron + container_name: ipam_cron environment: - - TZ=Europe/London - - IPAM_DATABASE_HOST=phpipam-mariadb - - IPAM_DATABASE_PASS=IPAMpass - - SCAN_INTERVAL=1h + - TZ=${TZ} + - SCAN_INTERVAL=1 + - PHPIPAM_BASE=/ + - MYSQL_ENV_MYSQL_USER=root + - MYSQL_ENV_MYSQL_DB=phpipam + - MYSQL_ENV_MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD} + - MYSQL_ENV_MYSQL_HOST=${MARIADB_HOST} restart: unless-stopped depends_on: - - phpipam-mariadb + - mariadb - phpipam-mariadb: + mariadb: image: mariadb:latest - container_name: phpipam_db + container_name: ipam_db environment: - - MYSQL_ROOT_PASSWORD=IPAMrootpwd - - MARIADB_USER=phpipam-mariadb - - MARIADB_PASSWORD=IPAMpass + - MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD} restart: unless-stopped volumes: - - phpipam-db-data:/var/lib/mysql + - ./volumes/mariadb:/var/lib/mysql -volumes: - phpipam-db-data: - phpipam-logo: diff --git a/ipam/php.ini b/ipam/php.ini new file mode 100644 index 00000000..bfcad23e --- /dev/null +++ b/ipam/php.ini @@ -0,0 +1,72 @@ +[PHP] +engine = On +short_open_tag = Off +precision = 14 +output_buffering = 4096 +zlib.output_compression = Off +implicit_flush = Off +serialize_precision = 17 +zend.enable_gc = On +expose_php = Off +max_execution_time = 600 +max_input_time = 60 +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT +display_errors = Off +log_errors = On +log_errors_max_len = 1024 +default_mimetype = "text/html" +default_charset = "UTF-8" +file_uploads = On +upload_max_filesize = 2M +max_file_uploads = 20 +allow_url_fopen = On +allow_url_include = Off +default_socket_timeout = 60 + +[Date] +date.timezone = "UTC" + +[mail function] +smtp_port = 25 +mail.add_x_header = On + +[SQL] +sql.safe_mode = Off + +[MySQLi] +mysqli.max_persistent = -1 +mysqli.allow_persistent = On +mysqli.max_links = -1 +mysqli.cache_size = 2000 +mysqli.default_port = 3306 +mysqli.reconnect = Off + +[mysqlnd] +mysqlnd.collect_statistics = On +mysqlnd.collect_memory_statistics = Off + +[Session] +session.save_handler = files +session.use_strict_mode = 0 +session.use_cookies = 1 +session.use_only_cookies = 1 +session.name = PHPSESSID +session.auto_start = 0 +session.cookie_lifetime = 0 +session.cookie_path = / +session.cookie_domain = +session.cookie_httponly = +session.serialize_handler = php +session.gc_probability = 1 +session.gc_divisor = 1000 +session.gc_maxlifetime = 1440 +session.cache_limiter = nocache +session.cache_expire = 180 +session.use_trans_sid = 0 +session.hash_function = 0 +session.hash_bits_per_character = 5 +url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" + +[ldap] +ldap.max_links = -1 + diff --git a/mediawiki/.env b/mediawiki/.env index e69de29b..565c46c5 100644 --- a/mediawiki/.env +++ b/mediawiki/.env @@ -0,0 +1,12 @@ +MW_SCRIPT_PATH=/w +MW_SERVER=http://localhost:8080 +MW_DOCKER_PORT=8080 +MEDIAWIKI_USER=Admin +MEDIAWIKI_PASSWORD=dockerpass +XDEBUG_CONFIG= +XDEBUG_ENABLE=true +XHPROF_ENABLE=true +MYSQL_DATABASE: my_wiki +MYSQL_USER: wikiuser +MYSQL_PASSWORD: example +MYSQL_RANDOM_ROOT_PASSWORD: 'yes' diff --git a/mediawiki/docker-compose.yml b/mediawiki/docker-compose.yml index fa959611..c914a825 100644 --- a/mediawiki/docker-compose.yml +++ b/mediawiki/docker-compose.yml @@ -6,7 +6,7 @@ version: '3' services: mediawiki: image: mediawiki - container_name: mediawiki + container_name: wiki restart: always ports: - 8070:80 @@ -21,11 +21,11 @@ services: # This key also defines the name of the database host used during setup instead of the default "localhost" database: image: mariadb - container_name: mediawiki_db + container_name: wikidb restart: always environment: # @see https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/DefaultSettings.php - MYSQL_DATABASE: my_wiki + MYSQL_DATABASE: wiki MYSQL_USER: wikiuser MYSQL_PASSWORD: example - MYSQL_RANDOM_ROOT_PASSWORD: 'yes' \ No newline at end of file + MYSQL_RANDOM_ROOT_PASSWORD: 'yes' diff --git a/portainer/docker-compose.yaml b/portainer/docker-compose.yaml new file mode 100644 index 00000000..a8a6b78a --- /dev/null +++ b/portainer/docker-compose.yaml @@ -0,0 +1,13 @@ +version: '2.4' + +services: + portainer: + image: portainer/portainer-ce:latest + container_name: portainer + restart: always + ports: + - 8000:8000 + - 9443:9443 + volumes: + - ./portainer_data:/data + - /var/run/docker.sock:/var/run/docker.sock diff --git a/portainer/portainer_data/backups/common/portainer.db.2.17.1.20230329123720 b/portainer/portainer_data/backups/common/portainer.db.2.17.1.20230329123720 new file mode 100644 index 00000000..f40c459e Binary files /dev/null and b/portainer/portainer_data/backups/common/portainer.db.2.17.1.20230329123720 differ diff --git a/portainer/portainer_data/certs/cert.pem b/portainer/portainer_data/certs/cert.pem new file mode 100644 index 00000000..60b1c871 --- /dev/null +++ b/portainer/portainer_data/certs/cert.pem @@ -0,0 +1,10 @@ +-----BEGIN CERTIFICATE----- +MIIBUTCB+aADAgECAhEAzCMCoLriIwCpK0RgVPPPHjAKBggqhkjOPQQDAjAAMB4X +DTIzMDMyOTEyMzEzMVoXDTI4MDMyOTEyMzEzMVowADBZMBMGByqGSM49AgEGCCqG +SM49AwEHA0IABEEA1sLZGRfK6R+njkEq9LD/M41FAMI7pg/J8GDvaSexeuXh0qAL +K4pmvBD4E4chJ0KRNjnU4whzUUEKoLRKcx6jVDBSMA4GA1UdDwEB/wQEAwIFoDAT +BgNVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMB0GA1UdEQEB/wQTMBGC +CWxvY2FsaG9zdIcEAAAAADAKBggqhkjOPQQDAgNHADBEAiBXgeviCYcEiMHJPhxN +7psUVVXHZqBt/RsaLWDEVqe5HQIgfdQoCHvcq5wUQMRF7YlrIJP20eoqqZRWDB8V +mFAjBEU= +-----END CERTIFICATE----- diff --git a/portainer/portainer_data/certs/key.pem b/portainer/portainer_data/certs/key.pem new file mode 100644 index 00000000..d9826cf3 --- /dev/null +++ b/portainer/portainer_data/certs/key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEINMkRbyAA37Se5V+cDZezaaqTnqQUmHu3sQdwHQbefRyoAoGCCqGSM49 +AwEHoUQDQgAEQQDWwtkZF8rpH6eOQSr0sP8zjUUAwjumD8nwYO9pJ7F65eHSoAsr +ima8EPgThyEnQpE2OdTjCHNRQQqgtEpzHg== +-----END EC PRIVATE KEY----- diff --git a/portainer/portainer_data/docker_config/config.json b/portainer/portainer_data/docker_config/config.json new file mode 100644 index 00000000..13551f3b --- /dev/null +++ b/portainer/portainer_data/docker_config/config.json @@ -0,0 +1 @@ +{"HttpHeaders":{"X-PortainerAgent-ManagerOperation":"1","X-PortainerAgent-PublicKey":"3059301306072a8648ce3d020106082a8648ce3d0301070342000423ff2b462113e7f1160b2b5928fcb7592035fa30484cfffad090b78e8b61e086902b50a90caae2af5b509e7b7dadb621523c2571389873b6c785061fe575cabc","X-PortainerAgent-Signature":"fLj8HUSCLaCcOMB3KHzUldHNM23swq8vIBieHAjoVSF57u7ASFq+7J3L80WeoM2BszFYySxsziUt4WI5fCr7GQ"}} \ No newline at end of file diff --git a/portainer/portainer_data/portainer.db b/portainer/portainer_data/portainer.db new file mode 100644 index 00000000..20f1a3a9 Binary files /dev/null and b/portainer/portainer_data/portainer.db differ diff --git a/portainer/portainer_data/portainer.key b/portainer/portainer_data/portainer.key new file mode 100644 index 00000000..96e501d6 --- /dev/null +++ b/portainer/portainer_data/portainer.key @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIHyUg5CHWXExcAV5z+RPx+B0XB1FFuPrxN7eD/xBV62NoAoGCCqGSM49 +AwEHoUQDQgAEI/8rRiET5/EWCytZKPy3WSA1+jBITP/60JC3joth4IaQK1CpDKri +r1tQnnt9rbYhUjwlcTiYc7bHhQYf5XXKvA== +-----END EC PRIVATE KEY----- diff --git a/portainer/portainer_data/portainer.pub b/portainer/portainer_data/portainer.pub new file mode 100644 index 00000000..ca69c7c5 --- /dev/null +++ b/portainer/portainer_data/portainer.pub @@ -0,0 +1,4 @@ +-----BEGIN ECDSA PUBLIC KEY----- +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEI/8rRiET5/EWCytZKPy3WSA1+jBI +TP/60JC3joth4IaQK1CpDKrir1tQnnt9rbYhUjwlcTiYc7bHhQYf5XXKvA== +-----END ECDSA PUBLIC KEY----- diff --git a/snipeit/.env b/snipeit/.env index 1ecdd7ab..e4575a54 100644 --- a/snipeit/.env +++ b/snipeit/.env @@ -2,7 +2,7 @@ MYSQL_ROOT_PASSWORD=Holdiom,snipeit,root MYSQL_DATABASE=snipeit MYSQL_USER=snipeit MYSQL_PASSWORD=Holdiom,snipeit -MYSQL_PORT_3306_TCP_ADDR=snipeit-db +MYSQL_PORT_3306_TCP_ADDR=snipe_db MYSQL_PORT_3306_TCP_PORT=3306 MAIL_PORT_587_TCP_ADDR=192.168.75.25 MAIL_PORT_587_TCP_PORT=587 @@ -14,6 +14,6 @@ MAIL_ENV_PASSWORD=pass APP_ENV=production APP_DEBUG=false APP_KEY=base64:i/+ZvT6C4LEWcBNL7vWwicRVtEt05pv22RhWMJy+yZ8= -APP_URL=http://it.ostrach.tld:8090 +APP_URL=http://itmgmt.ostrach.tld:8090 APP_TIMEZONE=Europe/Berlin APP_LOCALE=de diff --git a/snipeit/.gitignore b/snipeit/.gitignore new file mode 100644 index 00000000..5368aac3 --- /dev/null +++ b/snipeit/.gitignore @@ -0,0 +1 @@ +./volumes/** diff --git a/snipeit/docker-compose.yml b/snipeit/docker-compose.yml index 6e6f5488..d6ee84b7 100644 --- a/snipeit/docker-compose.yml +++ b/snipeit/docker-compose.yml @@ -3,18 +3,18 @@ version: '3' services: mysql: - image: mysql:latest - container_name: snipeit-db + image: mariadb:latest + container_name: snipe_db env_file: - ./.env restart: unless-stopped volumes: - - db:/var/lib/mysql + - ./volumes/db:/var/lib/mysql app: image: snipe/snipe-it:latest - container_name: snipeit-app + container_name: snipe_app env_file: - ./.env ports: @@ -22,7 +22,4 @@ services: restart: unless-stopped depends_on: - mysql - -volumes: - db: - \ No newline at end of file + diff --git a/snipeit/stack.env b/snipeit/stack.env deleted file mode 100644 index 1ecdd7ab..00000000 --- a/snipeit/stack.env +++ /dev/null @@ -1,19 +0,0 @@ -MYSQL_ROOT_PASSWORD=Holdiom,snipeit,root -MYSQL_DATABASE=snipeit -MYSQL_USER=snipeit -MYSQL_PASSWORD=Holdiom,snipeit -MYSQL_PORT_3306_TCP_ADDR=snipeit-db -MYSQL_PORT_3306_TCP_PORT=3306 -MAIL_PORT_587_TCP_ADDR=192.168.75.25 -MAIL_PORT_587_TCP_PORT=587 -MAIL_ENV_FROM_ADDR=it@hochvogel.de -MAIL_ENV_FROM_NAME=Snipe-IT -MAIL_ENV_ENCRYPTION=tcp -MAIL_ENV_USERNAME=user -MAIL_ENV_PASSWORD=pass -APP_ENV=production -APP_DEBUG=false -APP_KEY=base64:i/+ZvT6C4LEWcBNL7vWwicRVtEt05pv22RhWMJy+yZ8= -APP_URL=http://it.ostrach.tld:8090 -APP_TIMEZONE=Europe/Berlin -APP_LOCALE=de diff --git a/speedtest/.gitignore b/speedtest/.gitignore new file mode 100644 index 00000000..5368aac3 --- /dev/null +++ b/speedtest/.gitignore @@ -0,0 +1 @@ +./volumes/** diff --git a/speedtest/docker-compose.yml b/speedtest/docker-compose.yml index 8a15c95c..e30d2620 100644 --- a/speedtest/docker-compose.yml +++ b/speedtest/docker-compose.yml @@ -6,7 +6,7 @@ services: ports: - 8765:80 volumes: - - /path/to/data:/config + - ./volumes/config:/config environment: - TZ=Europe/Berlin - PGID= @@ -17,4 +17,4 @@ services: options: max-file: "10" max-size: "200k" - restart: unless-stopped \ No newline at end of file + restart: unless-stopped diff --git a/startstop.sh b/startstop.sh index c00e06ec..274e945c 100755 --- a/startstop.sh +++ b/startstop.sh @@ -41,6 +41,10 @@ stop) compose "docker compose stop" ;; +cleanup) + compose "rm ./volumes/* -rf" +;; + *) echo "Usage: $0 [start|stop|down]" ;; diff --git a/zabbix/.env b/zabbix/.env index e69de29b..df5d80f0 100644 --- a/zabbix/.env +++ b/zabbix/.env @@ -0,0 +1,14 @@ +MYSQL_ROOT_PASSWORD=zabbixrootsqlsecret +MYSQL_USER=zabbix +MYSQL_PASSWORD=zabbixsqlsecret +MYSQL_DATABASE=zabbix +DB_SERVER_HOST=zbxdb +DB_SERVER_PORT=3306 +ZBX_DEBUGLEVEL=3 +ZBX_SERVER_HOST="zabbix" +PHP_TZ="Europe/Berlin" +SERVER_NAME=itmgmt.ostrach.tld +ZBX_SERVER_HOST=zabbix +ZBX_HOSTNAME=agent2 +ZBX_STARTAGENTS=5 + diff --git a/zabbix/.gitignore b/zabbix/.gitignore new file mode 100644 index 00000000..5368aac3 --- /dev/null +++ b/zabbix/.gitignore @@ -0,0 +1 @@ +./volumes/** diff --git a/zabbix/docker-compose.yml b/zabbix/docker-compose.yml index c5a6f75e..f2d17322 100644 --- a/zabbix/docker-compose.yml +++ b/zabbix/docker-compose.yml @@ -4,69 +4,65 @@ version: '3.3' services: mysql: - image: mysql:latest - container_name: zabbix-db + image: mariadb:10.7.8 + container_name: zbxdb restart: unless-stopped environment: - - MYSQL_ROOT_PASSWORD=zabbixrootsqlsecret - - MYSQL_USER=zabbix - - MYSQL_PASSWORD=zabbixsqlsecret - - MYSQL_DATABASE=zabbix - - DB_SERVER_HOST=zabbix-db - - DB_SERVER_PORT=3306 - - ZBX_DEBUGLEVEL=3 - - ZBX_SERVER_HOST=zabbix-server + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} + - DB_SERVER_HOST=${DB_SERVER_HOST} + - DB_SERVER_PORT=${DB_SERVER_PORT} + - ZBX_DEBUGLEVEL=${ZBX_DEBUGLEVEL} + - ZBX_SERVER_HOST=${ZBX_SERVER_HOST} cap_add: - SYS_NICE # CAP_SYS_NICE volumes: - - db:/var/lib/mysql + - ./volumes/db:/var/lib/mysql server: image: zabbix/zabbix-server-mysql - container_name: zabbix-server + container_name: zabbix ports: - "10051:10051" restart: unless-stopped environment: - - SERVER_NAME=server - - MYSQL_ROOT_PASSWORD=zabbixrootsqlsecret - - MYSQL_USER=zabbix - - MYSQL_PASSWORD=zabbixsqlsecret - - MYSQL_DATABASE=zabbix - - DB_SERVER_HOST=zabbix-db - - DB_SERVER_PORT=3306 - - ZBX_DEBUGLEVEL=3 + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} + - DB_SERVER_HOST=${DB_SERVER_HOST} + - DB_SERVER_PORT=${DB_SERVER_PORT} + - ZBX_DEBUGLEVEL=${ZBX_DEBUGLEVEL} depends_on: - mysql agent: image: zabbix/zabbix-agent2 - container_name: zabbix-agent2 + container_name: zbxagent2 privileged: true environment: - - ZBX_SERVER_HOST=zabbix-server - - ZBX_HOSTNAME=zabbix-agent2 - - ZBX_STARTAGENTS=3 + - ZBX_SERVER_HOST=${ZBX_SERVER_HOST} + - ZBX_HOSTNAME=${ZBX_HOSTNAME} + - ZBX_STARTAGENTS=${ZBX_STARTAGENTS} restart: unless-stopped web: image: zabbix/zabbix-web-apache-mysql - container_name: zabbix-web + container_name: zbxweb ports: - "8085:8080" restart: unless-stopped environment: - - MYSQL_USER=zabbix - - MYSQL_PASSWORD=zabbixsqlsecret - - MYSQL_DATABASE=zabbix - - DB_SERVER_HOST=zabbix-db - - DB_SERVER_PORT=3306 - - ZBX_DEBUGLEVEL=3 - - ZBX_SERVER_HOST=zabbix-server + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} + - DB_SERVER_HOST=${DB_SERVER_HOST} + - DB_SERVER_PORT=${DB_SERVER_PORT} + - ZBX_DEBUGLEVEL=${ZBX_DEBUGLEVEL} + - ZBX_SERVER_HOST=${ZBX_SERVER_HOST} depends_on: - mysql -volumes: - db: - \ No newline at end of file diff --git a/zabbix/stack.env b/zabbix/stack.env deleted file mode 100644 index 331e17e1..00000000 --- a/zabbix/stack.env +++ /dev/null @@ -1,9 +0,0 @@ -MYSQL_ROOT_PASSWORD=zabbixrootsqlsecret -MYSQL_USER=zabbix -MYSQL_PASSWORD=zabbixsqlsecret -MYSQL_DATABASE=zabbix -DB_SERVER_HOST=zabbix-db -DB_SERVER_PORT=3306 -ZBX_DEBUGLEVEL=3 -ZBX_SERVER_HOST="zabbix-server" -PHP_TZ="Europe/Berlin"