# WebDesk 3rd party App Market server This allows you to host custom (known as 3rd party) App Market repositories of WebDesk applications. ## Features - Listing currently uploaded apps (/apps endpoint and root of web server) - Showing app source code (under /uploads/app_name/index.js) - Uploading new apps (/apps endpoint with Bearer token) - Editing app info (/editapp endpoint with Bearer token) - Delete apps (/delete endpoint with Bearer token) ## Prerequisites - Go (1.23.1 or later, older will work with go.mod changes to the version) ## Installation 1. Clone the repository: ``` git clone https://git.fluffy.pw/matu6968/webdesk-app-market-server ``` 2. Go to the project directory: ``` cd webdesk-app-market-server ``` 3. Build the binary: ``` go build -o app-market-server ``` 4. Execture the binary: ``` ./app-market-server ``` # Configuration In the .env file this is the only thing you can set ``` PORT=8080 AUTH_TOKEN=bearer-token-here # The program will automatically make a new token if not found so do not bother putting your own one ``` # Client demonstrations [Go](https://git.fluffy.pw/matu6968/webdesk-app-market-client) ## Autostart with systemd or OpenRC You can autostart the web server using systemd or OpenRC (init scripts are in the init-scripts folder) To use it, edit the script accordingly (edit username on what user it is going to run and the path to the binary on where it will run from) ## for systemd edit the following lines: ``` ; Don't forget to change the value here! ; There is no reason to run this program as root, just use your username User=examplename # change this to your username WorkingDirectory=/path/to/binary # change this to the path where the binary resides ``` ### and to add it as a service: ``` sudo cp /path/to/cloned/repo/init-scripts/app-market-server.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable app-market-server.service sudo systemctl start app-market-server.service ``` ## for OpenRC edit the following lines: ``` command="bash -c cd ~/webdesk-app-market-server && ./app-market-server" # if you have put the eprintclone binary somewhere else change this line # Don't forget to change the value here! # There is no reason to run this program as root, just use your username command_user="userexample" # change this to your usernames ``` ### and to add it as a service: ``` sudo cp /path/to/cloned/repo/init-scripts/app-market-server /etc/init.d/ sudo rc-update add app-market-server sudo rc-service app-market-server start ``` ### How does this work To use the API look at the [wiki](https://git.fluffy.pw/matu6968/webdesk-app-market-server/wiki) # !IMPORTANT! You will need a directory where your program is with read/write rights otherwaise actions like deleting apps will fail.