mirror of
https://github.com/lucaspalomodevelop/netbox-acls.git
synced 2026-03-12 23:27:23 +00:00
Merge pull request #45 from ryanmerolle/housekeeping_44
correct nginx dev setup
This commit is contained in:
commit
d3328e6719
@ -22,7 +22,7 @@ RUN useradd -md /home/vscode -s /usr/bin/zsh -u $USER_UID $USERNAME \
|
||||
&& usermod -aG sudo $USERNAME \
|
||||
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
|
||||
&& mkdir /opt/netbox/netbox/netbox-access-lists \
|
||||
&& chown $USERNAME:$USERNAME /opt/netbox /etc/netbox -R
|
||||
&& chown $USERNAME:$USERNAME /opt/netbox /etc/netbox /opt/unit -R
|
||||
|
||||
USER $USERNAME
|
||||
|
||||
@ -36,7 +36,7 @@ WORKDIR /opt/netbox/netbox/netbox-access-lists
|
||||
|
||||
USER root
|
||||
|
||||
COPY entrypoint-dev.sh /bin/entrypoint.sh
|
||||
RUN chmod +x /bin/entrypoint.sh
|
||||
COPY entrypoint-dev.sh /bin/entrypoint-dev.sh
|
||||
RUN chmod +x /bin/entrypoint-dev.sh
|
||||
|
||||
CMD ["/bin/entrypoint.sh"]
|
||||
CMD ["/bin/entrypoint-dev.sh"]
|
||||
|
||||
@ -30,14 +30,14 @@
|
||||
"python.sortImports.path": "/opt/netbox/venv/bin/isort",
|
||||
"python.analysis.typeCheckingMode": "strict",
|
||||
"python.analysis.extraPaths": [
|
||||
"/opt/netbox/",
|
||||
// "/opt/netbox/",
|
||||
"/opt/netbox/netbox"
|
||||
],
|
||||
"python.autoComplete.extraPaths": [
|
||||
"/opt/netbox/netbox/",
|
||||
"/opt/netbox/netbox/**",
|
||||
"/opt/netbox/netbox/**/**"
|
||||
|
||||
// "/opt/netbox/netbox/",
|
||||
// "/opt/netbox/netbox/**",
|
||||
// "/opt/netbox/netbox/**/**",
|
||||
"/opt/netbox/netbox"
|
||||
],
|
||||
"python.defaultInterpreterPath": "/opt/netbox/venv/bin/python3",
|
||||
"python.formatting.autopep8Path": "/opt/netbox/venv/bin/autopep8",
|
||||
@ -62,7 +62,13 @@
|
||||
"python.linting.pylintPath": "/opt/netbox/venv/bin/pylint",
|
||||
"python.pythonPath": "/opt/netbox/venv/bin/python3",
|
||||
"python.terminal.activateEnvironment": true,
|
||||
"python.venvPath": "/opt/netbox/"
|
||||
"python.venvPath": "/opt/netbox/",
|
||||
"files.exclude": {
|
||||
"**/node_modules": true,
|
||||
"build": true,
|
||||
"dist": true,
|
||||
"*egg*": true
|
||||
}
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
|
||||
48
Makefile
48
Makefile
@ -4,19 +4,19 @@ VENV_PY_PATH=/opt/netbox/venv/bin/python3
|
||||
NETBOX_MANAGE_PATH=/opt/netbox/netbox/manage.py
|
||||
VERFILE=./version.py
|
||||
|
||||
.PHONY: help
|
||||
help: ## Display help message
|
||||
.PHONY: help ## Display help message
|
||||
help:
|
||||
@grep -E '^[0-9a-zA-Z_-]+\.*[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
#################
|
||||
# DOCKER #
|
||||
#################
|
||||
|
||||
# Outside of Devcontainer
|
||||
|
||||
.PHONY: cleanup
|
||||
cleanup: ## Clean associated docker resources.
|
||||
-docker-compose -p netbox-access-lists_devcontainer rm -fv
|
||||
##################
|
||||
## DOCKER #
|
||||
##################
|
||||
#
|
||||
## Outside of Devcontainer
|
||||
#
|
||||
#.PHONY: cleanup ## Clean associated docker resources.
|
||||
#cleanup:
|
||||
# -docker-compose -p netbox-access-lists_devcontainer rm -fv
|
||||
|
||||
##################
|
||||
# PLUGIN DEV #
|
||||
@ -24,22 +24,22 @@ cleanup: ## Clean associated docker resources.
|
||||
|
||||
# in VS Code Devcontianer
|
||||
|
||||
.PHONY: nbshell
|
||||
nbshell: ## Run nbshell
|
||||
.PHONY: nbshell ## Run nbshell
|
||||
nbshell:
|
||||
${VENV_PY_PATH} ${NETBOX_MANAGE_PATH} nbshell
|
||||
from netbox_access_lists.models import *
|
||||
|
||||
.PHONY: setup
|
||||
setup: ## Copy plugin settings. Setup NetBox plugin.
|
||||
.PHONY: setup ## Copy plugin settings. Setup NetBox plugin.
|
||||
setup:
|
||||
-${VENV_PY_PATH} -m pip install --disable-pip-version-check --no-cache-dir -e ${REPO_PATH}
|
||||
#-python3 setup.py develop
|
||||
|
||||
.PHONY: makemigrations
|
||||
makemigrations: ## Run makemigrations
|
||||
.PHONY: makemigrations ## Run makemigrations
|
||||
makemigrations:
|
||||
-${VENV_PY_PATH} ${NETBOX_MANAGE_PATH} makemigrations --name ${PLUGIN_NAME}
|
||||
|
||||
.PHONY: migrate
|
||||
migrate: ## Run migrate
|
||||
.PHONY: migrate ## Run migrate
|
||||
migrate:
|
||||
-${VENV_PY_PATH} ${NETBOX_MANAGE_PATH} migrate
|
||||
|
||||
.PHONY: startup_scripts
|
||||
@ -50,12 +50,12 @@ startup_scripts:
|
||||
collectstatic:
|
||||
-${VENV_PY_PATH} ${NETBOX_MANAGE_PATH} collectstatic --no-input
|
||||
|
||||
.PHONY: start
|
||||
start: ## Start NetBox
|
||||
-${VENV_PY_PATH} ${NETBOX_MANAGE_PATH} runserver
|
||||
.PHONY: start ## Start NetBox
|
||||
start:
|
||||
- cd /opt/netbox/netbox/ && /opt/netbox/docker-entrypoint.sh && /opt/netbox/launch-netbox.sh
|
||||
|
||||
.PHONY: all
|
||||
all: setup makemigrations migrate collectstatic startup_scripts start ## Run all PLUGIN DEV targets
|
||||
.PHONY: all ## Run all PLUGIN DEV targets
|
||||
all: setup makemigrations migrate collectstatic startup_scripts start
|
||||
|
||||
#.PHONY: test
|
||||
#test:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user