Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8417c65
commit 4a5d3ff
Showing
7 changed files
with
654 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM ubuntu:bionic | ||
|
||
ENV LC_ALL C.UTF-8 | ||
ENV LANG C.UTF-8 | ||
ENV LANGUAGE C.UTF-8 | ||
|
||
RUN apt-get update && apt-get -y install \ | ||
build-essential \ | ||
python3-dev \ | ||
python3-pip \ | ||
libjpeg-dev \ | ||
libfreetype6-dev \ | ||
git \ | ||
curl \ | ||
gettext \ | ||
vim &&\ | ||
apt-get clean | ||
|
||
ADD . /opt/shakal/ | ||
|
||
RUN cd /opt/shakal &&\ | ||
pip3 install --no-cache-dir -r requirements.dev.txt --src /usr/local/src | ||
|
||
RUN useradd -ms /bin/bash -u 1000 shakal && chown -R 1000:1000 /opt/shakal | ||
|
||
USER shakal | ||
WORKDIR /opt/shakal | ||
EXPOSE 8000 | ||
|
||
CMD "/bin/bash" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.PHONY: all compilesprites migrate update update2 resetdb | ||
|
||
PIP=pip3 | ||
DJANGO_MANAGE=/opt/shakal/manage.py | ||
|
||
all: localinstall | ||
dev: sampledata banner runserver | ||
|
||
runserver: | ||
${DJANGO_MANAGE} runserver 0.0.0.0:8000 | ||
|
||
update: | ||
${PIP} install --no-cache-dir -r requirements.dev.txt --src /usr/local/src | ||
${DJANGO_MANAGE} compilesprites | ||
${DJANGO_MANAGE} makemigrations | ||
${DJANGO_MANAGE} migrate | ||
${DJANGO_MANAGE} compilemessages | ||
pull: | ||
cd /opt/shakal && git submodule init && git submodule update | ||
sampledata: | ||
rm -f db.sqlite3 | ||
${DJANGO_MANAGE} compilesprites | ||
${DJANGO_MANAGE} makemigrations | ||
${DJANGO_MANAGE} migrate | ||
${DJANGO_MANAGE} compilemessages | ||
${DJANGO_MANAGE} loaddata forum/data/categories.json | ||
${DJANGO_MANAGE} loaddata news/data/categories.json | ||
${DJANGO_MANAGE} create_sample_data --verbosity 2 | ||
${DJANGO_MANAGE} loaddata wiki/data/pages.json | ||
${DJANGO_MANAGE} rebuild_index --noinput | ||
|
||
resetdb: | ||
rm -f db.sqlite3 | ||
${DJANGO_MANAGE} migrate | ||
${DJANGO_MANAGE} loaddata forum/data/categories.json | ||
${DJANGO_MANAGE} loaddata news/data/categories.json | ||
${DJANGO_MANAGE} create_sample_data | ||
${DJANGO_MANAGE} loaddata wiki/data/pages.json | ||
${DJANGO_MANAGE} rebuild_index --noinput | ||
|
||
banner: | ||
@echo "================================================" | ||
@echo "Inštalácia prebehla úspešne" | ||
@echo "Používateľské meno je admin, heslo demo" | ||
@echo "================================================" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
Nová generácia Shakal CMS | ||
========================= | ||
|
||
Autor: | ||
: Miroslav Bendík | ||
|
||
Inštalácia | ||
---------- | ||
|
||
### Závislosti | ||
|
||
Debian 8 | ||
|
||
sudo apt-get --yes install libjpeg-dev build-essential python3-dev libfreetype6-dev git | ||
|
||
Arch linux: | ||
|
||
pacman -S --needed --noconfirm base-devel python3 libjpeg-turbo freetype2 zlib git | ||
|
||
### Inštalácia virtuálneho prostredia | ||
|
||
wget https://raw.github.com/LinuxOSsk/Shakal-NG/master/install.sh&&chmod +x install.sh&&. ./install.sh | ||
|
||
Skript vytvára v podadresári shakal súbor Makefile, ktorý následne | ||
stiahne a nainštaluje zvyšné závislosti pod bežným používateľom (nie je | ||
potrebný root). | ||
|
||
V prípade zlyhania v niektorom kroku je možné vykonať nápravu a | ||
spustením make v podadresári shakal pokračovať v inštalácii. | ||
|
||
Spustenie a aktualizácia | ||
------------------------ | ||
|
||
Súbor Makefile v podaresári shakal sa dá použiť aj na spúšťanie webu a | ||
jeho aktualizáciu z gitu. | ||
|
||
# spustenie | ||
make run | ||
|
||
# aktualizacia | ||
make update | ||
|
||
Vytvorenie novej db | ||
------------------- | ||
|
||
Zatiaľ nie je dokončený prechod na db migrácie. V niektorých prípadoch | ||
môže po aktualizácii prestať fungovať aplikácia kvôli zmene db modelu. | ||
Ak nevadí vymazanie celej databázy je možné vytvoriť novú db príkazom: | ||
|
||
make resetdb | ||
|
||
Docker | ||
----- | ||
|
||
Spustenie vyvojoveho prostredia je mozne aj pomocou docker-compose | ||
|
||
|
||
git clone https://github.com/LinuxOSsk/Shakal-NG.git | ||
cd Shakal-NG | ||
git submodule init | ||
git submodule update | ||
sudo docker-compose up | ||
|
||
|
||
TODO | ||
==== | ||
|
||
- integrovať <https://linuxjourney.com/> | ||
- hodnotenie článku | ||
- zaplatiť autorovi kávu | ||
- nahlásenie chyby článku | ||
- ponuky práce | ||
- bazár | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '3.5' | ||
services: | ||
web: | ||
build: . | ||
environment: | ||
- DJANGO_SETTINGS_MODULE=web.settings_dev | ||
command: make dev | ||
volumes: | ||
- type: bind | ||
source: ./ | ||
target: /opt/shakal | ||
ports: | ||
- "8000:8000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python3 | ||
import os | ||
import sys | ||
|
||
|
Oops, something went wrong.