[Unit]
Description=OwnCloud
Wants=basic.target
After=basic.target network.target

[Service]
WorkingDirectory=/opt/owncloud
ExecStart=/opt/owncloud/ocis server

Environment="PROXY_HTTP_ADDR=0.0.0.0:9200"
Environment="OCIS_URL=https://cloud.amy.mov"
Environment="OCIS_BASE_DATA_PATH=/opt/owncloud/"
Environment="OCIS_CONFIG_DIR=/opt/owncloud/"

Environment="OCIS_INSECURE=true"

Environment="STORAGE_USERS_DRIVER=s3ng"
Environment="STORAGE_HOME_DRIVER=s3ng"
Environment="STORAGE_METADATA_DRIVER=ocis"

Environment="STORAGE_USERS_S3NG_REGION=garage"
Environment="STORAGE_USERS_S3NG_ENDPOINT=https://internal-s3.amy.mov"
Environment="STORAGE_USERS_S3NG_SECRET_KEY="<%= @oc_s3_secret_key %>"
Environment="STORAGE_USERS_S3NG_ACCESS_KEY="<%= @oc_s3_access_key %>"
Environment="STORAGE_USERS_S3NG_BUCKET=cloud"

KillMode=process
Restart=on-failure
RestartSec=30s

[Install]
WantedBy=multi-user.target