# ohneconker

## 在vps已有毛象的基础上安装bookwyrm

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY=OhGezuz2021

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG=false

USE_HTTPS=true

DOMAIN="你的域名"
EMAIL=你的站长邮箱

# Used for deciding which editions to prefer
DEFAULT_LANGUAGE="English"

## Leave unset to allow all hosts
# ALLOWED_HOSTS="localhost,127.0.0.1,[::1]"

MEDIA_ROOT=images/

OL_URL=https://openlibrary.org

## Database backend to use.
## Default is postgres, sqlite is for dev quickstart only (NOT production!!!)
BOOKWYRM_DATABASE_BACKEND=postgres

MEDIA_ROOT=images/

POSTGRES_PORT=5432
POSTGRES_HOST=db

# Redis activity stream manager
MAX_STREAM_LENGTH=200
REDIS_ACTIVITY_HOST=redis_activity
REDIS_ACTIVITY_PORT=6380

# Redis as celery broker
REDIS_BROKER_PORT=6379
#CELERY_BROKER=redis://:${REDIS_BROKER_PASSWORD}@redis_broker:${REDIS_BROKER_PORT}/0
#CELERY_RESULT_BACKEND=redis://:${REDIS_BROKER_PASSWORD}@redis_broker:${REDIS_BROKER_PORT}/0

FLOWER_PORT=8888
FLOWER_USER=你的花花用户名

EMAIL_HOST="smtp.eu.mailgun.org"
EMAIL_PORT=587
EMAIL_HOST_USER=mail@域名.com
EMAIL_USE_TLS=true
EMAIL_USE_SSL=false

# Set this to true when initializing certbot for domain, false when not
CERTBOT_INIT=false

# Thumbnails Generation
ENABLE_THUMBNAIL_GENERATION=false

# S3 configuration
USE_S3=false
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

# Commented are example values if you use a non-AWS, S3-compatible service
# AWS S3 should work with only AWS_STORAGE_BUCKET_NAME and AWS_S3_REGION_NAME
# non-AWS S3-compatible services will need AWS_STORAGE_BUCKET_NAME,
# along with both AWS_S3_CUSTOM_DOMAIN and AWS_S3_ENDPOINT_URL

# AWS_STORAGE_BUCKET_NAME=        # "example-bucket-name"
# AWS_S3_CUSTOM_DOMAIN=None       # "example-bucket-name.s3.fr-par.scw.cloud"
# AWS_S3_REGION_NAME=None         # "fr-par"
# AWS_S3_ENDPOINT_URL=None        # "https://s3.fr-par.scw.cloud"

# Preview image generation can be computing and storage intensive
# ENABLE_PREVIEW_IMAGES=True

# Specify RGB tuple or RGB hex strings,
# or use_dominant_color_light / use_dominant_color_dark
PREVIEW_BG_COLOR=use_dominant_color_light
# Change to #FFF if you use use_dominant_color_dark
PREVIEW_TEXT_COLOR="#363636"
PREVIEW_IMG_WIDTH=1200
PREVIEW_IMG_HEIGHT=630
PREVIEW_DEFAULT_COVER_COLOR="#002549"


docker-compose.yml

version: '3'

services:
nginx:
image: nginx:latest
ports:
- 8001:8001
depends_on:
- web
networks:
- main
volumes:
- ./nginx:/etc/nginx/conf.d
- static_volume:/app/static
- media_volume:/app/images
db:
build: postgres-docker
env_file: .env
entrypoint: /bookwyrm-entrypoint.sh
command: cron postgres
volumes:
- pgdata:/var/lib/postgresql/data
- backups:/backups
networks:
- main
ports:
- 5433:5432
web:
build: .
env_file: .env
command: gunicorn bookwyrm.wsgi:application --bind 0.0.0.0:8000
volumes:
- .:/app
- static_volume:/app/static
- media_volume:/app/images
depends_on:
- db
- celery_worker
- redis_activity
networks:
- main
ports:
- 8000:8000
redis_activity:
image: redis
command: redis-server --requirepass ${REDIS_ACTIVITY_PASSWORD} --appendonly yes --port${REDIS_ACTIVITY_PORT}
volumes:
- ./redis.conf:/etc/redis/redis.conf
- redis_activity_data:/data
env_file: .env
networks:
- main
restart: on-failure
redis_broker:
image: redis
command: redis-server --requirepass ${REDIS_BROKER_PASSWORD} --appendonly yes --port${REDIS_BROKER_PORT}
volumes:
- ./redis.conf:/etc/redis/redis.conf
- redis_broker_data:/data
env_file: .env
ports:
- 6380:6379
networks:
- main
restart: on-failure
celery_worker:
env_file: .env
build: .
networks:
- main
command: celery -A celerywyrm worker -l info
volumes:
- .:/app
- static_volume:/app/static
- media_volume:/app/images
depends_on:
- db
- redis_broker
restart: on-failure
flower:
build: .
command: flower -A celerywyrm
env_file: .env
volumes:
- .:/app
networks:
- main
depends_on:
- db
- redis_broker
restart: on-failure
ports:
- 8888:8888
volumes:
pgdata:
backups:
static_volume:
media_volume:
redis_broker_data:
redis_activity_data:
networks:
main:


server {
server_name 域名;

listen [::]:80;
listen 80;
rewrite ^ https://$server_name$request_uri;
location / { return 301 https://$host$request_uri; }
}

# SSL code
ssl_certificate /etc/letsencrypt/live/域名/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/域名/privkey.pem;

server {
listen [::]:443 ssl http2;
listen 443 ssl http2;

server_name 域名;
location / {
proxy_pass http://localhost:8000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host$host;
}

location /images/ {
proxy_pass http://localhost:8001;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host$host;
}

location /static/ {
proxy_pass http://localhost:8001;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host$host;
}
}


## S3 设置

# S3 configuration                                                                                                      USE_S3=true                                                                                                             AWS_ACCESS_KEY_ID=你的aws的ID
AWS_SECRET_ACCESS_KEY=你的aws的id的密码                                                                                                                                                                                                                                                                               AWS_STORAGE_BUCKET_NAME="桶名字"
AWS_S3_CUSTOM_DOMAIN="桶名字.桶地区.桶服务商.com"       # "example-bucket-name.s3.fr-par.scw.cloud"

AWS_S3_REGION_NAME="地区"           # "fr-par"                                                                       AWS_S3_ENDPOINT_URL="https://s3.fr-par.scw.cloud"


(S3部分指路万能的皮皮站长教程

## 升级：

git pull

docker-compose build

docker-compose exec web python manage.py migrate

docker-compose exec web python manage.py collectstatic --no-input

docker-compose up -d

docker system prune -a


## Bookwyrm 安装教程

sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

1. 如果你的vps上已经有毛象了的话，建议用sudo useradd -r -m -d /home/bookwyrm -U -G docker bookwyrm 给Bookwyrm的服务创建一个专门的系统用户。

o3o站皮皮站长的毛象搭建教程里面有详细解释。

## 在崭新的vps服务器上安装bookwyrm

ssh至你的vps服务器

cd /home/
mkdir bookwyrm && cd bookwyrm
git clone https://github.com/bookwyrm-social/bookwyrm.git
git checkout production
cp .env.prod.example .env


.env设置如下:

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY="你的密码"

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG=false
USE_HTTPS=true

DOMAIN=你的域名
EMAIL=你的站长邮箱

# Used for deciding which editions to prefer
DEFAULT_LANGUAGE="English"

## Leave unset to allow all hosts
# ALLOWED_HOSTS="localhost,127.0.0.1,[::1]"

MEDIA_ROOT=images/

PGPORT=5432
POSTGRES_HOST=db

# Redis activity stream manager
MAX_STREAM_LENGTH=200
REDIS_ACTIVITY_HOST=redis_activity
REDIS_ACTIVITY_PORT=6379

# Redis as celery broker
REDIS_BROKER_PORT=6379

FLOWER_PORT=8888
FLOWER_USER=你的flower用户名

EMAIL_HOST=smtp.mailgun.org
EMAIL_PORT=587
EMAIL_HOST_USER=你的bookwyrm服务的邮箱地址
EMAIL_USE_TLS=true
EMAIL_USE_SSL=false

# Thumbnails Generation
ENABLE_THUMBNAIL_GENERATION=false

# S3 configuration
USE_S3=false
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

# Commented are example values if you use a non-AWS, S3-compatible service
# AWS S3 should work with only AWS_STORAGE_BUCKET_NAME and AWS_S3_REGION_NAME
# non-AWS S3-compatible services will need AWS_STORAGE_BUCKET_NAME,
# along with both AWS_S3_CUSTOM_DOMAIN and AWS_S3_ENDPOINT_URL

# AWS_STORAGE_BUCKET_NAME=        # "example-bucket-name"
# AWS_S3_CUSTOM_DOMAIN=None       # "example-bucket-name.s3.fr-par.scw.cloud"
# AWS_S3_REGION_NAME=None         # "fr-par"
# AWS_S3_ENDPOINT_URL=None        # "https://s3.fr-par.scw.cloud"

# Preview image generation can be computing and storage intensive
# ENABLE_PREVIEW_IMAGES=True

# Specify RGB tuple or RGB hex strings,
# or use_dominant_color_light / use_dominant_color_dark
PREVIEW_BG_COLOR=use_dominant_color_light
# Change to #FFF if you use use_dominant_color_dark
PREVIEW_TEXT_COLOR=#363636
PREVIEW_IMG_WIDTH=1200
PREVIEW_IMG_HEIGHT=630
PREVIEW_DEFAULT_COVER_COLOR=#002549


## 关于writefreely恶意注册

sudo mysql

use writefreely

show tables;

select * from users where users.created >= '2021-07-26 00:00:00';


select * from posts inner join users on posts.owner_id = users.id where users.created >= '2021-07-26 00:00:00';


Tables such as 'collectionkeys', 'collections' 逻辑类似，不累述。



## Seams and Seam Finishes

#裁缝合集Couture

Stitching seams is one of the basic components of sewing.

With a little practice, you'll be able to sew perfect straight or curved seams and a variety of professional finishes.

Before you begin sewing, always test for the best stitch length, needle size, and type of thread for your fabric. Test the stitch length for appearance and strength as well as for ease in ripping. A too-long stitch length uses less thread, but creates a puckered seam.

Keep a supply of different needles on hand and use only the best quality—this is not a place to skimp. Change the needle before you begin each new garment and any time the needle hits a pin (listen for the sound of a blunt or bent needle piercing the cloth).

If you notice skipped stitches, or if the thread keeps breaking or fraying, try a different-size needle.

If that doesn’t help, try another brand of needle.

### Sewing Perfect Seams

For smooth seams, always cut, stitch, and press seams in the same direction. For skirts, this usually means working along the length of the garment, from hem to waistline.

To sew long side seams, place pins vertically on the stitching line, positioned so that you can pull them out as you sew. This saves time and—because you're not sewing over pins—it also saves wear and tear on the machine.

Pin the top and bottom of the seam first. Next match the notches, then match or ease the fabric in between. A fabric with “tooth” grabs or sticks to itself and thus requires fewer pins than a slippery fabric that moves and slides. You may need to hand-baste some hard-to-handle fabrics, such as velvet, before stitching.

Most seams are sewn with right sides together, using a 5/8-in. seam allowance. Some machines have this 5/8-in. width marked on the throat plate. A magnetic seam guide, which acts as a “fence” along which you can guide the fabric, is also a very helpful tool.

Always press a seam after stitching and before crossing it with another seam or detail.

Remember, stitching and pressing go hand in hand.

### Ripping out Seams

Ripping out seams is an essential part of sewing. Use the narrow point of the seam ripper to break a few stitches on one side of the seam. This frees the thread on the other side so that it can be pulled. Working from one end of the seam to the other, rip just a few stitches, grasp the thread with your fingers, and give it a good pull, disposing of the loose threads as you go.

Another way to rip stitches is to use the point of the ripper to break threads on one side of the fabric every 1 in. to 1 in. along the seam and then pull the long freed-up thread on the other side. (The disadvantage is that on the first side you're left with broken threads all along the seam that need to be removed.)

Never work the curved portion of the seam ripper between the two layers of the seam unless the fabric is heavy and very firmly woven.

Otherwise, you’re liable to rip the fabric as well as the threads.

### Finishes for Side Seams

Aim for simple, light, unobtrusive seam finishes. Test fabric scraps to see which seam finish is most compatible with your fabric. The seam finish should keep the seam edges from fraying and shouldn't show from the right side. If your fabric doesn’t ravel, the best seam finish is none at all.

#### Pinked Seams

Trimming with pinking shears is a classic, honest way to finish a seam (see photo). The ultimate in simplicity, it adds no bulk and won't show from the right side. After you sew the seam, trim away the smallest amount of fabric possible.

Test the pinking shears on fabric scraps first. On some fabrics, you can trim both layers of the seam allowance at one time. With other fabrics, to get a clean edge, you must open the seam allowance and trim single layers. Test both methods and compare the results.

Some pinking shears have a notched tip that will cut all the way to the end of the cut. Other brands work best if you don’t fully open the shears and if you don’t cut all the way to the points. Test to see how deep a cut you need to make to work smoothly.

There’s also a rotary cutter with a wavy blade that works well as a pinking tool.

A pinked-and-stitched edge is especially flat and ravel-resistant: Sew a line of stitching ¼ in. from the edge before the seam is sewn.

Pink the edges after seaming, without cutting the line of stitching.

### Seams For Bias-Cut Skirts

Cut, making 11-in. seams to allow the fabric to relax. Mark the seamline with basting. Press the pieces. Pin along the marked seamline and try on the garment. Adjust where necessary. You may need to make smaller seam allowances to compensate for the pieces’ having stretched slightly in length and contracted in width. Sew with a slightly shorter stitch length than usual, stretching the fabric as you sew. Because bias does not ravel, you won't need to finish the seams.

#### Zigzag Seams

Zigzag edges are quick and simple finishes. Both are made after the seam is sewn and pressed.

Both finishes have two disadvantages, however. First, the extra stitching and thread can add bulk to thin fabrics, which will keep them from lying flat. Second, these finishes, which aren’t found in ready-to-wear, shout “homemade.” I generally don’t use them, but you might want to experiment with them yourself.

For a zigzag finish, use a stitch of medium width and length. Stitch near the edge, but not along it, and trim close to the stitching. If your machine has this option, try a machine-overcast stitch. Stitch close to the edge so the points of the stitches fall almost at the edge of the fabric.

#### Serged Seams

The serger, or overlock machine, has transformed home sewing.

Although it doesn’t replace a conventional machine, a serger is very useful for quickly cutting and finishing seam edges in one fast and easy operation (above right).

Fuse interfacings to pockets and zipper areas before serging. If your fabric frays easily, serge all around the skirt, but on more stable fabrics, serge only the seams that will be pressed open. Serge the hem after you mark the length and trim to desired width.

When using a serger, it’s not necessary to cut wider seams than you normally would. The cutting edge of the serger trims just the ravelly edges before overcasting.

Use fine, soft thread, machine-embroidery thread, or texturized nylon to minimize the amount of thread impression “striking through” on the right side of the fabric. A 3-thread edge, using long staple polyester or coned “serger” thread, is the most versatile of the serged finishes. Or, if your machine has a 2-thread finish, try that for a flatter edge.

Serge a wide edge on fabrics that are heavy or bulky, and a narrow edge on flat fabrics that are lightweight to midweight.

### Finishes for Hems and Waistband Seams

For a flat and professional-looking finish, you can bind hems and waistband seams with a Hong Kong finish or with a rayon seam binding.

Hong Kong Finish The Hong Kong finish is a simple and elegant touch for medium to heavy fabrics. This flat, narrow binding makes a fine finish for hems or an inside waistband seam ona skirt (see photo on p. 52), but it’s too bulky for most side seams.

A Hong Kong finish has two lines of stitching and adds three layers of fabric to the edge. The seam edge is bound in bias strips of a lightweight fabric, such as China silk, rayon lining, silk, or polyester crepe de chine.

For the binding, cut ¼-in. wide bias strips, piecing the lengths as necessary. Press the bias strips to remove excess stretchability and to prevent them from rippling.

Before you stitch the waistband to the skirt, sew the binding to the seam edge, with right sides together, /s in. from the edges. (Bind the hem in the same way after marking and trimming it.)

Trim the seam edge to an even 1/8 in. using sharp long-blade shears, or a rotary cutter (1).

Wrap the binding around the seam edge and press. On the right side of the fabric, stitch in the “ditch” of the seam of the waistband and the binding—that is, where the two fabrics are sewn together (2). For accuracy, use an edgestitching foot with the needle in the center position.

On the wrong side of the fabric, trim the excess binding 1/8 in. from the stitching line (3). Bias doesn’t fray, so the binding won't ravel.

Rayon Seam Binding A flat woven-tape seam binding creates a dressmaker’s touch for bulky and flat fabrics that ravel. Use rayon rather than polyester—it’s softer, flatter, and more fluid. With just a bit of practice, you'll find this technique fast and simple.

Rayon seam binding adds less bulk than the Hong Kong finish. It has only one line of stitching and adds only two layers of fabric to the edge. This seam binding can also be used to finish the inside waistband edge and the hem edge.

Press the binding in half lengthwise, making one half slightly wider than the other. Hold the end in place with a straight pin as you work.

Position the narrow half of the binding on top of the right side of the fabric and stitch along this half (4). This way, you'll be sure that your stitches will catch the wider half of the binding on the other side of the fabric.

As you stitch along the edge of the binding, pull it slightly toward the fabric with your finger so that it wraps around and encases the raw edge. Press to eliminate puckers.

## Pressing

#裁缝合集Couture

Pressing seams and darts is the secret to making clothes that look professional.

### Tools

The best iron gets hot and stays hot and gives off a good shot of steam.

Always test a scrap of your fabric to determine the best setting to use.

You'll also need a clapper/pointer, a hardwood tool for flattening seams and pressing points; a pressing ham, a contoured device that looks like its namesake and is used to shape darts and curved seams; and a press cloth.

Press cloths protect the surface of the garment fabric, and professionals rely on them. Use a cotton, see-through press cloth for cottons, silks, and linens; a specially treated, heavy drill (cotton twill) press cloth and a scrap of wool for pressing wools.

The heavy cotton protects the wool fabric, particularly if you are ironing the right side of the fabric, and allows you to press with the iron set at a high temperature.

Wool pressed against wool prevents the fabric from flattening and becoming shiny. (Professional tailors often sew a square of wool to one area of the heavy-cotton press cloth in order to have both at hand.)

Test your fabric to see if it can be pressed on the right side. If right-side pressing changes the appearance of the fabric, always use a press cloth. Your fingers are also important pressing tools, especially for fabrics that are slippery or don’t hold shape easily.

Finger-press all seams before using the iron.

### Techniques

After sewing each seam and dart, press it flat, as it was sewn, to blend the stitches, smooth the fabric, and erase puckers.

Then press the seams open on the wrong side of the fabric. Use your fingers and the point of the iron to open the seam halves to lie flat as you work (1).

💡 1. Press the seam flat on the wrong side, holding the seam halves open as you work.

Press the seam or dart again on the right side of the fabric, using the press cloth if necessary (2).

💡 2. Press again from the right side, using a press cloth if necessary.

Unlike ironing, which is a sliding motion, pressing is a lifting and lowering motion.

As you work, use the clapper to flatten and cool the pressed area.

The hardwood absorbs heat and moisture, and the weight of the tool and the pounding flattens the stitched seam or dart. For some fabrics, such as cottons, rayons, and silks, just the weight of the clapper is enough to do the job; for wools, you may need to apply extra pressure.

Also press back darts and curved seams over the ham to build curves and shape the garment (3).

💡 3. Shape curved darts and seams by pressing them over a ham.

Press front darts over the ham’s flattest part to avoid rounding them.

Press all vertical darts toward the center of the garment.

After pressing, seams and darts should be so flat they almost disappear. Let the pressed area cool before readjusting the fabric on the ironing board.

##### Pressing the Stretch out of Bias
Before handling any piece of fabric that’s been cut on the bias, press the stretch out. This technique is straight from the workrooms of French couture. After pressing, the seams of bias-cut skirt panels can be sewn with minimum distortion. After the garment is finished, the hem will not sag, and the skirt will be less likely to stretch in length and decrease in width. Position the bias-cut skirt panel on a pressing surface that is long enough for the entire length. Steam-press, and as you do, gently stretch the fabric in the lengthwise direction of the skirt. Begin at one seam and work in radiating parallel lines across the panel to the other seam. Allow the fabric to cool before repositioning it. Repeat the process with all of the skirt panels. The hem may become uneven, but after you've measured it and hemmed it evenly, it will stay even.

## Making Tailor's Tacks and Pleats

#裁缝合集Couture

Multistrand embroidery floss works well for making tailor’s tacks because it’s thick and won't pull out readily. I also use a chenille needle, which is sharp and has a large, easy-to-thread eye.

Make one small stitch through both layers of fabric on each pattern mark, leaving at least ½-in. tails at each end (1).

💡 1. Mark darts with tailor's tacks, leaving 1/2-in. tails.

Slowly peel the pattern tissue from the tacks without tearing it. Carefully pull open the fabric layers so that there is enough thread between them to clip the tacks and leave tails (2).

💡 2. Pull the fabrics apart and clip the tacks.

These tacks on the inside (right side) of the cloth will be more uniform lengths, so you will be able to tell the right side of the fabric from the wrong side at a glance.

To mark any pleats or tucks, try using two different colors of embroidery floss to mark each set. Later, you'll be able to match the sets easily. (See p. 61.)

To mark a dart, make snip marks to mark the tops of the legs. Use tailor’s tacks to mark the midpoints and tip of the dart. Then sculpt the dart by connecting the tacks with a hip curve and a fine-line chalk marker (3), and you'll have an easy-to-follow stitching guide.

💡 3. Use chalk and a hip curve to mark dart lines on the wrong side of the fabric.

Don't machine-stitch over tailor's tacks, they can get caught in the stitches and be tricky to pull out.

Instead, baste or mark the area carefully, remove the tacks, then stitch by machine.

（Voir (pg 49 of howto)