From 7bb8aebb8273013a08c99046f0e948733741208e Mon Sep 17 00:00:00 2001 From: mt Date: Tue, 18 Feb 2025 15:47:06 +0300 Subject: [PATCH] add ipam to repo --- 000-default.conf | 31 +++++++ Dockerfile | 7 ++ README.md | 92 +++++++++++++++++++++ config.php | 197 +++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 33 ++++++++ php.ini | 72 +++++++++++++++++ 6 files changed, 432 insertions(+) create mode 100644 000-default.conf create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 config.php create mode 100644 docker-compose.yml create mode 100644 php.ini diff --git a/000-default.conf b/000-default.conf new file mode 100644 index 0000000..ccbe3ae --- /dev/null +++ b/000-default.conf @@ -0,0 +1,31 @@ + + # The ServerName directive sets the request scheme, hostname and port that + # the server uses to identify itself. This is used when creating + # redirection URLs. In the context of virtual hosts, the ServerName + # specifies what hostname must appear in the request's Host: header to + # match this virtual host. For the default virtual host (this file) this + # value is not decisive as it is used as a last resort host regardless. + # However, you must set it for any further virtual host explicitly. + #ServerName www.example.com + + ServerAdmin webmaster@localhost + DocumentRoot /var/www/html + + # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, + # error, crit, alert, emerg. + # It is also possible to configure the loglevel for particular + # modules, e.g. + #LogLevel info ssl:warn + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + RequestHeader set x-forwarded-proto "http" + RequestHeader set x-forwarded-ssl "off" +RequestHeader set Adrian-standard "off" + # For most configuration files from conf-available/, which are + # enabled or disabled at a global level, it is possible to + # include a line for only one particular virtual host. For example the + # following line enables the CGI configuration for this host only + # after it has been globally disabled with "a2disconf". + #Include conf-available/serve-cgi-bin.conf + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8cde20c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM pierrecdn/phpipam:1.5.2 +RUN apt-get update && apt-get install php-mysql -y + +#COPY --chown=root:root input-files/php.ini /usr/local/etc/php/php.ini +COPY --chown=root:root 000-default.conf /etc/apache2/sites-enabled/000-default.conf + +RUN a2enmod headers diff --git a/README.md b/README.md new file mode 100644 index 0000000..cf7ccc2 --- /dev/null +++ b/README.md @@ -0,0 +1,92 @@ +# ipam + + + +## Getting started + +To make it easy for you to get started with GitLab, here's a list of recommended next steps. + +Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! + +## Add your files + +- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files +- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: + +``` +cd existing_repo +git remote add origin https://gitlablex.ibasis.net/simfony/adrian_transition/qa-ops/ipam.git +git branch -M production +git push -uf origin production +``` + +## Integrate with your tools + +- [ ] [Set up project integrations](https://gitlablex.ibasis.net/simfony/adrian_transition/qa-ops/ipam/-/settings/integrations) + +## Collaborate with your team + +- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) +- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) +- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) +- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) +- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) + +## Test and Deploy + +Use the built-in continuous integration in GitLab. + +- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) +- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) +- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) +- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) +- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) + +*** + +# Editing this README + +When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. + +## Suggestions for a good README +Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. + +## Name +Choose a self-explaining name for your project. + +## Description +Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. + +## Badges +On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. + +## Visuals +Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. + +## Installation +Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. + +## Usage +Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. + +## Support +Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. + +## Roadmap +If you have ideas for releases in the future, it is a good idea to list them in the README. + +## Contributing +State if you are open to contributions and what your requirements are for accepting them. + +For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. + +You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. + +## Authors and acknowledgment +Show your appreciation to those who have contributed to the project. + +## License +For open source projects, say how it is licensed. + +## Project status +If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. diff --git a/config.php b/config.php new file mode 100644 index 0000000..dd23ac1 --- /dev/null +++ b/config.php @@ -0,0 +1,197 @@ +/index.php + ******************************/ +$private_subpages = array(); + + +/** + * Google MAPs API key for locations to display map + * + * Obtain key: Go to your Google Console (https://console.developers.google.com) and enable "Google Maps JavaScript API" + * from overview tab, so go to Credentials tab and make an API key for your project. + ******************************/ +$gmaps_api_key = getenv("GMAPS_API_KEY") ?: ""; +$gmaps_api_geocode_key = getenv("GMAPS_API_GEOCODE_KEY") ?: ""; + +/** + * proxy connection details + ******************************/ +$proxy_enabled = false; // Enable/Disable usage of the Proxy server +$proxy_server = 'myproxy.something.com'; // Proxy server FQDN or IP +$proxy_port = '8080'; // Proxy server port +$proxy_user = 'USERNAME'; // Proxy Username +$proxy_pass = 'PASSWORD'; // Proxy Password +$proxy_use_auth = false; // Enable/Disable Proxy authentication + +/** + * General tweaks + ******************************/ +$config['logo_width'] = 220; // logo width +$config['requests_public'] = true; // Show IP request module on login page +$config['split_ip_custom_fields'] = false; // Show custom fields in separate table when editing IP address + +/** + * PHP CLI binary for scanning and network discovery. + * + * The default behaviour is to use the system wide default php version symlinked to php in PHP_BINDIR (/usr/bin/php). + * If multiple php versions are present; overide selection with $php_cli_binary. + */ +// $php_cli_binary = '/usr/bin/php7.1'; + +/** + * Path to mysqldump binary + * + * default: '/usr/bin/mysqldump' + */ +// $mysqldump_cli_binary = '/usr/bin/mysqldump'; +$db['webhost'] = '%'; diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5dafe1b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,33 @@ +version: '2' + +services: + ipam: + image: pierrecdn/phpipam:1.5.2 + container_name: ipam + restart: always + environment: + MYSQL_ENV_MYSQL_USER: root + MYSQL_ENV_MYSQL_ROOT_PASSWORD: 'xM9A4!exJbQNhqJ' + MYSQL_ENV_MYSQL_HOST: 172.20.64.140 + MYSQL_ENV_MYSQL_DB: 'ipam' + SSL_ENABLED: false + TRUST_X_FORWARDED_HEADERS: true + ports: + - "172.20.64.140:11080:80" + networks: + - portal_qa + volumes: + - ./config.php:/var/www/html/config.php + - ipam_config:/var/www/html + - ./php.ini:/usr/local/etc/php/php.ini + build: /app/deployments/ipam +volumes: + ipam_config: + driver: local + driver_opts: + type: none + device: /data/container_volumes/ipam_config + o: bind +networks: + portal_qa: + external: true diff --git a/php.ini b/php.ini new file mode 100644 index 0000000..d57d0c8 --- /dev/null +++ b/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 +memory_limit = 2048M + +[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