This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
forked from seb36273/openmediavault-ldap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix static rootbindpw by using the correct variable * Adapt UI * Remove obsolete file creation from salt * Fix editing route / missing content * Adapt README and add scripts for testing * Remove TODO * Fix script
- Loading branch information
Showing
21 changed files
with
356 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.vagrant | ||
|
||
# Generated files from dpkg-buildpackage | ||
openmediavault-ldap_* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# All Vagrant configuration is done below. The "2" in Vagrant.configure | ||
# configures the configuration version (we support older styles for | ||
# backwards compatibility). Please don't change it unless you know what | ||
# you're doing. | ||
Vagrant.configure("2") do |config| | ||
# The most common configuration options are documented and commented below. | ||
# For a complete reference, please see the online documentation at | ||
# https://docs.vagrantup.com. | ||
|
||
# Every Vagrant development environment requires a box. You can search for | ||
# boxes at https://vagrantcloud.com/search. | ||
config.vm.box = "debian/bullseye64" | ||
|
||
# Disable automatic box update checking. If you disable this, then | ||
# boxes will only be checked for updates when the user runs | ||
# `vagrant box outdated`. This is not recommended. | ||
# config.vm.box_check_update = false | ||
|
||
# Create a forwarded port mapping which allows access to a specific port | ||
# within the machine from a port on the host machine. In the example below, | ||
# accessing "localhost:8080" will access port 80 on the guest machine. | ||
# NOTE: This will enable public access to the opened port | ||
# config.vm.network "forwarded_port", guest: 80, host: 8080 | ||
|
||
# Create a forwarded port mapping which allows access to a specific port | ||
# within the machine from a port on the host machine and only allow access | ||
# via 127.0.0.1 to disable public access | ||
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" | ||
|
||
# Create a private network, which allows host-only access to the machine | ||
# using a specific IP. | ||
# config.vm.network "private_network", ip: "192.168.33.10" | ||
|
||
# Create a public network, which generally matched to bridged network. | ||
# Bridged networks make the machine appear as another physical device on | ||
# your network. | ||
# config.vm.network "public_network" | ||
|
||
# Share an additional folder to the guest VM. The first argument is | ||
# the path on the host to the actual folder. The second argument is | ||
# the path on the guest to mount the folder. And the optional third | ||
# argument is a set of non-required options. | ||
# config.vm.synced_folder "../data", "/vagrant_data" | ||
|
||
# Provider-specific configuration so you can fine-tune various | ||
# backing providers for Vagrant. These expose provider-specific options. | ||
# Example for VirtualBox: | ||
# | ||
# config.vm.provider "virtualbox" do |vb| | ||
# # Display the VirtualBox GUI when booting the machine | ||
# vb.gui = true | ||
# | ||
# # Customize the amount of memory on the VM: | ||
# vb.memory = "1024" | ||
# end | ||
# | ||
# View the documentation for the provider you are using for more | ||
# information on available options. | ||
|
||
# Enable provisioning with a shell script. Additional provisioners such as | ||
# Ansible, Chef, Docker, Puppet and Salt are also available. Please see the | ||
# documentation for more information about their specific syntax and use. | ||
# config.vm.provision "shell", inline: <<-SHELL | ||
# apt-get update | ||
# apt-get install -y apache2 | ||
# SHELL | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
BUILDER_IMAGE="local/$(basename $(pwd))/deb-builder" | ||
|
||
docker build -t ${BUILDER_IMAGE} deb-builder | ||
|
||
# Remove old results | ||
rm -fv openmediavault-ldap_* | ||
|
||
# Note: We need to mount the parent directory as dpkg-buildpackage writes there | ||
docker run \ | ||
--rm \ | ||
-t \ | ||
-v $(pwd)/../:$(pwd)/../ \ | ||
-w $(pwd) \ | ||
${BUILDER_IMAGE} \ | ||
dpkg-buildpackage -uc -us | ||
|
||
# Move results from parent directory | ||
mv -v ../openmediavault-ldap_* . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM debian:bullseye-slim | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y dpkg-dev debhelper gettext \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
9 | ||
12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
usr/share/openmediavault/* usr/share/openmediavault | ||
var/www/openmediavault/* var/www/openmediavault | ||
srv/* srv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
# Install OMV in a test environment based on Debian | ||
# See https://openmediavault.readthedocs.io/en/stable/installation/on_debian.html | ||
|
||
echo "Installing openmediavault gpg keyring" | ||
apt-get install --yes gnupg | ||
wget -O "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" https://packages.openmediavault.org/public/archive.key | ||
apt-key add "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" | ||
|
||
echo "Add package repositories" | ||
cat <<EOF >> /etc/apt/sources.list.d/openmediavault.list | ||
deb https://packages.openmediavault.org/public shaitan main | ||
# deb https://downloads.sourceforge.net/project/openmediavault/packages shaitan main | ||
## Uncomment the following line to add software from the proposed repository. | ||
# deb https://packages.openmediavault.org/public shaitan-proposed main | ||
# deb https://downloads.sourceforge.net/project/openmediavault/packages shaitan-proposed main | ||
## This software is not part of OpenMediaVault, but is offered by third-party | ||
## developers as a service to OpenMediaVault users. | ||
# deb https://packages.openmediavault.org/public shaitan partner | ||
# deb https://downloads.sourceforge.net/project/openmediavault/packages shaitan partner | ||
EOF | ||
|
||
echo "Install openmediavault package" | ||
export LANG=C.UTF-8 | ||
export DEBIAN_FRONTEND=noninteractive | ||
export APT_LISTCHANGES_FRONTEND=none | ||
apt-get update | ||
apt-get --yes --auto-remove --show-upgraded \ | ||
--allow-downgrades --allow-change-held-packages \ | ||
--no-install-recommends \ | ||
--option DPkg::Options::="--force-confdef" \ | ||
--option DPkg::Options::="--force-confold" \ | ||
install openmediavault-keyring openmediavault | ||
|
||
omv-confdbadm populate | ||
|
||
echo "Don't forget to add vagrant to the ssh group!" | ||
echo "Now do a reboot or vagrant reload" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
# Install tools for testing the plugin | ||
|
||
echo "Installing utils for development / testing" | ||
# TODO: setup LDAP with test data | ||
apt-get --yes install slapd ldap-utils smbldap-tools | ||
|
||
# See https://ubuntu.com/server/docs/samba-openldap-backend | ||
echo "Configuring LDAP" | ||
ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=schema,cn=config 'cn=*samba*' | ||
|
||
cat<<EOF > /tmp/samba_indices.ldif | ||
dn: olcDatabase={1}mdb,cn=config | ||
changetype: modify | ||
replace: olcDbIndex | ||
olcDbIndex: objectClass eq | ||
olcDbIndex: uidNumber,gidNumber eq | ||
olcDbIndex: loginShell eq | ||
olcDbIndex: uid,cn eq,sub | ||
olcDbIndex: memberUid eq,sub | ||
olcDbIndex: member,uniqueMember eq | ||
olcDbIndex: sambaSID eq | ||
olcDbIndex: sambaPrimaryGroupSID eq | ||
olcDbIndex: sambaGroupType eq | ||
olcDbIndex: sambaSIDList eq | ||
olcDbIndex: sambaDomainName eq | ||
olcDbIndex: default sub,eq | ||
EOF | ||
|
||
ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f /tmp/samba_indices.ldif | ||
|
||
# Note: Samba must be activated / running in OMV from here on | ||
# Generate configuration for smbldap-config, ask several questions | ||
# Note: Ensure that the port is not part of the hostname! | ||
smbldap-config | ||
# Prepare the LDAP using freshly created config | ||
smbldap-populate -g 10000 -u 10000 -r 10000 | ||
|
||
# Tell samba the ldap admin password | ||
smbpasswd -W | ||
|
||
# Not sure if thats really necessary | ||
systemctl restart smbd.service nmbd.service | ||
|
||
# Finally add a user to LDAP / Samba | ||
smbldap-useradd -a -P -m jodoe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.