Skip to content

Commit

Permalink
cleanup for easyer debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne committed Oct 30, 2024
1 parent 89cb12f commit cc2a215
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 195 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.secrets
43 changes: 0 additions & 43 deletions .gitlab-ci.yml

This file was deleted.

44 changes: 13 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ FROM alpine
LABEL authors="toxic0berliner"

# Set correct environment variables
ENV HOME /duc
ENV HOME="/duc"

# Install Dependencies
RUN apk add --no-cache --no-check-certificate\
wget \
git \
rsync \
bash \
automake \
autoconf \
Expand All @@ -18,51 +17,34 @@ RUN apk add --no-cache --no-check-certificate\
ncurses-dev \
libncursesw \
zlib \
zstd \
zstd-libs \
gcompat \
cairo-dev \
pango-dev \
build-base \
kyotocabinet-dev && \
cd /tmp && \
git -c http.sslVerify=false clone https://github.com/estraier/tkrzw.git &&\
cd /tmp/tkrzw && \
wget https://dbmx.net/tkrzw/pkg/tkrzw-1.0.25.tar.gz &&\
tar -xf tkrzw-1.0.25.tar.gz &&\
cd /tmp/tkrzw-1.0.25 && \
./configure && \
make && \
make install && \
cd .. && \
rm -rf tkrzw


# Install duc
# /duc/db is a directory to mount multiple DBs, for server. duc_startup.sh look into this directory and create CGIs
# Build duc
RUN mkdir /duc && \
mkdir /duc/db && \
cd /duc && \
git -c http.sslVerify=false clone https://github.com/zevv/duc.git &&\
cd /duc/duc && \
autoreconf -i && \
./configure && \
autoupdate && \
./configure --disable-cairo --disable-ui --disable-x11 --with-db-backend=tkrzw && \
make && \
make install && \
cd .. && \
rm -rf duc

COPY assets/000-default.conf /etc/apache2/sites-available/
COPY assets/ducrc /etc/
COPY assets/duc_startup.sh /duc/

# create a starter database so that we can set permissions for cgi access
RUN mkdir /var/www/duc && \
mkdir /host && \
chmod 777 /duc/

# DEBUG BELOW IS COMMENTED TO ALLOW SUCESSFULL IMAGE BUILD TO DEBUG CURRENT ISSUES WITH DUC
# RUN duc index /host/ && \
# chmod 777 /duc/.duc.db && \
# a2enmod cgi && \
# chmod +x /duc/duc_startup.sh

ENV DUC_CGI_OPTIONS --list --tooltip --dpi=120
EXPOSE 80
make install
ENV DUC_CGI_OPTIONS="--list --tooltip --dpi=120"

WORKDIR /duc
CMD /duc/duc_startup.sh
WORKDIR /duc
28 changes: 6 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,17 @@ This is a fork of [minostauros/duc-docker](https://github.com/minostauros/duc-do


# duc-docker
![Docker Pulls](https://img.shields.io/docker/pulls/tigerdockermediocore/duc-docker) [![Automated build on Github Actions](https://github.com/minostauros/duc-docker/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/minostauros/duc-docker/pkgs/container/duc-docker)
![Docker Pulls](https://img.shields.io/docker/pulls/toxic0berliner/duc-docker) [![Automated build on Github Actions](https://github.com/toxic0berliner/duc-docker/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/toxic0berliner/duc-docker/pkgs/container/duc-docker)

Dockerized version of [duc](https://duc.zevv.nl), a disk usage analyzer.
See [docker hub](https://hub.docker.com/r/tigerdockermediocore/duc-docker/) to pull the images.
See [docker hub](https://hub.docker.com/r/toxic0berliner/duc-docker/) to pull the images.

This image has some tweaks to achieve my personal need, but everything is straightforward (see its [github repo](https://github.com/minostauros/duc-docker/)).
This image has some tweaks to achieve my personal need, but everything is straightforward (see its [github repo](https://github.com/toxic0berliner/duc-docker/)).

# Building
Run `docker build -t duc-docker .` then `docker run --rm -it --hostname duc-docker duc-docker bash` to get a shell in the container.

## Usage
### Apache CGI Server
By default, this image will just start up as an apache server for duc databases. Say you have two db files named `one.db`, and `two.db` in your host directoy `/mydbs/` and a database file `/home/myduc.db` . Then running the following command
```sh
docker run -d -p 80:80 -v /mydbs/:/duc/db/:ro -v /home/myduc.db:/duc/.duc.db:ro tigerdockermediocore/duc-docker:latest
```
will provide following web pages
- http://localhost:80/one.cgi <- based on /mydbs/one.db mounted as /duc/db/one.db
- http://localhost:80/two.cgi <- based on /mydbs/two.db mounted as /duc/db/two.db
- http://localhost:80/index.cgi <- based on /home/myduc.db mounted as /duc/.duc.db


### duc Indexing
Mount directories you want to index into `/host` with readonly property. For example,
```sh
docker run -d -v /home:/host/home:ro -v /media:/host/media:ro tigerdockermediocore/duc-docker:latest duc index /host
```
will index `/home` and `/media`, creating `/duc/.duc.db` inside the container. So don't forget to pull out the db file afterward!

## References
- Original duc: https://duc.zevv.nl
- Reference duc-docker: https://hub.docker.com/r/digitalman2112/duc/
- Reference duc-docker: https://github.com/minostauros/duc-docker/
22 changes: 0 additions & 22 deletions assets/000-default.conf

This file was deleted.

72 changes: 0 additions & 72 deletions assets/duc_startup.sh

This file was deleted.

2 changes: 0 additions & 2 deletions assets/ducrc

This file was deleted.

3 changes: 0 additions & 3 deletions assets/index.cgi

This file was deleted.

0 comments on commit cc2a215

Please sign in to comment.