Skip to content

Commit 3f0a283

Browse files
authored
Merge pull request #61 from linuxserver/init-restructure
restructure init to allow for plugins as mods
2 parents 99c8208 + b45c949 commit 3f0a283

File tree

9 files changed

+38
-27
lines changed

9 files changed

+38
-27
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 & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -52,33 +52,6 @@ ln -sf /config/ldap_config.py /app/netbox/netbox/netbox/ldap_config.py
5252

5353
mv /defaults/uwsgi.ini /app/netbox/netbox/uwsgi.ini > /dev/null 2>&1
5454

55-
# build docs
56-
if [[ ! -e "/app/netbox/netbox/project-static/docs/index.html" ]]; then
57-
cd /app/netbox || exit 1
58-
echo "Building local documentation"
59-
mkdocs build -q
60-
cd /app/netbox/netbox || exit 1
61-
fi
62-
6355
# permissions
6456
lsiown -R abc:abc \
65-
/app/netbox/netbox/static \
6657
/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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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
23+
24+
# build docs
25+
if [[ ! -e "/app/netbox/netbox/project-static/docs/index.html" ]]; then
26+
cd /app/netbox || exit 1
27+
echo "Building local documentation"
28+
mkdocs build -q
29+
cd /app/netbox/netbox || exit 1
30+
fi
31+
32+
# permissions
33+
lsiown -R abc:abc \
34+
/app/netbox/netbox/static
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)