[gentoo-commits] proj/forums:initial-setup commit in: /, misc/

2020-02-02 Thread John R. Graham
commit: b475c9df9b323eab1ad2c23d1bc0026b1de596da
Author: John R. Graham  gentoo  org>
AuthorDate: Sat Dec 21 17:19:07 2019 +
Commit: John R. Graham  gentoo  org>
CommitDate: Sun Feb  2 23:20:51 2020 +
URL:https://gitweb.gentoo.org/proj/forums.git/commit/?id=b475c9df

Incremental progress on initial deployment environment.

- Modified setup-workdir script to check out the
  gentoo-docker-images repo.
- Moved the forums.Dockerfile into our repo.

Signed-off-by: John R. Graham  gentoo.org>

 .gitignore |  1 +
 TODO   | 14 +++---
 misc/forums.Dockerfile | 30 ++
 setup-workdir.bash | 42 +-
 4 files changed, 75 insertions(+), 12 deletions(-)

diff --git a/.gitignore b/.gitignore
index 36afc36fd..71e0a966a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 style
 phpbb
+gentoo-docker-images
 *~

diff --git a/TODO b/TODO
index 421b39ed4..cb0ac917e 100644
--- a/TODO
+++ b/TODO
@@ -1,7 +1,7 @@
-[ ] Get my Gentoo public key moved to Triton.
-[ ] Get forums repository checked out on Triton.
-[ ] Get forums.Dockerfile checked in to our repo.
-[ ] Get container repository checked out in our hierarchy. Probably set up by 
the setup-workdir script.
-[ ] Modify container to include nginx and play around until I have a working 
hello world web page.
-[ ] Get a real certificate. Look at the certs on Ceres and try to re-discover 
what was done there.
-[ ] Document the above.
+[X] JRG: Get my Gentoo public key moved to Triton.
+[X] JRG: Get forums repository checked out on Triton.
+[ ] JRG: Get forums.Dockerfile checked in to our repo.
+[X] JRG: Get container repository checked out in our hierarchy. Probably set 
up by the setup-workdir script.
+[ ] JRG: Modify container to include nginx and play around until I have a 
working hello world web page.
+[ ] JRG: Get a real certificate. Look at the certs on Ceres and try to 
re-discover what was done there.
+[ ] JRG: Document the above.

diff --git a/misc/forums.Dockerfile b/misc/forums.Dockerfile
new file mode 100644
index 0..24ac52992
--- /dev/null
+++ b/misc/forums.Dockerfile
@@ -0,0 +1,30 @@
+# name the portage image
+FROM gentoo/portage:latest as portage
+
+# image is based on stage3-amd64
+FROM gentoo/stage3-amd64:latest
+
+# copy the entire portage volume in
+COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo
+
+# continue with image build ...
+RUN emerge -qv dev-lang/php
+RUN emerge -qv www-servers/apache
+RUN emerge -qv app-portage/gentoolkit
+RUN emerge -qv dev-vcs/git
+RUN emerge -qv app-editors/qemacs
+
+# FIXME:
+# Outside the container, check out the release branch of the phpBB.
+# Inside the container:
+# COPY ${path_to_phpbb} /var/www/localhost/htdocs/
+# Outside the container, check out the release branch of the Gentoo-Subsilver 
style.
+# Inside the container:
+# COPY ${path_to_style}/Gentoo-SUBSILVER 
/var/www/localhost/htdocs/styles/Gentoo-SUBSILVER
+
+# Stopgap to prove it's working:
+COPY index.html /var/www/localhost/htdocs/index.html
+COPY startup.bash /root/startup.bash
+
+CMD ["/root/startup.bash"]
+

diff --git a/setup-workdir.bash b/setup-workdir.bash
index 49608d5d9..03465060f 100755
--- a/setup-workdir.bash
+++ b/setup-workdir.bash
@@ -5,7 +5,7 @@ function setup_worktree() {
branch="$2"
 
if [[ -z "$branch" ]] ; then
-   echo "Error in call to setup_branch()."
+   echo "Error in call to setup_worktree()."
exit 1
fi
 
@@ -17,22 +17,54 @@ function setup_worktree() {
 
echo "Adding worktree for ${directory} source from branch 
${branch} ..."
git worktree add ${directory} ${branch}
-   let worktree_count=worktree_count+1
+   let setup_count=setup_count+1
+   else
+   echo "Worktree for ${directory} already set up."
+   fi
+}
+
+function setup_repo() {
+   repo="$1"
+
+   directory=`basename ${repo}`
+   directory=${directory%%.git}
+
+   if [[ -z "$directory" ]] ; then
+   echo "Error in call to setup_repo()."
+   exit 1
+   fi
+
+   if [[ ! -d "${directory}" ]] ; then
+   if [[ -e "${directory}" ]] ; then
+   echo "Error: Strange repository structure found for 
directory \"${directory}\". Cannot continue with the setup."
+   exit 1
+   fi
+
+   echo "Cloning repository ${repo} into ${directory} ..."
+   git clone ${repo}
+   if [[ ! -d "${directory}" ]] ; then
+   echo "Error: Clone did not result in expected directory 
\"${directory}\". Cannot continue with the setup."
+   exit 1
+   fi
+   let setup_count=setup_count+1
+   else
+   echo "Repo for ${directory} already set up."
fi
 }
 
 # set -x
 set -e
 
-worktree_count=0
+set

[gentoo-commits] proj/forums:initial-setup commit in: /

2020-02-02 Thread John R. Graham
commit: fea7dbf19c184b5dcc24027566d90e2e16c0a79d
Author: John R. Graham  gentoo  org>
AuthorDate: Sun Feb  2 22:54:54 2020 +
Commit: John R. Graham  gentoo  org>
CommitDate: Sun Feb  2 23:21:05 2020 +
URL:https://gitweb.gentoo.org/proj/forums.git/commit/?id=fea7dbf1

Just updating TODO list file. Incremental progress.

Signed-off-by: John R. Graham  gentoo.org>

 TODO | 20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/TODO b/TODO
index cb0ac917e..84e77a3a9 100644
--- a/TODO
+++ b/TODO
@@ -1,7 +1,21 @@
 [X] JRG: Get my Gentoo public key moved to Triton.
 [X] JRG: Get forums repository checked out on Triton.
-[ ] JRG: Get forums.Dockerfile checked in to our repo.
-[X] JRG: Get container repository checked out in our hierarchy. Probably set 
up by the setup-workdir script.
+[X] JRG: Get forums.Dockerfile checked in to our repo.
+[X] JRG: Get container repository checked out in our hierarchy. Probably set 
up by the setup-workdir.bash script.
+[ ] JRG: Do a fresh pull of the phpBB repository and push it into the new 
Gentoo upstream repo. Remote should be named
+"upstream". Use the notes provided by Hu on getting this set up. Document 
this setup in README.md
+[ ] JRG: Document the current repo structure in README.md.
 [ ] JRG: Modify container to include nginx and play around until I have a 
working hello world web page.
-[ ] JRG: Get a real certificate. Look at the certs on Ceres and try to 
re-discover what was done there.
+[X] JRG: Locate where certs and keys are stored on ceres. Package is certbot. 
/etc/letsencrypt/...
+[ ] JRG: Get a real certificate. Look at the certs on Ceres and try to 
re-discover what was done there. 
 [ ] JRG: Document the above.
+[ ] JRG: Back up exiting database on ceres.
+[ ] Shut down the phpBB instance on ceres for now.
+[ ] Find database snapshot and restore a fresh copy? Is this necessary? Do it 
just in case. It's on ceres: ~/phpBB3/backup.
+[ ] Modify database scripts to prompt for password. Check them in to the misc 
directory in our repository.
+[X] Locate the command line database conversion tool. Check it in, if 
necessary. Document its use. It's documented in the
+installation documentation.
+[X] Get DNS record fixed so that the sample instance on ceres is accessible 
via hostname.
+[ ] Document the build process for the Docker container.
+[ ] Document the process of starting the Docker container with the appropriate 
directories mounted.
+[ ] Work through an install on Triton



[gentoo-commits] proj/forums:initial-setup commit in: /

2019-12-21 Thread John R. Graham
commit: 02c0c06f26ea98da16d2f43ed58358e9200d7bbd
Author: John R. Graham  gentoo  org>
AuthorDate: Sat Dec 21 16:01:18 2019 +
Commit: John R. Graham  gentoo  org>
CommitDate: Sat Dec 21 16:02:21 2019 +
URL:https://gitweb.gentoo.org/proj/forums.git/commit/?id=02c0c06f

Added README-first and TODO list files.

Signed-off-by: John R. Graham  gentoo.org>

 README-first | 7 +++
 TODO | 7 +++
 2 files changed, 14 insertions(+)

diff --git a/README-first b/README-first
new file mode 100644
index 0..9adb78720
--- /dev/null
+++ b/README-first
@@ -0,0 +1,7 @@
+Run the setup-workdir.bash script right after you clone this repository.
+
+Although there are multiple logical ways the working directory could be
+structured, all of the documentation is in the context of the structure
+created by that script.
+
+See README.md for additional details.

diff --git a/TODO b/TODO
new file mode 100644
index 0..421b39ed4
--- /dev/null
+++ b/TODO
@@ -0,0 +1,7 @@
+[ ] Get my Gentoo public key moved to Triton.
+[ ] Get forums repository checked out on Triton.
+[ ] Get forums.Dockerfile checked in to our repo.
+[ ] Get container repository checked out in our hierarchy. Probably set up by 
the setup-workdir script.
+[ ] Modify container to include nginx and play around until I have a working 
hello world web page.
+[ ] Get a real certificate. Look at the certs on Ceres and try to re-discover 
what was done there.
+[ ] Document the above.



[gentoo-commits] proj/forums:initial-setup commit in: /

2019-12-21 Thread John R. Graham
commit: 772f4e506dab25ae39eea0602d14371bfabfbc36
Author: John R. Graham  gentoo  org>
AuthorDate: Thu Dec 19 12:28:44 2019 +
Commit: John R. Graham  gentoo  org>
CommitDate: Thu Dec 19 12:28:44 2019 +
URL:https://gitweb.gentoo.org/proj/forums.git/commit/?id=772f4e50

setup-workdir.bash script now actually works.

Signed-off-by: John R. Graham  gentoo.org>

 workdir-setup.bash => setup-workdir.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/workdir-setup.bash b/setup-workdir.bash
similarity index 87%
rename from workdir-setup.bash
rename to setup-workdir.bash
index 2fcfd2b3c..49608d5d9 100755
--- a/workdir-setup.bash
+++ b/setup-workdir.bash
@@ -26,8 +26,8 @@ set -e
 
 worktree_count=0
 
-setup_worktree phpbb refs/heads/origin/3.2.x
-setup_worktree style refs/heads/styles/Gentoo-SUBSILVER
+setup_worktree phpbb origin/3.2.x
+setup_worktree style styles/Gentoo-SUBSILVER
 
 if [[ $worktree_count -eq 0 ]] ; then
echo "Working directory already set up."



[gentoo-commits] proj/forums:initial-setup commit in: /

2019-12-14 Thread John R. Graham
commit: 3d1b803c553435a85074e95a16da9b0cb674fc73
Author: John R. Graham  gentoo  org>
AuthorDate: Sat Dec 14 19:19:18 2019 +
Commit: John R. Graham  gentoo  org>
CommitDate: Sat Dec 14 19:28:03 2019 +
URL:https://gitweb.gentoo.org/proj/forums.git/commit/?id=3d1b803c

Created branch to work on the initial pass at repo setup.

Also going to work on the forum installation instructions here.

Signed-off-by: John R. Graham  gentoo.org>

 .gitignore |  3 +++
 workdir-setup.bash | 38 ++
 2 files changed, 41 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0..36afc36fd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+style
+phpbb
+*~

diff --git a/workdir-setup.bash b/workdir-setup.bash
new file mode 100755
index 0..2fcfd2b3c
--- /dev/null
+++ b/workdir-setup.bash
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+function setup_worktree() {
+   directory="$1"
+   branch="$2"
+
+   if [[ -z "$branch" ]] ; then
+   echo "Error in call to setup_branch()."
+   exit 1
+   fi
+
+   if [[ ! -d "${directory}" ]] ; then
+   if [[ -e "${directory}" ]] ; then
+   echo "Error: Strange repository structure found for 
directory \"${directory}\". Cannot continue with the setup."
+   exit 1
+   fi
+
+   echo "Adding worktree for ${directory} source from branch 
${branch} ..."
+   git worktree add ${directory} ${branch}
+   let worktree_count=worktree_count+1
+   fi
+}
+
+# set -x
+set -e
+
+worktree_count=0
+
+setup_worktree phpbb refs/heads/origin/3.2.x
+setup_worktree style refs/heads/styles/Gentoo-SUBSILVER
+
+if [[ $worktree_count -eq 0 ]] ; then
+   echo "Working directory already set up."
+else
+   echo "Working directory setup complete."
+fi
+
+echo