Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
website
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai
website
Commits
db1fbfd3
Commit
db1fbfd3
authored
Aug 30, 2019
by
agata
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'magutt' of git.autistici.org:ai/website into magutt
parents
d366bf43
cc109085
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
48 deletions
+35
-48
.gitlab-ci.yml
.gitlab-ci.yml
+1
-17
Dockerfile
Dockerfile
+16
-0
README.md
README.md
+15
-0
docker/Dockerfile
docker/Dockerfile
+0
-11
docker/build.sh
docker/build.sh
+3
-14
docker/conf/apache2/sites-available/000-default.conf
docker/conf/apache2/sites-available/000-default.conf
+0
-6
No files found.
.gitlab-ci.yml
View file @
db1fbfd3
...
...
@@ -2,7 +2,6 @@ image: docker:latest
stages
:
-
build
-
docker_build
-
release
services
:
...
...
@@ -13,27 +12,12 @@ variables:
RELEASE_TAG
:
$CI_REGISTRY_IMAGE:latest
GIT_SUBMODULE_STRATEGY
:
recursive
build
:
stage
:
build
image
:
"
debian:stretch"
script
:
-
apt-get -q update && apt-get -y install golang git
-
./scripts/lint.sh
-
./scripts/update.sh
-
tar -c -z -f site.tgz public index templates
artifacts
:
paths
:
-
site.tgz
docker_build
:
stage
:
docker_
build
stage
:
build
script
:
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.git.autistici.org
-
tar -x -z -f site.tgz -C docker
-
docker build --build-arg ci_token=$CI_JOB_TOKEN --pull -t $IMAGE_TAG docker
-
docker push $IMAGE_TAG
dependencies
:
-
build
release
:
stage
:
release
...
...
Dockerfile
0 → 100644
View file @
db1fbfd3
FROM
debian:stable AS build
ADD
. /src
RUN
apt-get
-q
update
&&
env
DEBIAN_FRONTEND
=
noninteractive apt-get
-qy
install
--no-install-recommends
rsync git golang ca-certificates
&&
cd
/src
&&
./scripts/lint.sh
&&
./scripts/update.sh
FROM
registry.git.autistici.org/ai3/docker/apache2-base:master
COPY
--from=build /src/public /var/www/autistici.org
COPY
--from=build /src/build/bin/sitesearch /usr/sbin/sitesearch
COPY
--from=build /src/index /var/lib/sitesearch/index
COPY
templates /var/lib/sitesearch/templates
COPY
docker/conf /tmp/conf
COPY
docker/build.sh /tmp/build.sh
RUN
/tmp/build.sh
&&
rm
/tmp/build.sh
ENTRYPOINT
["/usr/local/bin/chaperone"]
README.md
View file @
db1fbfd3
...
...
@@ -71,6 +71,21 @@ The resulting HTML pages will be found in the `public` directory.
## How to run a test webserver
### Docker
The preferred way, which avoids installing an entire Debian
distribution, would be to use Docker. Build the image with:
$ docker build -t ai-website .
and run it with:
$ docker run -P 8080
it should then be visible at http://localhost:8080/.
### debootstrap
To check the results of your edits, it is useful to start a local
webserver to inspect the generated HTML pages. In general, you
might want to avoid installing the Apache packages on your local
...
...
docker/Dockerfile
deleted
100644 → 0
View file @
d366bf43
FROM
registry.git.autistici.org/ai3/docker/apache2-base:master
COPY
public /var/www/autistici.org
COPY
index /var/lib/sitesearch/index
COPY
templates /var/lib/sitesearch/templates
COPY
conf /tmp/conf
COPY
build.sh /tmp/build.sh
RUN
/tmp/build.sh
&&
rm
/tmp/build.sh
ENTRYPOINT
["/usr/local/bin/chaperone"]
docker/build.sh
View file @
db1fbfd3
...
...
@@ -12,9 +12,7 @@
BUILD_PACKAGES
=
"rsync"
# Packages required to serve the website and run the services.
# We have to keep the python3 packages around in order to run
# chaperone (installed via pip).
PACKAGES
=
"ai-webtools"
PACKAGES
=
""
APACHE_MODULES_ENABLE
=
"
headers
...
...
@@ -24,10 +22,6 @@ APACHE_MODULES_ENABLE="
proxy_http
"
APACHE_SITES
=
"
main
"
# The default bitnami/minideb image defines an 'install_packages'
# command which is just a convenient helper. Define our own in
# case we are using some other Debian image.
...
...
@@ -37,21 +31,16 @@ if [ "x$(which install_packages)" = "x" ]; then
}
fi
# Install the main A/I package repository.
install_packages curl gnupg
echo
"deb http://deb.autistici.org/urepo stretch-ai/"
>
/etc/apt/sources.list.d/ai.list
curl
-s
http://deb.autistici.org/repo.key | apt-key add -
apt-get
-q
update
set
-e
umask
022
install_packages
${
BUILD_PACKAGES
}
${
PACKAGES
}
chmod
-R
go-w /tmp/conf
rsync
-a
/tmp/conf/ /etc/
# Setup Apache.
a2enmod
-q
${
APACHE_MODULES_ENABLE
}
a2ensite
${
APACHE_SITES
}
# Make sure that files are readable.
chmod
-R
a+rX /var/lib/sitesearch
...
...
docker/conf/apache2/sites-available/
main
.conf
→
docker/conf/apache2/sites-available/
000-default
.conf
View file @
db1fbfd3
...
...
@@ -34,12 +34,6 @@
# Rewrite rules are used to preserve the old links.
RewriteEngine
On
# Force HTTPS for all URLs, unless you are connecting
# to the hidden service.
RewriteCond
%{
HTTP
:
X
-
Forwarded
-
Proto
} !=
https
RewriteCond
%{
HTTP_HOST
} !\.
onion
$
RewriteRule
^/(.*)$
https
://%{
HTTP_HOST
}/$
1
$
2
[
R
,
L
]
# Remove the old language prefix from the URLs.
RewriteRule
^/(
it
|
en
|
cat
|
de
|
es
|
pt
|
fr
)/(.*)$ /$
2
[
R
=
301
,
L
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment