Update ente-install.sh
This commit is contained in:
parent
89e7dd5e51
commit
7624e540e4
@ -60,30 +60,46 @@ fi
|
|||||||
export CGO_CFLAGS
|
export CGO_CFLAGS
|
||||||
export CGO_LDFLAGS
|
export CGO_LDFLAGS
|
||||||
$STD go build cmd/museum/main.go
|
$STD go build cmd/museum/main.go
|
||||||
cp config/example.yaml museum.yaml
|
|
||||||
msg_ok "Built Museum"
|
msg_ok "Built Museum"
|
||||||
|
|
||||||
msg_info "Generating Secrets"
|
msg_info "Generating Secrets"
|
||||||
$STD go run tools/gen-random-keys/main.go >secrets.txt
|
SECRET_ENC=$($STD go run tools/gen-random-keys/main.go | grep "encryption" | awk '{print $2}')
|
||||||
|
SECRET_HASH=$($STD go run tools/gen-random-keys/main.go | grep "hash" | awk '{print $2}')
|
||||||
|
SECRET_JWT=$($STD go run tools/gen-random-keys/main.go | grep "jwt" | awk '{print $2}')
|
||||||
msg_ok "Generated Secrets"
|
msg_ok "Generated Secrets"
|
||||||
|
|
||||||
msg_info "Creating Museum Service"
|
msg_info "Creating museum.yaml"
|
||||||
cat <<EOF >/etc/systemd/system/ente-museum.service
|
cat <<EOF >/opt/ente/server/museum.yaml
|
||||||
[Unit]
|
db:
|
||||||
Description=Ente Museum Server
|
host: 127.0.0.1
|
||||||
After=network.target postgresql.service
|
port: 5432
|
||||||
|
name: $DB_NAME
|
||||||
|
user: $DB_USER
|
||||||
|
password: $DB_PASS
|
||||||
|
|
||||||
[Service]
|
s3:
|
||||||
WorkingDirectory=/opt/ente/server
|
are_local_buckets: true
|
||||||
ExecStart=/opt/ente/server/main
|
use_path_style_urls: true
|
||||||
Restart=always
|
local-dev:
|
||||||
Environment="DATABASE_URL=postgresql://$DB_USER:$DB_PASS@127.0.0.1:5432/$DB_NAME"
|
key: dummy
|
||||||
|
secret: dummy
|
||||||
|
endpoint: localhost:3200
|
||||||
|
region: eu-central-2
|
||||||
|
bucket: ente-dev
|
||||||
|
|
||||||
[Install]
|
apps:
|
||||||
WantedBy=multi-user.target
|
public-albums: http://localhost:3002
|
||||||
|
cast: http://localhost:3004
|
||||||
|
accounts: http://localhost:3001
|
||||||
|
|
||||||
|
key:
|
||||||
|
encryption: $SECRET_ENC
|
||||||
|
hash: $SECRET_HASH
|
||||||
|
|
||||||
|
jwt:
|
||||||
|
secret: $SECRET_JWT
|
||||||
EOF
|
EOF
|
||||||
systemctl enable -q --now ente-museum
|
msg_ok "Created museum.yaml"
|
||||||
msg_ok "Created Museum Service"
|
|
||||||
|
|
||||||
msg_info "Building Web Applications"
|
msg_info "Building Web Applications"
|
||||||
cd /opt/ente/web
|
cd /opt/ente/web
|
||||||
@ -101,6 +117,23 @@ cp -r apps/auth/out /var/www/ente/apps/auth
|
|||||||
cp -r apps/cast/out /var/www/ente/apps/cast
|
cp -r apps/cast/out /var/www/ente/apps/cast
|
||||||
msg_ok "Built Web Applications"
|
msg_ok "Built Web Applications"
|
||||||
|
|
||||||
|
msg_info "Creating Museum Service"
|
||||||
|
cat <<EOF >/etc/systemd/system/ente-museum.service
|
||||||
|
[Unit]
|
||||||
|
Description=Ente Museum Server
|
||||||
|
After=network.target postgresql.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
WorkingDirectory=/opt/ente/server
|
||||||
|
ExecStart=/opt/ente/server/main -config /opt/ente/server/museum.yaml
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
systemctl enable -q --now ente-museum
|
||||||
|
msg_ok "Created Museum Service"
|
||||||
|
|
||||||
msg_info "Configuring Caddy"
|
msg_info "Configuring Caddy"
|
||||||
cat <<EOF >/etc/caddy/Caddyfile
|
cat <<EOF >/etc/caddy/Caddyfile
|
||||||
:3000 {
|
:3000 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user