wiki:Tracalpine

Version 8 (modified by krit, 2 months ago) (diff)

--

Trac Alpine

Create the run.sh file for use to create the project and user admin with password

krit docker trac-alpine$ cat run.sh 
#!/usr/bin/env bash

# Create Trac project

if [ -f /trac/VERSION ]; then
        echo "Project already exists here"
else
        echo "Creating a new project"
        trac-admin /trac initenv $projectname sqlite:db/trac.db 
        trac-admin /trac permission add $user $password
        trac-admin /trac permission add $user TRAC_ADMIN
        htpasswd -cb .htpass $user $password
fi

#tracd --port 8000 /trac
tracd --port 8000 --basic-auth="*,/trac/.htpass,realmname" /trac/
krit docker trac-alpine$ 

Create Dockerfile with content in following

FROM alpine:3.11
RUN apk add --no-cache --upgrade bash
ENV projectname="FoodFact"
ENV user="admin"
ENV password="admin"
RUN apk update && apk upgrade
RUN apk add trac
RUN apk add apache2
RUN apk add apache2-utils
RUN mkdir /trac
COPY run.sh /
RUN chmod +x /run.sh
EXPOSE 8000
ENTRYPOINT "/run.sh" && /bin/ash

Then, we build the docker image with tag trac:alpine311

[krit docker trac-alpine]$ cat howtorun.txt 
docker build -t trac:alpine311 .
#docker run -it -v ./myprojects:/trac --name trac -p 8000:8000 trac:alpine311 /bin/ash
docker run -it -d --restart unless-stopped -v ./myprojects:/trac --name trac -p 8000:8000 trac:alpine311 /bin/ash
[krit docker trac-alpine]$ 

After docker container start, we exec -it in container to check permission

/trac # trac-admin . permission list

User           Action
------------------------------
admin          TRAC_ADMIN
anonymous      BROWSER_VIEW
anonymous      CHANGESET_VIEW
anonymous      FILE_VIEW
anonymous      LOG_VIEW
anonymous      MILESTONE_VIEW
anonymous      REPORT_SQL_VIEW
anonymous      REPORT_VIEW
anonymous      ROADMAP_VIEW
anonymous      SEARCH_VIEW
anonymous      TICKET_VIEW
anonymous      TIMELINE_VIEW
anonymous      WIKI_VIEW
authenticated  TICKET_CREATE
authenticated  TICKET_MODIFY
authenticated  WIKI_CREATE
authenticated  WIKI_MODIFY


Available actions:
 BROWSER_VIEW, CHANGESET_VIEW, CONFIG_VIEW, EMAIL_VIEW, FILE_VIEW,
 LOG_VIEW, MILESTONE_ADMIN, MILESTONE_CREATE, MILESTONE_DELETE,
 MILESTONE_MODIFY, MILESTONE_VIEW, PERMISSION_ADMIN, PERMISSION_GRANT,
 PERMISSION_REVOKE, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE,
 REPORT_MODIFY, REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW,
 SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_BATCH_MODIFY,
 TICKET_CHGPROP, TICKET_CREATE, TICKET_EDIT_CC, TICKET_EDIT_COMMENT,
 TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW,
 TRAC_ADMIN, VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE,
 WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW

/trac # 

Attachments (2)

Download all attachments as: .zip