diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index acdb4e0..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,14 +0,0 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -- cimnine -- tobiasge -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index b6f0479..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,148 +0,0 @@ -name: Bug report -description: Create a report about a malfunction of the Docker setup -body: -- type: markdown - attributes: - value: | - Please only raise an issue if you're certain that you've found a bug. - Else, see these other means to get help: - - - See our troubleshooting section: - https://github.com/netbox-community/netbox-docker/wiki/Troubleshooting - - Have a look at the rest of the wiki: - https://github.com/netbox-community/netbox-docker/wiki - - Check the release notes: - https://github.com/netbox-community/netbox-docker/releases - - Look through the issues already resolved: - https://github.com/netbox-community/netbox-docker/issues?q=is%3Aclosed - - If you did not find what you're looking for, - try the help of our community: - - - Post to Github Discussions: - https://github.com/netbox-community/netbox-docker/discussions - - Join the `#netbox-docker` channel on our Slack: - https://join.slack.com/t/netdev-community/shared_invite/zt-mtts8g0n-Sm6Wutn62q_M4OdsaIycrQ - - Ask on the NetBox mailing list: - https://groups.google.com/d/forum/netbox-discuss - - Please don't open an issue to open a PR. - Just submit the PR, that's good enough. -- type: textarea - id: current-behavior - attributes: - label: Current Behavior - description: Please describe what you did and how you think it misbehaved - placeholder: I tried to … by doing …, but it … - validations: - required: true -- type: textarea - id: expected-behavior - attributes: - label: Expected Behavior - description: Please describe what you expected instead - placeholder: I expected that … when I do … - validations: - required: true -- type: input - id: docker-compose-version - attributes: - label: Docker Compose Version - description: Please paste the output of `docker-compose version` - placeholder: Docker Compose version vX.Y.Z - validations: - required: true -- type: textarea - id: docker-version - attributes: - label: Docker Version - description: Please paste the output of `docker version` - render: text - placeholder: | - Client: - Cloud integration: 1.0.17 - Version: 20.10.8 - API version: 1.41 - Go version: go1.16.6 - Git commit: 3967b7d - Built: Fri Jul 30 19:55:20 2021 - OS/Arch: darwin/amd64 - Context: default - Experimental: true - - Server: Docker Engine - Community - Engine: - Version: 20.10.8 - API version: 1.41 (minimum version 1.12) - Go version: go1.16.6 - Git commit: 75249d8 - Built: Fri Jul 30 19:52:10 2021 - OS/Arch: linux/amd64 - Experimental: false - containerd: - Version: 1.4.9 - GitCommit: e25210fe30a0a703442421b0f60afac609f950a3 - runc: - Version: 1.0.1 - GitCommit: v1.0.1-0-g4144b63 - docker-init: - Version: 0.19.0 - GitCommit: de40ad0 - validations: - required: true -- type: input - id: git-rev - attributes: - label: The git Revision - description: Please paste the output of `git rev-parse HEAD` - validations: - required: true -- type: textarea - id: git-status - attributes: - label: The git Status - description: Please paste the output of `git status` - render: text - placeholder: | - On branch main - nothing to commit, working tree clean - validations: - required: true -- type: input - id: run-command - attributes: - label: Startup Command - description: Please specify the command you used to start the project - placeholder: docker compose up - validations: - required: true -- type: textarea - id: netbox-logs - attributes: - label: NetBox Logs - description: Please paste the output of `docker-compose logs netbox` (or `docker compose logs netbox`) - render: text - placeholder: | - netbox_1 | ⚙️ Applying database migrations - netbox_1 | 🧬 loaded config '/etc/netbox/config/configuration.py' - netbox_1 | 🧬 loaded config '/etc/netbox/config/a.py' - netbox_1 | 🧬 loaded config '/etc/netbox/config/extra.py' - netbox_1 | 🧬 loaded config '/etc/netbox/config/logging.py' - netbox_1 | 🧬 loaded config '/etc/netbox/config/plugins.py' - ... - validations: - required: true -- type: textarea - id: docker-compose-override-yml - attributes: - label: Content of docker-compose.override.yml - description: Please paste the output of `cat docker-compose.override.yml` - render: yaml - placeholder: | - version: '3.4' - services: - netbox: - ports: - - '8080:8080' - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index a584cc2..0000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,15 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Question - url: https://github.com/netbox-community/netbox-docker/discussions - about: The Github Discussions are the right place to ask questions about how to use or do certain things with NetBox Docker. - - - name: Chat - url: https://join.slack.com/t/netdev-community/shared_invite/zt-mtts8g0n-Sm6Wutn62q_M4OdsaIycrQ - about: 'Usually the quickest way to seek help with small issues is to join our #netbox-docker Slack channel.' - - - name: Community Wiki - url: https://github.com/netbox-community/netbox-docker/wiki - about: | - Our wiki contains information for common problems and tips for operating NetBox Docker in production. - It's maintained by our excellent community. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml deleted file mode 100644 index e8f2a55..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Feature or Change Request -description: Request a new feature or a change of the current behavior -body: -- type: markdown - attributes: - value: | - This issue type is to propose new features for the Docker setup. - To just spin an idea, see the Github Discussions section, please. - - Before asking for help, see these links first: - - - See our troubleshooting section: - https://github.com/netbox-community/netbox-docker/wiki/Troubleshooting - - Have a look at the rest of the wiki: - https://github.com/netbox-community/netbox-docker/wiki - - Check the release notes: - https://github.com/netbox-community/netbox-docker/releases - - Look through the issues already resolved: - https://github.com/netbox-community/netbox-docker/issues?q=is%3Aclosed - - If you did not find what you're looking for, - try the help of our community: - - - Post to Github Discussions: - https://github.com/netbox-community/netbox-docker/discussions - - Join the `#netbox-docker` channel on our Slack: - https://join.slack.com/t/netdev-community/shared_invite/zt-mtts8g0n-Sm6Wutn62q_M4OdsaIycrQ - - Ask on the NetBox mailing list: - https://groups.google.com/d/forum/netbox-discuss - - Please don't open an issue to open a PR. - Just submit the PR, that's good enough. -- type: textarea - id: desired-behavior - attributes: - label: Desired Behavior - description: Please describe the desired behavior - placeholder: To me, it would be useful, if … because … - validations: - required: true -- type: textarea - id: contrast-to-current - attributes: - label: Contrast to Current Behavior - description: Please describe how the desired behavior is different from the current behavior - placeholder: The current behavior is …, but this lacks … - validations: - required: true -- type: textarea - id: required-changes - attributes: - label: Required Changes - description: If you can, please elaborate what changes will be required to implement the desired behavior - placeholder: I suggest to change the file … - validations: - required: false -- type: textarea - id: discussion - attributes: - label: 'Discussion: Benefits and Drawbacks' - description: | - Please make your case here: - - Why do you think this project and the community will benefit from your suggestion? - - What are the drawbacks of this change? Is it backwards-compatible? - - Anything else that you think is relevant to the discussion of this feature/change request. - placeholder: I suggest to change the file … - validations: - required: false diff --git a/.github/no-response.yml b/.github/no-response.yml deleted file mode 100644 index 1a7a45a..0000000 --- a/.github/no-response.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration for probot-no-response - https://github.com/probot/no-response - -# Number of days of inactivity before an Issue is closed for lack of response -daysUntilClose: 30 -# Label requiring a response -responseRequiredLabel: awaiting answer -# Comment to post when closing an Issue for lack of response. Set to `false` to disable -closeComment: > - This issue has been automatically closed because there has been no response - to our request for more information from the original author. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 139ff96..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,85 +0,0 @@ - - - - -Related Issue: - -## New Behavior - - - -... - -## Contrast to Current Behavior - - - -... - -## Discussion: Benefits and Drawbacks - - - -... - -## Changes to the Wiki - - - -... - -## Proposed Release Note Entry - - - -... - -## Double Check - - - -* [ ] I have read the comments and followed the PR template. -* [ ] I have explained my PR according to the information in the comments. -* [ ] My PR targets the `develop` branch. diff --git a/.github/workflows/check_changes.yml b/.github/workflows/check_changes.yml new file mode 100644 index 0000000..b43dd1c --- /dev/null +++ b/.github/workflows/check_changes.yml @@ -0,0 +1,98 @@ +name: Check Changes + +on: + schedule: + # 07:00 UTC each day + - cron: '0 7 * * *' + + release: + types: [published] + + workflow_dispatch: + +jobs: + get_releases: + runs-on: ubuntu-latest + outputs: + releases: ${{ steps.get.outputs.result }} + empty_releases: ${{ steps.check.outputs.result }} + steps: + - name: Docker target releases + id: fetch_target_releases + uses: mxpicture/action-docker-hub-fetch-releases@v1 + with: + repository: mxpicture/openwrt-rootfs + max_items: "999999" + + - name: Docker source releases + id: fetch_source_releases + uses: mxpicture/action-docker-hub-fetch-releases@v1 + with: + repository: openwrtorg/rootfs + max_items: "999999" + + - name: Get releases, compare docker hub image dates + uses: actions/github-script@v5 + id: get + with: + script: | + const releases = (await github.request("https://api.github.com/repos/" + + context.repo.owner + "/" + context.repo.repo + "/releases")).data + const target_releases = ${{ steps.fetch_target_releases.outputs.results }} + const source_releases = ${{ steps.fetch_source_releases.outputs.results }} + let output = [] + for (const release of releases) { + console.log("Processing release: " + release.tag_name) + for (const source_release of source_releases) { + if ( source_release.tag_name === release.tag_name ) { + let found = false + for (const target_release of target_releases) { + if ( source_release.tag_name === target_release.tag_name ) { + found = true + console.log("Last updated (source): " + source_release.last_updated) + console.log("Last updated (target): " + target_release.last_updated) + if ( source_release.last_updated > target_release.last_updated ) { + console.log("Trigger event for release: " + release.tag_name) + output.push({ "name": release.tag_name }) + } + } + } + if (found != true) { + console.log("Trigger event for release: " + release.tag_name) + output.push({ "name": release.tag_name }) + } + } + } + } + return output + + - name: Check releases empty + uses: actions/github-script@v5 + id: check + with: + script: | + let output = ${{ steps.get.outputs.result }} + console.log("Count releases: " + (output.length)) + + if (output.length == 0) { + console.log("empty") + return 'true' + } else { + console.log("not empty") + return 'false' + } + dispatch: + needs: get_releases + if: ${{ fromJSON(needs.get_releases.outputs.empty_releases) == 'false' }} + runs-on: ubuntu-latest + strategy: + matrix: + release: ${{ fromJSON(needs.get_releases.outputs.releases) }} + steps: + - name: Dispatch deploy + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.ACCESS_TOKEN }} + repository: ${{ github.repository }} + event-type: docker_hub + client-payload: '{"release": "${{ matrix.release.tag_name }}"}' \ No newline at end of file diff --git a/.github/workflows/docker_hub.yml b/.github/workflows/docker_hub.yml new file mode 100644 index 0000000..cd10f71 --- /dev/null +++ b/.github/workflows/docker_hub.yml @@ -0,0 +1,43 @@ +name: Docker Hub Deploy + +on: + repository_dispatch: + types: [docker_hub] + + workflow_dispatch: + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: mxpicture + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract release name + shell: bash + run: echo "##[set-output name=release;]$(echo ${GITHUB_REF#refs/*/})" + if: github.event_name != 'repository_dispatch' + id: extract_release + + - name: Build and push (on push) + id: docker_build_push + uses: docker/build-push-action@v2 + if: github.event_name != 'repository_dispatch' + with: + push: true + releases: mxpicture/netbox:${{ steps.extract_release.outputs.release }} + build-args: "BASE_IMAGE_VERSION=${{ steps.extract_release.outputs.release }}" + + - name: Build and push (on dispatch) + id: docker_build_dispatch + uses: docker/build-push-action@v2 + if: github.event_name == 'repository_dispatch' + with: + push: true + releases: mxpicture/netbox:${{ github.event.client_payload.release }} + build-args: "BASE_IMAGE_VERSION=${{ github.event.client_payload.release }}" \ No newline at end of file diff --git a/.github/workflows/docker_hub_force_all.yml b/.github/workflows/docker_hub_force_all.yml new file mode 100644 index 0000000..cec792e --- /dev/null +++ b/.github/workflows/docker_hub_force_all.yml @@ -0,0 +1,56 @@ +name: Force deploy all + +on: + workflow_dispatch: + +jobs: + get_releases: + runs-on: ubuntu-latest + outputs: + releases: ${{ steps.get.outputs.result }} + empty_releases: ${{ steps.check.outputs.result }} + steps: + - name: Get releases + uses: actions/github-script@v5 + id: get + with: + script: | + const releases = (await github.request("https://api.github.com/repos/" + + context.repo.owner + "/" + context.repo.repo + "/releases")).data + + let output = [] + + for(let i=0; i We recommend to use either the `vX.Y.Z-a.b.c` tags or the `vX.Y-a.b.c` tags in production! -* `vX.Y.Z-a.b.c`, `vX.Y-a.b.c`: +- `vX.Y.Z-a.b.c`, `vX.Y-a.b.c`: These are release builds containing _NetBox version_ `vX.Y.Z`. They contain the support files of _NetBox Docker version_ `a.b.c`. You must use _NetBox Docker version_ `a.b.c` to guarantee the compatibility. These images are automatically built from [the corresponding releases of NetBox][netbox-releases]. -* `latest-a.b.c`: +- `latest-a.b.c`: These are release builds, containing the latest stable version of NetBox. They contain the support files of _NetBox Docker version_ `a.b.c`. You must use _NetBox Docker version_ `a.b.c` to guarantee the compatibility. These images are automatically built from [the `master` branch of NetBox][netbox-master]. -* `snapshot-a.b.c`: +- `snapshot-a.b.c`: These are pre-release builds. They contain the support files of _NetBox Docker version_ `a.b.c`. You must use _NetBox Docker version_ `a.b.c` to guarantee the compatibility. @@ -82,19 +88,19 @@ New container images are built and published automatically every ~24h. For each of the above tag, there is an extra tag: -* `vX.Y.Z`, `vX.Y`: +- `vX.Y.Z`, `vX.Y`: This is the same version as `vX.Y.Z-a.b.c` (or `vX.Y-a.b.c`, respectively). It always points to the latest version of _NetBox Docker_. -* `latest` +- `latest` This is the same version as `latest-a.b.c`. It always points to the latest version of _NetBox Docker_. -* `snapshot` +- `snapshot` This is the same version as `snapshot-a.b.c`. It always points to the latest version of _NetBox Docker_. Then there is currently one extra tags for each of the above tags: -* `-ldap`: +- `-ldap`: These container images contain additional dependencies and configuration files for connecting NetBox to an LDAP directory. [Learn more about that in our wiki][netbox-docker-ldap]. @@ -102,7 +108,7 @@ Then there is currently one extra tags for each of the above tags: [netbox-master]: https://github.com/netbox-community/netbox/tree/master [netbox-develop]: https://github.com/netbox-community/netbox/tree/develop [netbox-branches]: https://github.com/netbox-community/netbox/branches -[netbox-docker-ldap]: https://github.com/netbox-community/netbox-docker/wiki/LDAP +[netbox-docker-ldap]: https://github.com/MXPicture/docker-netbox/wiki/LDAP ## Documentation @@ -112,7 +118,7 @@ The wiki covers advanced topics such as using files for secrets, configuring TLS Our wiki is a community effort. Feel free to correct errors, update outdated information or provide additional guides and insights. -[netbox-docker-wiki]: https://github.com/netbox-community/netbox-docker/wiki/ +[netbox-docker-wiki]: https://github.com/MXPicture/docker-netbox/wiki/ ## Getting Help @@ -123,14 +129,14 @@ which is free to use and where there are almost always people online that can he If you need help with using NetBox or developing for it or against it's API you may find [the `#netbox` channel][netbox-slack-channel] on the same Slack instance very helpful. -[netbox-community]: https://github.com/netbox-community/netbox-docker/discussions +[netbox-community]: https://github.com/MXPicture/docker-netbox/discussions ## Dependencies -This project relies only on *Docker* and *docker-compose* meeting these requirements: +This project relies only on _Docker_ and _docker-compose_ meeting these requirements: -* The *Docker version* must be at least `19.03`. -* The *docker-compose version* must be at least `1.28.0`. +- The _Docker version_ must be at least `19.03`. +- The _docker-compose version_ must be at least `1.28.0`. To check the version installed on your system run `docker --version` and `docker-compose --version`. @@ -141,8 +147,8 @@ Note that the version of the NetBox Docker container image must stay in sync wit If you update for the first time, be sure [to follow our _How To Update NetBox Docker_ guide in the wiki][netbox-docker-wiki-updating]. -[releases]: https://github.com/netbox-community/netbox-docker/releases -[netbox-docker-wiki-updating]: https://github.com/netbox-community/netbox-docker/wiki/Updating +[releases]: https://github.com/MXPicture/docker-netbox/releases +[netbox-docker-wiki-updating]: https://github.com/MXPicture/docker-netbox/wiki/Updating ## Rebuilding the Image @@ -150,7 +156,7 @@ If you update for the first time, be sure [to follow our _How To Update NetBox D For more details on custom builds [consult our wiki][netbox-docker-wiki-build]. -[netbox-docker-wiki-build]: https://github.com/netbox-community/netbox-docker/wiki/Build +[netbox-docker-wiki-build]: https://github.com/MXPicture/docker-netbox/wiki/Build ## Tests