summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Dockerfile_i38611
-rw-r--r--Dockerfile_x86-6411
-rw-r--r--Makefile18
-rw-r--r--README.adoc33
-rw-r--r--go.mod9
-rw-r--r--go.sum10
-rw-r--r--main.go (renamed from src/pamldapd.go)0
7 files changed, 22 insertions, 70 deletions
diff --git a/Dockerfile_i386 b/Dockerfile_i386
deleted file mode 100644
index 101135a..0000000
--- a/Dockerfile_i386
+++ /dev/null
@@ -1,11 +0,0 @@
-FROM i386/centos:7
-ENV PATH $PATH:/usr/local/go/bin
-RUN linux32 sh -c 'yum install -y gcc git pam-devel \
- && curl -o go1.10.3.linux-386.tar.gz https://dl.google.com/go/go1.10.3.linux-386.tar.gz \
- && tar -C /usr/local -xzf go1.10.3.linux-386.tar.gz \
- && go get github.com/msteinert/pam \
- && go get github.com/nmcclain/asn1-ber \
- && go get github.com/nmcclain/ldap'
-COPY src /root/go/src
-RUN linux32 sh -c 'cd /root/go/src \
- && env GOOS=linux GOARCH=386 go build -a -ldflags "-extldflags \"-Wl,--hash-style=both\"" -x pamldapd.go'
diff --git a/Dockerfile_x86-64 b/Dockerfile_x86-64
deleted file mode 100644
index 0a1902d..0000000
--- a/Dockerfile_x86-64
+++ /dev/null
@@ -1,11 +0,0 @@
-FROM centos:7
-ENV PATH $PATH:/usr/local/go/bin
-RUN yum install -y gcc git pam-devel \
- && curl -o go1.10.3.linux-amd64.tar.gz https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz \
- && tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz \
- && go get github.com/msteinert/pam \
- && go get github.com/nmcclain/asn1-ber \
- && go get github.com/nmcclain/ldap
-COPY src /root/go/src
-RUN cd /root/go/src \
- && go build -a pamldapd.go
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 0093c01..0000000
--- a/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-.DEFAULT_GOAL := default
-
-all: pamldapd-x86-64 pamldapd-i386
-default: pamldapd-x86-64
-pamldapd-x86-64: x86-64.build Dockerfile_x86-64
-pamldapd-i386: i386.build Dockerfile_i386
-%.build: src/pamldapd.go
- @echo BUILD ARCH $(shell basename $@ .build)
- docker build -t pamldapd-build-$(shell basename $@ .build)-tmp -f Dockerfile_$(shell basename $@ .build) .
- docker run --name pamldapd-build-$(shell basename $@ .build)-tmp pamldapd-build-$(shell basename $@ .build)-tmp
- docker wait pamldapd-build-$(shell basename $@ .build)-tmp
- docker cp pamldapd-build-$(shell basename $@ .build)-tmp:/root/go/src/pamldapd pamldapd-$(shell basename $@ .build)
- docker rm pamldapd-build-$(shell basename $@ .build)-tmp
-
-clean: x86-64.clean i386.clean
-%.clean:
- @echo CLEAN ARCH $(shell basename $@ .build)
- docker rmi pamldapd-build-$(shell basename $@ .build)-tmp || true
diff --git a/README.adoc b/README.adoc
index 53ed9fa..ab692d8 100644
--- a/README.adoc
+++ b/README.adoc
@@ -2,22 +2,6 @@
## Getting Started
-### Requirements
-
-This guide is based on Amazon Linux
-
-. Check requirements is installed
-
- $ rpm -q git make docker
-
-. Check the Docker works without `sudo`
-
- $ docker ps
-
-. Check the free disk space (at least 2GB-3GB needed)
-
- $ df -h
-
### Download and Build
. Clone a repository
@@ -25,18 +9,7 @@ This guide is based on Amazon Linux
$ git clone https://github.com/eisin/pamldapd
$ cd pamldapd
-. Build using Docker
-
- build only x86-64:
- $ make
-
- build only i386:
- $ make i386
-
- build binaries both x86-64 and i386:
- $ make all
-
-. (Build without docker)
+. Build
$ yum install -y gcc golang pam-devel
$ go get github.com/msteinert/pam
@@ -68,11 +41,11 @@ While pamldapd uses PAM authentication, root privilege is required.
Start using configuration file, puts messages to STDOUT
- $ sudo pamldapd -c pamldapd.json
+ # pamldapd -c pamldapd.json
Start using configuration file, puts messages to a log file
- $ sudo pamldapd -c pamldapd.json -l /var/log/pamldapd.log
+ # pamldapd -c pamldapd.json -l /var/log/pamldapd.log
## Configuration
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..dd05de7
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,9 @@
+module 4a.si/pamldapd
+
+go 1.22.3
+
+require (
+ github.com/msteinert/pam v1.2.0
+ github.com/nmcclain/asn1-ber v0.0.0-20170104154839-2661553a0484
+ github.com/nmcclain/ldap v0.0.0-20210720162743-7f8d1e44eeba
+)
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..338c0ec
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,10 @@
+github.com/msteinert/pam v1.2.0 h1:mYfjlvN2KYs2Pb9G6nb/1f/nPfAttT/Jee5Sq9r3bGE=
+github.com/msteinert/pam v1.2.0/go.mod h1:d2n0DCUK8rGecChV3JzvmsDjOY4R7AYbsNxAT+ftQl0=
+github.com/nmcclain/asn1-ber v0.0.0-20170104154839-2661553a0484 h1:D9EvfGQvlkKaDr2CRKN++7HbSXbefUNDrPq60T+g24s=
+github.com/nmcclain/asn1-ber v0.0.0-20170104154839-2661553a0484/go.mod h1:O1EljZ+oHprtxDDPHiMWVo/5dBT6PlvWX5PSwj80aBA=
+github.com/nmcclain/ldap v0.0.0-20210720162743-7f8d1e44eeba h1:DO8NFYdcRv1dnyAINJIBm6Bw2XibtLvQniNFGzf2W8E=
+github.com/nmcclain/ldap v0.0.0-20210720162743-7f8d1e44eeba/go.mod h1:4S0XndRL8HNOaQBfdViJ2F/GPCgL524xlXRuXFH12/U=
+golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
+golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw=
+golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
diff --git a/src/pamldapd.go b/main.go
index 9685b3e..9685b3e 100644
--- a/src/pamldapd.go
+++ b/main.go