This is the repository for the My NAS project, a simple web application for managing user accounts with MySQL, PHP, HTML, CSS, and JavaScript. The website runs inside a Docker container for easy deployment.
- User Management: Users can register, log in, and reset their passwords.
- Database: The MySQL database contains a table called
accountsfor managing user information.- Columns in the
accountstable:ID: The account's ID.USERNAME: The account's username.PASSWORD: The user's password (stored encrypted).EMAIL: The user's email address.reset_code: A code used for password reset.rememberTOKEN: A token used for the "Remember me" functionality.api_key: For the My NAS app in the My-NAS-Flutter-App repository.
- Columns in the
- Docker-based Deployment: Easily deploy using Docker and Docker Compose.
- Automatic Setup: The entire setup process, including database creation, SSL certification, and configurations, is handled automatically when the container starts.
- Modern UI: Built with a clean, modern, and responsive design.
- Docker and Docker Compose installed on your system.
- Linux Server (or a local machine with Docker support).
- Domain (optional, for public websites).
Linux
- Clone Repository
cd ~
git clone https://github.com/MarcusNebel/My-NAS.git nas-website
cd ~/nas-website- Set needed root permissions to files folder
sudo chmod -R 777 nas-website-files/user_files/MacOS
- Download the release
.ZIPfile and extract it. - Open a terminal window (ensure you're in the extracted folder).
Windows
- Download the release
.ZIPfile and extract it. - Open a terminal window (ensure you're in the extracted folder).
All SMTP and IP settings are now configured exclusively in the app/config.json file. Open this file and edit the corresponding fields:
{
"flaskServerURL": "https://__SERVER_IP__:8080",
"update_server_ip": "http://__SERVER_IP__:5000",
"proxy_update_server_ip": "https://__SERVER_IP__:8081/proxy-update",
"smtp": {
"host": "smtp.gmail.com",
"auth": true,
"username": "youremail@gmail.com",
"password": "your_App_Password",
"encryption": "tls",
"port": 587
},
"email": {
"support_address": "__SERVER_ADMIN_EMAIL__",
"support_name": "My NAS Support",
"from_address": "mynas-support@gmail.com",
"from_name": "My NAS Support",
"reset_password": "Create new password",
"registered": "My NAS account created",
"signed_in": "New device logged in"
}
}__SERVER_IP__: Place the server IP (or Domain) here.host: SMTP server address (e.g.,smtp.gmail.com).username: Your email address.password: Your app password.port: Port for the SMTP server (e.g.,587).support_address: The email to reach the server admin.
Note: For Gmail, use an app password instead of your regular account password.
The website is now accessible within the local network.
If you want to use it outside the network, you'll need to configure a domain.
Start My NAS using Docker Compose:
Windows
- Build docker-image
docker-compose build --no-cache- Start docker-container
docker-compose up -d- Start update-server
start run-update-flask-server.cmdTo be shure that the update server is running every time you have to put a shortcut of the
run-update-flask-server.cmdinto the Startup folder that you can acces overWindows + Rand thenshell:startup.
MacOS and Linux
- Build docker-image
docker compose build --no-cache- Start docker-container
docker compose up -d- Start update-server
chmod +x run-update-flask-server.sh
sh run-update-flask-server.shTo be shure that the update server is running every time you can create an cron-tab entry that starts the
run-update-flask-server.shscript.Crontab entry
- Open crontab
crontab -e
- Paste the following line in the end of the crontab
@reboot /bin/bash ~/nas-website/run-update-flask-server.sh
This will start the necessary containers and automatically set up everything, including:
- Apache + PHP
- MySQL Database
- Database Initialization (automatic creation of tables and configurations)
- Update Server to update My NAS automaticly on new Github release
Once the containers are running, open your browser and visit:
https://your-server-ip:8443You can set up the weather function on the My Account page.
That's it! No manual setup required. The website is ready to use.
- If you encounter issues with the website or app after an update, reset all caches and clear your browser cache.
This project is licensed under the MIT License.