diff --git a/README.md b/README.md index 8ee4254b2..546dace0c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,15 @@ This is the code for OrcPub2.com. Many, many people have expressed interest in helping out or checking out the code, so I have decided to make that possible by open sourcing it. +## Running + +To run a local instance of Orcpub, all you need is Docker, docker-compose, and the `docker-compose.yml` file and an SSL certificate. Simply edit the paths to the SSL certificate and key in the `web** service definition and run the following: + + docker-compose pull + docker-compose up -d + +**NOTE:** If you need a quick SSL certificate, the script at `deploy/snakeoil.sh` will generate one. Links to Docker installation can be found [below](#with-docker). + ## Getting Started with Development ### With docker diff --git a/deploy/nginx.conf b/deploy/nginx.conf index 34a375a75..f590ec6cd 100644 --- a/deploy/nginx.conf +++ b/deploy/nginx.conf @@ -1,4 +1,5 @@ server { + listen 80; listen 443 ssl; server_name localhost; diff --git a/docker-compose.yaml b/docker-compose.yaml index 25c4d15bf..d2c05d408 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,12 +2,10 @@ version: '3' services: orcpub: - image: demonsthere/orcpub:orcpub - # build: - # context: docker/orcpub - # args: - # REPO: Orcpub - # BRANCH: develop + image: orcpub/orcpub:orcpub + build: + context: . + dockerfile: docker/orcpub/Dockerfile environment: PORT: 8890 EMAIL_SERVER_URL: '' @@ -21,7 +19,10 @@ services: - datomic restart: always datomic: - image: demonsthere/orcpub:datomic + image: orcpub/orcpub:datomic + build: + context: . + dockerfile: docker/datomic/Dockerfile volumes: - ./data:/data restart: always @@ -36,3 +37,4 @@ services: - ./deploy/snakeoil.key:/etc/nginx/snakeoil.key depends_on: - orcpub + restart: always diff --git a/docker/datomic/Dockerfile b/docker/datomic/Dockerfile index a29498216..b9989a86c 100644 --- a/docker/datomic/Dockerfile +++ b/docker/datomic/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get update &&\ ADD https://my.datomic.com/downloads/free/${DATOMIC_VERSION} /tmp/datomic.zip RUN unzip /tmp/datomic.zip && rm /tmp/datomic.zip &&\ - mv datomic-free-${DATOMIC_VERSION} datomic + mv datomic-free-${DATOMIC_VERSION} /datomic ADD ./docker/datomic/transactor.properties /datomic/transactor.properties VOLUME /data diff --git a/docker/orcpub/Dockerfile b/docker/orcpub/Dockerfile index 80ecae343..f30f97a22 100644 --- a/docker/orcpub/Dockerfile +++ b/docker/orcpub/Dockerfile @@ -1,19 +1,19 @@ FROM clojure:openjdk-8-lein as builder MAINTAINER daemonsthere@gmail.com -ARG REPO="Orcpub" -ARG BRANCH="develop" +# Build cache layer +WORKDIR /orcpub +COPY project.clj /orcpub/ +RUN lein deps -# Get orcpub source ADD ./ /orcpub -WORKDIR /orcpub RUN printenv &&\ lein uberjar FROM openjdk:8-jre-alpine as runner MAINTAINER daemonsthere@gmail.com -COPY --from=builder /opt/orcpub/target/orcpub.jar /orcpub.jar +COPY --from=builder /orcpub/target/orcpub.jar /orcpub.jar ENTRYPOINT ["java", "-jar"] CMD ["/orcpub.jar"] diff --git a/src/clj/orcpub/email.clj b/src/clj/orcpub/email.clj index 5ad8ea5ff..f45eb4f9f 100644 --- a/src/clj/orcpub/email.clj +++ b/src/clj/orcpub/email.clj @@ -28,7 +28,7 @@ {:user (environ/env :email-access-key) :pass (environ/env :email-secret-key) :host (environ/env :email-server-url) - :port (Integer/parseInt (environ/env :email-server-port))}) + :port (Integer/parseInt (or (environ/env :email-server-port) "587"))}) (defn send-verification-email [base-url {:keys [email username first-and-last-name]} verification-key] (postal/send-message (email-cfg) diff --git a/src/cljc/orcpub/dnd/e5/views_2.cljc b/src/cljc/orcpub/dnd/e5/views_2.cljc index e71807296..118d81d63 100644 --- a/src/cljc/orcpub/dnd/e5/views_2.cljc +++ b/src/cljc/orcpub/dnd/e5/views_2.cljc @@ -40,7 +40,7 @@ (defn legal-footer [] [:div.m-l-15.m-b-10.m-t-10.t-a-l - [:span "© 2018 OrcPub"] + [:span "© 2019 OrcPub"] [:a.m-l-5 {:href "/terms-of-use" :target :_blank} "Terms of Use"] [:a.m-l-5 {:href "/privacy-policy" :target :_blank} "Privacy Policy"]]) @@ -65,8 +65,8 @@ [:a {:style (style orange-style) :href "/privacy-policy" :target :_blank} "Privacy Policy"] [:a.m-l-5 {:style (orange-style {:margin-left "5px"}) :href "/terms-of-use" :target :_blank} "Terms of Use"]] [:div.legal-footer - [:p "© 2018 OrcPub" [:span {:style (style {:margin-left "20px"})} "Contact: " [:a {:href "mailto:redorc@orcpub.com"} "redorc@orcpub.com"]]] - [:p "Wizards of the Coast, Dungeons & Dragons, D&D, and their logos are trademarks of Wizards of the Coast LLC in the United States and other countries. © 2017 Wizards. All Rights Reserved. OrcPub.com is not affiliated with, endorsed, sponsored, or specifically approved by Wizards of the Coast LLC."]]]) + [:p "© 2019 OrcPub" [:span {:style (style {:margin-left "20px"})} "Contact: " [:a {:href "mailto:redorc@orcpub.com"} "redorc@orcpub.com"]]] + [:p "Wizards of the Coast, Dungeons & Dragons, D&D, and their logos are trademarks of Wizards of the Coast LLC in the United States and other countries. © 2019 Wizards. All Rights Reserved. OrcPub.com is not affiliated with, endorsed, sponsored, or specifically approved by Wizards of the Coast LLC."]]]) (defn splash-page [] [:div.app @@ -93,7 +93,7 @@ :font-weight :bold :font-size "14px" :height "48px"})} - "version 2.0"] + "version 2.0 - community edition"] [:div {:style (style {:display :flex diff --git a/src/cljs/orcpub/dnd/e5/views.cljs b/src/cljs/orcpub/dnd/e5/views.cljs index 5baf8358f..d7b040417 100644 --- a/src/cljs/orcpub/dnd/e5/views.cljs +++ b/src/cljs/orcpub/dnd/e5/views.cljs @@ -1555,8 +1555,8 @@ [:a.orange {:href "/privacy-policy" :target :_blank} "Privacy Policy"] [:a.orange.m-l-5 {:href "/terms-of-use" :target :_blank} "Terms of Use"]] [:div.legal-footer - [:p "© 2018 OrcPub" [:span.m-l-20 "Contact: " [:a {:href "mailto:redorc@orcpub.com"} "redorc@orcpub.com"]]] - [:p "Wizards of the Coast, Dungeons & Dragons, D&D, and their logos are trademarks of Wizards of the Coast LLC in the United States and other countries. © 2018 Wizards. All Rights Reserved. OrcPub.com is not affiliated with, endorsed, sponsored, or specifically approved by Wizards of the Coast LLC."]]] + [:p "© 2019 OrcPub" [:span.m-l-20 "Contact: " [:a {:href "mailto:redorc@orcpub.com"} "redorc@orcpub.com"]]] + [:p "Wizards of the Coast, Dungeons & Dragons, D&D, and their logos are trademarks of Wizards of the Coast LLC in the United States and other countries. © 2019 Wizards. All Rights Reserved. OrcPub.com is not affiliated with, endorsed, sponsored, or specifically approved by Wizards of the Coast LLC."]]] [debug-data]]]])])) (def row-style