Skip to content

Commit d175a8d

Browse files
committed
restructure init to allow for plugins as mods
1 parent 99c8208 commit d175a8d

File tree

9 files changed

+26
-18
lines changed

9 files changed

+26
-18
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
333333

334334
## Versions
335335

336+
* **26.08.24:** - Restructure init to allow for plugins as mods.
336337
* **16.07.24:** - Add required packages for LDAP support.
337338
* **01.06.24:** - Rebase to Alpine 3.20.
338339
* **23.12.23:** - Rebase to Alpine 3.19.

readme-vars.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ app_setup_block: |
5757
5858
# changelog
5959
changelogs:
60+
- { date: "26.08.24:", desc: "Restructure init to allow for plugins as mods."}
6061
- { date: "16.07.24:", desc: "Add required packages for LDAP support."}
6162
- { date: "01.06.24:", desc: "Rebase to Alpine 3.20."}
6263
- { date: "23.12.23:", desc: "Rebase to Alpine 3.19."}

root/etc/s6-overlay/s6-rc.d/init-netbox-config/run

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,3 @@ fi
6464
lsiown -R abc:abc \
6565
/app/netbox/netbox/static \
6666
/config
67-
68-
s6-setuidgid abc python3 ./manage.py migrate
69-
70-
if [[ -n "$SUPERUSER_EMAIL" ]] && [[ -n "$SUPERUSER_PASSWORD" ]]; then
71-
cat << EOF | s6-setuidgid abc python3 /app/netbox/netbox/manage.py shell
72-
from users.models import Token, User;
73-
74-
username = 'admin';
75-
password = '$SUPERUSER_PASSWORD';
76-
email = '$SUPERUSER_EMAIL';
77-
78-
if not User.objects.filter(username='admin'):
79-
User.objects.create_superuser(username, email, password);
80-
print('Superuser created.');
81-
else:
82-
print('Superuser creation skipped. Already exists.');
83-
EOF
84-
fi
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/with-contenv bash
2+
# shellcheck shell=bash
3+
4+
cd /app/netbox/netbox || exit 1
5+
6+
s6-setuidgid abc python3 ./manage.py migrate
7+
8+
if [[ -n "$SUPERUSER_EMAIL" ]] && [[ -n "$SUPERUSER_PASSWORD" ]]; then
9+
cat << EOF | s6-setuidgid abc python3 /app/netbox/netbox/manage.py shell
10+
from users.models import Token, User;
11+
12+
username = 'admin';
13+
password = '$SUPERUSER_PASSWORD';
14+
email = '$SUPERUSER_EMAIL';
15+
16+
if not User.objects.filter(username='admin'):
17+
User.objects.create_superuser(username, email, password);
18+
print('Superuser created.');
19+
else:
20+
print('Superuser creation skipped. Already exists.');
21+
EOF
22+
fi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
oneshot
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/etc/s6-overlay/s6-rc.d/svc-netbox-prepare/run

root/etc/s6-overlay/s6-rc.d/svc-netbox/dependencies.d/svc-netbox-prepare

Whitespace-only changes.

root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-netbox-prepare

Whitespace-only changes.

0 commit comments

Comments
 (0)