mirror of
https://github.com/wallabag/docker
synced 2025-12-13 17:56:31 +00:00
Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90265c1653 | ||
|
|
fb020c3be6 | ||
|
|
80a3379a76 | ||
|
|
5203ab63b1 | ||
|
|
65b2e2c7a9 | ||
|
|
4de27027b9 | ||
|
|
924d663c86 | ||
|
|
ec8f599298 | ||
|
|
125aad2c1c | ||
|
|
606b7d681c | ||
|
|
fdaaf37381 | ||
|
|
2b13ed0703 | ||
|
|
e41a237604 | ||
|
|
724d6492bc | ||
|
|
267618a519 | ||
|
|
0fe227a0cc | ||
|
|
d42d34cdac | ||
|
|
58cc845c75 | ||
|
|
c553787564 | ||
|
|
73187d7ce1 | ||
|
|
f7bd58c73a | ||
|
|
ba8f6ec5d3 | ||
|
|
68db53e09c | ||
|
|
530e59329a | ||
|
|
2ae7dee8af | ||
|
|
c2052c2681 | ||
|
|
310d55bdea | ||
|
|
76f5ecb61e | ||
|
|
92f5db7ba9 | ||
|
|
ee4a7e4a46 | ||
|
|
e0bc4e895d | ||
|
|
ed6b4437b8 | ||
|
|
af2fb30389 | ||
|
|
af6c68a312 | ||
|
|
1f4d9af316 | ||
|
|
6a5ab7c126 | ||
|
|
f66d2aeab0 | ||
|
|
0d2bf2999a | ||
|
|
8bd298316a | ||
|
|
d9f9efcf13 | ||
|
|
cccc5fb91e | ||
|
|
79ae48bfac | ||
|
|
d0691598b6 | ||
|
|
28b4b03b21 | ||
|
|
c65be008ec | ||
|
|
63ee463365 | ||
|
|
efbcf75701 | ||
|
|
b4b1469215 | ||
|
|
4a81bc45db | ||
|
|
107beb115c | ||
|
|
67030c1c36 | ||
|
|
255fe53dfc | ||
|
|
4094d3c9ff | ||
|
|
93651c95f5 | ||
|
|
97783ac312 | ||
|
|
b165d3c14f |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.cache
|
||||||
|
__pycache__/*
|
||||||
|
*.pyc
|
||||||
26
.travis.yml
Normal file
26
.travis.yml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
language: python
|
||||||
|
|
||||||
|
python:
|
||||||
|
- 3.5
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
env:
|
||||||
|
- DB_TYPE=default
|
||||||
|
- DB_TYPE=sqlite
|
||||||
|
- DB_TYPE=mariadb
|
||||||
|
- DB_TYPE=postgresql
|
||||||
|
|
||||||
|
install:
|
||||||
|
- docker-compose -f tests/docker-compose.$DB_TYPE.yml build
|
||||||
|
- docker-compose -f tests/docker-compose.$DB_TYPE.yml up -d
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- pip install pytest
|
||||||
|
- pip install requests
|
||||||
|
|
||||||
|
script:
|
||||||
|
- docker ps | grep -q wallabag
|
||||||
|
- sleep 60
|
||||||
|
- py.test tests/
|
||||||
21
Dockerfile
21
Dockerfile
@@ -1,19 +1,8 @@
|
|||||||
FROM alpine:edge
|
FROM alpine:edge
|
||||||
MAINTAINER Marvin Steadfast <marvin@xsteadfastx.org>
|
MAINTAINER Marvin Steadfast <marvin@xsteadfastx.org>
|
||||||
|
|
||||||
ENV WALLABAG_VERSION=2.0.6 \
|
ARG WALLABAG_VERSION=2.2.1
|
||||||
SYMFONY__ENV__DATABASE_DRIVER=pdo_sqlite \
|
ARG POSTGRES_USER=postgres
|
||||||
SYMFONY__ENV__DATABASE_HOST=127.0.0.1 \
|
|
||||||
SYMFONY__ENV__DATABASE_PORT=~ \
|
|
||||||
SYMFONY__ENV__DATABASE_NAME=symfony \
|
|
||||||
SYMFONY__ENV__DATABASE_USER=root \
|
|
||||||
SYMFONY__ENV__DATABASE_PASSWORD=~ \
|
|
||||||
SYMFONY__ENV__SECRET=ovmpmAWXRCabNlMgzlzFXDYmCFfzGv \
|
|
||||||
SYMFONY__ENV__MAILER_HOST=127.0.0.1 \
|
|
||||||
SYMFONY__ENV__MAILER_USER=~ \
|
|
||||||
SYMFONY__ENV__MAILER_PASSWORD=~ \
|
|
||||||
SYMFONY__ENV__FROM_EMAIL=wallabag@example.com
|
|
||||||
|
|
||||||
|
|
||||||
RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
||||||
&& apk add --update \
|
&& apk add --update \
|
||||||
@@ -25,6 +14,8 @@ RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/
|
|||||||
nginx \
|
nginx \
|
||||||
pcre \
|
pcre \
|
||||||
php7 \
|
php7 \
|
||||||
|
php7-amqp@testing \
|
||||||
|
php7-bcmath \
|
||||||
php7-ctype@testing \
|
php7-ctype@testing \
|
||||||
php7-curl@testing \
|
php7-curl@testing \
|
||||||
php7-dom@testing \
|
php7-dom@testing \
|
||||||
@@ -41,11 +32,13 @@ RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/
|
|||||||
php7-phar@testing \
|
php7-phar@testing \
|
||||||
php7-session@testing \
|
php7-session@testing \
|
||||||
php7-xml@testing \
|
php7-xml@testing \
|
||||||
|
php7-zlib@testing \
|
||||||
php7@testing\
|
php7@testing\
|
||||||
py-mysqldb \
|
py-mysqldb \
|
||||||
py-psycopg2 \
|
py-psycopg2 \
|
||||||
py-simplejson \
|
py-simplejson \
|
||||||
s6 \
|
s6 \
|
||||||
|
tar \
|
||||||
&& rm -rf /var/cache/apk/*
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
RUN ln -s /usr/bin/php7 /usr/bin/php \
|
RUN ln -s /usr/bin/php7 /usr/bin/php \
|
||||||
@@ -64,8 +57,6 @@ RUN cd /var/www/wallabag \
|
|||||||
|
|
||||||
RUN chown -R nobody:nobody /var/www/wallabag
|
RUN chown -R nobody:nobody /var/www/wallabag
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["wallabag"]
|
CMD ["wallabag"]
|
||||||
|
|||||||
66
README.md
66
README.md
@@ -1,5 +1,9 @@
|
|||||||
# What is wallabag?
|
# What is wallabag?
|
||||||
|
|
||||||
|
[](https://travis-ci.org/wallabag/docker)
|
||||||
|
[](https://hub.docker.com/r/wallabag/wallabag/)
|
||||||
|
[](https://hub.docker.com/r/wallabag/wallabag/)
|
||||||
|
|
||||||
[wallabag](https://www.wallabag.org/) is a self hostable application for saving web pages. Unlike other services, wallabag is free (as in freedom) and open source.
|
[wallabag](https://www.wallabag.org/) is a self hostable application for saving web pages. Unlike other services, wallabag is free (as in freedom) and open source.
|
||||||
|
|
||||||
With this application you will not miss content anymore. Click, save, read it when you want. It saves the content you select so that you can read it when you have time.
|
With this application you will not miss content anymore. Click, save, read it when you want. It saves the content you select so that you can read it when you have time.
|
||||||
@@ -12,6 +16,7 @@ Default login is `wallabag:wallabag`.
|
|||||||
|
|
||||||
- `-e MYSQL_ROOT_PASSWORD=...` (needed for the mariadb container to initialise and for the entrypoint in the wallabag container to create a database and user if its not there)
|
- `-e MYSQL_ROOT_PASSWORD=...` (needed for the mariadb container to initialise and for the entrypoint in the wallabag container to create a database and user if its not there)
|
||||||
- `-e POSTGRES_PASSWORD=...` (needed for the posgres container to initialise and for the entrypoint in the wallabag container to create a database and user if not there)
|
- `-e POSTGRES_PASSWORD=...` (needed for the posgres container to initialise and for the entrypoint in the wallabag container to create a database and user if not there)
|
||||||
|
- `-e POSTGRES_USER=...` (needed for the posgres container to initialise and for the entrypoint in the wallabag container to create a database and user if not there)
|
||||||
- `-e SYMFONY__ENV__DATABASE_DRIVER=...` (defaults to "pdo_sqlite", this sets the database driver to use)
|
- `-e SYMFONY__ENV__DATABASE_DRIVER=...` (defaults to "pdo_sqlite", this sets the database driver to use)
|
||||||
- `-e SYMFONY__ENV__DATABASE_HOST=...` (defaults to "127.0.0.1", if use mysql this should be the name of the mariadb container)
|
- `-e SYMFONY__ENV__DATABASE_HOST=...` (defaults to "127.0.0.1", if use mysql this should be the name of the mariadb container)
|
||||||
- `-e SYMFONY__ENV__DATABASE_PORT=...` (port of the database host)
|
- `-e SYMFONY__ENV__DATABASE_PORT=...` (port of the database host)
|
||||||
@@ -23,36 +28,62 @@ Default login is `wallabag:wallabag`.
|
|||||||
- `-e SYMFONY__ENV__MAILER_USER=...` (defaults to "~", the SMTP user)
|
- `-e SYMFONY__ENV__MAILER_USER=...` (defaults to "~", the SMTP user)
|
||||||
- `-e SYMFONY__ENV__MAILER_PASSWORD=...`(defaults to "~", the SMTP password)
|
- `-e SYMFONY__ENV__MAILER_PASSWORD=...`(defaults to "~", the SMTP password)
|
||||||
- `-e SYMFONY__ENV__FROM_EMAIL=...`(defaults to "wallabag@example.com", the address wallabag uses for outgoing emails)
|
- `-e SYMFONY__ENV__FROM_EMAIL=...`(defaults to "wallabag@example.com", the address wallabag uses for outgoing emails)
|
||||||
## sqlite
|
- `-e SYMFONY__ENV__FOSUSER_REGISTRATION=...`(defaults to "true", enable or disable public user registration)
|
||||||
|
- `-e POPULATE_DATABASE=...`(defaults to "True". Does the DB has to be populated or is it an existing one)
|
||||||
|
|
||||||
The easiest way to start wallabag is to use the sqlite backend. You can spin that up with
|
## SQLite
|
||||||
|
|
||||||
|
The easiest way to start wallabag is to use the SQLite backend. You can spin that up with
|
||||||
|
|
||||||
```
|
```
|
||||||
$ docker run -p 80:80 xsteadfastx/wallabag
|
$ docker run -p 80:80 wallabag/wallabag
|
||||||
```
|
```
|
||||||
|
|
||||||
and point your browser to `http://localhost:80`. For persistent storage you should start the container with the a volume:
|
and point your browser to `http://localhost:80`. For persistent storage you should start the container with a volume:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ docker run -v /opt/wallabag:/var/www/wallabag/data -p 80:80 xsteadfastx/wallabag
|
$ docker run -v /opt/wallabag:/var/www/wallabag/data -p 80:80 wallabag/wallabag
|
||||||
```
|
```
|
||||||
|
|
||||||
## mariadb / mysql
|
## MariaDB / MySQL
|
||||||
|
|
||||||
For using mariadb or mysql you have to define some environment variables with the container. Example:
|
For using MariaDB or MySQL you have to define some environment variables with the container. Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ docker run docker run --name wallabag-db -e "MYSQL_ROOT_PASSWORD=my-secret-pw" -d mariadb
|
$ docker run --name wallabag-db -e "MYSQL_ROOT_PASSWORD=my-secret-pw" -d mariadb
|
||||||
$ docker run --name wallabag --link wallabag-db:wallabag-db -e "MYSQL_ROOT_PASSWORD=my-secret-pw" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql" -e "SYMFONY__ENV__DATABASE_HOST=wallabag-db" -e "SYMFONY__ENV__DATABASE_PORT=3306" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=wallapass" -p 80:80 wallabag/wallabag
|
$ docker run --name wallabag --link wallabag-db:wallabag-db -e "MYSQL_ROOT_PASSWORD=my-secret-pw" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql" -e "SYMFONY__ENV__DATABASE_HOST=wallabag-db" -e "SYMFONY__ENV__DATABASE_PORT=3306" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=wallapass" -p 80:80 wallabag/wallabag
|
||||||
```
|
```
|
||||||
|
|
||||||
## postgresql
|
## PostgreSQL
|
||||||
|
|
||||||
For using postgresql you have to define some environment variables with the container. Example:
|
For using PostgreSQL you have to define some environment variables with the container. Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ docker run docker run --name wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -d postgres
|
$ docker run --name wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -e "POSTGRES_USER=my-super-user" -d postgres
|
||||||
$ docker run --name wallabag --link wallabag-db:wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql" -e "SYMFONY__ENV__DATABASE_HOST=wallabag-db" -e "SYMFONY__ENV__DATABASE_PORT=5432" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=wallapass" -p 80:80 wallabag/wallabag
|
$ docker run --name wallabag --link wallabag-db:wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -e "POSTGRES_USER=my-super-user" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql" -e "SYMFONY__ENV__DATABASE_HOST=wallabag-db" -e "SYMFONY__ENV__DATABASE_PORT=5432" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=wallapass" -p 80:80 wallabag/wallabag
|
||||||
|
```
|
||||||
|
|
||||||
|
## Redis
|
||||||
|
|
||||||
|
To use redis support a linked redis container with the name `redis` is needed.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker run -p 6379:6379 --name redis redis:alpine
|
||||||
|
$ docker run -p 80:80 --link redis:redis wallabag/wallabag
|
||||||
|
```
|
||||||
|
|
||||||
|
## Upgrading
|
||||||
|
|
||||||
|
If there is a version upgrade that needs a database migration. The most easy way to do is running the `migrate` command:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker run --link wallabag-db:wallabag-db -e <... your config variables here ...> wallabag/wallabag migrate
|
||||||
|
```
|
||||||
|
|
||||||
|
Or you can start the container with the new image and run the migration command manually:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker exec -t NAME_OR_ID_OF_YOUR_WALLABAG_CONTAINER /var/www/wallabag/bin/console doctrine:migrations:migrate --env=prod --no-interaction
|
||||||
```
|
```
|
||||||
|
|
||||||
## docker-compose
|
## docker-compose
|
||||||
@@ -84,7 +115,10 @@ services:
|
|||||||
- MYSQL_ROOT_PASSWORD=wallaroot
|
- MYSQL_ROOT_PASSWORD=wallaroot
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/wallabag:/var/lib/mysql
|
- /opt/wallabag:/var/lib/mysql
|
||||||
|
redis:
|
||||||
|
image: redis:alpine
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that you must fill out the mail related variables according to your mail config.
|
Note that you must fill out the mail related variables according to your mail config.
|
||||||
|
|
||||||
## nginx
|
## nginx
|
||||||
@@ -109,3 +143,11 @@ server {
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Import worker
|
||||||
|
|
||||||
|
To run the [async redis import worker](http://doc.wallabag.org/en/master/developer/asynchronous.html#install-redis-for-asynchronous-tasks) use the following command:
|
||||||
|
```
|
||||||
|
$ docker run --name wallabag --link wallabag-db:wallabag-db --link redis:redis -e <... your config variables here ...> wallabag/wallabag import <type>
|
||||||
|
```
|
||||||
|
Where `<type>` is one of pocket, readability, instapaper, wallabag_v1, wallabag_v2, firefox or chrome.
|
||||||
|
|||||||
10
root/entrypoint.sh
Normal file → Executable file
10
root/entrypoint.sh
Normal file → Executable file
@@ -4,5 +4,15 @@ if [ "$1" = "wallabag" ];then
|
|||||||
ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local
|
ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local
|
||||||
exec s6-svscan /etc/s6/
|
exec s6-svscan /etc/s6/
|
||||||
fi
|
fi
|
||||||
|
if [ "$1" = "import" ];then
|
||||||
|
ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local --skip-tags=firstrun
|
||||||
|
cd /var/www/wallabag/
|
||||||
|
exec su -c "bin/console wallabag:import:redis-worker -e=prod $2 -vv" -s /bin/sh nobody
|
||||||
|
fi
|
||||||
|
if [ "$1" = "migrate" ];then
|
||||||
|
ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local
|
||||||
|
cd /var/www/wallabag/
|
||||||
|
exec su -c "bin/console doctrine:migrations:migrate --env=prod --no-interaction" -s /bin/sh nobody
|
||||||
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
@@ -4,14 +4,22 @@
|
|||||||
|
|
||||||
vars:
|
vars:
|
||||||
|
|
||||||
database_driver: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_DRIVER') }}"
|
database_driver: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_DRIVER')|default('pdo_sqlite', true) }}"
|
||||||
database_host: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_HOST') }}"
|
database_host: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_HOST')|default('127.0.0.1', true) }}"
|
||||||
database_name: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_NAME') }}"
|
database_name: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_NAME')|default('symfony', true) }}"
|
||||||
database_password: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PASSWORD') }}"
|
database_password: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PASSWORD')|default('~', true) }}"
|
||||||
database_port: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PORT') }}"
|
database_port: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PORT')|default('~', true) }}"
|
||||||
database_root_password_mariadb: "{{ lookup('env', 'MYSQL_ROOT_PASSWORD') }}"
|
database_root_password_mariadb: "{{ lookup('env', 'MYSQL_ROOT_PASSWORD') }}"
|
||||||
|
database_root_user_postgres: "{{ lookup('env', 'POSTGRES_USER') }}"
|
||||||
database_root_password_postgres: "{{ lookup('env', 'POSTGRES_PASSWORD') }}"
|
database_root_password_postgres: "{{ lookup('env', 'POSTGRES_PASSWORD') }}"
|
||||||
database_user: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_USER') }}"
|
database_user: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_USER')|default('root', true) }}"
|
||||||
|
populate_database: "{{ lookup('env', 'POPULATE_DATABASE')|default(True, true) }}"
|
||||||
|
secret: "{{ lookup('env', 'SYMFONY__ENV__SECRET')|default('ovmpmAWXRCabNlMgzlzFXDYmCFfzGv', true) }}"
|
||||||
|
mailer_host: "{{ lookup('env', 'SYMFONY__ENV__MAILER_HOST')|default('127.0.0.1', true) }}"
|
||||||
|
mailer_user: "{{ lookup('env', 'SYMFONY__ENV__MAILER_USER')|default('~', true) }}"
|
||||||
|
mailer_password: "{{ lookup('env', 'SYMFONY__ENV__MAILER_PASSWORD')|default('~', true) }}"
|
||||||
|
from_email: "{{ lookup('env', 'SYMFONY__ENV__FROM_EMAIL')|default('wallabag@example.com', true) }}"
|
||||||
|
registration: "{{ lookup('env', 'SYMFONY__ENV__FOSUSER_REGISTRATION')|default('true', true) }}"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
@@ -20,9 +28,19 @@
|
|||||||
path={{ item }}
|
path={{ item }}
|
||||||
state=directory
|
state=directory
|
||||||
with_items:
|
with_items:
|
||||||
- /var/www/wallabag/data/db
|
- /var/www/wallabag/app
|
||||||
|
- /var/www/wallabag/app/config
|
||||||
|
- /var/www/wallabag/data
|
||||||
- /var/www/wallabag/data/assets
|
- /var/www/wallabag/data/assets
|
||||||
|
- /var/www/wallabag/data/db
|
||||||
notify: chown dir
|
notify: chown dir
|
||||||
|
tags:
|
||||||
|
- firstrun
|
||||||
|
|
||||||
|
- name: write parameters.yml
|
||||||
|
template:
|
||||||
|
src=templates/parameters.yml.j2
|
||||||
|
dest=/var/www/wallabag/app/config/parameters.yml
|
||||||
|
|
||||||
- stat:
|
- stat:
|
||||||
path=/var/www/wallabag/data/db/wallabag.sqlite
|
path=/var/www/wallabag/data/db/wallabag.sqlite
|
||||||
@@ -53,7 +71,10 @@
|
|||||||
login_user=root
|
login_user=root
|
||||||
login_password="{{ database_root_password_mariadb }}"
|
login_password="{{ database_root_password_mariadb }}"
|
||||||
notify: run install
|
notify: run install
|
||||||
when: database_driver == 'pdo_mysql'
|
when: (database_driver == 'pdo_mysql') and
|
||||||
|
(populate_database == True)
|
||||||
|
tags:
|
||||||
|
- firstrun
|
||||||
|
|
||||||
- name: add mariadb user
|
- name: add mariadb user
|
||||||
mysql_user:
|
mysql_user:
|
||||||
@@ -67,7 +88,10 @@
|
|||||||
login_password="{{ database_root_password_mariadb }}"
|
login_password="{{ database_root_password_mariadb }}"
|
||||||
state=present
|
state=present
|
||||||
when: (database_driver == 'pdo_mysql') and
|
when: (database_driver == 'pdo_mysql') and
|
||||||
(database_user != 'root')
|
(database_user != 'root') and
|
||||||
|
(populate_database == True)
|
||||||
|
tags:
|
||||||
|
- firstrun
|
||||||
|
|
||||||
- name: postgresql db
|
- name: postgresql db
|
||||||
postgresql_db:
|
postgresql_db:
|
||||||
@@ -75,10 +99,13 @@
|
|||||||
state=present
|
state=present
|
||||||
login_host="{{ database_host }}"
|
login_host="{{ database_host }}"
|
||||||
port={{ database_port }}
|
port={{ database_port }}
|
||||||
login_user=postgres
|
login_user="{{ database_root_user_postgres }}"
|
||||||
login_password="{{ database_root_password_postgres }}"
|
login_password="{{ database_root_password_postgres }}"
|
||||||
notify: run install
|
notify: run install
|
||||||
when: database_driver == 'pdo_pgsql'
|
when: (database_driver == 'pdo_pgsql') and
|
||||||
|
(populate_database == True)
|
||||||
|
tags:
|
||||||
|
- firstrun
|
||||||
|
|
||||||
- name: add postgresql user
|
- name: add postgresql user
|
||||||
postgresql_user:
|
postgresql_user:
|
||||||
@@ -88,11 +115,14 @@
|
|||||||
priv=ALL
|
priv=ALL
|
||||||
login_host="{{ database_host }}"
|
login_host="{{ database_host }}"
|
||||||
port={{ database_port }}
|
port={{ database_port }}
|
||||||
login_user=postgres
|
login_user="{{ database_root_user_postgres }}"
|
||||||
login_password="{{ database_root_password_postgres }}"
|
login_password="{{ database_root_password_postgres }}"
|
||||||
state=present
|
state=present
|
||||||
when: (database_driver == 'pdo_pgsql') and
|
when: (database_driver == 'pdo_pgsql') and
|
||||||
(database_user != 'postgres')
|
(database_user != 'postgres') and
|
||||||
|
(populate_database == True)
|
||||||
|
tags:
|
||||||
|
- firstrun
|
||||||
|
|
||||||
- name: remove cache
|
- name: remove cache
|
||||||
file:
|
file:
|
||||||
|
|||||||
50
root/etc/ansible/templates/parameters.yml.j2
Normal file
50
root/etc/ansible/templates/parameters.yml.j2
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
parameters:
|
||||||
|
database_driver: {{ database_driver }}
|
||||||
|
database_host: {{ database_host }}
|
||||||
|
database_port: {{ database_port }}
|
||||||
|
database_name: {{ database_name }}
|
||||||
|
database_user: {{ database_user }}
|
||||||
|
database_password: {{ database_password }}
|
||||||
|
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
||||||
|
database_table_prefix: wallabag_
|
||||||
|
database_socket: null
|
||||||
|
database_charset: utf8
|
||||||
|
|
||||||
|
mailer_transport: smtp
|
||||||
|
mailer_host: {{ mailer_host }}
|
||||||
|
mailer_user: {{ mailer_user }}
|
||||||
|
mailer_password: {{ mailer_password }}
|
||||||
|
|
||||||
|
locale: en
|
||||||
|
|
||||||
|
# A secret key that's used to generate certain security-related tokens
|
||||||
|
secret: {{ secret }}
|
||||||
|
|
||||||
|
# two factor stuff
|
||||||
|
twofactor_auth: true
|
||||||
|
twofactor_sender: no-reply@wallabag.org
|
||||||
|
|
||||||
|
# fosuser stuff
|
||||||
|
fosuser_registration: {{ registration }}
|
||||||
|
fosuser_confirmation: true
|
||||||
|
|
||||||
|
from_email: {{ from_email }}
|
||||||
|
|
||||||
|
rss_limit: 50
|
||||||
|
|
||||||
|
# RabbitMQ processing
|
||||||
|
rabbitmq_host: localhost
|
||||||
|
rabbitmq_port: 5672
|
||||||
|
rabbitmq_user: guest
|
||||||
|
rabbitmq_password: guest
|
||||||
|
rabbitmq_prefetch_count: 10
|
||||||
|
|
||||||
|
# Redis processing
|
||||||
|
redis_scheme: tcp
|
||||||
|
redis_host: redis
|
||||||
|
redis_port: 6379
|
||||||
|
redis_path: null
|
||||||
|
redis_password: null
|
||||||
|
|
||||||
|
# sites credentials
|
||||||
|
sites_credentials: {}
|
||||||
@@ -23,7 +23,7 @@ http {
|
|||||||
gzip on;
|
gzip on;
|
||||||
gzip_disable "msie6";
|
gzip_disable "msie6";
|
||||||
open_file_cache max=100;
|
open_file_cache max=100;
|
||||||
client_max_body_size 50M;
|
client_max_body_size 100M;
|
||||||
|
|
||||||
|
|
||||||
upstream php-upstream {
|
upstream php-upstream {
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ output_buffering = 4096
|
|||||||
; Note: You need to use zlib.output_handler instead of the standard
|
; Note: You need to use zlib.output_handler instead of the standard
|
||||||
; output_handler, or otherwise the output will be corrupted.
|
; output_handler, or otherwise the output will be corrupted.
|
||||||
; http://php.net/zlib.output-compression
|
; http://php.net/zlib.output-compression
|
||||||
zlib.output_compression = Off
|
zlib.output_compression = On
|
||||||
|
|
||||||
; http://php.net/zlib.output-compression-level
|
; http://php.net/zlib.output-compression-level
|
||||||
;zlib.output_compression_level = -1
|
;zlib.output_compression_level = -1
|
||||||
@@ -670,7 +670,7 @@ auto_globals_jit = On
|
|||||||
; Its value may be 0 to disable the limit. It is ignored if POST data reading
|
; Its value may be 0 to disable the limit. It is ignored if POST data reading
|
||||||
; is disabled through enable_post_data_reading.
|
; is disabled through enable_post_data_reading.
|
||||||
; http://php.net/post-max-size
|
; http://php.net/post-max-size
|
||||||
post_max_size = 20G
|
post_max_size = 100M
|
||||||
|
|
||||||
; Automatically add files before PHP document.
|
; Automatically add files before PHP document.
|
||||||
; http://php.net/auto-prepend-file
|
; http://php.net/auto-prepend-file
|
||||||
@@ -802,7 +802,7 @@ upload_tmp_dir = /tmp/
|
|||||||
|
|
||||||
; Maximum allowed size for uploaded files.
|
; Maximum allowed size for uploaded files.
|
||||||
; http://php.net/upload-max-filesize
|
; http://php.net/upload-max-filesize
|
||||||
upload_max_filesize = 20G
|
upload_max_filesize = 100M
|
||||||
|
|
||||||
; Maximum number of files that can be uploaded via a single request
|
; Maximum number of files that can be uploaded via a single request
|
||||||
max_file_uploads = 20
|
max_file_uploads = 20
|
||||||
2
root/etc/s6/.s6-svscan/finish
Executable file
2
root/etc/s6/.s6-svscan/finish
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
exec /bin/true
|
||||||
@@ -1,12 +1,14 @@
|
|||||||
parameters:
|
parameters:
|
||||||
database_driver: %env.database_driver%
|
database_driver: pdo_sqlite
|
||||||
database_host: %env.database_host%
|
database_host: 127.0.0.1
|
||||||
database_port: %env.database_port%
|
database_port: ~
|
||||||
database_name: %env.database_name%
|
database_name: symfony
|
||||||
database_user: %env.database_user%
|
database_user: root
|
||||||
database_password: %env.database_password%
|
database_password: ~
|
||||||
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
||||||
database_table_prefix: wallabag_
|
database_table_prefix: wallabag_
|
||||||
|
database_socket: null
|
||||||
|
database_charset: utf8
|
||||||
|
|
||||||
test_database_driver: pdo_sqlite
|
test_database_driver: pdo_sqlite
|
||||||
test_database_host: 127.0.0.1
|
test_database_host: 127.0.0.1
|
||||||
@@ -17,20 +19,40 @@ parameters:
|
|||||||
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
|
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
|
||||||
|
|
||||||
mailer_transport: smtp
|
mailer_transport: smtp
|
||||||
mailer_host: %env.mailer_host%
|
mailer_host: 127.0.0.1
|
||||||
mailer_user: %env.mailer_user%
|
mailer_user: ~
|
||||||
mailer_password: %env.mailer_password%
|
mailer_password: ~
|
||||||
|
|
||||||
locale: en
|
locale: en
|
||||||
|
|
||||||
# A secret key that's used to generate certain security-related tokens
|
# A secret key that's used to generate certain security-related tokens
|
||||||
secret: %env.secret%
|
secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv
|
||||||
|
|
||||||
# two factor stuff
|
# two factor stuff
|
||||||
twofactor_auth: true
|
twofactor_auth: true
|
||||||
twofactor_sender: %env.from_email%
|
twofactor_sender: no-reply@wallabag.org
|
||||||
|
|
||||||
# fosuser stuff
|
# fosuser stuff
|
||||||
|
fosuser_registration: true
|
||||||
fosuser_confirmation: true
|
fosuser_confirmation: true
|
||||||
|
|
||||||
from_email: %env.from_email%
|
from_email: no-reply@wallabag.org
|
||||||
|
|
||||||
|
rss_limit: 50
|
||||||
|
|
||||||
|
# RabbitMQ processing
|
||||||
|
rabbitmq_host: localhost
|
||||||
|
rabbitmq_port: 5672
|
||||||
|
rabbitmq_user: guest
|
||||||
|
rabbitmq_password: guest
|
||||||
|
rabbitmq_prefetch_count: 10
|
||||||
|
|
||||||
|
# Redis processing
|
||||||
|
redis_scheme: tcp
|
||||||
|
redis_host: localhost
|
||||||
|
redis_port: 6379
|
||||||
|
redis_path: null
|
||||||
|
redis_password: null
|
||||||
|
|
||||||
|
# sites credentials
|
||||||
|
sites_credentials: {}
|
||||||
|
|||||||
9
tests/docker-compose.default.yml
Normal file
9
tests/docker-compose.default.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
wallabag:
|
||||||
|
build:
|
||||||
|
context: ../
|
||||||
|
image: wallabag:default
|
||||||
|
container_name: wallabag
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
22
tests/docker-compose.mariadb.yml
Normal file
22
tests/docker-compose.mariadb.yml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
wallabag:
|
||||||
|
build:
|
||||||
|
context: ../
|
||||||
|
image: wallabag:mariadb
|
||||||
|
container_name: wallabag
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=wallaroot
|
||||||
|
- SYMFONY__ENV__SECRET=F00B4R
|
||||||
|
- SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
|
||||||
|
- SYMFONY__ENV__DATABASE_HOST=db
|
||||||
|
- SYMFONY__ENV__DATABASE_PORT=3306
|
||||||
|
- SYMFONY__ENV__DATABASE_NAME=wallabag
|
||||||
|
- SYMFONY__ENV__DATABASE_USER=wallabag
|
||||||
|
- SYMFONY__ENV__DATABASE_PASSWORD=wallapass
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
|
db:
|
||||||
|
image: mariadb
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=wallaroot
|
||||||
24
tests/docker-compose.postgresql.yml
Normal file
24
tests/docker-compose.postgresql.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
wallabag:
|
||||||
|
build:
|
||||||
|
context: ../
|
||||||
|
image: wallabag:postgresql
|
||||||
|
container_name: wallabag
|
||||||
|
environment:
|
||||||
|
- POSTGRES_PASSWORD=my-secret-pw
|
||||||
|
- POSTGRES_USER=my-super-user
|
||||||
|
- SYMFONY__ENV__SECRET=F00B4R
|
||||||
|
- SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql
|
||||||
|
- SYMFONY__ENV__DATABASE_HOST=db
|
||||||
|
- SYMFONY__ENV__DATABASE_PORT=5432
|
||||||
|
- SYMFONY__ENV__DATABASE_NAME=wallabag
|
||||||
|
- SYMFONY__ENV__DATABASE_USER=wallabag
|
||||||
|
- SYMFONY__ENV__DATABASE_PASSWORD=wallapass
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
|
db:
|
||||||
|
image: postgres
|
||||||
|
environment:
|
||||||
|
- POSTGRES_PASSWORD=my-secret-pw
|
||||||
|
- POSTGRES_USER=my-super-user
|
||||||
17
tests/docker-compose.sqlite.yml
Normal file
17
tests/docker-compose.sqlite.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
wallabag:
|
||||||
|
build:
|
||||||
|
context: ../
|
||||||
|
image: wallabag:sqlite
|
||||||
|
container_name: wallabag
|
||||||
|
environment:
|
||||||
|
- SYMFONY__ENV__DATABASE_DRIVER=pdo_sqlite
|
||||||
|
- SYMFONY__ENV__DATABASE_HOST=127.0.0.1
|
||||||
|
- SYMFONY__ENV__DATABASE_PORT=~
|
||||||
|
- SYMFONY__ENV__DATABASE_NAME=symfony
|
||||||
|
- SYMFONY__ENV__DATABASE_USER=root
|
||||||
|
- SYMFONY__ENV_DATABASE_PASSWORD=~
|
||||||
|
- SYMFONY__ENV__SECRET=F00B4R
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
47
tests/test_login.py
Normal file
47
tests/test_login.py
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import pytest
|
||||||
|
import re
|
||||||
|
import requests
|
||||||
|
|
||||||
|
|
||||||
|
URL = 'http://127.0.0.1:80'
|
||||||
|
|
||||||
|
|
||||||
|
def test_accessing_login_page():
|
||||||
|
r = requests.get(URL, allow_redirects=True)
|
||||||
|
|
||||||
|
assert r.status_code == 200
|
||||||
|
assert 'Login' in r.text
|
||||||
|
assert 'Password' in r.text
|
||||||
|
assert 'Register' in r.text
|
||||||
|
assert 'Username' in r.text
|
||||||
|
|
||||||
|
|
||||||
|
def test_logging_in():
|
||||||
|
client = requests.session()
|
||||||
|
r = client.get(URL, allow_redirects=True)
|
||||||
|
jar = r.cookies
|
||||||
|
|
||||||
|
# get csrf token
|
||||||
|
csrf_match = re.search(
|
||||||
|
'<input type="hidden" name="_csrf_token" value="(.*)" />',
|
||||||
|
r.text
|
||||||
|
)
|
||||||
|
|
||||||
|
if csrf_match:
|
||||||
|
csrf = csrf_match.group(1)
|
||||||
|
else:
|
||||||
|
# if there is no csrf token the test will fail
|
||||||
|
pytest.fail('csrf not matched')
|
||||||
|
|
||||||
|
data = {
|
||||||
|
'_username': 'wallabag',
|
||||||
|
'_password': 'wallabag',
|
||||||
|
'_csrf_token': csrf
|
||||||
|
}
|
||||||
|
|
||||||
|
r = client.post(URL + '/login_check', cookies=jar, data=data)
|
||||||
|
assert r.status_code == 200
|
||||||
|
assert '/unread/list' in r.text
|
||||||
|
assert '/starred/list' in r.text
|
||||||
|
assert '/archive/list' in r.text
|
||||||
|
assert '/all/list' in r.text
|
||||||
Reference in New Issue
Block a user