This commit is contained in:
PaulVua
2025-05-23 11:02:06 +02:00
parent f40c105abf
commit 2bd74ca91a
3 changed files with 26 additions and 22 deletions

View File

@@ -59,6 +59,7 @@ ALL ALL=(ALL) NOPASSWD: /usr/bin/nmcli, /usr/sbin/reboot
www-data ALL=(ALL) NOPASSWD: /usr/bin/git pull www-data ALL=(ALL) NOPASSWD: /usr/bin/git pull
www-data ALL=(ALL) NOPASSWD: /usr/bin/ssh www-data ALL=(ALL) NOPASSWD: /usr/bin/ssh
www-data ALL=(ALL) NOPASSWD: /usr/bin/python3 * www-data ALL=(ALL) NOPASSWD: /usr/bin/python3 *
www-data ALL=(ALL) NOPASSWD: /bin/systemctl *
``` ```
## Serial ## Serial

View File

@@ -180,36 +180,39 @@
<!-- SYSTEMD SERVICES SECTION --> <!-- SYSTEMD SERVICES SECTION -->
<div class="row mb-3"> <div class="row mb-3">
<div class="col-12"> <div class="col-lg-8 col-12">
<h3 class="mt-4">SystemD Services</h3> <h4 class="mt-4">SystemD Services</h4>
<div id="services-table"> <div id="services-table" class="card">
<div class="d-flex justify-content-end mb-3"> <div class="card-header d-flex justify-content-between align-items-center">
<button type="button" class="btn btn-primary" onclick="refreshServices()"> <span class="fw-bold">Service Status</span>
<svg width="16" height="16" fill="currentColor" class="bi bi-arrow-clockwise" viewBox="0 0 16 16"> <button type="button" class="btn btn-sm btn-outline-primary" onclick="refreshServices()">
<svg width="14" height="14" fill="currentColor" class="bi bi-arrow-clockwise" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z"/> <path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z"/>
<path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z"/> <path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z"/>
</svg> </svg>
Refresh Refresh
</button> </button>
</div> </div>
<table class="table table-striped"> <div class="card-body p-0">
<thead> <table class="table table-sm table-hover mb-0">
<thead class="table-light">
<tr> <tr>
<th>Service</th> <th style="width: 30%">Service</th>
<th>Status</th> <th style="width: 15%">Status</th>
<th>Enabled</th> <th style="width: 15%">Enabled</th>
<th>Actions</th> <th style="width: 40%">Actions</th>
</tr> </tr>
</thead> </thead>
<tbody id="services-tbody"> <tbody id="services-tbody">
<tr> <tr>
<td colspan="4" class="text-center">Loading services...</td> <td colspan="4" class="text-center py-3">Loading services...</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- toast --> <!-- toast -->

View File

@@ -100,7 +100,7 @@ fi
# Add sudo authorization (prevent duplicate entries) # Add sudo authorization (prevent duplicate entries)
info "Setting up sudo authorization..." info "Setting up sudo authorization..."
if ! sudo grep -q "/usr/bin/nmcli" /etc/sudoers; then if ! sudo grep -q "/usr/bin/nmcli" /etc/sudoers; then
echo -e "ALL ALL=(ALL) NOPASSWD: /usr/bin/nmcli, /usr/sbin/reboot\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/git pull\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/ssh\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/python3 *" | sudo tee -a /etc/sudoers > /dev/null echo -e "ALL ALL=(ALL) NOPASSWD: /usr/bin/nmcli, /usr/sbin/reboot\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/git pull\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/ssh\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/python3 * www-data ALL=(ALL) NOPASSWD: /bin/systemctl *" | sudo tee -a /etc/sudoers > /dev/null
success "Sudo authorization added." success "Sudo authorization added."
else else
warning "Sudo authorization already set. Skipping." warning "Sudo authorization already set. Skipping."