mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Reinclude create_db.sql
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -125,7 +125,6 @@ dmypy.json
|
|||||||
# End of https://www.gitignore.io/api/python
|
# End of https://www.gitignore.io/api/python
|
||||||
0
|
0
|
||||||
config.backup.json
|
config.backup.json
|
||||||
create_db.sql
|
|
||||||
uwsgi.ini
|
uwsgi.ini
|
||||||
installer.log
|
installer.log
|
||||||
pyshelf_nginx.conf
|
pyshelf_nginx.conf
|
||||||
|
|||||||
7
Dockerfile
vendored
7
Dockerfile
vendored
@@ -1,16 +1,19 @@
|
|||||||
FROM archlinux:latest
|
FROM archlinux:latest
|
||||||
RUN pacman -Syy
|
RUN pacman -Syy
|
||||||
RUN pacman -Syu --noconfirm
|
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 useradd pyshelf && chpasswd pyshelf:pyshelf
|
||||||
RUN mkdir -p /srv/Books && mkdir -p /srv/http && \
|
RUN mkdir -p /srv/Books && mkdir -p /srv/http && \
|
||||||
chown -R http.pyshelf /srv/Books && chown -R http.pyshelf /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']
|
VOLUME ['/srv/Books','/srv/http']
|
||||||
ENV nginx_conf /etc/nginx/nginx.conf
|
ENV nginx_conf /etc/nginx/nginx.conf
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
WORKDIR /srv/http
|
WORKDIR /srv/http
|
||||||
RUN git clone https://github.com/th3r00t/pyShelf.git /srv/http && \
|
RUN git clone https://github.com/th3r00t/pyShelf.git /srv/http && \
|
||||||
git checkout 0.5.0--docker && pip install -r requirements.txt
|
git checkout 0.5.0--docker && pip install -r requirements.txt
|
||||||
|
RUN sudo -u postgres psql -f create_db.sql
|
||||||
EXPOSE 80 22 8000
|
EXPOSE 80 22 8000
|
||||||
RUN gunicorn pyShelf.wsgi 8000:8000
|
RUN gunicorn pyShelf.wsgi 8000:8000
|
||||||
|
|||||||
1
create_db.sql
vendored
Executable file
1
create_db.sql
vendored
Executable file
@@ -0,0 +1 @@
|
|||||||
|
CREATE DATABASE 'pyshelf'; CREATE USER 'pyshelf' WITH PASSWORD 'pyshelf'; GRANT ALL PRIVILEGES ON DATABASE 'pyshelf' TO 'pyshelf';
|
||||||
3
installer
vendored
3
installer
vendored
@@ -307,9 +307,6 @@ if RequiredServices().db_server_found(req) is False:
|
|||||||
# sql_user = config["USER"]
|
# sql_user = config["USER"]
|
||||||
sql_user = "pyshelf"
|
sql_user = "pyshelf"
|
||||||
db_name = "pyshelf"
|
db_name = "pyshelf"
|
||||||
import pudb
|
|
||||||
|
|
||||||
pudb.set_trace()
|
|
||||||
psql_cmd = (
|
psql_cmd = (
|
||||||
"CREATE DATABASE %s; CREATE USER %s WITH PASSWORD '%s'; GRANT ALL PRIVILEGES ON DATABASE %s TO %s;"
|
"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)
|
% (db_name, sql_user, sql_pass, db_name, sql_user)
|
||||||
|
|||||||
Reference in New Issue
Block a user