Dockerfile
... ...
@@ -1,20 +1,26 @@
1
-FROM ruby:3.0
1
+FROM ubuntu:22.04
2 2
## Apt
3
-RUN apt-get -y update
4
-RUN apt-get -y install libicu-dev cmake git cron nginx && rm -rf /var/lib/apt/lists/*
3
+RUN apt-get update
4
+RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y ruby ruby-dev make zlib1g-dev libicu-dev build-essential git cmake
5
+RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y libssl-dev asciidoc pkg-config nginx certbot python3-certbot-nginx
6
+RUN rm -rf /var/lib/apt/lists/*
5 7
6 8
# Install
7
-RUN gem install github-linguist
9
+RUN gem install github-markdown
8 10
RUN gem install gollum
9
-RUN gem install org-ruby
10 11
11
-RUN git config --global url."https://{token}:@github.com/".insteadOf "https://github.com/"
12
-RUN cd / && git clone https://github.com/stubbornspace/spacewiki.git
13
-# setup cron
14
-RUN chmod 0755 /spacewiki/git-push.sh
15
-RUN /usr/bin/crontab /spacewiki/cron.txt
12
+COPY nginx.conf /etc/nginx/sites-available/spacewiki
13
+RUN rm /etc/nginx/sites-enabled/default
14
+RUN ln -s /etc/nginx/sites-available/spacewiki /etc/nginx/sites-enabled/spacewiki
15
+
16
+RUN useradd -ms /bin/bash gollum
17
+RUN mkdir -p /spacewiki
18
+#COPY . /spacewiki/
19
+#RUN chown -R gollum /spacewiki
16 20
17 21
# Run
18
-EXPOSE 4567
22
+EXPOSE 4567 80 443
19 23
WORKDIR /spacewiki
20
-ENTRYPOINT gollum --css --allow-uploads --port 4567
24
+
25
+#USER gollum
26
+ENTRYPOINT tail -f /dev/null
README.md
... ...
@@ -1 +1,28 @@
1
-wiki
1
+# Spacewiki
2
+
3
+## wiki
4
+docker build -t spacewiki:latest .
5
+docker run -d -v $(pwd):/spacewiki -p 4567:4567 spacewiki
6
+
7
+## HTTPS Proxy
8
+1. run ngin
9
+## Cron
10
+``
11
+# Backup script daily at 3 AM
12
+0 3 * * * /path/to/spacewiki/gitbackup.sh
13
+``
14
+
15
+## Golum on nginx:lastest
16
+sudo apt update
17
+sudo apt install -y pkg-config ruby ruby-dev make zlib1g-dev libicu-dev build-essential git asciidoc cmake
18
+
19
+sudo apt-get install ruby ruby-dev make zlib1g-dev libicu-dev build-essential git cmake libssl-dev
20
+
21
+sudo gem install gollum
22
+
23
+gem install gollum
24
+gem install github-markdown
25
+
26
+
27
+apt-get install python3-pip libkrb5-dev
28
+pip install gssapi
... ...
\ No newline at end of file
command.sh
... ...
@@ -0,0 +1,5 @@
1
+## setup https
2
+certbot run -n --nginx --agree-tos -d stubbornspace.com -m stubbornspace@gmail.com --redirect
3
+
4
+## switch to gollum and gun gollum
5
+cd /spacewiki && gollum --css --allow-uploads --port 4567
fosi.md
... ...
@@ -0,0 +1 @@
1
+sdfsdfsd
... ...
\ No newline at end of file
gitbackup.sh
... ...
@@ -0,0 +1,5 @@
1
+## Backup
2
+git add *
3
+git commit -m "nightly backup$(date)"
4
+git push
5
+echo "backup completed $(date)"
nginx.conf
... ...
@@ -0,0 +1,28 @@
1
+
2
+server {
3
+ listen 80;
4
+ listen [::]:80;
5
+ server_name stubbornspace.com;
6
+
7
+ access_log /var/log/nginx/access.log main;
8
+
9
+ #location / {
10
+ # root /usr/share/nginx/html;
11
+ # index index.html index.htm;
12
+ #}
13
+
14
+ location / {
15
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
16
+ proxy_set_header X-Forwarded-Proto $scheme;
17
+ proxy_set_header X-Real-IP $remote_addr;
18
+ proxy_set_header Host $http_host;
19
+ proxy_pass http://127.0.0.1:4567;
20
+ }
21
+ client_max_body_size 10m;
22
+
23
+ error_page 500 502 503 504 /50x.html;
24
+ location = /50x.html {
25
+ root /usr/share/nginx/html;
26
+ }
27
+}
28
+