xaque8787 / wimps Goto Github PK
View Code? Open in Web Editor NEWWindows Is My Primary Server is a set of scripts to help automate a media server setup on Windows.
Windows Is My Primary Server is a set of scripts to help automate a media server setup on Windows.
Apps not yet supported, but are planned to be.
The idea is to keep things as FREE and FOSS as possible. DONATE TO OPEN SOURCE PROJECTS USED IN THIS SCRIPT IF YOU ARE ABLE.
Apps NOT TO BE supported
1.Plex
2.
3.
Tool to list installed apps and Back Up and Restore configs and settings.
Should interact with "Settings service" to apply any backed up settings.
Script will need to update itself (ran manually preferably) to keep urls relevant and add features.
Optional Wizard Option instead of "manual" select insatll.
A step by step install guide which should:
Examples for app installations
What download client would you like to install?
1.qBittorrent
2.SABnzb
What Browser(s) do you want installed?
1.Firefox
2.Chrome
What VPN provider would you like to use?
1.ProtonVPN
2.Mullvad
Examples for credentials
Caddy setup complete,
Please enter in your duckdns subdomains (subdomain.duckdns.org)
-accept user inputs-
What is the ip:port of service this subdomain will connect to.
-accept user inputs- local.ip.address:port
Your email address for LetsEncrypt (optional)
-accept user inputs-
ProtonVPN setup complete.
By default, any download client will only use the VPN, while all other apps will use your normal internet. What other apps would you like to use behind the VPN
1.Firefox
2.Chrome
List of general things to accomplish
UPDATE m3uparserrun.bat with new moviemover.py and tvshowmovie.py to allow more seamless updating media files. This allows to set jellyfin libraries to real time monitoring as it doesn't remove/rebuild entire media library as the script currently does. This will require using the %destination% values entered in m3uinput.bat as each script requires those locations, as well as m3u_file.m3u location.\
Trouble calling yarn from .bat for insatlling jellyseer. Try "c:\program files(86)\yarn\yarn.js" yarn install && yarn run build
Change putting apps in %HOMEDIR% (C:) --- to --- %LOCALAPPDATA% (C:\Users\username\AppData\Local) or %HOMEPATH% (C:\Users\username)
Include shortcut to WIMPS.bat with icon
Add folder structure to \installers folder based on application type
Currently not liking how appins.bat uses the "timeout x" to give enough time in-between silent installing.
---------------------------SOLUTION to the ABOVE----------------------------------
edit each line appins.bat to include start "" /WAIT /B cmd /C installers\INSTALLER.bat
edit each INSTALLER.bat to end with exit /B
Addition of comments to more sections would be nice.
Add more echo statements for installation process to echo back to a single cmd.
I'm sure there are lines in there that are doing nothing, doing something that is not necessary, not needed, etc...
Create and move shortcuts to startup folder or configure event ghost config for installed apps to facilitate auto starting programs.
EVENT GOHST
changing the desktop shortcut to add -configdir and -file
set shortcut="%homepath%\Desktop\EventGhost.lnk"
set "argument1=-configdir C:\peth\to\config\directory"
set "argument2=-file C:\path\to\xml\in\configdir"
setlocal enabledelayedexpansion
rem Update the shortcut with the new arguments
powershell -Command "$shortcut = (New-Object -COM WScript.Shell).CreateShortcut('%shortcut%'); $shortcut.Arguments = '!argument1! !argument2!'; $shortcut.Save()"
endlocal
Another .bat to be ran after the shortcut edit to update the paths in xml to %homepath% of user.
setlocal
set "xml_file=C:\User\Path\Desktop\sad\evg.xmll"
REM Get the current user's name from %HOMEPATH%
for %%A in ("%HOMEPATH%") do set "current_user=%%~nxA"
REM Define the line changes with unique identifiers and their corresponding replacements
set "line1_identifier=CURUSE"
set "line1_replacement=%current_user%"
REM Generate a temporary file path
set "temp_file=%temp%\temp.xml"
REM Use PowerShell to perform the line replacement
powershell -Command "(gc '%xml_file%') -replace '%line1_identifier%', '%line1_replacement%' | Out-File -encoding ASCII '%temp_file%'"
REM Move the temporary file to overwrite the original XML file
move /y "%temp_file%" "%xml_file%"
start "%HOMEPATH%\Desktop\EventGhost.lnk"
endlocal
Add "Settings Service"Service to run after installing apps that applies needed settings. Example would be ProtonVPN needing the split tunneling for specific apps. Or to run a Caddy adapt/fmt on any credentials added to Caddyfile.
The below is messy, but working and expandable.
@echo off
color 6
echo ____ ____ ____ ____ __ __ _ ___ ____ ____ ____ _ _ __ ___ ____
echo / ___)( __)(_ _)(_ _)( )( ( \ / __) / ___)( __)( _ \/ )( \( )/ __)( __)
echo \___ \ ) _) )( )( )( / /( (_ \ \___ \ ) _) ) /\ \/ / )(( (__ ) _)
echo (____/(____) (__) (__) (__)\_)__) \___/ (____/(____)(__\_) \__/ (__)\___)(____)
echo.
cd %~dp0
setlocal enabledelayedexpansion
for /f "tokens=1,2 delims==" %%a in (mainlist.cfg) do (
set /A i+=1
set "appname[!i!]=%%a"
set "appval[!i!]=%%b"
)
set "checkApp1=caddy"
set "checkApp2=m3uparser"
for /L %%i in (1,1,!i!) do (
if "!appname[%%i]!" == "%checkApp1%" (
if "!appval[%%i]!" == "false" (
choice /C YN /M "Caddy requires information to set up reverse proxy, enter this info now?"
if errorlevel 2 (
goto end
) else if errorlevel 1 (
start cmd.exe /c "%~dp0rproxy.bat"
)
)
)
if "!appname[%%i]!" == "%checkApp2%" (
if "!appval[%%i]!" == "false" (
choice /C YN /M "m3uparser requires a destination folder for VOD media folders, and your m3u VOD url. Enter those now?"
if errorlevel 2 (
goto end
) else if errorlevel 1 (
start cmd.exe /c "%~dp0m3uinput.bat"
)
)
)
)
:end
endlocal
Caddy
@echo off
setlocal enabledelayedexpansion
@echo off
cd %~dp0
color A
echo ____ ____ _ _ ____ ____ ____ ____ ____ ____ __ _ _ _ _
echo ( _ \( __)/ )( \( __)( _ \/ ___)( __) ( _ \( _ \ / \( \/ )( \/ )
echo ) / ) _) \ \/ / ) _) ) /\___ \ ) _) ) __/ ) /( O )) ( ) /
echo (__\_)(____) \__/ (____)(__\_)(____/(____) (__) (__\_) \__/(_/\_)(__/
echo.
cd "%HOMEDRIVE%\caddy"
echo What is your email? (optional)
set /p email=
if not "%email%" == "" (
set email=email %email%
)
echo How many services do you need behind reverse proxy?
echo 1, 2, 3, 4, 5
set /p numServices=
if "%numServices%" == "1" (
set numServices=1
) else if "%numServices%" == "2" (
set numServices=2
) else if "%numServices%" == "3" (
set numServices=3
) else if "%numServices%" == "4" (
set numServices=4
) else if "%numServices%" == "5" (
set numServices=5
) else (
echo Invalid input, must be 1, 2, 3, 4, or 5. Exiting.
goto :eof
)
set i=0
for /l %%i in (1,1,%numServices%) do (
set /a i=!i!+1
echo Service !i!
echo What is the ddns url to use for the service?
set /p ddnsUrl!i!=
echo What is the local ip of the machine running the service, and the services port being used?
set /p localIpPort!i!=
)
(
echo {
if not "%email%" == "" (
echo %email%
)
echo }
for /l %%i in (1,1,%numServices%) do (
echo !ddnsUrl%%i! {
echo reverse_proxy !localIpPort%%i!
echo }
)
) > caddyfile.tmp
chcp 65001 >nul
type caddyfile.tmp > caddyfile
del caddyfile.tmp
echo Configuration written to caddyfile.
call caddy fmt --overwrite && call caddy adapt
timeout 3
M3U Input for folder location
@echo off
color C
echo _ _ ____ _ _ __ __ _ ____ __
echo ( \/ )( __ \/ )( \ ( )( ( \( __)/ \
echo / \/ \ (__ () \/ ( )( / / ) _)( O )
echo \_)(_/(____/\____/ (__)\_)__)(__) \__/
echo.
cd %~dp0
echo Folder destination for media?
set /p destination=
echo m3u VOD URL?
set /p vodurl=
echo %destination%|find /v "" > destination.cfg
echo %vodurl%|find /v "" > vodurl.cfg
timeout 3
start m3uparserrun.bat
ProtonVPN
*not implemented as taking username/password for Proton account, and using that to auto sign in the Proton app on initial startup is proving difficult.
<setting name="SplitTunnelingEnabled" serializeAs="String">
<value>True</value>
</setting>
<setting name="SplitTunnelMode" serializeAs="String">
<value>2</value>
</setting>
<setting name="SplitTunnelingAllowApps" serializeAs="String">
<value>[{"Name":"qBittorrent","Path":"C:\\Program Files (x86)\\qBittorrent\\FULLPATHTOEXE","AdditionalPaths":null,"Enabled":true}]</value>
</setting>
Those lines need to be added to \AppData\Local\ProtonVPN\ProtonVPN.exe_Url_5k5woeau2v3gmtlay4mjwsftlqxjnn2p\2.3.1.0.\user.cfg
cd in script needs wildcards \ProtonVPN\ProtonVPN.exe*\2*\user.cfg
Set up NSSM for jellyseerr instead of using the current jsrun cmd. This should be handled by the service manager.
Use NSSM for the *arrr apps. Not sure if this is necessary and would require removing the default installation behavior.
*issues when running radarr as service and mapping non root folder for media, changed radarrinst to reflect this
https://wiki.servarr.com/sonarr/installation
https://wiki.servarr.com/radarr/installation
Some apps had uninstallers in the windows control panel, but others, like jellyfin, have no uninstaller. Is there a simple way to uninstall all apps? Or should I just delete the jellyfin folder?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.