Reinclude create_db.sql

This commit is contained in:
Raelon Masters
2020-04-07 10:00:25 -04:00
parent 47bff56119
commit b27ef2b0c1
4 changed files with 6 additions and 6 deletions

1
.gitignore vendored
View File

@@ -125,7 +125,6 @@ dmypy.json
# End of https://www.gitignore.io/api/python
0
config.backup.json
create_db.sql
uwsgi.ini
installer.log
pyshelf_nginx.conf

7
Dockerfile vendored
View File

@@ -1,16 +1,19 @@
FROM archlinux:latest
RUN pacman -Syy
RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm python python-pip git openssh
RUN pacman -S --noconfirm python python-pip git openssh postgresql
RUN sudo -u postgres initdb --locale=en_US.UTF-8 -E UTF8 -D /var/lib/postgres/data
RUN systemctl enable postgresql && systemctl start postgresql
RUN useradd pyshelf && chpasswd pyshelf:pyshelf
RUN mkdir -p /srv/Books && mkdir -p /srv/http && \
chown -R http.pyshelf /srv/Books && chown -R http.pyshelf /srv/http
RUN systemctl enable sshd
RUN systemctl enable sshd && systemctl start sshd
VOLUME ['/srv/Books','/srv/http']
ENV nginx_conf /etc/nginx/nginx.conf
ENV PYTHONUNBUFFERED 1
WORKDIR /srv/http
RUN git clone https://github.com/th3r00t/pyShelf.git /srv/http && \
git checkout 0.5.0--docker && pip install -r requirements.txt
RUN sudo -u postgres psql -f create_db.sql
EXPOSE 80 22 8000
RUN gunicorn pyShelf.wsgi 8000:8000

1
create_db.sql vendored Executable file
View File

@@ -0,0 +1 @@
CREATE DATABASE 'pyshelf'; CREATE USER 'pyshelf' WITH PASSWORD 'pyshelf'; GRANT ALL PRIVILEGES ON DATABASE 'pyshelf' TO 'pyshelf';

3
installer vendored
View File

@@ -307,9 +307,6 @@ if RequiredServices().db_server_found(req) is False:
# sql_user = config["USER"]
sql_user = "pyshelf"
db_name = "pyshelf"
import pudb
pudb.set_trace()
psql_cmd = (
"CREATE DATABASE %s; CREATE USER %s WITH PASSWORD '%s'; GRANT ALL PRIVILEGES ON DATABASE %s TO %s;"
% (db_name, sql_user, sql_pass, db_name, sql_user)