This commit is contained in:
2023-09-26 18:14:36 -06:00
commit fb5a0fc542
443 changed files with 21892 additions and 0 deletions

110
YourSpotify/.drone.yml Normal file
View File

@@ -0,0 +1,110 @@
---
kind: pipeline
type: docker
name: deploy
environment:
PACKAGE: YourSpotify
URL: yourspotify.alexlebens.net yourspotifyapi.alexlebens.net
steps:
- name: Tests
image: ps03fd.alexlebens.net:5000/droneimage:latest
commands:
- /scripts/tests.sh
- name: Nofification > Discord | Tests - Failure
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
username: DroneCI - ps03fd
message: Docker compose validation for YourSpotify failed.
when:
status:
- failure
- name: Configuration
image: ps03fd.alexlebens.net:5000/droneimage:latest
commands:
- mkdir ~/.ssh/
- echo "$SSH_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H $HOST_IP >> ~/.ssh/known_hosts
- /scripts/configuration.sh
environment:
SSH_KEY:
from_secret: ssh_key_ps03fd_drone
DOCKER_HOST:
from_secret: docker_host_ps03fd
HOST_IP:
from_secret: host_ip_ps03fd
UPTIMEKUMA_NAME:
from_secret: uptimekuma_name
UPTIMEKUMA_PASSWORD:
from_secret: uptimekuma_password
UPTIMEKUMA_URL:
from_secret: uptimekuma_url
when:
branch:
- main
- name: Nofification > Discord | Configuration - Failure
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
username: DroneCI - ps03fd
message: Configuration for YourSpotify failed.
when:
status:
- failure
- name: Deploy
image: ps03fd.alexlebens.net:5000/droneimage:latest
commands:
- mkdir ~/.ssh/
- echo "$SSH_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H $HOST_IP >> ~/.ssh/known_hosts
- /scripts/deploy.sh
environment:
SSH_KEY:
from_secret: ssh_key_ps03fd_drone
DOCKER_HOST:
from_secret: docker_host_ps03fd
HOST_IP:
from_secret: host_ip_ps03fd
when:
branch:
- main
- name: Nofification > Discord | Deploy - Success
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
username: DroneCI - ps03fd
message: Docker compose deployment for YourSpotify succeeded
when:
status:
- sucess
- name: Nofification > Discord | Deploy - Failure
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
username: DroneCI - ps03fd
message: Docker compose deployment for YourSpotify failed.
when:
status:
- failure

8
YourSpotify/.env Normal file
View File

@@ -0,0 +1,8 @@
API_ENDPOINT=https://yourspotifyapi.alexlebens.net
CLIENT_ENDPOINT=https://yourspotify.alexlebens.net
SPOTIFY_PUBLIC=2ef3348a6ab94bf8bc8dfa66e481d444
SPOTIFY_SECRET=964d902a03d744e9a922759ef1eab47d
CORS=all
MONGO_ENDPOINT=mongodb://yourspotify_mongo:27017/yourspotify
MAX_IMPORT_CACHE_SIZE=100000
TIMEZONE=America/Denver

3
YourSpotify/README.md Normal file
View File

@@ -0,0 +1,3 @@
# YourSpotify
[![Build Status](https://drone.alexlebens.net/api/badges/alexlebens/YourSpotify/status.svg)](https://drone.alexlebens.net/alexlebens/YourSpotify)

View File

@@ -0,0 +1,17 @@
{
"type": "docker",
"name": "YourSpotify MongoDB - Docker",
"interval": 60,
"retryInterval": 20,
"maxretries": 1,
"notificationIDList": [
3,
4
],
"url": "https://yourspotify.alexlebens.net",
"accepted_statuscodes": [
"200-299"
],
"docker_container": "yourspotify_mongo",
"docker_host": 1
}

View File

@@ -0,0 +1,17 @@
{
"type": "docker",
"name": "YourSpotify Server - Docker",
"interval": 60,
"retryInterval": 20,
"maxretries": 1,
"notificationIDList": [
3,
4
],
"url": "https://yourspotifyapi.alexlebens.net",
"accepted_statuscodes": [
"200-299"
],
"docker_container": "yourspotify_server",
"docker_host": 1
}

View File

@@ -0,0 +1,17 @@
{
"type": "docker",
"name": "YourSpotify Web - Docker",
"interval": 60,
"retryInterval": 20,
"maxretries": 1,
"notificationIDList": [
3,
4
],
"url": "https://yourspotify.alexlebens.net",
"accepted_statuscodes": [
"200-299"
],
"docker_container": "yourspotify_web",
"docker_host": 1
}

View File

@@ -0,0 +1,15 @@
{
"type": "http",
"name": "YourSpotify Server - Web",
"interval": 60,
"retryInterval": 20,
"maxretries": 1,
"notificationIDList": [
3,
4
],
"url": "https://yourspotifyapi.alexlebens.net",
"accepted_statuscodes": [
"200-299"
]
}

View File

@@ -0,0 +1,15 @@
{
"type": "http",
"name": "YourSpotify Web - Web",
"interval": 60,
"retryInterval": 20,
"maxretries": 1,
"notificationIDList": [
3,
4
],
"url": "https://yourspotify.alexlebens.net",
"accepted_statuscodes": [
"200-299"
]
}

View File

@@ -0,0 +1,85 @@
services:
mongo:
container_name: yourspotify_mongo
environment:
- PUID=1000
- PGID=1000
image: mongo:4.4.8
logging:
driver: json-file
options:
max-size: 50m
max-file: "3"
networks:
traefik:
ipv4_address: 172.27.1.50
restart: always
volumes:
- data:/data/db
- configdata:/data/configdb
server:
container_name: yourspotify_server
depends_on:
- mongo
env_file:
- .env
image: yooooomi/your_spotify_server
labels:
traefik.docker.network: traefik
traefik.enable: true
traefik.http.routers.yourspotifyserver.entrypoints: websecure
traefik.http.routers.yourspotifyserver.rule: Host(`yourspotifyapi.alexlebens.net`)
traefik.http.routers.yourspotifyserver.service: yourspotifyserver
traefik.http.services.yourspotifyserver.loadbalancer.server.port: 8080
logging:
driver: json-file
options:
max-size: 50m
max-file: "3"
networks:
traefik:
ipv4_address: 172.27.1.51
restart: always
web:
container_name: yourspotify_web
environment:
API_ENDPOINT: https://yourspotifyapi.alexlebens.net
image: yooooomi/your_spotify_client
labels:
traefik.docker.network: traefik
traefik.enable: true
traefik.http.routers.yourspotify.entrypoints: websecure
traefik.http.routers.yourspotify.rule: Host(`yourspotify.alexlebens.net`)
traefik.http.routers.yourspotify.service: yourspotify
traefik.http.services.yourspotify.loadbalancer.server.port: 3000
logging:
driver: json-file
options:
max-size: 50m
max-file: "3"
networks:
traefik:
ipv4_address: 172.27.1.52
restart: unless-stopped
networks:
traefik:
name: traefik
external: true
volumes:
data:
driver: local
driver_opts:
type: none
o: bind
device: /var/lib/docker/volumes/partition/yourspotify_data
configdata:
driver: local
driver_opts:
type: none
o: bind
device: /var/lib/docker/volumes/partition/yourspotify_configdata