-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from opennetadmin/develop
Develop
- Loading branch information
Showing
409 changed files
with
53,335 additions
and
17,933 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM mcr.microsoft.com/devcontainers/php:0-8.0 | ||
|
||
# Install MariaDB client | ||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get install -y mariadb-client \ | ||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install php-mysql driver | ||
RUN docker-php-ext-install mysqli pdo pdo_mysql | ||
|
||
RUN [ ! -d /var/www/html/ona ] && ln -fs /workspace/ona/www /var/www/html/ona | ||
RUN apache2ctl start | ||
|
||
# run php install/installcli.php and set 127.0.0.1 | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
# && apt-get -y install --no-install-recommends <your-package-list-here> | ||
|
||
# [Optional] Uncomment this line to install global node packages. | ||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
I'm not sure that I will continue with the .devcontainer testing. I will | ||
leave it here for the time being. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/php-mariadb | ||
{ | ||
"name": "PHP & MariaDB", | ||
"dockerComposeFile": "docker-compose.yml", | ||
"service": "app", | ||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// For use with PHP or Apache (e.g.php -S localhost:8080 or apache2ctl start) | ||
"forwardPorts": [ | ||
8080, | ||
3306 | ||
], | ||
"features": { | ||
"ghcr.io/devcontainers-contrib/features/neofetch:1": {} | ||
} | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: '3.8' | ||
|
||
services: | ||
app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
|
||
volumes: | ||
- ../..:/workspaces:cached | ||
|
||
# Overrides default command so things don't shut down after the process ends. | ||
command: sleep infinity | ||
|
||
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. | ||
network_mode: service:db | ||
|
||
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally. | ||
# (Adding the "ports" property to this file will not forward from a Codespace.) | ||
|
||
db: | ||
image: mariadb:10.4 | ||
restart: unless-stopped | ||
volumes: | ||
- mariadb-data:/var/lib/mysql | ||
environment: | ||
MYSQL_ROOT_PASSWORD: mariadb | ||
MYSQL_DATABASE: mariadb | ||
MYSQL_USER: mariadb | ||
MYSQL_PASSWORD: mariadb | ||
|
||
# Add "forwardPorts": ["3306"] to **devcontainer.json** to forward MariaDB locally. | ||
# (Adding the "ports" property to this file will not forward from a Codespace.) | ||
|
||
volumes: | ||
mariadb-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,13 @@ www/*.htm | |
cfg_archive_local | ||
|
||
spool | ||
|
||
*.log | ||
|
||
.vagrant | ||
.DS_Store | ||
|
||
# ignore vim swap files | ||
*.swp | ||
|
||
.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# This Dockerfile is intended for development and testing purposes only. Not | ||
# recommended for production use. | ||
# | ||
# First: Build an image with a specific version of Ubuntu and tag it as such. | ||
# docker build --build-arg UBUNTU_VERSION=23.04 -t ona-dev:23.04 . | ||
# | ||
# Second: Start the container for general use. Point your browser to http://localhost/ona | ||
# docker run -p 80:80 -it ona-dev:23.04 | ||
# | ||
# OR | ||
# | ||
# Start the container for development. Mount the current directory as a volume | ||
# This will allow you to edit the files on your host and have them be hosted | ||
# in the container | ||
# docker run -p 80:80 -it -v $(pwd):/opt/ona ona-dev:23.04 | ||
# | ||
# This assumes you are in the directory you cloned the ONA repo into. | ||
# Also, if you have already installed this prior, you may need to remove | ||
# www/local/config/database_settings.conf.php to get the install to run again. | ||
|
||
ARG UBUNTU_VERSION=latest | ||
FROM ubuntu:${UBUNTU_VERSION} | ||
|
||
LABEL description="OpenNetAdmin development and testing docker image" | ||
LABEL Author="Matt Pascoe <[email protected]>" | ||
|
||
ENV TZ=UTC | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
|
||
RUN apt-get update | ||
RUN apt-get -y install git mariadb-server apache2 php-yaml php-gmp php-mysql libapache2-mod-php php-mbstring php-xml unzip vim sendemail jq curl && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN git -C /opt clone https://github.com/opennetadmin/ona.git -b develop | ||
|
||
ENV APACHE_RUN_USER www-data | ||
ENV APACHE_RUN_GROUP www-data | ||
ENV APACHE_LOG_DIR /var/log/apache2 | ||
|
||
RUN ln -sf /opt/ona/www /var/www/html/ona | ||
RUN rm -f /var/www/html/index.html | ||
|
||
RUN touch /var/log/ona.log | ||
RUN chmod 666 /var/log/ona.log | ||
|
||
RUN chown www-data /opt/ona/www/local/config | ||
|
||
# Start as mariadb or mysql depending on version of Ubuntu. | ||
RUN service mariadb start || service mysql start | ||
|
||
RUN echo '/opt/ona' > /etc/onabase | ||
RUN echo "\n\n\n"|php /opt/ona/install/installcli.php | ||
RUN echo "ServerName ona-dev.localhost" > /etc/apache2/conf-enabled/servername.conf | ||
|
||
EXPOSE 80 | ||
|
||
# Since we are running mysql and apache, start them both. Also runs initial install. | ||
CMD bash -c 'service mariadb start || service mysql start && echo "\n\n\n"|php /opt/ona/install/installcli.php && /usr/sbin/apache2ctl -D FOREGROUND' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v18.1.1 | ||
v19.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# Allow user to pass in a different web port forward value. | ||
# Use when you are running multiple vms on one system | ||
PORTNUM = ENV["PORTNUM"] || "10000" | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.box = "ubuntu/jammy64" | ||
|
||
# Assign this VM to a bridged network, allowing you to connect directly to a | ||
# network using the host's network device. This makes the VM appear as another | ||
# physical device on your network. | ||
# Uncomment the following if you want this VM to have its own IP | ||
#config.vm.network :bridged | ||
|
||
# Create a forwarded port mapping which allows access to a specific port | ||
# within the machine from a port on the host machine. In the example below, | ||
# accessing "localhost:10000" will access port 80 on the guest machine. | ||
# NOTE: This will enable public access to the opened port | ||
config.vm.network "forwarded_port", guest: 80, host: PORTNUM , auto_correct: false | ||
|
||
# Set up our repo as a synced folder | ||
config.vm.synced_folder ".", "/opt/ona" | ||
|
||
# The basic install script | ||
$script = <<-SCRIPT | ||
#------- Start provision -------- | ||
PORTNUM=$1 | ||
# Tell apt to quit its whining | ||
export DEBIAN_FRONTEND=noninteractive | ||
apt-get update | ||
apt-get install -y \ | ||
curl \ | ||
apache2 \ | ||
mariadb-server \ | ||
php \ | ||
php-mysql \ | ||
php-mbstring \ | ||
php-gmp \ | ||
php-pear \ | ||
libapache2-mod-php \ | ||
libyaml-dev \ | ||
libio-socket-ssl-perl | ||
# Link in our ona code | ||
[ ! -d /var/www/html/ona ] && ln -fs /opt/ona/www /var/www/html/ona | ||
# Allow others to see apache logs (and probably other stuff) | ||
#usermod -a -G adm www-data | ||
#usermod -a -G adm vagrant | ||
# Set up application log file | ||
if [ ! -f /var/log/ona.log ] | ||
then | ||
touch /var/log/ona.log | ||
chmod 666 /var/log/ona.log | ||
fi | ||
# restart apache so it picks up changes | ||
systemctl restart apache2.service | ||
# Clean out any old configs | ||
# Re-running the provisioner will wipe out any previous configs | ||
rm -f /opt/ona/www/local/config/database_settings.inc.php | ||
# Run the CLI installer with all default options | ||
echo "\n\n\n"|php /opt/ona/install/installcli.php | ||
echo " | ||
Please point your browser to: http://localhost:${PORTNUM}/ona | ||
" | ||
#------- End provision -------- | ||
SCRIPT | ||
|
||
# Run our shell provisioner | ||
config.vm.provision "shell", inline: $script, :args => [ PORTNUM ] | ||
|
||
end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"id": "1c834988-d66c-2969-ffb4-33ccbb1b32cb", | ||
"name": "Dev", | ||
"values": [ | ||
{ | ||
"key": "URL", | ||
"value": "http://127.0.0.1", | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "DCM_URL", | ||
"value": "{{URL}}/ona/dcm.php", | ||
"type": "default", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "format", | ||
"value": "json", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "username", | ||
"value": "admin", | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "password", | ||
"value": "admin", | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "netname", | ||
"value": "LAN-EXAMPLE", | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "netip", | ||
"value": "1.1.1.0", | ||
"type": "default", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "netmask", | ||
"value": "/24", | ||
"type": "default", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "domainname", | ||
"value": "example.com", | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "host", | ||
"value": "host.{{domainname}}", | ||
"type": "text", | ||
"enabled": true | ||
} | ||
], | ||
"_postman_variable_scope": "environment", | ||
"_postman_exported_at": "2023-05-27T05:16:49.996Z", | ||
"_postman_exported_using": "Postman/10.14.4" | ||
} |
Oops, something went wrong.